Merge "Add support for PHP7 random_bytes in favor of mcrypt_create_iv"
[lhc/web/wiklou.git] / includes / utils / AutoloadGenerator.php
index 55e228a..1dac0b1 100644 (file)
@@ -152,7 +152,7 @@ class AutoloadGenerator {
                ksort( $json[$key] );
 
                // Return the whole JSON file
-               return FormatJson::encode( $json, true ) . "\n";
+               return FormatJson::encode( $json, "\t", FormatJson::ALL_OK ) . "\n";
        }
 
        /**
@@ -432,6 +432,15 @@ class ClassCollector {
                                        $this->classes[] = $this->alias['name'];
                                        $this->alias = null;
                                        $this->startToken = null;
+                               } elseif ( !is_array( $token ) || (
+                                       $token[0] !== T_STRING &&
+                                       $token[0] !== T_DOUBLE_COLON &&
+                                       $token[0] !== T_CLASS &&
+                                       $token[0] !== T_WHITESPACE
+                               ) ) {
+                                       // Ignore this call to class_alias() - compat/Timestamp.php
+                                       $this->alias = null;
+                                       $this->startToken = null;
                                }
                        }
                        break;