Commit d66303db authored by Benjamin Franzke's avatar Benjamin Franzke Committed by Benni Mack
Browse files

[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: default avatarTYPO3com <noreply@typo3.com>
Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Andreas Fernandez's avatarAndreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Reviewed-by: Andreas Fernandez's avatarAndreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
parent 872e0ce0
......@@ -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",
......
......@@ -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);
}
......
......@@ -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",
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment