ソースを参照

[Cache] Fixing a coding standard, adding a small note for clarity, and adding a missing type-hint.

Ryan Weaver 14 年 前
コミット
769344733a

+ 2 - 1
src/Symfony/Component/HttpKernel/Cache/Cache.php

@@ -227,6 +227,7 @@ class Cache implements HttpKernelInterface
      */
     protected function lookup(Request $request)
     {
+        // if allow_reload and no-cache Cache-Control, allow a cache reload
         if ($this->options['allow_reload'] && $request->isNoCache()) {
             $this->record($request, 'reload');
 
@@ -275,7 +276,7 @@ class Cache implements HttpKernelInterface
      *
      * @return Response A Response instance
      */
-    protected function validate(Request $request, $entry)
+    protected function validate(Request $request, Response $entry)
     {
         $subRequest = clone $request;
 

+ 1 - 2
src/Symfony/Component/HttpKernel/Cache/Store.php

@@ -108,8 +108,7 @@ class Store
         // find a cached entry that matches the request.
         $match = null;
         foreach ($entries as $entry) {
-            if ($this->requestsMatch(isset($entry[1]['vary']) ? $entry[1]['vary'][0] : '', $request->headers->all(), $entry[0]))
-            {
+            if ($this->requestsMatch(isset($entry[1]['vary']) ? $entry[1]['vary'][0] : '', $request->headers->all(), $entry[0])) {
                 $match = $entry;
 
                 break;