Extends
lithium\core\StaticObject
Determines if a given $identifier is a class property, a class method, a class itself,
or a namespace identifier.
Parameters
- string $identifier The identifier to be analyzed
Returns
string Identifier type. One of `property`, `method`, `class` or `namespace`.Source
public static function type($identifier) {
$identifier = ltrim($identifier, '\\');
if (strpos($identifier, '::')) {
return (strpos($identifier, '$') !== false) ? 'property' : 'method';
}
if (is_readable(Libraries::path($identifier))) {
if (class_exists($identifier) && in_array($identifier, get_declared_classes())) {
return 'class';
}
}
return 'namespace';
}