summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rw-r--r--composer.json12
-rw-r--r--php-myclabs-php-enum.spec67
3 files changed, 63 insertions, 18 deletions
diff --git a/.gitignore b/.gitignore
index 1ab5c4f..01f0400 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,7 @@
+clog
package-*.xml
*.tgz
+*.tar.bz2
*.tar.gz
*.tar.xz
*.tar.xz.asc
diff --git a/composer.json b/composer.json
index 871156d..978cb19 100644
--- a/composer.json
+++ b/composer.json
@@ -14,7 +14,10 @@
"autoload": {
"psr-4": {
"MyCLabs\\Enum\\": "src/"
- }
+ },
+ "classmap": [
+ "stubs/Stringable.php"
+ ]
},
"autoload-dev": {
"psr-4": {
@@ -22,11 +25,12 @@
}
},
"require": {
- "php": ">=7.1",
+ "php": "^7.3 || ^8.0",
"ext-json": "*"
},
"require-dev": {
- "phpunit/phpunit": "^4.8.35|^5.7|^6.0",
- "squizlabs/php_codesniffer": "1.*"
+ "phpunit/phpunit": "^9.5",
+ "squizlabs/php_codesniffer": "1.*",
+ "vimeo/psalm": "^4.6.2"
}
}
diff --git a/php-myclabs-php-enum.spec b/php-myclabs-php-enum.spec
index 86e844e..eda4add 100644
--- a/php-myclabs-php-enum.spec
+++ b/php-myclabs-php-enum.spec
@@ -1,12 +1,12 @@
# remirepo/fedora spec file for php-myclabs-php-enum
#
-# Copyright (c) 2017-2019 Remi Collet
+# Copyright (c) 2017-2022 Remi Collet
# License: CC-BY-SA
# http://creativecommons.org/licenses/by-sa/4.0/
#
# Please, preserve the changelog entries
#
-%global gh_commit f46847626b8739de22e4ebc6b56010f317d4448d
+%global gh_commit a867478eae49c9f59ece437ae7f9506bfaa27483
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
%global gh_owner myclabs
%global gh_project php-enum
@@ -17,10 +17,11 @@
%global ns_vendor MyCLabs
%global ns_project Enum
%global php_home %{_datadir}/php
-%global with_tests 0%{!?_without_tests:1}
+
+%bcond_without tests
Name: php-%{pk_vendor}-%{pk_project}
-Version: 1.7.1
+Version: 1.8.4
Release: 1%{?dist}
Summary: PHP Enum implementation
@@ -31,25 +32,26 @@ Source0: %{name}-%{version}-%{gh_short}.tgz
Source1: makesrc.sh
BuildArch: noarch
-%if %{with_tests}
+%if %{with tests}
# For tests
-BuildRequires: php(language) >= 7.1
+BuildRequires: php(language) >= 7.3
BuildRequires: php-reflection
BuildRequires: php-json
BuildRequires: php-spl
# From composer.json, "require-dev": {
-# "phpunit/phpunit": "^4.8.35|^5.7|^6.0",
+# "phpunit/phpunit": "^9.5",
# "squizlabs/php_codesniffer": "1.*"
-%global phpunit %{_bindir}/phpunit6
-BuildRequires: %{phpunit}
+# "vimeo/psalm": "^4.6.2"
+%global phpunit %{_bindir}/phpunit9
+BuildRequires: phpunit9 >= 9.5
# Required by autoloader
BuildRequires: php-composer(fedora/autoloader)
%endif
# From composer.json, "require": {
-# "php": ">=7.1",
+# "php": "^7.3 || ^8.0",
# "ext-json": "*"
-Requires: php(language) >= 7.1
+Requires: php(language) >= 7.3
Requires: php-json
# From phpcompatinfo report for version 1.6.1
Requires: php-reflection
@@ -69,11 +71,14 @@ Autoloader: %{php_home}/%{ns_vendor}/%{ns_project}/autoload.php
%prep
%setup -q -n %{gh_project}-%{gh_commit}
+mv stubs/Stringable.php src/
+
cat << 'EOF' | tee src/autoload.php
<?php
/* Autoloader for %{name} and its dependencies */
require_once '/usr/share/php/Fedora/Autoloader/autoload.php';
\Fedora\Autoloader\Autoload::addPsr4('%{ns_vendor}\\%{ns_project}\\', __DIR__);
+require_once __DIR__ . '/Stringable.php';
EOF
@@ -88,7 +93,7 @@ cp -pr src %{buildroot}%{php_home}/%{ns_vendor}/%{ns_project}
%check
-%if %{with_tests}
+%if %{with tests}
mkdir vendor
cat << 'EOF' | tee tests/autoload.php
<?php
@@ -98,10 +103,10 @@ require __DIR__ . '/bootstrap.php';
EOF
ret=0
-for cmd in "php %{phpunit}" php71 php72 php73; do
+for cmd in "php %{phpunit}" php74 php80 php81 php82; do
if which $cmd; then
set $cmd
- $1 ${2:-%{_bindir}/phpunit6} --verbose --bootstrap tests/autoload.php || ret=1
+ $1 ${2:-%{_bindir}/phpunit9} --verbose --bootstrap tests/autoload.php || ret=1
fi
done
exit $ret
@@ -111,6 +116,7 @@ exit $ret
%files
+# remirepo:1
%{!?_licensedir:%global license %%doc}
%license LICENSE
%doc composer.json
@@ -120,6 +126,39 @@ exit $ret
%changelog
+* Thu Aug 4 2022 Remi Collet <remi@remirepo.net> - 1.8.4-1
+- update to 1.8.4
+
+* Mon Jul 5 2021 Remi Collet <remi@remirepo.net> - 1.8.3-1
+- update to 1.8.3
+
+* Mon Jul 5 2021 Remi Collet <remi@remirepo.net> - 1.8.2-1
+- update to 1.8.2
+
+* Tue Jun 29 2021 Remi Collet <remi@remirepo.net> - 1.8.1-1
+- update to 1.8.1
+
+* Tue Feb 16 2021 Remi Collet <remi@remirepo.net> - 1.8.0-1
+- update to 1.8.0
+- raise dependency on PHP 7.3
+- switch to phpunit9
+
+* Mon Nov 16 2020 Remi Collet <remi@remirepo.net> - 1.7.7-1
+- update to 1.7.7
+
+* Fri Feb 14 2020 Remi Collet <remi@remirepo.net> - 1.7.6-1
+- update to 1.7.6
+
+* Fri Feb 14 2020 Remi Collet <remi@remirepo.net> - 1.7.5-1
+- update to 1.7.5
+
+* Fri Feb 7 2020 Remi Collet <remi@remirepo.net> - 1.7.4-1
+- update to 1.7.4
+- switch to phpunit7
+
+* Tue Aug 20 2019 Remi Collet <remi@remirepo.net> - 1.7.2-1
+- update to 1.7.2
+
* Mon May 6 2019 Remi Collet <remi@remirepo.net> - 1.7.1-1
- update to 1.7.1
- lower dependency on PHP 7.1