Merge "Mostly revert "Verify parameter for MapCacheLRU::has() can be passed to array_...
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Tue, 7 Apr 2015 19:43:41 +0000 (19:43 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 7 Apr 2015 19:43:41 +0000 (19:43 +0000)
includes/Title.php
includes/libs/MapCacheLRU.php

index 9868b2e..bf0fb8e 100644 (file)
@@ -260,8 +260,10 @@ class Title {
         * @return Title|null Title or null on an error.
         */
        public static function newFromText( $text, $defaultNamespace = NS_MAIN ) {
-               if ( !is_string( $text ) ) {
-                       throw new InvalidArgumentException( 'Title::newFromText given something that isn\'t a string' );
+               if ( is_object( $text ) ) {
+                       throw new InvalidArgumentException( '$text must be a string.' );
+               } elseif ( !is_string( $text ) ) {
+                       wfWarn( __METHOD__ . ': $text must be a string. This will throw an InvalidArgumentException in future.' );
                }
 
                $cache = self::getTitleCache();
index b0cb078..0b6db32 100644 (file)
@@ -74,11 +74,7 @@ class MapCacheLRU {
         * @return bool
         */
        public function has( $key ) {
-               if ( is_string( $key ) || is_integer( $key ) ) {
-                       return array_key_exists( $key, $this->cache );
-               }
-               wfWarn( __METHOD__ . ": Key passed isn't a string or an integer.", 2 );
-               return false;
+               return array_key_exists( $key, $this->cache );
        }
 
        /**