Skip to content

Commit

Permalink
Merge pull request #2885 from Ayesh/3.x
Browse files Browse the repository at this point in the history
Replace abandoned `container-interop/container-interop` package with `psr/container`
  • Loading branch information
l0gicgate committed Nov 27, 2019
2 parents 925445e + 1a67c19 commit b38f3ec
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Slim/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use Closure;
use Exception;
use FastRoute\Dispatcher;
use Interop\Container\Exception\ContainerException;
use Psr\Container\ContainerExceptionInterface as ContainerException;
use InvalidArgumentException;
use Psr\Container\ContainerInterface;
use Psr\Http\Message\RequestInterface;
Expand Down
16 changes: 9 additions & 7 deletions Slim/Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
namespace Slim;

use ArrayAccess;
use Interop\Container\ContainerInterface;
use Interop\Container\Exception\ContainerException;
use Psr\Container\ContainerInterface;
use Psr\Container\ContainerExceptionInterface;
use InvalidArgumentException;
use Pimple\Container as PimpleContainer;
use Slim\Exception\ContainerException as SlimContainerException;
Expand Down Expand Up @@ -95,9 +95,10 @@ private function registerDefaultServices($userSettings)
* @return mixed
*
* @throws InvalidArgumentException Thrown when an offset cannot be found in the Pimple container
* @throws SlimContainerException Thrown when an exception is not an instance of ContainerException
* @throws SlimContainerException Thrown when an exception is
* not an instance of ContainerExceptionInterface
* @throws ContainerValueNotFoundException No entry was found for this identifier.
* @throws ContainerException Error while retrieving the entry.
* @throws ContainerExceptionInterface Error while retrieving the entry.
*/
public function get($id)
{
Expand All @@ -120,7 +121,7 @@ public function get($id)
}

/**
* Tests whether an exception needs to be recast for compliance with Container-Interop. This will be if the
* Tests whether an exception needs to be recast for compliance with psr/container. This will be if the
* exception was thrown by Pimple.
*
* @param InvalidArgumentException $exception
Expand Down Expand Up @@ -153,9 +154,10 @@ public function has($id)
* @return mixed
*
* @throws InvalidArgumentException Thrown when an offset cannot be found in the Pimple container
* @throws SlimContainerException Thrown when an exception is not an instance of ContainerException
* @throws SlimContainerException Thrown when an exception is not
* an instance of ContainerExceptionInterface
* @throws ContainerValueNotFoundException No entry was found for this identifier.
* @throws ContainerException Error while retrieving the entry.
* @throws ContainerExceptionInterface Error while retrieving the entry.
*/
public function __get($name)
{
Expand Down
2 changes: 1 addition & 1 deletion Slim/DefaultServicesProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class DefaultServicesProvider
/**
* Register Slim's default services.
*
* @param Container $container A DI container implementing ArrayAccess and container-interop.
* @param Container $container A DI container implementing ArrayAccess and psr/container.
*/
public function register($container)
{
Expand Down
4 changes: 2 additions & 2 deletions Slim/Exception/ContainerException.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

namespace Slim\Exception;

use Interop\Container\Exception\ContainerException as InteropContainerException;
use Psr\Container\ContainerExceptionInterface;
use InvalidArgumentException;

class ContainerException extends InvalidArgumentException implements InteropContainerException
class ContainerException extends InvalidArgumentException implements ContainerExceptionInterface
{
}
4 changes: 2 additions & 2 deletions Slim/Exception/ContainerValueNotFoundException.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

namespace Slim\Exception;

use Interop\Container\Exception\NotFoundException as InteropNotFoundException;
use Psr\Container\NotFoundExceptionInterface;
use RuntimeException;

class ContainerValueNotFoundException extends RuntimeException implements InteropNotFoundException
class ContainerValueNotFoundException extends RuntimeException implements NotFoundExceptionInterface
{
}
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
"pimple/pimple": "^3.0",
"psr/http-message": "^1.0",
"nikic/fast-route": "^1.0",
"container-interop/container-interop": "^1.2",
"psr/container": "^1.0"
},
"require-dev": {
Expand Down
2 changes: 1 addition & 1 deletion tests/ContainerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function (ContainerInterface $container) {
}

/**
* Test `get()` recasts InvalidArgumentException as ContainerInterop-compliant exceptions when an error is present
* Test `get()` recasts InvalidArgumentException as psr/container exceptions when an error is present
* in the DI config
*
* @expectedException \Slim\Exception\ContainerException
Expand Down

0 comments on commit b38f3ec

Please sign in to comment.