Your project must not contain invalid instantiations 2
- Read doc
- Reliability
- Major
More information: https://insight.symfony.com/what-we-analyse/php.invalid_instantiation
- if (! \is_array($callable)) {
- return new ReflectionFunction($callable);
- }
- try {
- $ref = new ReflectionMethod($callable[0], $callable[1]);
- } catch (ReflectionException $err) {
- throw new InvalidArgumentException($err->getMessage(), $err->getCode(), $err);
- }
- // If trying to statically call a non-static method (at least on PHP 7.x)
- if (! \is_array($callable)) {
- return new ReflectionFunction($callable);
- }
- try {
- $ref = new ReflectionMethod($callable[0], $callable[1]);
- } catch (ReflectionException $err) {
- throw new InvalidArgumentException($err->getMessage(), $err->getCode(), $err);
- }
- // If trying to statically call a non-static method (at least on PHP 7.x)
Your project must not contain invalid function or method calls
- 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);
- }
- $ref = $this->createCallableReflection($callable);
- try {
- if ($ref instanceof ReflectionFunction) {
- return $ref->invokeArgs(
- $this->resolveArgs($ref, $args)