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 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<object|string>|string>::make() expects TCallable of array{object|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. );
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<object|string>|string,array<int, mixed>>::handle() expects array{object|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 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<object|string>|string,array<int, mixed>>::handle() expects array{object|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. *
  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<object|string>|string,TArgs of array<int, mixed>>::createCallableReflection() expects TCallable of array{object|string, string}|Closure|string, (Closure(mixed ...): mixed)|(TCallable of array{object|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 = [];
  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<object|string>|string,TArgs of array<int, mixed>>::resolve() expects TCallable of array{object|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. }

Your project must not contain invalid instantiations

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

  1. if (! \is_array($callable)) {
  2. return new \ReflectionFunction($callable);
  3. }
  4. try {
  5. $ref = new \ReflectionMethod($callable[0], $callable[1]);
    Parameter #2 $method of class ReflectionMethod constructor expects string, object|string given.
    Time to fix: about 1 hour
    Read doc Permalink Copy Prompt
    Last edited by Fery Wardiyanto
  6. } catch (\ReflectionException $err) {
  7. throw new InvalidArgumentException($err->getMessage(), $err->getCode(), $err);
  8. }
  9. // If trying to statically call a non-static method (at least on PHP 7.x)