summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2021-10-25 14:15:02 +0200
committerRemi Collet <remi@php.net>2021-10-25 14:15:02 +0200
commita278f7364e903574382ccc100d43ff284d842fcf (patch)
treecd9320ec360509b5fb6ca957ce049f08e6c376a7
parent8e1205d16551d10a4ef66dc069d1d33c4007cbcf (diff)
update to 4.1.2
rename to php-league-container4 install in /usr/share/php/League/Container4 raise dependency on PHP 7.2 raise dependency on psr/container 2.0.0
-rw-r--r--Makefile2
-rw-r--r--composer.json25
-rw-r--r--php-league-container4.spec54
3 files changed, 53 insertions, 28 deletions
diff --git a/Makefile b/Makefile
index 91b0fd5..13af741 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
SRCDIR := $(shell pwd)
NAME := $(shell basename $(SRCDIR))
-include ../../common/Makefile
+include ../../../common/Makefile
diff --git a/composer.json b/composer.json
index 61cedd9..5165cce 100644
--- a/composer.json
+++ b/composer.json
@@ -15,20 +15,22 @@
"authors": [
{
"name": "Phil Bennett",
- "email": "philipobenito@gmail.com",
- "homepage": "http://www.philipobenito.com",
+ "email": "mail@philbennett.co.uk",
"role": "Developer"
}
],
"require": {
- "php": "^7.0 || ^8.0",
- "psr/container": "^1.0.0"
+ "php": "^7.2 || ^8.0",
+ "psr/container": "^2.0.0"
},
"require-dev": {
- "phpunit/phpunit": "^6.0 || ^7.0",
+ "nette/php-generator": "^3.4",
+ "nikic/php-parser": "^4.10",
+ "phpstan/phpstan": "^0.12.47",
+ "phpunit/phpunit": "^8.5.17",
"roave/security-advisories": "dev-latest",
"scrutinizer/ocular": "^1.8",
- "squizlabs/php_codesniffer": "^3.5"
+ "squizlabs/php_codesniffer": "^3.6"
},
"provide": {
"psr/container-implementation": "^1.0"
@@ -44,11 +46,15 @@
"autoload-dev": {
"psr-4": {
"League\\Container\\Test\\": "tests"
- }
+ },
+ "files": [
+ "tests/Asset/function.php"
+ ]
},
"extra": {
"branch-alias": {
- "dev-master": "3.x-dev",
+ "dev-master": "4.x-dev",
+ "dev-4.x": "4.x-dev",
"dev-3.x": "3.x-dev",
"dev-2.x": "2.x-dev",
"dev-1.x": "1.x-dev"
@@ -56,7 +62,8 @@
},
"scripts": {
"test": [
- "phpunit"
+ "phpunit",
+ "phpstan analyse"
]
}
}
diff --git a/php-league-container4.spec b/php-league-container4.spec
index 6b94cd6..e4bf24e 100644
--- a/php-league-container4.spec
+++ b/php-league-container4.spec
@@ -12,27 +12,29 @@
%global github_owner thephpleague
%global github_name container
-%global github_version 3.4.1
-%global github_commit 84ecbc2dbecc31bd23faf759a0e329ee49abddbd
+%global github_version 4.1.2
+%global github_commit 82a57588c630663d2600f046753b23ab6dcda9b5
+
+%global major 4
%global composer_vendor league
%global composer_project container
-# "php": "^7.0"
-%global php_min_ver 7.0
-# "psr/container": "^1.0.0"
-%global psr_container_min_ver 1.0
-%global psr_container_max_ver 2
+# "php": "^7.2 || ^8.0"
+%global php_min_ver 7.2
+# "psr/container": "^2.0.0"
+%global psr_container_min_ver 2.0.0
+%global psr_container_max_ver 3
# Build using "--without tests" to disable tests
%global with_tests 0%{!?_without_tests:1}
%{!?phpdir: %global phpdir %{_datadir}/php}
-Name: php-%{composer_vendor}-%{composer_project}
+Name: php-%{composer_vendor}-%{composer_project}%{major}
Version: %{github_version}
Release: 1%{?github_release}%{?dist}
-Summary: A fast and intuitive dependency injection container
+Summary: A fast and intuitive dependency injection container version %{major}
License: MIT
URL: http://container.thephpleague.com/
@@ -47,7 +49,7 @@ BuildArch: noarch
%if %{with_tests}
## composer.json
BuildRequires: php(language) >= %{php_min_ver}
-BuildRequires: phpunit8
+BuildRequires: phpunit8 >= 8.5.17
%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
BuildRequires: (php-composer(psr/container) >= %{psr_container_min_ver} with php-composer(psr/container) < %{psr_container_max_ver})
%else
@@ -83,7 +85,7 @@ Provides: php-composer(psr/container-implementation) = 1.0
A small but powerful dependency injection container that allows you to decouple
components in your application in order to write clean and testable code.
-Autoloader: %{phpdir}/League/Container/autoload.php
+Autoloader: %{phpdir}/League/Container%{major}/autoload.php
%prep
@@ -103,14 +105,14 @@ require_once '%{phpdir}/Fedora/Autoloader/autoload.php';
\Fedora\Autoloader\Autoload::addPsr4('League\\Container\\', __DIR__);
\Fedora\Autoloader\Dependencies::required([
- '%{phpdir}/Psr/Container/autoload.php',
+ '%{phpdir}/Psr/Container2/autoload.php',
]);
AUTOLOAD
%install
mkdir -p %{buildroot}%{phpdir}/League
-cp -rp src %{buildroot}%{phpdir}/League/Container
+cp -rp src %{buildroot}%{phpdir}/League/Container%{major}
%check
@@ -118,8 +120,9 @@ cp -rp src %{buildroot}%{phpdir}/League/Container
: Create tests bootstrap
cat <<'BOOTSTRAP' | tee bootstrap.php
<?php
-require '%{buildroot}%{phpdir}/League/Container/autoload.php';
+require '%{buildroot}%{phpdir}/League/Container%{major}/autoload.php';
\Fedora\Autoloader\Autoload::addPsr4('League\\Container\\Test\\', __DIR__.'/tests');
+require __DIR__ . '/tests/Asset/function.php';
BOOTSTRAP
: cleanup for phpunit8/9
@@ -127,10 +130,18 @@ sed -e '/log/d' -i phpunit.xml
: Upstream tests
RETURN_CODE=0
+# TODO PHP 8.1, Call to undefined method ReflectionUnionType::getName()
PHPUNIT=$(which phpunit8)
-for PHP_EXEC in php php73 php74 php80; do
- if [ "php" = "$PHP_EXEC" ] || which $PHP_EXEC; then
- $PHP_EXEC $PHPUNIT --bootstrap bootstrap.php --verbose || RETURN_CODE=1
+for PHP_EXEC in php php73 php74 php80 php81; do
+ if which $PHP_EXEC; then
+ FILTER=""
+ VER=$($PHP_EXEC -r 'echo PHP_VERSION_ID;')
+ if [ $VER -ge 80100 ]; then
+ FILTER="--filter '^((?!(testResolverResolvesArgumentsViaReflection|testResolverThrowsExceptionWhenReflectionDoesNotResolve)).)*\$'"
+ fi
+ $PHP_EXEC $PHPUNIT $FILTER \
+ --bootstrap bootstrap.php \
+ --verbose || RETURN_CODE=1
fi
done
exit $RETURN_CODE
@@ -147,11 +158,18 @@ exit $RETURN_CODE
%doc CONTRIBUTING.md
%doc README.md
%dir %{phpdir}/League
- %{phpdir}/League/Container
+ %{phpdir}/League/Container%{major}
%changelog
* Fri Jul 9 2021 Remi Collet <remi@remirepo.net> - 3.4.1-1
+- update to 4.1.2
+- rename to php-league-container4
+- install in /usr/share/php/League/Container4
+- raise dependency on PHP 7.2
+- raise dependency on psr/container 2.0.0
+
+* Fri Jul 9 2021 Remi Collet <remi@remirepo.net> - 3.4.1-1
- update to 3.4.1
- revert allow psr/container v2