@@ -62,7 +62,7 @@ public function __construct(
6262 /**
6363 * {@inheritdoc}
6464 */
65- public function fetchById (int $ userId ): DomainObjectInterface
65+ public function fetchById (string | int $ userId ): DomainObjectInterface
6666 {
6767 $ roles = $ this ->roleToUserMapper ->fetchByUserId ($ userId );
6868 $ permissions = $ this ->permissionMapper ->fetchByUserId ($ userId );
@@ -132,7 +132,7 @@ public function fetchByPermission(Permission $permission): array
132132 /**
133133 * {@inheritdoc}
134134 */
135- public function fetchByPermissionId (int $ permissionId ): array
135+ public function fetchByPermissionId (string | int $ permissionId ): array
136136 {
137137 $ pdos = $ this ->pdo ->prepare ('
138138 (SELECT u.user_id AS "id", u.uuid, u.name, u.email, u.description,
@@ -163,7 +163,7 @@ public function fetchByPermissionName(string $permissionName): array
163163 {
164164 $ permission = $ this ->permissionMapper ->fetchByName ($ permissionName );
165165
166- return $ this ->fetchByPermissionId ($ permission ->getId ());
166+ return $ this ->fetchByPermissionId (( int ) $ permission ->getId ());
167167 }
168168
169169 /**
@@ -177,7 +177,7 @@ public function fetchByRole(Role $role): array
177177 /**
178178 * {@inheritdoc}
179179 */
180- public function fetchByRoleId (int $ roleId ): array
180+ public function fetchByRoleId (string | int $ roleId ): array
181181 {
182182 $ pdos = $ this ->pdo ->prepare ('
183183 SELECT u.user_id AS "id", u.uuid, u.name, u.email, u.description,
@@ -263,7 +263,7 @@ public function grantPermission(EnhancedUser &$user, Permission $permission)
263263 /**
264264 * {@inheritdoc}
265265 */
266- public function grantPermissionById (EnhancedUser &$ user , int $ permissionId )
266+ public function grantPermissionById (EnhancedUser &$ user , string | int $ permissionId )
267267 {
268268 $ userId = $ user ->getId ();
269269
@@ -301,7 +301,7 @@ public function revokePermission(EnhancedUser &$user, Permission $permission)
301301 /**
302302 * {@inheritdoc}
303303 */
304- public function revokePermissionById (EnhancedUser &$ user , int $ permissionId )
304+ public function revokePermissionById (EnhancedUser &$ user , string | int $ permissionId )
305305 {
306306 $ userId = $ user ->getId ();
307307
@@ -335,7 +335,7 @@ public function addRole(EnhancedUser &$user, Role $role)
335335 /**
336336 * {@inheritdoc}
337337 */
338- public function addRoleById (EnhancedUser &$ user , int $ roleId )
338+ public function addRoleById (EnhancedUser &$ user , string | int $ roleId )
339339 {
340340 $ userId = $ user ->getId ();
341341
@@ -383,7 +383,7 @@ public function removeRole(EnhancedUser &$user, Role $role)
383383 /**
384384 * {@inheritdoc}
385385 */
386- public function removeRoleById (EnhancedUser &$ user , int $ roleId )
386+ public function removeRoleById (EnhancedUser &$ user , string | int $ roleId )
387387 {
388388 $ userId = $ user ->getId ();
389389
@@ -423,7 +423,7 @@ protected function concreteCreate(): DomainObjectInterface
423423 /**
424424 * {@inheritdoc}
425425 */
426- protected function checkDomainObjectType (DomainObjectInterface $ domainObject )
426+ protected function checkDomainObjectType (DomainObjectInterface $ domainObject ): void
427427 {
428428 if (!($ domainObject instanceof EnhancedUser)) {
429429 throw new InvalidArgumentException ('Domain Object parameter must be instance of EnhancedUser class ' );
0 commit comments