Code Duplication    Length = 9-10 lines in 4 locations

module/Core/src/Core/Entity/FileEntity.php 1 location

@@ 91-100 (lines=10) @@
88
     * @param UserInterface $user
89
     * @return $this
90
     */
91
    public function setUser(UserInterface $user)
92
    {
93
        if ($this->user) {
94
            $this->getPermissions()->revoke($this->user, Permissions::PERMISSION_ALL, false);
95
        }
96
        $this->user = $user;
97
        $this->getPermissions()->grant($user, Permissions::PERMISSION_ALL);
98
        
99
        return $this;
100
    }
101
102
    /**
103
     * Gets the owner of a file

module/Applications/src/Applications/Entity/Application.php 1 location

@@ 277-285 (lines=9) @@
274
     * @return Application
275
     * @see \Applications\Entity\ApplicationInterface::setUser()
276
     */
277
    public function setUser(UserInterface $user)
278
    {
279
        if ($this->user) {
280
            $this->getPermissions()->revoke($this->user, Permissions::PERMISSION_ALL, false);
281
        }
282
        $this->getPermissions()->grant($user, Permissions::PERMISSION_ALL);
283
        $this->user = $user;
284
        return $this;
285
    }
286
    
287
    /**
288
     * {@inheritDoc}

module/Jobs/src/Jobs/Entity/Job.php 1 location

@@ 468-476 (lines=9) @@
465
     * (non-PHPdoc)
466
     * @see \Jobs\Entity\JobInterface::setUser()
467
     */
468
    public function setUser(UserInterface $user)
469
    {
470
        if ($this->user) {
471
            $this->getPermissions()->revoke($this->user, Permissions::PERMISSION_ALL, false);
472
        }
473
        $this->user = $user;
474
        $this->getPermissions()->grant($user, Permissions::PERMISSION_ALL);
475
        return $this;
476
    }
477
    /**
478
     * (non-PHPdoc)
479
     * @see \Jobs\Entity\JobInterface::getUser()

module/Organizations/src/Organizations/Entity/Organization.php 1 location

@@ 679-687 (lines=9) @@
676
    }
677
678
679
    public function setUser(UserInterface $user)
680
    {
681
        if ($this->user) {
682
            $this->getPermissions()->revoke($this->user, Permissions::PERMISSION_ALL, false);
683
        }
684
        $this->user = $user;
685
        $this->getPermissions()->grant($user, Permissions::PERMISSION_ALL);
686
687
        return $this;
688
    }
689
690
    /**