T_FUNCTION
T_FUNCTION
Symbol types
registerFailureHandler(callable $callable) : null
Register a failure handler
Once registered, the failure handler is called each time a symbol resolution fails.
There is no limit on the number of failure handlers that can be registered.
Handlers cannot be unregistered.
callable | $callable |
registerSuccessHandler(callable $callable) : null
Register a success handler
Once registered, the success handler is called each time a symbol resolution succeeds.
The success handler receives two arguments : An array as returned by the getSymbol() method, and the ID of the map where the symbol was found.
There is no limit on the number of success handlers that can be registered.
Handlers cannot be unregistered.
callable | $callable |
key(string $type, string $name) : string
Combines a type and a symbol in a 'key'
Starting with version 3.0, Automap is fully case-sensitive. This allows for higher performance and cleaner code.
Do not use: access reserved for Automap classes
string | $type | one of the 'T_' constants |
string | $name | The symbol value (case sensitive) |
Symbol key
map(string $id) : \Automap\Map
Returns the \Automap\Map object corresponding to an active map ID
string | $id | The map ID |
if map ID is invalid
instance
callFailureHandlers(string $type, string $name) : null
Call every registered failure handlers
Call provides two arguments : the symbol type (one of the 'T_' constants) and the symbol name.
Handlers are called in registration order.
string | $type | one of the 'T_' constants |
string | $name | The symbol name |
resolve(string $type, string $name, boolean $autoloading = false, boolean $exception = false) : true
Resolve a symbol
, i.e. load what needs to be loaded for the symbol to be defined.
In order to optimize the PHK case, maps are searched in reverse order (newest first).
Warning: Autoload mechanism is not reentrant. This function cannot reference an unknow class (like \Phool\Display).
string | $type | Symbol type |
string | $name | Symbol name |
boolean | $autoloading | Whether this was called by the PHP autoloader |
boolean | $exception | Whether we must throw an exception if the resolution fails |
on success / false if unable to resolve symbol