Missing use statement should be avoided 4

  • Major
  • Bugrisk

More information: https://insight.sensiolabs.com/what-we-analyse/php.missing_use_statement

in src/Container.php, line 16
  1. use League\Container\Inflector\InflectorAggregate;
  2. use League\Container\Inflector\InflectorAggregateInterface;
  3. use League\Container\ServiceProvider\ServiceProviderAggregate;
  4. use League\Container\ServiceProvider\ServiceProviderAggregateInterface;
  5. class Container implements ContainerInterface

    The ContainerInterface class resolves to the following classes: Psr\Container\ContainerInterface or Interop\Container\ContainerInterface.
    Did you forget to add a corresponding use statement for one of them?

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Phil Bennett
  6. {
  7. /**
  8. * @var \League\Container\Definition\DefinitionFactoryInterface
  9. */
  10. protected $definitionFactory;
in src/Container.php, line 225
  1. */
  2. public function delegate(InteropContainerInterface $container)
  3. {
  4. $this->delegates[] = $container;
  5. if ($container instanceof ImmutableContainerAwareInterface) {

    The ImmutableContainerAwareInterface class resolves to the League\Container\ImmutableContainerAwareInterface class which PHP does not seem to be able to autoload.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Andreas Möller
  6. $container->setContainer($this);
  7. }
  8. return $this;
  9. }
  1. use League\Container\Exception\NotFoundException;
  2. use ReflectionClass;
  3. use ReflectionFunction;
  4. use ReflectionMethod;
  5. class ReflectionContainer implements

    The ImmutableContainerInterface class resolves to the League\Container\ImmutableContainerInterface class which PHP does not seem to be able to autoload.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Phil Bennett
  6. ArgumentResolverInterface,
  7. ImmutableContainerInterface
  8. {
  9. use ArgumentResolverTrait;
  10. use ImmutableContainerAwareTrait;
  1. class ReflectionContainer implements
  2. ArgumentResolverInterface,
  3. ImmutableContainerInterface
  4. {
  5. use ArgumentResolverTrait;
  6. use ImmutableContainerAwareTrait;

    The ImmutableContainerAwareTrait class resolves to the League\Container\ImmutableContainerAwareTrait class which PHP does not seem to be able to autoload.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Phil Bennett
  7. /**
  8. * {@inheritdoc}
  9. */
  10. public function get($alias, array $args = [])