Skip to content

Commit

Permalink
Solve psalm issues (#8154)
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentLanglet committed Jan 22, 2024
1 parent 9b1294e commit ee8dee3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/Controller/CRUDController.php
Original file line number Diff line number Diff line change
Expand Up @@ -470,14 +470,14 @@ public function batchAction(Request $request): Response
$nonRelevantMessage = 0 !== \count($idx) || $allElements; // at least one item is selected
}

if (!$nonRelevantMessage) { // default non relevant message (if false of null)
if (!\is_string($nonRelevantMessage) && true !== $nonRelevantMessage) { // default non relevant message
$nonRelevantMessage = 'flash_batch_empty';
}

$datagrid = $this->admin->getDatagrid();
$datagrid->buildPager();

if (true !== $nonRelevantMessage) {
if (\is_string($nonRelevantMessage)) {
$this->addFlash(
'sonata_flash_info',
$this->trans($nonRelevantMessage, [], 'SonataAdminBundle')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@ public function process(ContainerBuilder $container): void
'priority' => $attributes['priority'] ?? 0,
];

if (isset($groupDefaults[$resolvedGroupName]['on_top']) && $groupDefaults[$resolvedGroupName]['on_top']
|| $onTop && (\count($groupDefaults[$resolvedGroupName]['items']) > 1)) {
if (isset($groupDefaults[$resolvedGroupName]['on_top']) && true === $groupDefaults[$resolvedGroupName]['on_top']
|| true === $onTop && (\count($groupDefaults[$resolvedGroupName]['items']) > 1)) {
throw new \RuntimeException('You can\'t use "on_top" option with multiple same name groups.');
}
$groupDefaults[$resolvedGroupName]['on_top'] = $onTop;
Expand Down Expand Up @@ -271,7 +271,7 @@ public function process(ContainerBuilder $container): void

if (
isset($groups[$resolvedGroupName]['on_top'])
&& ($group['on_top'] ?? false)
&& true === ($group['on_top'] ?? false)
&& \count($groups[$resolvedGroupName]['items']) > 1
) {
throw new \RuntimeException('You can\'t use "on_top" option with multiple same name groups.');
Expand Down
2 changes: 1 addition & 1 deletion src/DependencyInjection/Compiler/ExtensionCompilerPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public function process(ContainerBuilder $container): void
}
$universalExtensions[$id][] = $attributes;

if (!$target || !$container->hasDefinition($target)) {
if (false === $target || !$container->hasDefinition($target)) {
continue;
}

Expand Down

0 comments on commit ee8dee3

Please sign in to comment.