Your project must not contain invalid function or method calls 2

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

  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::createCallableReflection() expects array{string, string}|(callable(): mixed)|string, array{object|string, string}|(callable(): mixed)|string given.
    Last edited by Fery Wardiyanto
  5. try {
  6. if ($ref instanceof ReflectionFunction) {
  7. return $ref->invokeArgs(
  8. $this->resolveArgs($ref, $args)
  1. $this->resolveArgs($ref, $args)
  2. );
  3. }
  4. return $ref->invokeArgs(
  5. $ref->isStatic() && ! \is_object($callable[0]) ? null : $callable[0],
    Parameter #1 $object of method ReflectionMethod::invokeArgs() expects object|null, mixed given.
    Last edited by Fery Wardiyanto
  6. $this->resolveArgs($ref, $args)
  7. );
  8. } catch (UnresolvableArgumentException $err) {
  9. throw new Exception($err->getMessage(), $err->getPrevious());
  10. }

Your project must not contain invalid instantiations 3

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

  1. if (\is_string($callable) && \str_contains($callable, '::')) {
  2. $callable = \explode('::', $callable);
  3. }
  4. if (! \is_array($callable)) {
  5. return new ReflectionFunction($callable);
    Parameter #1 $function of class ReflectionFunction constructor expects Closure|string, (callable(): mixed)|string given.
    Last edited by Fery Wardiyanto
  6. }
  7. try {
  8. $ref = new ReflectionMethod($callable[0], $callable[1]);
  9. } catch (ReflectionException $err) {
  1. if (! \is_array($callable)) {
  2. return new ReflectionFunction($callable);
  3. }
  4. try {
  5. $ref = new ReflectionMethod($callable[0], $callable[1]);
    Parameter #1 $objectOrMethod of class ReflectionMethod constructor expects object|string, mixed given.
    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)
  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, mixed given.
    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)