]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Cleanup cookie jar 4303/head
authorJeremy Benoist <jeremy.benoist@gmail.com>
Sun, 29 Mar 2020 09:39:49 +0000 (11:39 +0200)
committerJeremy Benoist <jeremy.benoist@gmail.com>
Sun, 29 Mar 2020 09:39:49 +0000 (11:39 +0200)
As of latest Guzzle release, it's fixed so we can removed that code.

src/Wallabag/CoreBundle/Helper/FileCookieJar.php

index 9a63e9493259b45f8c7b4bc0771661c713936948..4b4dca10fc92aa6de4e8773d4342097bd341285f 100644 (file)
@@ -9,7 +9,6 @@ use Psr\Log\LoggerInterface;
 
 /**
  * Overidden Cookie behavior to:
- *     - fix multiple concurrent writes (see https://github.com/guzzle/guzzle/pull/1884)
  *     - ignore error when the cookie file is malformatted (resulting in clearing it).
  */
 class FileCookieJar extends BaseFileCookieJar
@@ -27,29 +26,6 @@ class FileCookieJar extends BaseFileCookieJar
         $this->logger = $logger;
     }
 
-    /**
-     * Saves the cookies to a file.
-     *
-     * @param string $filename File to save
-     *
-     * @throws \RuntimeException if the file cannot be found or created
-     */
-    public function save($filename)
-    {
-        $json = [];
-        foreach ($this as $cookie) {
-            if ($cookie->getExpires() && !$cookie->getDiscard()) {
-                $json[] = $cookie->toArray();
-            }
-        }
-
-        if (false === file_put_contents($filename, json_encode($json), LOCK_EX)) {
-            // @codeCoverageIgnoreStart
-            throw new \RuntimeException("Unable to save file {$filename}");
-            // @codeCoverageIgnoreEnd
-        }
-    }
-
     /**
      * Load cookies from a JSON formatted file.
      *