Skip to content

Commit 65d8b29

Browse files
authored
Quality of Life (#108)
* adjusted code for Psalm ^5.4 * allowed Composer plugins for infection/extension-installer * moved PHP 8.2 to regular CI workflow, allowed failures on PHP 8.3 nightly
1 parent 3072ceb commit 65d8b29

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

.github/workflows/test.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ jobs:
1111
runs-on: '${{ matrix.os }}'
1212
strategy:
1313
matrix:
14-
php: ['7.4', '8.0', '8.1']
14+
php: ['7.4', '8.0', '8.1', '8.2']
1515
os: ['ubuntu-latest']
1616
failure: [false]
1717
include:
18-
- { php: '8.2', os: 'ubuntu-latest', failure: true } # '8.2' means 'nightly'
18+
- { php: '8.3', os: 'ubuntu-latest', failure: true } # '8.3' means 'nightly'
1919
steps:
2020
- name: 'Checkout'
2121
uses: 'actions/checkout@v2'

composer.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,10 @@
3030
"symfony/yaml": "if you want to use YAML serializer",
3131
"ext-dom": "if you want to use XML serializer",
3232
"ext-json": "if you want to use JSON serializer"
33+
},
34+
"config": {
35+
"allow-plugins": {
36+
"infection/extension-installer": true
37+
}
3338
}
3439
}

src/Parser/RegularParser.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ private function shortcode(array &$names)
142142
}
143143

144144
$this->beginBacktrack();
145-
/** @psalm-suppress MixedArgumentTypeCoercion */
146145
$contentMatchedShortcodes = $this->shortcode($names);
147146
if(\is_string($contentMatchedShortcodes)) {
148147
$closingName = $contentMatchedShortcodes;

src/Serializer/XmlSerializer.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ public function unserialize($text)
8888
if($shortcode->length !== 1) {
8989
throw new \InvalidArgumentException('Invalid shortcode XML!');
9090
}
91+
/** @psalm-suppress PossiblyNullArgument */
9192
$name = $this->getAttribute($shortcode->item(0), 'name');
9293

9394
$bbCode = $this->getValue($xpath->query('/shortcode/bbCode'));
@@ -98,6 +99,7 @@ public function unserialize($text)
9899
for($i = 0; $i < $elements->length; $i++) {
99100
$node = $elements->item($i);
100101

102+
/** @psalm-suppress PossiblyNullReference */
101103
$parameters[$this->getAttribute($node, 'name')] = $node->hasChildNodes() ? $node->nodeValue : null;
102104
}
103105

@@ -111,6 +113,7 @@ public function unserialize($text)
111113
*/
112114
private function getValue(\DOMNodeList $node)
113115
{
116+
/** @psalm-suppress PossiblyNullReference,PossiblyNullPropertyFetch */
114117
return $node->length === 1 && $node->item(0)->hasChildNodes()
115118
? $node->item(0)->nodeValue
116119
: null;
@@ -119,7 +122,6 @@ private function getValue(\DOMNodeList $node)
119122
/**
120123
* @param \DOMNode $node
121124
* @param string $name
122-
* @psalm-suppress UnusedParam
123125
*
124126
* @return string
125127
*/

0 commit comments

Comments
 (0)