Skip to content

Commit

Permalink
Fix psalm
Browse files Browse the repository at this point in the history
  • Loading branch information
heiglandreas committed Feb 12, 2024
1 parent 2906e98 commit e6ca0e5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Dictionary/Dictionary.php
Expand Up @@ -111,7 +111,7 @@ public static function fromFile(string $file): Dictionary
$dictionary = new Dictionary();

foreach (parse_ini_file($file) as $key => $val) {
if (is_array($val)) {
if (is_array($key)) {

Check failure on line 114 in src/Dictionary/Dictionary.php

View workflow job for this annotation

GitHub Actions / analyze

TypeDoesNotContainType

src/Dictionary/Dictionary.php:114:17: TypeDoesNotContainType: Type array-key for $key is never array<array-key, mixed> (see https://psalm.dev/056)
continue;
}
$dictionary->dictionary[str_replace('@:', '', $key)] = $val;

Check failure on line 117 in src/Dictionary/Dictionary.php

View workflow job for this annotation

GitHub Actions / analyze

InvalidPropertyAssignmentValue

src/Dictionary/Dictionary.php:117:13: InvalidPropertyAssignmentValue: $dictionary->dictionary with declared type 'array<array-key, mixed>' cannot be assigned type 'non-empty-array<array-key|array<array-key, string>, mixed>' (see https://psalm.dev/145)
Expand All @@ -136,7 +136,7 @@ public function load($locale)
return $this;
}
foreach (parse_ini_file($file) as $key => $val) {
if (is_array($val)) {
if (is_array($key)) {

Check failure on line 139 in src/Dictionary/Dictionary.php

View workflow job for this annotation

GitHub Actions / analyze

TypeDoesNotContainType

src/Dictionary/Dictionary.php:139:17: TypeDoesNotContainType: Type array-key for $key is never array<array-key, mixed> (see https://psalm.dev/056)
continue;
}
$this->dictionary[str_replace('@:', '', $key)] = $val;

Check failure on line 142 in src/Dictionary/Dictionary.php

View workflow job for this annotation

GitHub Actions / analyze

InvalidPropertyAssignmentValue

src/Dictionary/Dictionary.php:142:13: InvalidPropertyAssignmentValue: $this->dictionary with declared type 'array<array-key, mixed>' cannot be assigned type 'non-empty-array<array<array-key, string>|string, mixed>' (see https://psalm.dev/145)
Expand Down

0 comments on commit e6ca0e5

Please sign in to comment.