public function isAccessibleFrom(string $class = null) : bool
    {
        switch ($this->accessibility) {
            case self::ACCESS_PUBLIC:
                return true;

            case self::ACCESS_PROTECTED:
                return $class && (is_a($class, $this->declaredClass, true) || is_a($this->declaredClass, $class, true));

            case self::ACCESS_PRIVATE:
                return $class === $this->declaredClass;
        }
    }
public function isAccessibleFrom(string $class = null) : bool
    {
        switch ($this->accessibility) {
            case self::ACCESS_PUBLIC:
                return true;

            case self::ACCESS_PROTECTED:
                return $class && (is_a($class, $this->declaredClass, true) || is_a($this->declaredClass, $class, true));

            case self::ACCESS_PRIVATE:
                return $class === $this->declaredClass;
        }
    }
public function isAccessibleFrom ( string $ class = null ) : bool { switch ( $ this -> accessibility ) { case self :: ACCESS_PUBLIC : return true ; case self :: ACCESS_PROTECTED : return $ class && ( is_a ( $ class , $ this -> declaredClass , true ) || is_a ( $ this -> declaredClass , $ class , true ) ) ; case self :: ACCESS_PRIVATE : return $ class === $ this -> declaredClass ; } }
Returns whether the property is accessible from the supplied class
or class is null which means it is not in a class scope.

@param string|null $class

@return bool
Returns whether the property is accessible from the supplied class or class is null which means it is not in a class scope .