Skip to content

Commit aca96fc

Browse files
Assert that we operate on DOMNode objects
1 parent 6ce7ecf commit aca96fc

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/Util/Configuration.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
use function version_compare;
4545
use DOMDocument;
4646
use DOMElement;
47+
use DOMNode;
4748
use DOMNodeList;
4849
use DOMXPath;
4950
use LibXMLError;
@@ -346,6 +347,8 @@ public function getPHPConfiguration(): array
346347
];
347348

348349
foreach ($this->xpath->query('php/includePath') as $includePath) {
350+
assert($includePath instanceof DOMNode);
351+
349352
$path = (string) $includePath->textContent;
350353

351354
if ($path) {
@@ -1143,6 +1146,8 @@ private function readFilterFiles(string $query): array
11431146
$files = [];
11441147

11451148
foreach ($this->xpath->query($query) as $file) {
1149+
assert($file instanceof DOMNode);
1150+
11461151
$filePath = (string) $file->textContent;
11471152

11481153
if ($filePath) {
@@ -1199,10 +1204,14 @@ private function parseGroupConfiguration(string $root): array
11991204
];
12001205

12011206
foreach ($this->xpath->query($root . '/include/group') as $group) {
1207+
assert($group instanceof DOMNode);
1208+
12021209
$groups['include'][] = (string) $group->textContent;
12031210
}
12041211

12051212
foreach ($this->xpath->query($root . '/exclude/group') as $group) {
1213+
assert($group instanceof DOMNode);
1214+
12061215
$groups['exclude'][] = (string) $group->textContent;
12071216
}
12081217

0 commit comments

Comments
 (0)