Merge pull request #478 from TonisOrmisson/fix-block-controller
fixed userBlockService controller type check to use "instanceof" to a…
This commit is contained in:
@ -32,8 +32,8 @@ class UserBlockService implements ServiceInterface
|
|||||||
$controller,
|
$controller,
|
||||||
SecurityHelper $securityHelper
|
SecurityHelper $securityHelper
|
||||||
) {
|
) {
|
||||||
if (!in_array(get_class($controller), [AdminController::class, AdminControllerRest::class])) {
|
if (!($controller instanceof AdminController || $controller instanceof AdminControllerRest)) {
|
||||||
throw new TypeError('Argument controller must be either of type '
|
throw new TypeError('Argument controller must be either of type '
|
||||||
. AdminController::class . ' or ' . AdminControllerRest::class . ', ' . get_class($controller) . ' given');
|
. AdminController::class . ' or ' . AdminControllerRest::class . ', ' . get_class($controller) . ' given');
|
||||||
}
|
}
|
||||||
$this->model = $model;
|
$this->model = $model;
|
||||||
|
|||||||
Reference in New Issue
Block a user