From 9a04bf9e488eada94125b9e42473830fb645ee32 Mon Sep 17 00:00:00 2001 From: Sam-Burns Date: Tue, 21 Mar 2017 11:38:58 +0000 Subject: [PATCH] Switching from ContainerInterop to PSR-11 --- Slim/App.php | 2 +- Slim/CallableResolver.php | 2 +- Slim/Container.php | 8 ++++---- Slim/Exception/ContainerException.php | 4 ++-- Slim/Exception/ContainerValueNotFoundException.php | 4 ++-- composer.json | 2 +- tests/AppTest.php | 2 +- tests/ContainerTest.php | 10 +++++----- 8 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Slim/App.php b/Slim/App.php index 5c4538f8f..d28a71459 100644 --- a/Slim/App.php +++ b/Slim/App.php @@ -11,7 +11,7 @@ use Closure; use Exception; use FastRoute\Dispatcher; -use Interop\Container\ContainerInterface; +use Psr\Container\ContainerInterface; use InvalidArgumentException; use Psr\Http\Message\RequestInterface; use Psr\Http\Message\ResponseInterface; diff --git a/Slim/CallableResolver.php b/Slim/CallableResolver.php index 3015a2955..62d13a36e 100644 --- a/Slim/CallableResolver.php +++ b/Slim/CallableResolver.php @@ -9,7 +9,7 @@ namespace Slim; use RuntimeException; -use Interop\Container\ContainerInterface; +use Psr\Container\ContainerInterface; use Slim\Interfaces\CallableResolverInterface; /** diff --git a/Slim/Container.php b/Slim/Container.php index ac0d9179c..6a95e6f34 100644 --- a/Slim/Container.php +++ b/Slim/Container.php @@ -8,8 +8,8 @@ */ namespace Slim; -use Interop\Container\ContainerInterface; -use Interop\Container\Exception\ContainerException; +use Psr\Container\ContainerInterface; +use Psr\Container\ContainerExceptionInterface; use Pimple\Container as PimpleContainer; use Slim\Exception\ContainerValueNotFoundException; use Slim\Exception\ContainerException as SlimContainerException; @@ -17,7 +17,7 @@ /** * Slim's default DI container is Pimple. * - * Slim\App expects a container that implements Interop\Container\ContainerInterface + * Slim\App expects a container that implements Psr\Container\ContainerInterface * with these service keys configured and ready for use: * * - settings: an array or instance of \ArrayAccess @@ -110,7 +110,7 @@ private function registerDefaultServices($userSettings) * @param string $id Identifier of the entry to look for. * * @throws ContainerValueNotFoundException No entry was found for this identifier. - * @throws ContainerException Error while retrieving the entry. + * @throws ContainerExceptionInterface Error while retrieving the entry. * * @return mixed Entry. */ diff --git a/Slim/Exception/ContainerException.php b/Slim/Exception/ContainerException.php index b147eb99a..f63275935 100644 --- a/Slim/Exception/ContainerException.php +++ b/Slim/Exception/ContainerException.php @@ -9,12 +9,12 @@ namespace Slim\Exception; use InvalidArgumentException; -use Interop\Container\Exception\ContainerException as InteropContainerException; +use Psr\Container\ContainerExceptionInterface; /** * Container Exception */ -class ContainerException extends InvalidArgumentException implements InteropContainerException +class ContainerException extends InvalidArgumentException implements ContainerExceptionInterface { } diff --git a/Slim/Exception/ContainerValueNotFoundException.php b/Slim/Exception/ContainerValueNotFoundException.php index c5033b6dd..c45563c5b 100644 --- a/Slim/Exception/ContainerValueNotFoundException.php +++ b/Slim/Exception/ContainerValueNotFoundException.php @@ -9,12 +9,12 @@ namespace Slim\Exception; use RuntimeException; -use Interop\Container\Exception\NotFoundException as InteropNotFoundException; +use Psr\Container\NotFoundExceptionInterface; /** * Not Found Exception */ -class ContainerValueNotFoundException extends RuntimeException implements InteropNotFoundException +class ContainerValueNotFoundException extends RuntimeException implements NotFoundExceptionInterface { } diff --git a/composer.json b/composer.json index 936f2c3fa..fec5a55a4 100644 --- a/composer.json +++ b/composer.json @@ -32,7 +32,7 @@ "pimple/pimple": "^3.0", "psr/http-message": "^1.0", "nikic/fast-route": "^1.0", - "container-interop/container-interop": "^1.1" + "psr/container": "^1.0" }, "require-dev": { "squizlabs/php_codesniffer": "^2.5", diff --git a/tests/AppTest.php b/tests/AppTest.php index 028eb4246..0137f331e 100644 --- a/tests/AppTest.php +++ b/tests/AppTest.php @@ -9,7 +9,7 @@ namespace Slim\Tests; -use Interop\Container\ContainerInterface; +use Psr\Container\ContainerInterface; use Psr\Http\Message\ResponseInterface; use Slim\App; use Slim\Container; diff --git a/tests/ContainerTest.php b/tests/ContainerTest.php index 309376f3a..fda2db8cf 100644 --- a/tests/ContainerTest.php +++ b/tests/ContainerTest.php @@ -9,7 +9,7 @@ namespace Slim\Tests; use Slim\Container; -use Interop\Container\ContainerInterface; +use Psr\Container\ContainerInterface; class ContainerTest extends \PHPUnit_Framework_TestCase { @@ -36,7 +36,7 @@ public function testGet() /** * Test `get()` throws error if item does not exist * - * @expectedException \Interop\Container\Exception\NotFoundException + * @expectedException \Psr\Container\NotFoundExceptionInterface */ public function testGetWithValueNotFoundError() { @@ -47,7 +47,7 @@ public function testGetWithValueNotFoundError() * Test `get()` throws something that is a ContainerExpception - typically a NotFoundException, when there is a DI * config error * - * @expectedException \Interop\Container\Exception\ContainerException + * @expectedException \Psr\Container\NotFoundExceptionInterface */ public function testGetWithDiConfigErrorThrownAsContainerValueNotFoundException() { @@ -61,10 +61,10 @@ function (ContainerInterface $container) { } /** - * Test `get()` recasts \InvalidArgumentException as ContainerInterop-compliant exceptions when an error is present + * Test `get()` recasts \InvalidArgumentException as PSR-11 compliant exceptions when an error is present * in the DI config * - * @expectedException \Interop\Container\Exception\ContainerException + * @expectedException \Psr\Container\ContainerExceptionInterface */ public function testGetWithDiConfigErrorThrownAsInvalidArgumentException() {