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);
- }
- $ref = $this->createCallableReflection($callable);
- try {
- 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 (UnresolvableArgumentException $err) {
- throw new Exception($err->getMessage(), $err->getPrevious());
- }
Your project must not contain invalid instantiations 3
- Read doc
- Reliability
- Major
More information: https://insight.symfony.com/what-we-analyse/php.invalid_instantiation
- if (\is_string($callable) && \str_contains($callable, '::')) {
- $callable = \explode('::', $callable);
- }
- if (! \is_array($callable)) {
- return new ReflectionFunction($callable);
- }
- try {
- $ref = new ReflectionMethod($callable[0], $callable[1]);
- } catch (ReflectionException $err) {
- 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)