Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[DependencyInjection] Implement psr/container 1.1 #40384

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions 4 src/Symfony/Bundle/FrameworkBundle/Test/TestContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,15 @@ public function set(string $id, $service)
/**
* {@inheritdoc}
*/
public function has($id): bool
public function has(string $id): bool
{
return $this->getPublicContainer()->has($id) || $this->getPrivateContainer()->has($id);
}

/**
* {@inheritdoc}
*/
public function get($id, int $invalidBehavior = /* self::EXCEPTION_ON_INVALID_REFERENCE */ 1): ?object
public function get(string $id, int $invalidBehavior = /* self::EXCEPTION_ON_INVALID_REFERENCE */ 1): ?object
{
return $this->getPrivateContainer()->has($id) ? $this->getPrivateContainer()->get($id) : $this->getPublicContainer()->get($id, $invalidBehavior);
}
Expand Down
4 changes: 2 additions & 2 deletions 4 src/Symfony/Component/DependencyInjection/Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ public function set(string $id, ?object $service)
*
* @return bool true if the service is defined, false otherwise
*/
public function has($id)
public function has(string $id)
{
if (isset($this->aliases[$id])) {
$id = $this->aliases[$id];
Expand Down Expand Up @@ -221,7 +221,7 @@ public function has($id)
*
* @see Reference
*/
public function get($id, int $invalidBehavior = /* self::EXCEPTION_ON_INVALID_REFERENCE */ 1)
public function get(string $id, int $invalidBehavior = /* self::EXCEPTION_ON_INVALID_REFERENCE */ 1)
{
return $this->services[$id]
?? $this->services[$id = $this->aliases[$id] ?? $id]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -517,10 +517,8 @@ public function removeDefinition(string $id)
*
* @return bool true if the service is defined, false otherwise
*/
public function has($id)
public function has(string $id)
{
$id = (string) $id;

return isset($this->definitions[$id]) || isset($this->aliasDefinitions[$id]) || parent::has($id);
}

Expand All @@ -539,9 +537,9 @@ public function has($id)
*
* @see Reference
*/
public function get($id, int $invalidBehavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE)
public function get(string $id, int $invalidBehavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE)
{
if ($this->isCompiled() && isset($this->removedIds[$id = (string) $id]) && ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE >= $invalidBehavior) {
if ($this->isCompiled() && isset($this->removedIds[$id]) && ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE >= $invalidBehavior) {
return parent::get($id);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function set(string $id, ?object $service);
*
* @see Reference
*/
public function get($id, int $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE);
public function get(string $id, int $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE);

/**
* Returns true if the given service is defined.
Expand All @@ -57,7 +57,7 @@ public function get($id, int $invalidBehavior = self::EXCEPTION_ON_INVALID_REFER
*
* @return bool true if the service is defined, false otherwise
*/
public function has($id);
public function has(string $id);

/**
* Check for whether or not a service has been initialized.
Expand Down
2 changes: 1 addition & 1 deletion 2 src/Symfony/Component/DependencyInjection/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
],
"require": {
"php": ">=7.2.5",
"psr/container": "^1.0",
"psr/container": "^1.1.1",
"symfony/deprecation-contracts": "^2.1",
"symfony/polyfill-php80": "^1.15",
"symfony/service-contracts": "^1.1.6|^2"
Expand Down
4 changes: 2 additions & 2 deletions 4 src/Symfony/Contracts/Service/ServiceLocatorTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function __construct(array $factories)
*
* @return bool
*/
public function has($id)
public function has(string $id)
{
return isset($this->factories[$id]);
}
Expand All @@ -53,7 +53,7 @@ public function has($id)
*
* @return mixed
*/
public function get($id)
public function get(string $id)
{
if (!isset($this->factories[$id])) {
throw $this->createNotFoundException($id);
Expand Down
2 changes: 1 addition & 1 deletion 2 src/Symfony/Contracts/Service/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
],
"require": {
"php": ">=7.2.5",
"psr/container": "^1.0"
"psr/container": "^1.1"
},
"suggest": {
"symfony/service-implementation": ""
Expand Down
2 changes: 1 addition & 1 deletion 2 src/Symfony/Contracts/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"require": {
"php": ">=7.2.5",
"psr/cache": "^1.0|^2.0|^3.0",
"psr/container": "^1.0",
"psr/container": "^1.1",
"psr/event-dispatcher": "^1.0"
},
"require-dev": {
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.