Skip to content

Commit

Permalink
Use Psr\Container\ContainerInterface.
Browse files Browse the repository at this point in the history
  • Loading branch information
joeparsons committed Sep 14, 2020
1 parent 2307735 commit dea091b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/Collection/CollectionBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function __construct($commandFile)
}

/**
* @param \League\Container\Container $container
* @param \Psr\Container\ContainerInterface $container
* @param \Robo\Tasks $commandFile
*
* @return static
Expand Down
2 changes: 1 addition & 1 deletion src/Common/ProcessExecutor.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function __construct(Process $process)
}

/**
* @param \League\Container\Container $container
* @param \Psr\Container\ContainerInterface $container
* @param \Symfony\Component\Process\Process $process
*
* @return static
Expand Down
19 changes: 10 additions & 9 deletions src/Robo.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Composer\Autoload\ClassLoader;
use League\Container\Container;
use Psr\Container\ContainerInterface;
use Robo\Common\ProcessExecutor;
use Consolidation\Config\ConfigInterface;
use Consolidation\Config\Loader\ConfigProcessor;
Expand All @@ -25,7 +26,7 @@ class Robo
/**
* The currently active container object, or NULL if not initialized yet.
*
* @var \League\Container\Container|null
* @var \Psr\Container\ContainerInterface|null
*/
protected static $container;

Expand All @@ -52,10 +53,10 @@ public static function run($argv, $commandClasses, $appName = null, $appVersion
/**
* Sets a new global container.
*
* @param \League\Container\Container $container
* @param \Psr\Container\ContainerInterface $container
* A new container instance to replace the current.
*/
public static function setContainer(Container $container)
public static function setContainer(ContainerInterface $container)
{
static::$container = $container;
}
Expand All @@ -71,7 +72,7 @@ public static function unsetContainer()
/**
* Returns the currently active global container.
*
* @return \League\Container\Container
* @return \Psr\Container\ContainerInterface
*
* @throws \RuntimeException
*/
Expand Down Expand Up @@ -138,7 +139,7 @@ public static function loadConfiguration($paths, $config = null)
* @param null|\Consolidation\Config\ConfigInterface $config
* @param null|\Composer\Autoload\ClassLoader $classLoader
*
* @return \League\Container\Container
* @return \Psr\Container\ContainerInterface
*/
public static function createContainer($app = null, $config = null, $classLoader = null)
{
Expand Down Expand Up @@ -179,7 +180,7 @@ public static function createContainer($app = null, $config = null, $classLoader
*
* @deprecated Use createContainer instead
*
* @return \League\Container\Container
* @return \Psr\Container\ContainerInterface
*/
public static function createDefaultContainer($input = null, $output = null, $app = null, $config = null, $classLoader = null)
{
Expand Down Expand Up @@ -229,14 +230,14 @@ public static function finalizeContainer(Container $container)
*
* It is recommended to use Robo::createContainer() instead.
*
* @param \League\Container\Container $container
* @param \Psr\Container\ContainerInterface $container
* @param \Symfony\Component\Console\Application $app
* @param \Consolidation\Config\ConfigInterface $config
* @param null|\Symfony\Component\Console\Input\InputInterface $input
* @param null|\Symfony\Component\Console\Output\OutputInterface $output
* @param null|\Composer\Autoload\ClassLoader $classLoader
*/
public static function configureContainer(Container $container, SymfonyApplication $app, ConfigInterface $config, $input = null, $output = null, $classLoader = null)
public static function configureContainer(ContainerInterface $container, SymfonyApplication $app, ConfigInterface $config, $input = null, $output = null, $classLoader = null)
{
// Self-referential container refernce for the inflector
$container->add('container', $container);
Expand Down Expand Up @@ -356,7 +357,7 @@ public static function createDefaultApplication($appName = null, $appVersion = n
/**
* Add the Robo League\Container inflectors to the container
*
* @param \League\Container\Container $container
* @param \Psr\Container\ContainerInterface $container
*/
public static function addInflectors($container)
{
Expand Down

0 comments on commit dea091b

Please sign in to comment.