Skip to content

Commit

Permalink
Add typehinting for League container
Browse files Browse the repository at this point in the history
  • Loading branch information
jenssegers committed Sep 19, 2017
1 parent 7637694 commit e62dcbc
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
13 changes: 11 additions & 2 deletions src/Lean/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,29 @@
namespace Jenssegers\Lean;

use League\Container\Container;
use League\Container\ContainerInterface;
use League\Container\ReflectionContainer;
use Slim\App as Slim;

class App extends Slim
{
/**
* {@inheritdoc}
* @inheritdoc
*/
public function __construct(Container $container = null)
public function __construct(ContainerInterface $container = null)
{
$container = $container ?: new Container;
$container->delegate(new ReflectionContainer);
$container->addServiceProvider(new SlimServiceProvider);

parent::__construct($container);
}

/**
* @return ContainerInterface
*/
public function getContainer()
{
return parent::getContainer();
}
}
5 changes: 1 addition & 4 deletions src/Lean/SlimServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,14 @@ class SlimServiceProvider extends AbstractServiceProvider
'routerCacheFile' => false,
];

/**
* Constructor.
*/
public function __construct()
{
// Add alias classes to the provides array.
$this->provides = array_merge($this->provides, array_keys($this->aliases));
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function register()
{
Expand Down
2 changes: 0 additions & 2 deletions src/Lean/Strategies/AutoWiringStrategy.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ class AutoWiringStrategy implements InvocationStrategyInterface
protected $container;

/**
* AutoWiring constructor.
*
* @param ContainerInterface $container
*/
public function __construct(ContainerInterface $container)
Expand Down

0 comments on commit e62dcbc

Please sign in to comment.