PHP Класс Neos\Flow\Utility\PhpAnalyzer

Usage: extract the FQN e.g. "Some\Namespace\SomeClassName" $fullyQualifiedClassName = (new PhpAnalyzer($fileContents))->extractFullyQualifiedClassName(); extract the namespace "Some\Namespace" $namespace = (new PhpAnalyzer($fileContents))->extractNamespace(); extract just the class name "SomeClassName" $className = (new PhpAnalyzer($fileContents))->extractClassName();
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$phpCode string

Открытые методы

Метод Описание
__construct ( string $phpCode )
extractClassName ( ) : string Extracts the className of the given PHP code Note: This only returns the class name without namespace, @see extractFullyQualifiedClassName()
extractFullyQualifiedClassName ( ) : string Extracts the Fully Qualified Class name from the given PHP code
extractNamespace ( ) : string Extracts the PHP namespace from the given PHP code

Описание методов

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

public __construct ( string $phpCode )
$phpCode string

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

Extracts the className of the given PHP code Note: This only returns the class name without namespace, @see extractFullyQualifiedClassName()
public extractClassName ( ) : string
Результат string

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

Extracts the Fully Qualified Class name from the given PHP code
public extractFullyQualifiedClassName ( ) : string
Результат string FQN in the format "Some\Fully\Qualified\ClassName" or NULL if no class was detected

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

Extracts the PHP namespace from the given PHP code
public extractNamespace ( ) : string
Результат string the PHP namespace in the form "Some\Namespace" (w/o leading backslash) - or NULL if no namespace modifier was found

Описание свойств

$phpCode защищенное свойство

protected string $phpCode
Результат string