Code Duplication    Length = 4-4 lines in 3 locations

module/Core/src/Core/Entity/Permissions.php 3 locations

@@ 151-154 (lines=4) @@
148
            throw new \InvalidArgumentException('Missing required parameter.');
149
        }
150
151
        if (preg_match('~^is(View|Change|None|All)Granted$~', $method, $match)) {
152
            $permission = constant('self::PERMISSION_' . strtoupper($match[1]));
153
            return $this->isGranted($params[0], $permission);
154
        }
155
        
156
        if (preg_match('~^grant(View|Change|None|All)$~', $method, $match)) {
157
            $permission = constant('self::PERMISSION_' . strtoupper($match[1]));
@@ 156-159 (lines=4) @@
153
            return $this->isGranted($params[0], $permission);
154
        }
155
        
156
        if (preg_match('~^grant(View|Change|None|All)$~', $method, $match)) {
157
            $permission = constant('self::PERMISSION_' . strtoupper($match[1]));
158
            return $this->grant($params[0], $permission);
159
        }
160
        
161
        if (preg_match('~^revoke(View|Change|None|All)$~', $method, $match)) {
162
            $permission = constant('self::PERMISSION_' . strtoupper($match[1]));
@@ 161-164 (lines=4) @@
158
            return $this->grant($params[0], $permission);
159
        }
160
        
161
        if (preg_match('~^revoke(View|Change|None|All)$~', $method, $match)) {
162
            $permission = constant('self::PERMISSION_' . strtoupper($match[1]));
163
            return $this->revoke($params[0], $permission);
164
        }
165
        
166
        throw new \BadMethodCallException('Unknown method "' . $method . '"');
167
    }