PHPSpec2\Prophet\ObjectProphet::isSubjectMethodAccessible PHP Method

isSubjectMethodAccessible() private method

private isSubjectMethodAccessible ( $method )
    private function isSubjectMethodAccessible($method)
    {
        if (!is_object($this->getWrappedSubject())) {
            return false;
        }
        if (method_exists($this->getWrappedSubject(), '__call')) {
            return true;
        }
        if (!method_exists($this->getWrappedSubject(), $method)) {
            return false;
        }
        $methodReflection = new ReflectionMethod($this->getWrappedSubject(), $method);
        return $methodReflection->isPublic();
    }