Implement PSR-11

Delegate lookup is optional and thus, not implemented.
This commit is contained in:
Grégoire Paris 2017-01-12 23:20:30 +01:00
parent 46daa359ea
commit bde0efd01c
No known key found for this signature in database
GPG Key ID: 24D48B8012B116BF
6 changed files with 16 additions and 4 deletions

View File

@ -20,6 +20,7 @@
"doctrine/common": "~2.4", "doctrine/common": "~2.4",
"twig/twig": "~1.28|~2.0", "twig/twig": "~1.28|~2.0",
"psr/cache": "~1.0", "psr/cache": "~1.0",
"psr/container": "^1.0",
"psr/log": "~1.0", "psr/log": "~1.0",
"psr/simple-cache": "^1.0", "psr/simple-cache": "^1.0",
"symfony/polyfill-intl-icu": "~1.0", "symfony/polyfill-intl-icu": "~1.0",
@ -102,6 +103,7 @@
}, },
"provide": { "provide": {
"psr/cache-implementation": "1.0", "psr/cache-implementation": "1.0",
"psr/container-implementation": "1.0",
"psr/simple-cache-implementation": "1.0" "psr/simple-cache-implementation": "1.0"
}, },
"autoload": { "autoload": {

View File

@ -40,6 +40,7 @@
<argument type="collection" /> <argument type="collection" />
</service> </service>
<service id="Psr\Container\ContainerInterface" alias="service_container" public="false" />
<service id="Symfony\Component\DependencyInjection\ContainerInterface" alias="service_container" public="false" /> <service id="Symfony\Component\DependencyInjection\ContainerInterface" alias="service_container" public="false" />
<service id="Symfony\Component\DependencyInjection\Container" alias="service_container" public="false" /> <service id="Symfony\Component\DependencyInjection\Container" alias="service_container" public="false" />

View File

@ -11,6 +11,7 @@
namespace Symfony\Component\DependencyInjection; namespace Symfony\Component\DependencyInjection;
use Psr\Container\ContainerInterface as PsrContainerInterface;
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
use Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException; use Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException;
use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException; use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException;
@ -21,7 +22,7 @@ use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException;
* @author Fabien Potencier <fabien@symfony.com> * @author Fabien Potencier <fabien@symfony.com>
* @author Johannes M. Schmitt <schmittjoh@gmail.com> * @author Johannes M. Schmitt <schmittjoh@gmail.com>
*/ */
interface ContainerInterface interface ContainerInterface extends PsrContainerInterface
{ {
const EXCEPTION_ON_INVALID_REFERENCE = 1; const EXCEPTION_ON_INVALID_REFERENCE = 1;
const NULL_ON_INVALID_REFERENCE = 2; const NULL_ON_INVALID_REFERENCE = 2;

View File

@ -11,12 +11,14 @@
namespace Symfony\Component\DependencyInjection\Exception; namespace Symfony\Component\DependencyInjection\Exception;
use Psr\Container\ContainerExceptionInterface;
/** /**
* Base ExceptionInterface for Dependency Injection component. * Base ExceptionInterface for Dependency Injection component.
* *
* @author Fabien Potencier <fabien@symfony.com> * @author Fabien Potencier <fabien@symfony.com>
* @author Bulat Shakirzyanov <bulat@theopenskyproject.com> * @author Bulat Shakirzyanov <bulat@theopenskyproject.com>
*/ */
interface ExceptionInterface interface ExceptionInterface extends ContainerExceptionInterface
{ {
} }

View File

@ -11,12 +11,14 @@
namespace Symfony\Component\DependencyInjection\Exception; namespace Symfony\Component\DependencyInjection\Exception;
use Psr\Container\NotFoundExceptionInterface;
/** /**
* This exception is thrown when a non-existent service is requested. * This exception is thrown when a non-existent service is requested.
* *
* @author Johannes M. Schmitt <schmittjoh@gmail.com> * @author Johannes M. Schmitt <schmittjoh@gmail.com>
*/ */
class ServiceNotFoundException extends InvalidArgumentException class ServiceNotFoundException extends InvalidArgumentException implements NotFoundExceptionInterface
{ {
private $id; private $id;
private $sourceId; private $sourceId;

View File

@ -16,7 +16,8 @@
} }
], ],
"require": { "require": {
"php": ">=5.5.9" "php": ">=5.5.9",
"psr/container": "^1.0"
}, },
"require-dev": { "require-dev": {
"symfony/yaml": "~3.2", "symfony/yaml": "~3.2",
@ -32,6 +33,9 @@
"conflict": { "conflict": {
"symfony/yaml": "<3.2" "symfony/yaml": "<3.2"
}, },
"provide": {
"psr/container-implementation": "1.0"
},
"autoload": { "autoload": {
"psr-4": { "Symfony\\Component\\DependencyInjection\\": "" }, "psr-4": { "Symfony\\Component\\DependencyInjection\\": "" },
"exclude-from-classmap": [ "exclude-from-classmap": [