The method getURI() does not exist on Gewaer\Contracts\RequestJwtInterface. Since it exists in all sub-types, consider adding an abstract or default implementation to Gewaer\Contracts\RequestJwtInterface.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the ignore-call annotation
52
if (preg_match("/\/([0-9]+)(?=[^\/]*$)/", $request->/** @scrutinizer ignore-call */ getURI())) {
Loading history...
53
7
$action = 'read';
54
}
55
38
break;
56
43
case 'post':
57
21
$action = 'create';
58
21
break;
59
22
case 'delete':
60
8
$action = 'delete';
61
8
break;
62
14
case 'put':
63
case 'patch':
64
14
$action = 'update';
65
14
break;
66
default:
67
throw new ServerErrorHttpException('No Permission define for this action');
68
break;
69
}
70
//do you have permision
71
61
if (!$userData->can($resource . '.' . $action)) {
72
throw new PermissionException('You dont have permission to run this action ' . $action . ' at ' . $resource);