Skip to content

Commit

Permalink
fix phpstan and psalm errors (#1025)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmaicher committed Mar 5, 2022
1 parent 0f664bf commit c185190
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
4 changes: 4 additions & 0 deletions src/DependencyInjection/Compiler/TweakCompilerPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,13 @@ public function process(ContainerBuilder $container): void
$manager = $container->getDefinition('sonata.block.manager');
$registry = $container->getDefinition('sonata.block.menu.registry');

/** @var array<string, mixed> $blocks */
$blocks = $container->getParameter('sonata_block.blocks');
/** @var array<string, mixed> $blockTypes */
$blockTypes = $container->getParameter('sonata_blocks.block_types');
/** @var array<string, mixed> $cacheBlocks */
$cacheBlocks = $container->getParameter('sonata_block.cache_blocks');
/** @var string[] $defaultContexs */
$defaultContexs = $container->getParameter('sonata_blocks.default_contexts');

foreach ($container->findTaggedServiceIds('sonata.block') as $id => $tags) {
Expand Down
2 changes: 2 additions & 0 deletions src/DependencyInjection/SonataBlockExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ final class SonataBlockExtension extends Extension
*/
public function getConfiguration(array $config, ContainerBuilder $container): ?ConfigurationInterface
{
/** @var array<string, mixed> $bundles */
$bundles = $container->getParameter('kernel.bundles');

$defaultTemplates = [];
Expand All @@ -51,6 +52,7 @@ public function getConfiguration(array $config, ContainerBuilder $container): ?C

public function load(array $configs, ContainerBuilder $container): void
{
/** @var array<string, mixed> $bundles */
$bundles = $container->getParameter('kernel.bundles');

$processor = new Processor();
Expand Down
12 changes: 6 additions & 6 deletions src/Form/Type/ServiceListType.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,16 @@ public function configureOptions(OptionsResolver $resolver): void
},
'preferred_choices' => [],
'empty_data' => static function (Options $options) {
$multiple = isset($options['multiple']) && $options['multiple'];
$expanded = isset($options['expanded']) && $options['expanded'];
$multiple = $options['multiple'] ?? false;
$expanded = $options['expanded'] ?? false;

return $multiple || $expanded ? [] : '';
return true === $multiple || true === $expanded ? [] : '';
},
'empty_value' => static function (Options $options, $previousValue): ?string {
$multiple = isset($options['multiple']) && $options['multiple'];
$expanded = isset($options['expanded']) && $options['expanded'];
$multiple = $options['multiple'] ?? false;
$expanded = $options['expanded'] ?? false;

return $multiple || $expanded || !isset($previousValue) ? null : '';
return true === $multiple || true === $expanded || !isset($previousValue) ? null : '';
},
'error_bubbling' => false,
'include_containers' => false,
Expand Down

0 comments on commit c185190

Please sign in to comment.