PHP Class Eloquent\Phony\Reflection\FeatureDetector

Afficher le fichier Open project: eloquent/phony Class Usage Examples

Méthodes publiques

Méthode Description
__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.

Method Details

__construct() public méthode

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

addFeature() public méthode

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() public méthode

Check that the specified class is defined by the PHP core, or an extension.
public checkInternalClass ( string $className ) : boolean
$className string The class name.
Résultat boolean True if the class exists, and is internal.

checkInternalMethod() public méthode

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.
Résultat boolean True if the method exists, and is internal.

checkStatement() public méthode

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.
Résultat boolean True if the syntax is valid.

checkToken() public méthode

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.
Résultat boolean True if the keyword is interpreted as expected.

features() public méthode

Get the features.
public features ( ) : callable>\array
Résultat callable>\array

instance() public static méthode

Get the static instance of this detector.
public static instance ( ) : FeatureDetector
Résultat FeatureDetector The static detector.

isSupported() public méthode

Returns true if the specified feature is supported by the current runtime environment.
public isSupported ( string $feature ) : boolean
$feature string The feature.
Résultat boolean True if supported.

runtime() public méthode

Determine the current PHP runtime.
public runtime ( ) : string
Résultat string The runtime.

standardFeatures() public méthode

Get the standard feature detection callbacks.
public standardFeatures ( ) : callable>\array
Résultat callable>\array

supported() public méthode

Get the known feature support.
public supported ( ) : bool>\array
Résultat bool>\array

uniqueSymbolName() public méthode

Returns a symbol name that is unique for this process execution.
public uniqueSymbolName ( ) : string
Résultat string The symbol name.