lithium\analysis\Inspector::type()
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
stringIdentifier 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';
}
$path = Libraries::path($identifier);
if ($path && is_readable($path)) {
if ($identifier && class_exists($identifier) && in_array($identifier, get_declared_classes())) {
return 'class';
}
}
return 'namespace';
}