Skip to content

Navigation Menu

Sign in
Appearance settings

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

Commit f8bf6ea

Browse filesBrowse files
committed
Implement PSR-11
This is a work in progress, obviously. TODO: - use a stable version of the package; - act on the outcome of php-fig/container#8 ; - solve the mandatory NotFoundExceptionInterface on non-existing service problem (with a flag ?).
1 parent 136a5ff commit f8bf6ea
Copy full SHA for f8bf6ea

File tree

6 files changed

+19
-6
lines changed
Filter options

6 files changed

+19
-6
lines changed

‎composer.json

Copy file name to clipboardExpand all lines: composer.json
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"doctrine/common": "~2.4",
2121
"twig/twig": "~1.28|~2.0",
2222
"psr/cache": "~1.0",
23+
"psr/container": "^1.0@dev",
2324
"psr/log": "~1.0",
2425
"symfony/polyfill-intl-icu": "~1.0",
2526
"symfony/polyfill-mbstring": "~1.0",
@@ -99,7 +100,8 @@
99100
"phpdocumentor/type-resolver": "<0.2.0"
100101
},
101102
"provide": {
102-
"psr/cache-implementation": "1.0"
103+
"psr/cache-implementation": "1.0",
104+
"psr/container-implementation": "1.0"
103105
},
104106
"autoload": {
105107
"psr-4": {

‎src/Symfony/Component/DependencyInjection/ContainerInterface.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/ContainerInterface.php
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Component\DependencyInjection;
1313

14+
use Psr\Container\ContainerInterface as PsrContainerInterface;
1415
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
1516
use Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException;
1617
use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException;
@@ -21,7 +22,7 @@
2122
* @author Fabien Potencier <fabien@symfony.com>
2223
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
2324
*/
24-
interface ContainerInterface
25+
interface ContainerInterface extends PsrContainerInterface
2526
{
2627
const EXCEPTION_ON_INVALID_REFERENCE = 1;
2728
const NULL_ON_INVALID_REFERENCE = 2;

‎src/Symfony/Component/DependencyInjection/Exception/InvalidArgumentException.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Exception/InvalidArgumentException.php
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@
1111

1212
namespace Symfony\Component\DependencyInjection\Exception;
1313

14+
use Psr\Container\ContainerException;
15+
1416
/**
1517
* Base InvalidArgumentException for Dependency Injection component.
1618
*
1719
* @author Bulat Shakirzyanov <bulat@theopenskyproject.com>
1820
*/
19-
class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface
21+
class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface, ContainerException
2022
{
2123
}

‎src/Symfony/Component/DependencyInjection/Exception/ServiceCircularReferenceException.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Exception/ServiceCircularReferenceException.php
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@
1111

1212
namespace Symfony\Component\DependencyInjection\Exception;
1313

14+
use Psr\Container\ContainerException;
15+
1416
/**
1517
* This exception is thrown when a circular reference is detected.
1618
*
1719
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
1820
*/
19-
class ServiceCircularReferenceException extends RuntimeException
21+
class ServiceCircularReferenceException extends RuntimeException implements ContainerException
2022
{
2123
private $serviceId;
2224
private $path;

‎src/Symfony/Component/DependencyInjection/Exception/ServiceNotFoundException.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Exception/ServiceNotFoundException.php
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@
1111

1212
namespace Symfony\Component\DependencyInjection\Exception;
1313

14+
use Psr\Container\NotFoundException;
15+
1416
/**
1517
* This exception is thrown when a non-existent service is requested.
1618
*
1719
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
1820
*/
19-
class ServiceNotFoundException extends InvalidArgumentException
21+
class ServiceNotFoundException extends InvalidArgumentException implements NotFoundException
2022
{
2123
private $id;
2224
private $sourceId;

‎src/Symfony/Component/DependencyInjection/composer.json

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/composer.json
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
}
1717
],
1818
"require": {
19-
"php": ">=5.5.9"
19+
"php": ">=5.5.9",
20+
"psr/container": "^1.0@dev"
2021
},
2122
"require-dev": {
2223
"symfony/yaml": "~3.2",
@@ -32,6 +33,9 @@
3233
"conflict": {
3334
"symfony/yaml": "<3.2"
3435
},
36+
"provide": {
37+
"psr/container-implementation": "1.0"
38+
},
3539
"autoload": {
3640
"psr-4": { "Symfony\\Component\\DependencyInjection\\": "" },
3741
"exclude-from-classmap": [

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.