Merge "Services: Convert DefaultPreferencesFactory's static to a const now HHVM is...
[lhc/web/wiklou.git] / includes / title / NamespaceInfo.php
index 7fb598f..7234be2 100644 (file)
@@ -342,7 +342,7 @@ class NamespaceInfo {
         * Returns array of all defined namespaces with their canonical
         * (English) names.
         *
-        * @return array
+        * @return string[]
         */
        public function getCanonicalNamespaces() {
                if ( $this->canonicalNamespaces === null ) {
@@ -397,6 +397,7 @@ class NamespaceInfo {
         */
        public function getValidNamespaces() {
                if ( is_null( $this->validNamespaces ) ) {
+                       $this->validNamespaces = [];
                        foreach ( array_keys( $this->getCanonicalNamespaces() ) as $ns ) {
                                if ( $ns >= 0 ) {
                                        $this->validNamespaces[] = $ns;