src/State/StateTrait.php
private function checkVisibilityProtected(string &$methodName, string &$statedClassOrigin): bool
    {
        if (false === $this->reflectionsMethods[$methodName]->isPrivate()
            && !empty($statedClassOrigin)
            && ($statedClassOrigin === $this->statedClassName
                || \is_subclass_of($statedClassOrigin, $this->statedClassName))) {
            //It's a public or protected method, do like if there is no method
            return true;
        }

        return false;
    }
private function checkVisibilityProtected(string &$methodName, string &$statedClassOrigin): bool
    {
        if (false === $this->reflectionsMethods[$methodName]->isPrivate()
            && !empty($statedClassOrigin)
            && ($statedClassOrigin === $this->statedClassName
                || \is_subclass_of($statedClassOrigin, $this->statedClassName))) {
            //It's a public or protected method, do like if there is no method
            return true;
        }

        return false;
    }
private function checkVisibilityProtected ( string & $ methodName , string & $ statedClassOrigin ) : bool { if ( false === $ this -> reflectionsMethods [ $ methodName ] -> isPrivate ( ) && ! empty ( $ statedClassOrigin ) && ( $ statedClassOrigin === $ this -> statedClassName || \ is_subclass_of ( $ statedClassOrigin , $ this -> statedClassName ) ) ) { //It's a public or protected method, do like if there is no method return true ; } return false ; }
Can not access to private methods, only public and protected.

@param string $methodName
@param string $statedClassOrigin

@return bool
Can not access to private methods only public and protected .