PHP Class Kahlan\Jit\Patchers

Datei anzeigen Open project: crysalead/kahlan

Protected Properties

Property Type Description
$_patchers The registered patchers.

Public Methods

Method Description
add ( string $name, object $patcher ) : object | boolean Adds a patcher.
clear ( ) Removes all patchers.
exists ( string $name ) : boolean Checks if a patcher exist.
findFile ( $loader, $class, $file ) Runs file loader patchers.
get ( $name ) : object | boolean Gets a patcher.
patchable ( string $class ) : boolean Checks whether a class need to be patched or not.
process ( string $code, string $path = null ) : string Runs file patchers.
remove ( string $name ) Removes a patcher.

Method Details

add() public method

Adds a patcher.
public add ( string $name, object $patcher ) : object | boolean
$name string The patcher name.
$patcher object A patcher.
return object | boolean The added patcher instance or `false` on failure.

clear() public method

Removes all patchers.
public clear ( )

exists() public method

Checks if a patcher exist.
public exists ( string $name ) : boolean
$name string The patcher name.
return boolean

findFile() public method

Runs file loader patchers.
public findFile ( $loader, $class, $file )

get() public method

Gets a patcher.
public get ( $name ) : object | boolean
return object | boolean The patcher instance or `false` if not founded.

patchable() public method

Checks whether a class need to be patched or not.
public patchable ( string $class ) : boolean
$class string The class to check.
return boolean

process() public method

Runs file patchers.
public process ( string $code, string $path = null ) : string
$code string The source code to process.
$path string The file path of the source code.
return string The patched source code.

remove() public method

Removes a patcher.
public remove ( string $name )
$name string The patcher name.

Property Details

$_patchers protected_oe property

The registered patchers.
protected $_patchers