Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / psy / psysh / src / Command / ListCommand / MethodEnumerator.php
similarity index 91%
rename from vendor/psy/psysh/src/Psy/Command/ListCommand/MethodEnumerator.php
rename to vendor/psy/psysh/src/Command/ListCommand/MethodEnumerator.php
index 963761cfce6925c353c65b66d9a382356dda6f30..ebe43afad071b7425e47f358a71acc02abc920e7 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.
@@ -47,7 +47,7 @@ class MethodEnumerator extends Enumerator
             return;
         }
 
-        $ret = array();
+        $ret = [];
         $ret[$this->getKindLabel($reflector)] = $methods;
 
         return $ret;
@@ -66,7 +66,7 @@ class MethodEnumerator extends Enumerator
     {
         $className = $reflector->getName();
 
-        $methods = array();
+        $methods = [];
         foreach ($reflector->getMethods() as $name => $method) {
             if ($noInherit && $method->getDeclaringClass()->getName() !== $className) {
                 continue;
@@ -77,9 +77,7 @@ class MethodEnumerator extends Enumerator
             }
         }
 
-        // @todo switch to ksort after we drop support for 5.3:
-        //     ksort($methods, SORT_NATURAL | SORT_FLAG_CASE);
-        uksort($methods, 'strnatcasecmp');
+        ksort($methods, SORT_NATURAL | SORT_FLAG_CASE);
 
         return $methods;
     }
@@ -94,15 +92,15 @@ class MethodEnumerator extends Enumerator
     protected function prepareMethods(array $methods)
     {
         // My kingdom for a generator.
-        $ret = array();
+        $ret = [];
 
         foreach ($methods as $name => $method) {
             if ($this->showItem($name)) {
-                $ret[$name] = array(
+                $ret[$name] = [
                     'name'  => $name,
                     'style' => $this->getVisibilityStyle($method),
                     'value' => $this->presentSignature($method),
-                );
+                ];
             }
         }