Your project must not contain invalid function or method calls 2
- Read doc
- Reliability
- Major
More information: https://insight.symfony.com/what-we-analyse/php.invalid_call
- // Otherwise convert it to closure.
- $callable = Closure::fromCallable($callable);
- }
- try {
- $ref = $this->createCallableReflection($callable);
- if ($ref instanceof ReflectionFunction) {
- return $ref->invokeArgs(
- $this->resolveArgs($ref, $args)
- );
- $this->resolveArgs($ref, $args)
- );
- }
- return $ref->invokeArgs(
- $ref->isStatic() && ! \is_object($callable[0]) ? null : $callable[0],
- $this->resolveArgs($ref, $args)
- );
- } catch (ReflectionException $err) {
- throw new InvalidArgumentException($err->getMessage(), $err->getCode(), $err);
- } catch (UnresolvableArgumentException $err) {
Your project must not contain invalid instantiations
- Read doc
- Reliability
- Major
More information: https://insight.symfony.com/what-we-analyse/php.invalid_instantiation
- }
- // Pass non-array $callable directly to `ReflectionFunction` that possibly
- // a callable object including a `Closure`, or a string of function name
- if (! \is_array($callable)) {
- return new ReflectionFunction($callable);
- }
- /** @var array{object|string,string} $callable */
- $ref = new ReflectionMethod($callable[0], $callable[1]);