Code Duplication    Length = 9-10 lines in 4 locations

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

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

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

@@ 82-91 (lines=10) @@
79
        return 'Entity/File';
80
    }
81
    
82
    public function setUser(UserInterface $user)
83
    {
84
        if ($this->user) {
85
            $this->getPermissions()->revoke($this->user, Permissions::PERMISSION_ALL, false);
86
        }
87
        $this->user = $user;
88
        $this->getPermissions()->grant($user, Permissions::PERMISSION_ALL);
89
        
90
        return $this;
91
    }
92
93
    /**
94
     * @return User

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

@@ 492-500 (lines=9) @@
489
     * (non-PHPdoc)
490
     * @see \Jobs\Entity\JobInterface::setUser()
491
     */
492
    public function setUser(UserInterface $user)
493
    {
494
        if ($this->user) {
495
            $this->getPermissions()->revoke($this->user, Permissions::PERMISSION_ALL, false);
496
        }
497
        $this->user = $user;
498
        $this->getPermissions()->grant($user, Permissions::PERMISSION_ALL);
499
        return $this;
500
    }
501
    /**
502
     * (non-PHPdoc)
503
     * @see \Jobs\Entity\JobInterface::getUser()

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

@@ 475-483 (lines=9) @@
472
        $perms->build();
473
    }
474
475
    public function setUser(UserInterface $user)
476
    {
477
        if ($this->user) {
478
            $this->getPermissions()->revoke($this->user, Permissions::PERMISSION_ALL, false);
479
        }
480
        $this->user = $user;
481
        $this->getPermissions()->grant($user, Permissions::PERMISSION_ALL);
482
        return $this;
483
    }
484
485
    public function getUser()
486
    {