Code Duplication    Length = 17-17 lines in 3 locations

src/cli/Database/Base/Channel.php 1 location

@@ 1391-1407 (lines=17) @@
1388
     * @param  ChildSubscription $l ChildSubscription
1389
     * @return $this|\Jalle19\StatusManager\Database\Channel The current object (for fluent API support)
1390
     */
1391
    public function addSubscription(ChildSubscription $l)
1392
    {
1393
        if ($this->collSubscriptions === null) {
1394
            $this->initSubscriptions();
1395
            $this->collSubscriptionsPartial = true;
1396
        }
1397
1398
        if (!$this->collSubscriptions->contains($l)) {
1399
            $this->doAddSubscription($l);
1400
1401
            if ($this->subscriptionsScheduledForDeletion and $this->subscriptionsScheduledForDeletion->contains($l)) {
1402
                $this->subscriptionsScheduledForDeletion->remove($this->subscriptionsScheduledForDeletion->search($l));
1403
            }
1404
        }
1405
1406
        return $this;
1407
    }
1408
1409
    /**
1410
     * @param ChildSubscription $subscription The ChildSubscription object to add.

src/cli/Database/Base/Instance.php 1 location

@@ 2041-2057 (lines=17) @@
2038
     * @param  ChildSubscription $l ChildSubscription
2039
     * @return $this|\Jalle19\StatusManager\Database\Instance The current object (for fluent API support)
2040
     */
2041
    public function addSubscription(ChildSubscription $l)
2042
    {
2043
        if ($this->collSubscriptions === null) {
2044
            $this->initSubscriptions();
2045
            $this->collSubscriptionsPartial = true;
2046
        }
2047
2048
        if (!$this->collSubscriptions->contains($l)) {
2049
            $this->doAddSubscription($l);
2050
2051
            if ($this->subscriptionsScheduledForDeletion and $this->subscriptionsScheduledForDeletion->contains($l)) {
2052
                $this->subscriptionsScheduledForDeletion->remove($this->subscriptionsScheduledForDeletion->search($l));
2053
            }
2054
        }
2055
2056
        return $this;
2057
    }
2058
2059
    /**
2060
     * @param ChildSubscription $subscription The ChildSubscription object to add.

src/cli/Database/Base/User.php 1 location

@@ 1701-1717 (lines=17) @@
1698
     * @param  ChildSubscription $l ChildSubscription
1699
     * @return $this|\Jalle19\StatusManager\Database\User The current object (for fluent API support)
1700
     */
1701
    public function addSubscription(ChildSubscription $l)
1702
    {
1703
        if ($this->collSubscriptions === null) {
1704
            $this->initSubscriptions();
1705
            $this->collSubscriptionsPartial = true;
1706
        }
1707
1708
        if (!$this->collSubscriptions->contains($l)) {
1709
            $this->doAddSubscription($l);
1710
1711
            if ($this->subscriptionsScheduledForDeletion and $this->subscriptionsScheduledForDeletion->contains($l)) {
1712
                $this->subscriptionsScheduledForDeletion->remove($this->subscriptionsScheduledForDeletion->search($l));
1713
            }
1714
        }
1715
1716
        return $this;
1717
    }
1718
1719
    /**
1720
     * @param ChildSubscription $subscription The ChildSubscription object to add.