Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / psy / psysh / src / Command / ListCommand / ClassConstantEnumerator.php
similarity index 90%
rename from vendor/psy/psysh/src/Psy/Command/ListCommand/ClassConstantEnumerator.php
rename to vendor/psy/psysh/src/Command/ListCommand/ClassConstantEnumerator.php
index fc974b2d944d4ec2061d49c964ffefea5c2bf5b0..66d75d0efc8433e0f3700dda1e3b7e4f48115fc7 100644 (file)
@@ -3,7 +3,7 @@
 /*
  * 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.
@@ -48,7 +48,7 @@ class ClassConstantEnumerator extends Enumerator
             return;
         }
 
-        $ret = array();
+        $ret = [];
         $ret[$this->getKindLabel($reflector)] = $constants;
 
         return $ret;
@@ -66,7 +66,7 @@ class ClassConstantEnumerator extends Enumerator
     {
         $className = $reflector->getName();
 
-        $constants = array();
+        $constants = [];
         foreach ($reflector->getConstants() as $name => $constant) {
             $constReflector = new ReflectionConstant($reflector, $name);
 
@@ -77,9 +77,7 @@ class ClassConstantEnumerator extends Enumerator
             $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;
     }
@@ -94,15 +92,15 @@ class ClassConstantEnumerator extends Enumerator
     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()),
-                );
+                ];
             }
         }