ソースを参照

Fix invalid method usage.

Mark Story 7 年 前
コミット
0c112e4b28

+ 3 - 3
src/Cache/CacheEngine.php

@@ -123,7 +123,7 @@ abstract class CacheEngine implements CacheInterface, CacheEngineInterface
     {
         $return = [];
         foreach ($data as $key => $value) {
-            $return[$key] = $this->write($key, $value);
+            $return[$key] = $this->set($key, $value);
         }
 
         return $return;
@@ -141,7 +141,7 @@ abstract class CacheEngine implements CacheInterface, CacheEngineInterface
     {
         $return = [];
         foreach ($keys as $key) {
-            $return[$key] = $this->read($key);
+            $return[$key] = $this->get($key);
         }
 
         return $return;
@@ -152,7 +152,7 @@ abstract class CacheEngine implements CacheInterface, CacheEngineInterface
      *
      * @param iterable $keys A list of keys that can obtained in a single operation.
      * @param mixed $default Default value to return for keys that do not exist.
-     * @return iterable A list of key => value pairs. Cache keys that do not exist or are stale will have $default as value.
+     * @return array A list of key => value pairs. Cache keys that do not exist or are stale will have $default as value.
      * @throws \Cake\Cache\InvalidArgumentException If $keys is neither an array nor a Traversable,
      *   or if any of the $keys are not a legal value.
      */

+ 2 - 2
src/Datasource/QueryCacher.php

@@ -74,7 +74,7 @@ class QueryCacher
     {
         $key = $this->_resolveKey($query);
         $storage = $this->_resolveCacher();
-        $result = $storage->read($key);
+        $result = $storage->get($key);
         if (empty($result)) {
             return null;
         }
@@ -94,7 +94,7 @@ class QueryCacher
         $key = $this->_resolveKey($query);
         $storage = $this->_resolveCacher();
 
-        return (bool)$storage->write($key, $results);
+        return (bool)$storage->set($key, $results);
     }
 
     /**

+ 2 - 2
src/I18n/TranslatorRegistry.php

@@ -146,10 +146,10 @@ class TranslatorRegistry extends TranslatorLocator
         }
 
         $key = "translations.$name.$locale";
-        $translator = $this->_cacher->read($key);
+        $translator = $this->_cacher->get($key);
         if (!$translator || !$translator->getPackage()) {
             $translator = $this->_getTranslator($name, $locale);
-            $this->_cacher->write($key, $translator);
+            $this->_cacher->set($key, $translator);
         }
 
         return $this->registry[$name][$locale] = $translator;

+ 1 - 1
tests/TestCase/Database/Schema/CollectionTest.php

@@ -46,7 +46,7 @@ class CollectionTest extends TestCase
     {
         parent::setUp();
         $this->connection = ConnectionManager::get('test');
-        Cache::clear(false, '_cake_model_');
+        Cache::clear('_cake_model_');
         Cache::enable();
     }
 

+ 1 - 1
tests/TestCase/Http/Session/CacheSessionTest.php

@@ -48,7 +48,7 @@ class CacheSessionTest extends TestCase
     public function tearDown()
     {
         parent::tearDown();
-        Cache::clear(false, 'session_test');
+        Cache::clear('session_test');
         Cache::drop('session_test');
         unset($this->storage);
     }

+ 1 - 1
tests/TestCase/I18n/I18nTest.php

@@ -57,7 +57,7 @@ class I18nTest extends TestCase
         I18n::setDefaultFormatter('default');
         I18n::setLocale($this->locale);
         Plugin::unload();
-        Cache::clear(false, '_cake_core_');
+        Cache::clear('_cake_core_');
     }
 
     /**

+ 1 - 1
tests/TestCase/I18n/Parser/PoFileParserTest.php

@@ -49,7 +49,7 @@ class PoFileParserTest extends TestCase
         parent::tearDown();
         I18n::clear();
         I18n::setLocale($this->locale);
-        Cache::clear(false, '_cake_core_');
+        Cache::clear('_cake_core_');
     }
 
     /**

+ 2 - 2
tests/TestCase/Routing/Middleware/RoutingMiddlewareTest.php

@@ -490,7 +490,7 @@ class RoutingMiddlewareTest extends TestCase
         $middleware = new RoutingMiddleware($app, $cacheConfigName);
         $middleware($request, $response, $next);
 
-        Cache::clear(false, $cacheConfigName);
+        Cache::clear($cacheConfigName);
         Cache::drop($cacheConfigName);
     }
 
@@ -520,7 +520,7 @@ class RoutingMiddlewareTest extends TestCase
         $middleware = new RoutingMiddleware($app, $cacheConfigName);
         $middleware($request, $response, $next);
 
-        Cache::clear(false, $cacheConfigName);
+        Cache::clear($cacheConfigName);
         Cache::drop($cacheConfigName);
         Cache::enable();
     }

+ 2 - 2
tests/TestCase/View/ViewTest.php

@@ -1003,7 +1003,7 @@ class ViewTest extends TestCase
             'path' => CACHE . 'views/',
             'prefix' => '',
         ]);
-        Cache::clear(false, 'test_view');
+        Cache::clear('test_view');
 
         $View = $this->PostsController->createView();
         $View->setElementCache('test_view');
@@ -1040,7 +1040,7 @@ class ViewTest extends TestCase
         $result = Cache::read('element__test_element_param_foo', 'test_view');
         $this->assertEquals($expected, $result);
 
-        Cache::clear(true, 'test_view');
+        Cache::clear('test_view');
         Cache::drop('test_view');
     }