Skip to content

Commit 60a0120

Browse files
committed
Update pslam usage
- bump level to 2 - add suppress to shutup about things that are intentional - add missing type annotations
1 parent 40bf9ba commit 60a0120

File tree

7 files changed

+11
-35
lines changed

7 files changed

+11
-35
lines changed

build/psalm/baseline.xml

+4-12
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<files psalm-version="5.13.1@086b94371304750d1c673315321a55d15fc59015">
2+
<files psalm-version="5.14.1@b9d355e0829c397b9b3b47d0c0ed042a8a70284d">
33
<file src="src/formdata/FormDataRenderer.php">
4-
<PossiblyInvalidArgument>
5-
<code><![CDATA[$form->getValue(
6-
$textarea->getAttribute('name')
7-
)]]></code>
8-
<code><![CDATA[$form->getValue(
9-
$name
10-
)]]></code>
11-
<code><![CDATA[$form->getValue(
12-
$select->getAttribute('name')
13-
)]]></code>
14-
</PossiblyInvalidArgument>
4+
<PossiblyNullReference>
5+
<code>createTextNode</code>
6+
</PossiblyNullReference>
157
</file>
168
</files>

psalm.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0"?>
22
<psalm
3-
errorLevel="3"
3+
errorLevel="2"
44
resolveFromConfigFile="true"
55
totallyTyped="true"
66
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

psalm.xml.org

-21
This file was deleted.

src/formdata/FormData.php

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
final class FormData {
2222
private readonly string $identifier;
2323

24+
/** @psalm-var array<string,string> */
2425
private array $values = [];
2526

2627
/**

src/serializer/EmptyElementsFilter.php

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
class EmptyElementsFilter implements Filter {
1616
public function apply(string $content): string {
17+
/** @psalm-var list<string> */
1718
static $tagList = [
1819
'base', 'br', 'meta', 'link', 'img', 'input', 'button', 'hr', 'embed',
1920
'param', 'source', 'track', 'area', 'keygen',

src/serializer/HTMLSerializer.php

+2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@ class HTMLSerializer implements Serializer {
2020

2121
private bool $withDoctypeFlag = true;
2222

23+
/** @psalm-var list<Filter> */
2324
private array $filters = [];
2425

26+
/** @psalm-var list<Transformation> */
2527
private array $transformations = [];
2628

2729
public function stripRDFa(): self {

src/viewmodel/ViewModelRenderer.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,7 @@ private function conditionalApply(DOMElement $context, object|iterable $model):
386386
}
387387

388388
$typeOf = $current->typeOf();
389+
389390
if (!is_string($typeOf)) {
390391
throw new ViewModelRendererException(
391392
sprintf('Value returned by typeOf() must be string (%s)', $this->getModelPath($context)),
@@ -408,7 +409,7 @@ private function conditionalApply(DOMElement $context, object|iterable $model):
408409
$context,
409410
$current,
410411
'typeOf',
411-
sprintf('No matching types for "%s" found', (string)$typeOf)
412+
sprintf('No matching types for "%s" found', $typeOf)
412413
),
413414
ViewModelRendererException::NoMatch
414415
);

0 commit comments

Comments
 (0)