summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2019-06-17 15:53:04 +0200
committerRemi Collet <remi@remirepo.net>2019-06-17 15:53:04 +0200
commitaa692687734dcab79bddd7fb2145cb8824cdf000 (patch)
treea5cd4220ee264da2a86cd5b105472f442b43c3db
parent860bc555f6f7774ea302cfbd73d370ce398e0a31 (diff)
v6.0.8 from Fedora
-rw-r--r--composer.json38
-rw-r--r--ecab701e7de49f160d83be6a42d6c5aa9a8df76b.patch26
-rw-r--r--php-di.spec108
3 files changed, 67 insertions, 105 deletions
diff --git a/composer.json b/composer.json
index 0f22f9c..f9b531c 100644
--- a/composer.json
+++ b/composer.json
@@ -2,15 +2,15 @@
"name": "php-di/php-di",
"type": "library",
"description": "The dependency injection container for humans",
- "keywords": ["di", "dependency injection", "container"],
+ "keywords": ["di", "dependency injection", "container", "ioc", "psr-11", "psr11", "container-interop"],
"homepage": "http://php-di.org/",
"license": "MIT",
"autoload": {
"psr-4": {
- "DI\\": "src/DI/"
+ "DI\\": "src/"
},
"files": [
- "src/DI/functions.php"
+ "src/functions.php"
]
},
"autoload-dev": {
@@ -20,33 +20,31 @@
}
},
"scripts": {
- "test": "phpunit"
+ "test": "phpunit",
+ "format-code": "php-cs-fixer fix --allow-risky=yes",
+ "phpstan": "phpstan analyse -l 6 -c phpstan.neon src"
},
"require": {
- "php": ">=5.5.0",
- "container-interop/container-interop": "~1.2",
- "psr/container": "~1.0",
- "php-di/invoker": "^1.3.2",
- "php-di/phpdoc-reader": "^2.0.1"
+ "php": ">=7.0.0",
+ "psr/container": "^1.0",
+ "php-di/invoker": "^2.0",
+ "php-di/phpdoc-reader": "^2.0.1",
+ "jeremeamia/superclosure": "^2.0",
+ "nikic/php-parser": "^2.0|^3.0|^4.0"
},
"require-dev": {
- "phpunit/phpunit": "~4.5",
- "mnapoli/phpunit-easymock": "~0.2.0",
- "doctrine/cache": "~1.4",
+ "phpunit/phpunit": "~6.4",
+ "mnapoli/phpunit-easymock": "~1.0",
"doctrine/annotations": "~1.2",
- "phpbench/phpbench": "@dev",
- "ocramius/proxy-manager": "~1.0|~2.0"
- },
- "replace": {
- "mnapoli/php-di": "*"
+ "ocramius/proxy-manager": "~2.0.2",
+ "friendsofphp/php-cs-fixer": "^2.4",
+ "phpstan/phpstan": "^0.9.2"
},
"provide": {
- "container-interop/container-interop-implementation": "^1.0",
"psr/container-implementation": "^1.0"
},
"suggest": {
- "doctrine/cache": "Install it if you want to use the cache (version ~1.4)",
"doctrine/annotations": "Install it if you want to use annotations (version ~1.2)",
- "ocramius/proxy-manager": "Install it if you want to use lazy injection (version ~1.0 or ~2.0)"
+ "ocramius/proxy-manager": "Install it if you want to use lazy injection (version ~2.0)"
}
}
diff --git a/ecab701e7de49f160d83be6a42d6c5aa9a8df76b.patch b/ecab701e7de49f160d83be6a42d6c5aa9a8df76b.patch
deleted file mode 100644
index ea6649d..0000000
--- a/ecab701e7de49f160d83be6a42d6c5aa9a8df76b.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-For PHP 7.2, adapted for version 5.4.3 from
-
-From ecab701e7de49f160d83be6a42d6c5aa9a8df76b Mon Sep 17 00:00:00 2001
-From: Matthieu Napoli <matthieu@mnapoli.fr>
-Date: Sun, 4 Jun 2017 17:11:16 +0200
-Subject: [PATCH] Fix the build on PHP 7.2
-
----
- src/Container.php | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/src/Container.php b/src/Container.php
-index d7e87585..b445aa89 100644
---- a/src/DI/Container.php
-+++ b/src/DI/Container.php
-@@ -211,6 +211,10 @@ public function has($name)
- */
- public function injectOn($instance)
- {
-+ if (!$instance) {
-+ return $instance;
-+ }
-+
- $objectDefinition = $this->definitionSource->getDefinition(get_class($instance));
- if (! $objectDefinition instanceof ObjectDefinition) {
- return $instance;
diff --git a/php-di.spec b/php-di.spec
index 198e4b9..df94a3d 100644
--- a/php-di.spec
+++ b/php-di.spec
@@ -12,36 +12,36 @@
%global github_owner PHP-DI
%global github_name PHP-DI
-%global github_version 5.4.6
-%global github_commit 3f9255659595f3e289f473778bb6c51aa72abbbd
+%global github_version 6.0.8
+%global github_commit a634876c69b643b779a89e4b7bec1ed1df803afc
%global composer_vendor php-di
%global composer_project php-di
-# "php": ">=5.5.0"
-%global php_min_ver 5.5.0
-# "container-interop/container-interop": "~1.2"
-%global container_interop_min_ver 1.2
-%global container_interop_max_ver 2.0
+# "php": ">=7.0.0"
+%global php_min_ver 7.0.0
# "doctrine/annotations": "~1.2"
%global doctrine_annotations_min_ver 1.2
%global doctrine_annotations_max_ver 2.0
-# "doctrine/cache": "~1.4"
-%global doctrine_cache_min_ver 1.4
-%global doctrine_cache_max_ver 2.0
-# "mnapoli/phpunit-easymock": "~0.2.0"
-%global phpunit_easymock_min_ver 0.2.0
-%global phpunit_easymock_max_ver 1.0
-# "ocramius/proxy-manager": "~1.0|~2.0"
-%global proxy_manager_min_ver 1.0
+# "jeremeamia/superclosure": "^2.0"
+%global jeremeamia_superclosure_min_ver 2.0
+%global jeremeamia_superclosure_max_ver 3.0
+# "mnapoli/phpunit-easymock": "~1.0"
+%global phpunit_easymock_min_ver 1.0
+%global phpunit_easymock_max_ver 2.0
+# "nikic/php-parser": "^2.0|^3.0|^4.0"
+%global nikic_php_parser_min_ver 2.0
+%global nikic_php_parser_max_ver 5.0
+# "ocramius/proxy-manager": "~2.0.2"
+%global proxy_manager_min_ver 2.0.2
%global proxy_manager_max_ver 3.0
-# "php-di/invoker": "^1.3.2"
-%global di_invoker_min_ver 1.3.2
-%global di_invoker_max_ver 2.0
+# "php-di/invoker": "^2.0"
+%global di_invoker_min_ver 2.0
+%global di_invoker_max_ver 3.0
# "php-di/phpdoc-reader": "^2.0.1"
%global di_phpdoc_reader_min_ver 2.0.1
%global di_phpdoc_reader_max_ver 3.0
-# "psr/container": "~1.0"
+# "psr/container": "^1.0"
%global psr_container_min_ver 1.0
%global psr_container_max_ver 2.0
@@ -52,7 +52,7 @@
Name: %{composer_project}
Version: %{github_version}
-Release: 7%{?github_release}%{?dist}
+Release: 1%{?github_release}%{?dist}
Summary: The dependency injection container for humans
License: MIT
@@ -63,8 +63,6 @@ URL: http://php-di.org/
Source0: %{name}-%{github_version}-%{github_commit}.tar.gz
Source1: %{name}-get-source.sh
-Patch0: https://github.com/PHP-DI/PHP-DI/commit/ecab701e7de49f160d83be6a42d6c5aa9a8df76b.patch
-
BuildArch: noarch
# Tests
%if %{with_tests}
@@ -72,23 +70,23 @@ BuildArch: noarch
BuildRequires: php(language) >= %{php_min_ver}
BuildRequires: php-composer(phpunit/phpunit)
%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
-BuildRequires: (php-composer(container-interop/container-interop) >= %{container_interop_min_ver} with php-composer(container-interop/container-interop) < %{container_interop_max_ver})
BuildRequires: (php-composer(doctrine/annotations) >= %{doctrine_annotations_min_ver} with php-composer(doctrine/annotations) < %{doctrine_annotations_max_ver})
-BuildRequires: (php-composer(doctrine/cache) >= %{doctrine_cache_min_ver} with php-composer(doctrine/cache) < %{doctrine_cache_max_ver})
+BuildRequires: (php-composer(jeremeamia/superclosure) >= %{jeremeamia_superclosure_min_ver} with php-composer(jeremeamia/superclosure) < %{jeremeamia_superclosure_max_ver})
BuildRequires: (php-composer(mnapoli/phpunit-easymock) >= %{phpunit_easymock_min_ver} with php-composer(mnapoli/phpunit-easymock) < %{phpunit_easymock_max_ver})
+BuildRequires: (php-composer(nikic/php-parser) >= %{nikic_php_parser_min_ver} with php-composer(nikic/php-parser) < %{nikic_php_parser_max_ver})
BuildRequires: (php-composer(ocramius/proxy-manager) >= %{proxy_manager_min_ver} with php-composer(ocramius/proxy-manager) < %{proxy_manager_max_ver})
BuildRequires: (php-composer(php-di/invoker) >= %{di_invoker_min_ver} with php-composer(php-di/invoker) < %{di_invoker_max_ver})
BuildRequires: (php-composer(php-di/phpdoc-reader) >= %{di_phpdoc_reader_min_ver} with php-composer(php-di/phpdoc-reader) < %{di_phpdoc_reader_max_ver})
BuildRequires: (php-composer(psr/container) >= %{psr_container_min_ver} with php-composer(psr/container) < %{psr_container_max_ver})
%else
-BuildRequires: php-composer(container-interop/container-interop) < %{container_interop_max_ver}
-BuildRequires: php-composer(container-interop/container-interop) >= %{container_interop_min_ver}
BuildRequires: php-composer(doctrine/annotations) < %{doctrine_annotations_max_ver}
BuildRequires: php-composer(doctrine/annotations) >= %{doctrine_annotations_min_ver}
-BuildRequires: php-composer(doctrine/cache) < %{doctrine_cache_max_ver}
-BuildRequires: php-composer(doctrine/cache) >= %{doctrine_cache_min_ver}
+BuildRequires: php-composer(jeremeamia/superclosure) < %{jeremeamia_superclosure_max_ver}
+BuildRequires: php-composer(jeremeamia/superclosure) >= %{jeremeamia_superclosure_min_ver}
BuildRequires: php-composer(mnapoli/phpunit-easymock) < %{phpunit_easymock_max_ver}
BuildRequires: php-composer(mnapoli/phpunit-easymock) >= %{phpunit_easymock_min_ver}
+BuildRequires: php-composer(nikic/php-parser) < %{nikic_php_parser_max_ver}
+BuildRequires: php-composer(nikic/php-parser) >= %{nikic_php_parser_min_ver}
BuildRequires: php-composer(ocramius/proxy-manager) < %{proxy_manager_max_ver}
BuildRequires: php-composer(ocramius/proxy-manager) >= %{proxy_manager_min_ver}
BuildRequires: php-composer(php-di/invoker) < %{di_invoker_max_ver}
@@ -98,7 +96,8 @@ BuildRequires: php-composer(php-di/phpdoc-reader) >= %{di_phpdoc_reader_min_ver}
BuildRequires: php-composer(psr/container) < %{psr_container_max_ver}
BuildRequires: php-composer(psr/container) >= %{psr_container_min_ver}
%endif
-## phpcompatinfo (computed from version 5.4.6)
+## phpcompatinfo (computed from version 6.0.8)
+BuildRequires: php-date
BuildRequires: php-json
BuildRequires: php-pcre
BuildRequires: php-reflection
@@ -110,13 +109,16 @@ BuildRequires: php-composer(fedora/autoloader)
# composer.json
Requires: php(language) >= %{php_min_ver}
%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
-Requires: (php-composer(container-interop/container-interop) >= %{container_interop_min_ver} with php-composer(container-interop/container-interop) < %{container_interop_max_ver})
+Requires: (php-composer(jeremeamia/superclosure) >= %{jeremeamia_superclosure_min_ver} with php-composer(jeremeamia/superclosure) < %{jeremeamia_superclosure_max_ver})
+Requires: (php-composer(nikic/php-parser) >= %{nikic_php_parser_min_ver} with php-composer(nikic/php-parser) < %{nikic_php_parser_max_ver})
Requires: (php-composer(php-di/invoker) >= %{di_invoker_min_ver} with php-composer(php-di/invoker) < %{di_invoker_max_ver})
Requires: (php-composer(php-di/phpdoc-reader) >= %{di_phpdoc_reader_min_ver} with php-composer(php-di/phpdoc-reader) < %{di_phpdoc_reader_max_ver})
Requires: (php-composer(psr/container) >= %{psr_container_min_ver} with php-composer(psr/container) < %{psr_container_max_ver})
%else
-Requires: php-composer(container-interop/container-interop) < %{container_interop_max_ver}
-Requires: php-composer(container-interop/container-interop) >= %{container_interop_min_ver}
+Requires: php-composer(jeremeamia/superclosure) < %{jeremeamia_superclosure_max_ver}
+Requires: php-composer(jeremeamia/superclosure) >= %{jeremeamia_superclosure_min_ver}
+Requires: php-composer(nikic/php-parser) < %{nikic_php_parser_max_ver}
+Requires: php-composer(nikic/php-parser) >= %{nikic_php_parser_min_ver}
Requires: php-composer(php-di/invoker) < %{di_invoker_max_ver}
Requires: php-composer(php-di/invoker) >= %{di_invoker_min_ver}
Requires: php-composer(php-di/phpdoc-reader) < %{di_phpdoc_reader_max_ver}
@@ -133,17 +135,16 @@ Requires: php-spl
Requires: php-composer(fedora/autoloader)
# Weak dependencies
-%if 0%{?fedora} >= 21
+%if 0%{?fedora} >= 21 || 0%{?rhel} >= 8
Suggests: php-composer(doctrine/annotations)
-Suggests: php-composer(doctrine/cache)
Suggests: php-composer(ocramius/proxy-manager)
+Suggests: php-pecl(apcu)
%endif
# php-{COMPOSER_VENDOR}-{COMPOSER_PROJECT}
Provides: php-%{composer_vendor}-%{composer_project} = %{version}-%{release}
# Composer
Provides: php-composer(%{composer_vendor}/%{composer_project}) = %{version}
-Provides: php-composer(container-interop/container-interop-implementation) = 1.0
Provides: php-composer(psr/container-implementation) = 1.0
%description
@@ -154,16 +155,11 @@ Autoloader: %{phpdir}/DI/autoload.php
%prep
%setup -qn %{github_name}-%{github_commit}
-%patch0 -p1
-
-: Remove executable bit
-: https://github.com/PHP-DI/PHP-DI/pull/392
-chmod a-x src/DI/Definition/Source/DefinitionArray.php
%build
: Create autoloader
-cat <<'AUTOLOAD' | tee src/DI/autoload.php
+cat <<'AUTOLOAD' | tee src/autoload.php
<?php
/**
* Autoloader for %{name} and its' dependencies
@@ -175,15 +171,19 @@ require_once '%{phpdir}/Fedora/Autoloader/autoload.php';
require_once __DIR__.'/functions.php';
\Fedora\Autoloader\Dependencies::required([
- '%{phpdir}/Interop/Container/autoload.php',
+ [
+ '%{phpdir}/PhpParser4/autoload.php',
+ '%{phpdir}/PhpParser3/autoload.php',
+ '%{phpdir}/PhpParser2/autoload.php',
+ ],
'%{phpdir}/Invoker/autoload.php',
'%{phpdir}/PhpDocReader/autoload.php',
'%{phpdir}/Psr/Container/autoload.php',
+ '%{phpdir}/SuperClosure/autoload.php',
]);
\Fedora\Autoloader\Dependencies::optional([
'%{phpdir}/Doctrine/Common/Annotations/autoload.php',
- '%{phpdir}/Doctrine/Common/Cache/autoload.php',
'%{phpdir}/ProxyManager/autoload.php',
]);
AUTOLOAD
@@ -191,7 +191,7 @@ AUTOLOAD
%install
mkdir -p %{buildroot}%{phpdir}
-cp -rp src/* %{buildroot}%{phpdir}/
+cp -rp src %{buildroot}%{phpdir}/DI
%check
@@ -207,24 +207,11 @@ require '%{buildroot}%{phpdir}/DI/autoload.php';
require_once '%{phpdir}/EasyMock/autoload.php';
BOOTSTRAP
-: Skip tests known to fail with "php-composer(php-di/invoker)" >= 1.3.2
-: See https://github.com/PHP-DI/Invoker/issues/13
-sed 's/function test_not_callable/function SKIP_test_not_callable/' \
- -i tests/IntegrationTest/CallFunctionTest.php
-sed 's/function test_not_callable_factory_definition/function SKIP_test_not_callable_factory_definition/' \
- -i tests/IntegrationTest/Definitions/FactoryDefinitionTest.php
-sed 's/function test_factory_not_callable/function SKIP_test_factory_not_callable/' \
- -i tests/IntegrationTest/ErrorMessages/ErrorMessagesTest.php
-sed -e '/@test/d' \
- -e 's/public function should_/public function test_should_/g' \
- -e 's/function test_should_throw_if_the_factory_is_not_callable/function SKIP_test_should_throw_if_the_factory_is_not_callable/' \
- -i tests/UnitTest/Definition/Resolver/FactoryResolverTest.php
-
: Upstream tests
RETURN_CODE=0
-for PHP_EXEC in php php71 php72 php73; do
+for PHP_EXEC in php php70 php71 php72 php73 php74; do
if [ "php" == "$PHP_EXEC" ] || which $PHP_EXEC; then
- for PHPUNIT in phpunit; do
+ for PHPUNIT in phpunit6; do
PHPUNIT=$(which $PHPUNIT) || :
if [ -n "$PHPUNIT" ]; then
$PHP_EXEC $PHPUNIT --bootstrap bootstrap.php --verbose || RETURN_CODE=1
@@ -248,6 +235,9 @@ exit $RETURN_CODE
%changelog
+* Sun May 26 2019 Shawn Iwinski <shawn@iwin.ski> - 6.0.8-1
+- Update to 6.0.8 (RHBZ #1442587)
+
* Tue May 14 2019 Shawn Iwinski <shawn@iwin.ski> - 5.4.6-7
- Add range version dependencies for Fedora >= 27 || RHEL >= 8