/*
* This file is part of Psy Shell.
*
- * (c) 2012-2017 Justin Hileman
+ * (c) 2012-2018 Justin Hileman
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
return;
}
- $ret = array();
+ $ret = [];
$ret[$this->getKindLabel($reflector)] = $constants;
return $ret;
{
$className = $reflector->getName();
- $constants = array();
+ $constants = [];
foreach ($reflector->getConstants() as $name => $constant) {
$constReflector = new ReflectionConstant($reflector, $name);
$constants[$name] = $constReflector;
}
- // @todo switch to ksort after we drop support for 5.3:
- // ksort($constants, SORT_NATURAL | SORT_FLAG_CASE);
- uksort($constants, 'strnatcasecmp');
+ ksort($constants, SORT_NATURAL | SORT_FLAG_CASE);
return $constants;
}
protected function prepareConstants(array $constants)
{
// My kingdom for a generator.
- $ret = array();
+ $ret = [];
foreach ($constants as $name => $constant) {
if ($this->showItem($name)) {
- $ret[$name] = array(
+ $ret[$name] = [
'name' => $name,
'style' => self::IS_CONSTANT,
'value' => $this->presentRef($constant->getValue()),
- );
+ ];
}
}