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();
파일 보기 프로젝트 열기: neos/flow-development-collection 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$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