X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=sidebyside;f=src%2FWallabag%2FUserBundle%2FEntity%2FUser.php;h=aba76ca74a262e3ddcc83b90d26519a0af151d2d;hb=eb570e49c8e3ba12638fac600bb5527191c2aaa2;hp=5c75846f85993f8bf677fa0110bee9516400f9bf;hpb=0c00e5251671c3648eabb8888271c09137ad902d;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/UserBundle/Entity/User.php b/src/Wallabag/UserBundle/Entity/User.php index 5c75846f..aba76ca7 100644 --- a/src/Wallabag/UserBundle/Entity/User.php +++ b/src/Wallabag/UserBundle/Entity/User.php @@ -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(); } }