Code Duplication    Length = 7-7 lines in 3 locations

src/AuthManager.php 3 locations

@@ 91-97 (lines=7) @@
88
     */
89
    public function setChild($parent, $child)
90
    {
91
        if (is_string($parent)) {
92
            $name   = $parent;
93
            $parent = $this->getItem($parent);
94
            if (is_null($parent)) {
95
                throw new InvalidParamException("Unknown parent:$name at setChild");
96
            }
97
        }
98
        if (is_string($child)) {
99
            $name  = $child;
100
            $child = $this->getItem($child);
@@ 98-104 (lines=7) @@
95
                throw new InvalidParamException("Unknown parent:$name at setChild");
96
            }
97
        }
98
        if (is_string($child)) {
99
            $name  = $child;
100
            $child = $this->getItem($child);
101
            if (is_null($child)) {
102
                throw new InvalidParamException("Unknown child:$name at setChild");
103
            }
104
        }
105
        if (isset($this->children[$parent->name][$child->name])) {
106
            return false;
107
        }
@@ 113-119 (lines=7) @@
110
111
    public function setAssignment($role, $userId)
112
    {
113
        if (is_string($role)) {
114
            $name = $role;
115
            $role = $this->getRole($role);
116
            if (is_null($role)) {
117
                throw new InvalidParamException("Unknown role:$name at setAssignment");
118
            }
119
        }
120
        if (isset($this->assignments[$userId][$role->name])) {
121
            return false;
122
        }