Merge pull request #478 from TonisOrmisson/fix-block-controller

fixed userBlockService controller type check to use "instanceof" to a…
This commit is contained in:
Lorenzo Milesi
2022-10-05 14:47:25 +02:00
committed by GitHub

View File

@ -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;