From d66303db7006e52a5a20695e79ef967cc9b4ae58 Mon Sep 17 00:00:00 2001 From: Benjamin Franzke <bfr@qbus.de> Date: Mon, 8 Mar 2021 21:22:23 +0100 Subject: [PATCH] [TASK] Update to psr/container v1.1 The v1.1 interface adds support for parameter type declarations. Also mark as psr/container v2 compatible as we add the `bool` return type annoation for `has()` right away. (yes that is compatible with the v1.1 interface, although it doesn't contain a return type declaration) This is not yet testable against psr/container v2, but will show up in nightly composer-max stages once symfony/dependency-injection is released with support for psr/container v2. Commands used: composer require "psr/container:^1.1 || ^2.0" composer require "psr/container:^1.1 || ^2.0" \ --no-update -d typo3/sysext/core Releases: master Resolves: #93681 Change-Id: Ia0e5024bae0a05ae72b83964233d449b63896440 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/68256 Tested-by: TYPO3com <noreply@typo3.com> Tested-by: core-ci <typo3@b13.com> Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de> Tested-by: Benni Mack <benni@typo3.org> Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de> Reviewed-by: Benni Mack <benni@typo3.org> --- composer.json | 2 +- composer.lock | 23 ++++++++----------- .../DependencyInjection/FailsafeContainer.php | 4 ++-- typo3/sysext/core/composer.json | 2 +- 4 files changed, 13 insertions(+), 18 deletions(-) diff --git a/composer.json b/composer.json index 5b221d1821e5..be92ac7a5e2c 100644 --- a/composer.json +++ b/composer.json @@ -50,7 +50,7 @@ "nikic/php-parser": "^4.10.4", "phpdocumentor/reflection-docblock": "^5.2", "phpdocumentor/type-resolver": "^1.3", - "psr/container": "^1.0", + "psr/container": "^1.1 || ^2.0", "psr/event-dispatcher": "^1.0", "psr/http-client": "^1.0", "psr/http-factory": "^1.0", diff --git a/composer.lock b/composer.lock index 79e4c7d50fe2..d8bac49e1e18 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "7a46414102d656d03ff52982e9bfa89d", + "content-hash": "2a0b82edb285d0727a6686f63ef285cb", "packages": [ { "name": "bacon/bacon-qr-code", @@ -1277,27 +1277,22 @@ }, { "name": "psr/container", - "version": "1.0.0", + "version": "1.1.1", "source": { "type": "git", "url": "https://github.com/php-fig/container.git", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" + "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "url": "https://api.github.com/repos/php-fig/container/zipball/8622567409010282b7aeebe4bb841fe98b58dcaf", + "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=7.2.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, "autoload": { "psr-4": { "Psr\\Container\\": "src/" @@ -1310,7 +1305,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common Container Interface (PHP FIG PSR-11)", @@ -1324,9 +1319,9 @@ ], "support": { "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/master" + "source": "https://github.com/php-fig/container/tree/1.1.1" }, - "time": "2017-02-14T16:28:37+00:00" + "time": "2021-03-05T17:36:06+00:00" }, { "name": "psr/event-dispatcher", diff --git a/typo3/sysext/core/Classes/DependencyInjection/FailsafeContainer.php b/typo3/sysext/core/Classes/DependencyInjection/FailsafeContainer.php index 2fbd6011224f..51961e145551 100644 --- a/typo3/sysext/core/Classes/DependencyInjection/FailsafeContainer.php +++ b/typo3/sysext/core/Classes/DependencyInjection/FailsafeContainer.php @@ -75,7 +75,7 @@ class FailsafeContainer implements ContainerInterface * @param string $id * @return bool */ - public function has($id) + public function has(string $id): bool { return array_key_exists($id, $this->entries) || array_key_exists($id, $this->factories); } @@ -112,7 +112,7 @@ class FailsafeContainer implements ContainerInterface * @param string $id * @return mixed */ - public function get($id) + public function get(string $id) { return $this->entries[$id] ?? $this->create($id); } diff --git a/typo3/sysext/core/composer.json b/typo3/sysext/core/composer.json index 006350a6568d..9f8dc6488dde 100644 --- a/typo3/sysext/core/composer.json +++ b/typo3/sysext/core/composer.json @@ -36,7 +36,7 @@ "egulias/email-validator": "^2.1", "guzzlehttp/guzzle": "^7.2", "nikic/php-parser": "^4.10.4", - "psr/container": "^1.0", + "psr/container": "^1.1 || ^2.0", "psr/event-dispatcher": "^1.0", "psr/http-client": "^1.0", "psr/http-factory": "^1.0", -- GitLab