Your project must not contain invalid function or method calls 5

More information: https://insight.symfony.com/what-we-analyse/php.invalid_call

in src/Container.php, line 90
  1. if (\is_object($entry) && ! \is_callable($entry)) {
  2. return $entry;
  3. }
  4. return $this->handledEntries[$id] = $this->resolver->handle($entry);
    Parameter #1 $callable of method Projek\Container\Resolver<Closure|list<string>|string,array<int, mixed>>::handle() expects array{string, string}|Closure|string, mixed given.
    Time to fix: about 9 minutes
    Read doc Permalink Copy Prompt
    Last edited by Fery Wardiyanto
  5. }
  6. /**
  7. * Determine whether the **entry** is registered.
  8. *
in src/Container.php, line 196
  1. if ($callback) {
  2. $instance = $callback($instance) ?: $instance;
  3. }
  4. return $this->resolver->handle($instance, $args);
    Parameter #1 $callable of method Projek\Container\Resolver<Closure|list<string>|string,array<int, mixed>>::handle() expects array{string, string}|Closure|string, mixed given.
    Time to fix: about 9 minutes
    Read doc Permalink Copy Prompt
    Last edited by Fery Wardiyanto
  5. }
  6. /**
  7. * Extending an entry.
  8. *
in src/Container.php, line 221
  1. throw new Container\Exception(
  2. \sprintf('Cannot extending a non-object or a callable entry of "%s"', $id)
  3. );
  4. }
  5. $extended = $this->make($callback, [$entry]);
    Parameter #1 $instance of method Projek\Container<TCallable of Closure|list<string>|string>::make() expects TCallable of array{string, string}|Closure|string, Closure given.
    Time to fix: about 9 minutes
    Read doc Permalink Copy Prompt
    Last edited by Fery Wardiyanto
  6. if (! \is_a($extended, $class = \get_class($entry))) {
  7. throw new Container\Exception(
  8. \sprintf('Argument #2 callback must be returns of type "%s"', $class)
  9. );
  1. ? \explode('::', $entry)
  2. : $this->createInstance($entry, $args);
  3. }
  4. if (\is_array($entry) && \is_string($entry[0])) {
  5. $entry[0] = $this->resolve($entry[0], $args);
    Parameter #1 $entry of method Projek\Container\Resolver<TCallable of Closure|list<string>|string,TArgs of array<int, mixed>>::resolve() expects TCallable of array{string, string}|Closure|string, string given.
    Time to fix: about 9 minutes
    Read doc Permalink Copy Prompt
    Last edited by Fery Wardiyanto
  6. }
  7. if (\is_object($entry) || \is_callable($entry)) {
  8. return $entry;
  9. }
  1. // Otherwise convert it to closure.
  2. $callable = \Closure::fromCallable($callable);
  3. }
  4. $ref = $this->createCallableReflection($callable);
    Parameter #1 $callable of method Projek\Container\Resolver<TCallable of Closure|list<string>|string,TArgs of array<int, mixed>>::createCallableReflection() expects TCallable of array{string, string}|Closure|string, (Closure(mixed ...): mixed)|(TCallable of array{string, string}|string) given.
    Time to fix: about 9 minutes
    Read doc Permalink Copy Prompt
    Last edited by Fery Wardiyanto
  5. $caller = $ref->getName();
  6. /** @var array{object|null, TArgs} */
  7. $params = [];

Your project should not use invalid parameter and return typehints 3

More information: https://insight.symfony.com/what-we-analyse/php.invalid_typehint

  1. /**
  2. * Create instance.
  3. *
  4. * @param Container $container
  5. */
  6. public function __construct(ContainerInterface $container)
    Method Projek\Container\Resolver::__construct() has parameter $container with generic class Projek\Container but does not specify its types: TCallable
    Time to fix: about 9 minutes
    Read doc Permalink Copy Prompt
    Last edited by Fery Wardiyanto
  7. {
  8. $this->container = $container;
  9. }
  10. /**
  1. protected $container = null;
  2. /**
  3. * @see ContainerAware::setContainer()
  4. */
  5. public function setContainer(\Projek\Container $container): ContainerAware
    Method Projek\Container\AbstractContainerAware::setContainer() has parameter $container with generic class Projek\Container but does not specify its types: TCallable
    Time to fix: about 9 minutes
    Read doc Permalink Copy Prompt
    Last edited by Fery Wardiyanto
  6. {
  7. $this->container = $container;
  8. return $this;
  9. }
  1. * Assign a container to the instance.
  2. *
  3. * @param \Projek\Container $container
  4. * @return static
  5. */
  6. public function setContainer(\Projek\Container $container): ContainerAware;
    Method Projek\Container\ContainerAware::setContainer() has parameter $container with generic class Projek\Container but does not specify its types: TCallable
    Time to fix: about 9 minutes
    Read doc Permalink Copy Prompt
    Last edited by Fery Wardiyanto
  7. /**
  8. * Retrieve container instance or the instance of registered service.
  9. *
  10. * If no parameter given, this method should returns instance of `Projek\Container`