diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index c99b0769..492ed4c7 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -60,6 +60,11 @@ parameters: count: 1 path: src/Form/Transformer/RestoreRolesTransformer.php + - + message: "#^Strict comparison using \\=\\=\\= between false and array\\<\\(int\\|string\\)\\> will always evaluate to false\\.$#" + count: 1 + path: src/Form/Type/RolesMatrixType.php + - message: "#^Method Nucleos\\\\UserAdminBundle\\\\Security\\\\Authorization\\\\Voter\\\\UserAclVoter\\:\\:vote\\(\\) has parameter \\$attributes with no value type specified in iterable type array\\.$#" count: 1 @@ -75,11 +80,21 @@ parameters: count: 1 path: src/Security/EditableRolesBuilder.php + - + message: "#^Strict comparison using \\=\\=\\= between null and Sonata\\\\AdminBundle\\\\Security\\\\Handler\\\\SecurityHandlerInterface will always evaluate to false\\.$#" + count: 1 + path: src/Security/EditableRolesBuilder.php + - message: "#^Method Nucleos\\\\UserAdminBundle\\\\Security\\\\RolesBuilder\\\\AdminRolesBuilder\\:\\:getRoles\\(\\) return type has no value type specified in iterable type array\\.$#" count: 1 path: src/Security/RolesBuilder/AdminRolesBuilder.php + - + message: "#^Strict comparison using \\=\\=\\= between null and Sonata\\\\AdminBundle\\\\Security\\\\Handler\\\\SecurityHandlerInterface will always evaluate to false\\.$#" + count: 1 + path: src/Security/RolesBuilder/AdminRolesBuilder.php + - message: "#^Method Nucleos\\\\UserAdminBundle\\\\Security\\\\RolesBuilder\\\\ExpandableRolesBuilderInterface\\:\\:getExpandedRoles\\(\\) return type has no value type specified in iterable type array\\.$#" count: 1 diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 6a2a1980..f3d73d59 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -1,16 +1,11 @@ - + dispatch - - $this->getSubject() - $user - $user - $this->getSubject() @@ -64,6 +59,10 @@ $securityRoles $securityRoles + + $securityRoles[$role] + $securityRoles[$role] + $role diff --git a/src/DependencyInjection/NucleosUserAdminExtension.php b/src/DependencyInjection/NucleosUserAdminExtension.php index 33aa9d49..b7a2d163 100644 --- a/src/DependencyInjection/NucleosUserAdminExtension.php +++ b/src/DependencyInjection/NucleosUserAdminExtension.php @@ -45,6 +45,7 @@ public function load(array $configs, ContainerBuilder $container): void $config['manager_type'] = $container->getParameter('nucleos_user.storage'); + /** @var array $bundles */ $bundles = $container->getParameter('kernel.bundles'); $loader = new PhpFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); diff --git a/src/Security/RolesBuilder/AdminRolesBuilder.php b/src/Security/RolesBuilder/AdminRolesBuilder.php index 825e54e6..96aea7cc 100644 --- a/src/Security/RolesBuilder/AdminRolesBuilder.php +++ b/src/Security/RolesBuilder/AdminRolesBuilder.php @@ -116,7 +116,7 @@ private function getAdminLabel(AdminInterface $admin): string return sprintf( '%s > %s', $this->getGroupLabel($admin), - $admin->getTranslator()->trans($admin->getLabel(), [], $admin->getTranslationDomain()) + $admin->getTranslator()->trans($admin->getLabel() ?? '', [], $admin->getTranslationDomain()) ); }