Skip to content

Commit 2eaa3f0

Browse files
derrabusnicolas-grekas
authored andcommitted
Fix inconsistent return points.
1 parent 9a735cb commit 2eaa3f0

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

Crawler.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1063,9 +1063,7 @@ private function relativize(string $xpath): string
10631063
*/
10641064
public function getNode($position)
10651065
{
1066-
if (isset($this->nodes[$position])) {
1067-
return $this->nodes[$position];
1068-
}
1066+
return isset($this->nodes[$position]) ? $this->nodes[$position] : null;
10691067
}
10701068

10711069
/**
@@ -1180,11 +1178,7 @@ private function discoverNamespace(\DOMXPath $domxpath, string $prefix): ?string
11801178
// ask for one namespace, otherwise we'd get a collection with an item for each node
11811179
$namespaces = $domxpath->query(sprintf('(//namespace::*[name()="%s"])[last()]', $this->defaultNamespacePrefix === $prefix ? '' : $prefix));
11821180

1183-
if ($node = $namespaces->item(0)) {
1184-
return $node->nodeValue;
1185-
}
1186-
1187-
return null;
1181+
return ($node = $namespaces->item(0)) ? $node->nodeValue : null;
11881182
}
11891183

11901184
private function findNamespacePrefixes(string $xpath): array

0 commit comments

Comments
 (0)