]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/UserBundle/Entity/User.php
CS
[github/wallabag/wallabag.git] / src / Wallabag / UserBundle / Entity / User.php
index 5c75846f85993f8bf677fa0110bee9516400f9bf..aba76ca74a262e3ddcc83b90d26519a0af151d2d 100644 (file)
@@ -110,6 +110,8 @@ class User extends BaseUser implements TwoFactorInterface, TrustedComputerInterf
     private $trusted;
 
     /**
+     * @var ArrayCollection
+     *
      * @ORM\OneToMany(targetEntity="Wallabag\ApiBundle\Entity\Client", mappedBy="user", cascade={"remove"})
      */
     protected $clients;
@@ -306,10 +308,8 @@ class User extends BaseUser implements TwoFactorInterface, TrustedComputerInterf
      */
     public function getFirstClient()
     {
-        if (empty($this->clients)) {
-            return $this->clients;
+        if (!empty($this->clients)) {
+            return $this->clients->first();
         }
-
-        return $this->clients->first();
     }
 }