PHP Класс Eloquent\Phony\Reflection\FeatureDetector

Показать файл Открыть проект Примеры использования класса

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

Метод Описание
__construct ( array $features = null, array $supported = [] ) Construct a new feature detector.
addFeature ( string $feature, callable $callback ) Add a custom feature.
checkInternalClass ( string $className ) : boolean Check that the specified class is defined by the PHP core, or an extension.
checkInternalMethod ( string $className, string $methodName ) : boolean Check that the specified method is defined by the PHP core, or an extension.
checkStatement ( string $source, boolean $useClosure = true ) : boolean Check that the supplied syntax is valid.
checkToken ( string $keyword, string $constantName ) : boolean Check that a keyword is interpreted as a particular token type.
features ( ) : callable>\array Get the features.
instance ( ) : FeatureDetector Get the static instance of this detector.
isSupported ( string $feature ) : boolean Returns true if the specified feature is supported by the current runtime environment.
runtime ( ) : string Determine the current PHP runtime.
standardFeatures ( ) : callable>\array Get the standard feature detection callbacks.
supported ( ) : bool>\array Get the known feature support.
uniqueSymbolName ( ) : string Returns a symbol name that is unique for this process execution.

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

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

Construct a new feature detector.
public __construct ( array $features = null, array $supported = [] )
$features array
$supported array

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

The callback will be passed this detector as the first argument. The return value will be interpreted as a boolean.
public addFeature ( string $feature, callable $callback )
$feature string The feature.
$callback callable The feature detection callback.

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

Check that the specified class is defined by the PHP core, or an extension.
public checkInternalClass ( string $className ) : boolean
$className string The class name.
Результат boolean True if the class exists, and is internal.

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

Check that the specified method is defined by the PHP core, or an extension.
public checkInternalMethod ( string $className, string $methodName ) : boolean
$className string The class name.
$methodName string The class name.
Результат boolean True if the method exists, and is internal.

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

Check that the supplied syntax is valid.
public checkStatement ( string $source, boolean $useClosure = true ) : boolean
$source string The source to check.
$useClosure boolean True to wrap the supplied source code in a closure.
Результат boolean True if the syntax is valid.

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

Check that a keyword is interpreted as a particular token type.
public checkToken ( string $keyword, string $constantName ) : boolean
$keyword string The keyword.
$constantName string The name of the token type constant.
Результат boolean True if the keyword is interpreted as expected.

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

Get the features.
public features ( ) : callable>\array
Результат callable>\array

instance() публичный статический Метод

Get the static instance of this detector.
public static instance ( ) : FeatureDetector
Результат FeatureDetector The static detector.

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

Returns true if the specified feature is supported by the current runtime environment.
public isSupported ( string $feature ) : boolean
$feature string The feature.
Результат boolean True if supported.

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

Determine the current PHP runtime.
public runtime ( ) : string
Результат string The runtime.

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

Get the standard feature detection callbacks.
public standardFeatures ( ) : callable>\array
Результат callable>\array

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

Get the known feature support.
public supported ( ) : bool>\array
Результат bool>\array

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

Returns a symbol name that is unique for this process execution.
public uniqueSymbolName ( ) : string
Результат string The symbol name.