Neos\Flow\Reflection\ReflectionService::isMethodPrivate PHP Метод

isMethodPrivate() публичный Метод

Tells if the specified method is private
public isMethodPrivate ( string $className, string $methodName ) : boolean
$className string Name of the class containing the method
$methodName string Name of the method to analyze
Результат boolean TRUE if the method is private, otherwise FALSE
    public function isMethodPrivate($className, $methodName)
    {
        $className = $this->prepareClassReflectionForUsage($className);
        return isset($this->classReflectionData[$className][self::DATA_CLASS_METHODS][$methodName][self::DATA_METHOD_VISIBILITY]) && $this->classReflectionData[$className][self::DATA_CLASS_METHODS][$methodName][self::DATA_METHOD_VISIBILITY] === self::VISIBILITY_PRIVATE;
    }

Usage Example

 /**
  * Returns the method's visibility string found by the reflection service
  * Note: If the reflection service has no information about this method,
  * 'public' is returned.
  *
  * @return string One of 'public', 'protected' or 'private'
  */
 protected function getMethodVisibilityString()
 {
     if ($this->reflectionService->isMethodProtected($this->fullOriginalClassName, $this->methodName)) {
         return 'protected';
     } elseif ($this->reflectionService->isMethodPrivate($this->fullOriginalClassName, $this->methodName)) {
         return 'private';
     }
     return 'public';
 }
All Usage Examples Of Neos\Flow\Reflection\ReflectionService::isMethodPrivate
ReflectionService