Skip to content

Commit

Permalink
Fix psalm (#185)
Browse files Browse the repository at this point in the history
  • Loading branch information
vjik committed Feb 7, 2024
1 parent 26b8708 commit 1d85b7d
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 5 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/static.yml
Expand Up @@ -29,4 +29,12 @@ jobs:
os: >-
['ubuntu-latest']
php: >-
['8.0', '8.1', '8.2']
['8.1', '8.2', '8.3']
psalm80:
uses: yiisoft/actions/.github/workflows/psalm.yml@master
with:
psalm-config: psalm80.xml
os: >-
['ubuntu-latest']
php: >-
['8.0']
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -36,7 +36,7 @@
"rector/rector": "^1.0.0",
"roave/infection-static-analysis-plugin": "^1.16",
"spatie/phpunit-watcher": "^1.23",
"vimeo/psalm": "^4.18|^5.0"
"vimeo/psalm": "^4.30|^5.21"
},
"autoload": {
"psr-4": {
Expand Down
7 changes: 7 additions & 0 deletions psalm.xml
Expand Up @@ -9,5 +9,12 @@
>
<projectFiles>
<directory name="src" />
<ignoreFiles>
<directory name="vendor" />
</ignoreFiles>
</projectFiles>
<issueHandlers>
<MixedAssignment errorLevel="suppress" />
<RiskyTruthyFalsyComparison errorLevel="suppress" />
</issueHandlers>
</psalm>
19 changes: 19 additions & 0 deletions psalm80.xml
@@ -0,0 +1,19 @@
<?xml version="1.0"?>
<psalm
errorLevel="1"
findUnusedBaselineEntry="true"
findUnusedCode="false"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
>
<projectFiles>
<directory name="src" />
<ignoreFiles>
<directory name="vendor" />
</ignoreFiles>
</projectFiles>
<issueHandlers>
<MixedAssignment errorLevel="suppress" />
</issueHandlers>
</psalm>
2 changes: 0 additions & 2 deletions src/Html.php
Expand Up @@ -1592,7 +1592,6 @@ public static function renderTagAttributes(array $attributes): string
$sorted = [];
foreach (self::ATTRIBUTE_ORDER as $name) {
if (isset($attributes[$name])) {
/** @var mixed */
$sorted[$name] = $attributes[$name];
}
}
Expand All @@ -1602,7 +1601,6 @@ public static function renderTagAttributes(array $attributes): string
$html = '';
/**
* @var string $name
* @var mixed $value
*/
foreach ($attributes as $name => $value) {
if (is_bool($value)) {
Expand Down
1 change: 0 additions & 1 deletion src/Tag/Option.php
Expand Up @@ -57,7 +57,6 @@ public function disabled(bool $disabled = true): self
*/
public function getValue(): ?string
{
/** @var mixed $value */
$value = ArrayHelper::getValue($this->attributes, 'value');
return $value === null ? null : (string)$value;
}
Expand Down

0 comments on commit 1d85b7d

Please sign in to comment.