namespace Psy\Command\ListCommand;
-use Psy\Reflection\ReflectionConstant;
+use Psy\Reflection\ReflectionClassConstant;
use Symfony\Component\Console\Input\InputInterface;
/**
$constants = [];
foreach ($reflector->getConstants() as $name => $constant) {
- $constReflector = new ReflectionConstant($reflector, $name);
+ $constReflector = ReflectionClassConstant::create($reflector->name, $name);
if ($noInherit && $constReflector->getDeclaringClass()->getName() !== $className) {
continue;
$constants[$name] = $constReflector;
}
- ksort($constants, SORT_NATURAL | SORT_FLAG_CASE);
+ \ksort($constants, SORT_NATURAL | SORT_FLAG_CASE);
return $constants;
}
{
if ($reflector->isInterface()) {
return 'Interface Constants';
- } elseif (method_exists($reflector, 'isTrait') && $reflector->isTrait()) {
+ } elseif (\method_exists($reflector, 'isTrait') && $reflector->isTrait()) {
return 'Trait Constants';
} else {
return 'Class Constants';