protected function findCommand(\ReflectionMethod $reflectionMethod)
    {
        $parameters = $reflectionMethod->getParameters();

        /** @var \ReflectionParameter $parameter */
        foreach ($parameters as $parameter) {
            $class = $parameter->getClass();

            if (null !== $class && true === $class->implementsInterface('RomaricDrigon\OrchestraBundle\Domain\Command\CommandInterface')) {
                return $class->getName();
            }
        }

        return null;
    }
protected function findCommand(\ReflectionMethod $reflectionMethod)
    {
        $parameters = $reflectionMethod->getParameters();

        /** @var \ReflectionParameter $parameter */
        foreach ($parameters as $parameter) {
            $class = $parameter->getClass();

            if (null !== $class && true === $class->implementsInterface('RomaricDrigon\OrchestraBundle\Domain\Command\CommandInterface')) {
                return $class->getName();
            }
        }

        return null;
    }
protected function findCommand ( \ ReflectionMethod $ reflectionMethod ) { $ parameters = $ reflectionMethod -> getParameters ( ) ; /** @var \ReflectionParameter $parameter */ foreach ( $ parameters as $ parameter ) { $ class = $ parameter -> getClass ( ) ; if ( null !== $ class && true === $ class -> implementsInterface ( 'RomaricDrigon\OrchestraBundle\Domain\Command\CommandInterface' ) ) { return $ class -> getName ( ) ; } } return null ; }
Look if we have a parameter of type "CommandInterface", and then return its precise class name

@param \ReflectionMethod $reflectionMethod
@return null|string
Look if we have a parameter of type CommandInterface and then return its precise class name