Skip to content

Commit

Permalink
make psalm happy (fingers crossed)
Browse files Browse the repository at this point in the history
Signed-off-by: Matthias Kühne <[email protected]>
  • Loading branch information
MatthiasKuehneEllerhold committed Dec 8, 2023
1 parent a6fa7c0 commit 3bab68d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/Filter/AbstractLocale.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Laminas\Filter\AbstractFilter;
use Locale;

use function array_key_exists;
use function is_string;

/**
* @psalm-type Options = array{
Expand Down Expand Up @@ -40,9 +40,9 @@ public function setLocale($locale = null)
*/
public function getLocale()
{
if (! array_key_exists('locale', $this->options)) {
return Locale::getDefault();
if (isset($this->options['locale']) && is_string($this->options['locale'])) {
return $this->options['locale'];
}
return $this->options['locale'];
return Locale::getDefault();
}
}
2 changes: 1 addition & 1 deletion src/View/Helper/Container/CountryCodeDataListFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ public function __invoke(ContainerInterface $container): CountryCodeDataList
/** @psalm-var mixed $config */
$config = $config instanceof Traversable ? iterator_to_array($config) : $config;

/** @psalm-var string|null $locale */
$locale = is_array($config) && isset($config['locale']) && is_string($config['locale'])
? $config['locale']
: null;

Check failure on line 34 in src/View/Helper/Container/CountryCodeDataListFactory.php

View workflow job for this annotation

GitHub Actions / ci / QA Checks (PHPCodeSniffer [8.1, locked], ubuntu-latest, laminas/laminas-continuous-integration-ac...

Unexpected blank line found
assert(($locale === null) || is_string($locale));

return new CountryCodeDataList(
$container->get(CountryCodeListInterface::class),
Expand Down

0 comments on commit 3bab68d

Please sign in to comment.