]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Controller/EntryController.php
Avoid returning objects passed by reference.
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Controller / EntryController.php
index 8d2ac6d4cf144fd515bf347ec1d0dfa12beb725d..6018dfacd999c330378a858a9b50c6bc36d3974b 100644 (file)
@@ -53,12 +53,10 @@ class EntryController extends Controller
 
     /**
      * Fetch content and update entry.
-     * In case it fails, entry will return to avod loosing the data.
+     * In case it fails, $entry->getContent will return an error message.
      *
      * @param Entry  $entry
      * @param string $prefixMessage Should be the translation key: entry_saved or entry_reloaded
-     *
-     * @return Entry
      */
     private function updateEntry(Entry $entry, $prefixMessage = 'entry_saved')
     {
@@ -68,7 +66,7 @@ class EntryController extends Controller
         $message = 'flashes.entry.notice.'.$prefixMessage;
 
         try {
-            $entry = $this->get('wallabag_core.content_proxy')->updateEntry($entry, $entry->getUrl());
+            $this->get('wallabag_core.content_proxy')->updateEntry($entry, $entry->getUrl());
         } catch (\Exception $e) {
             $this->get('logger')->error('Error while saving an entry', [
                 'exception' => $e,
@@ -79,8 +77,6 @@ class EntryController extends Controller
         }
 
         $this->get('session')->getFlashBag()->add('notice', $message);
-
-        return $entry;
     }
 
     /**