protected function setListenerProperties(Listener $listener): void
    {
        $classReflection = $this->getClassReflection($listener->getClass());

        if (
            $listener->getMethod()
            || $classReflection->hasMethod('__construct')
        ) {
            $methodReflection = $this->getMethodReflection(
                $listener->getClass(),
                $listener->getMethod() ?? '__construct'
            );
            $parameters       = $methodReflection->getParameters();

            // Set the dependencies
            $listener->setDependencies($this->getDependencies(...$parameters));
        }

        $listener->setMatches();
    }
protected function setListenerProperties(Listener $listener): void
    {
        $classReflection = $this->getClassReflection($listener->getClass());

        if (
            $listener->getMethod()
            || $classReflection->hasMethod('__construct')
        ) {
            $methodReflection = $this->getMethodReflection(
                $listener->getClass(),
                $listener->getMethod() ?? '__construct'
            );
            $parameters       = $methodReflection->getParameters();

            // Set the dependencies
            $listener->setDependencies($this->getDependencies(...$parameters));
        }

        $listener->setMatches();
    }
protected function setListenerProperties ( Listener $ listener ) : void { $ classReflection = $ this -> getClassReflection ( $ listener -> getClass ( ) ) ; if ( $ listener -> getMethod ( ) || $ classReflection -> hasMethod ( '__construct' ) ) { $ methodReflection = $ this -> getMethodReflection ( $ listener -> getClass ( ) , $ listener -> getMethod ( ) ?? '__construct' ) ; $ parameters = $ methodReflection -> getParameters ( ) ; // Set the dependencies $ listener -> setDependencies ( $ this -> getDependencies ( ... $ parameters ) ) ; } $ listener -> setMatches ( ) ; }
Set the properties for a listener annotation.

@param Listener $listener

@throws \ReflectionException

@return void
Set the properties for a listener annotation .