Extends
lithium\core\StaticObject
Convenience method to get the token name of a PHP code string. If multiple tokens are
present in the string, only the first is returned.
Parameters
- string $string String of PHP code to get the token name of, i.e. `'=>'` or `'static'`.
- array $options
Returns
mixedSource
public static function token($string, array $options = array()) {
$defaults = array('id' => false);
$options += $defaults;
if (empty($string) && $string !== '0') {
return false;
}
list($token) = static::tokenize($string);
return $token[($options['id']) ? 'id' : 'name'];
}