Skip to content

Commit b933434

Browse files
Merge branch '4.3' into 4.4
* 4.3: cs fix Fix inconsistent return points. [Config] Add handling for ignored keys in ArrayNode::mergeValues. Fix inconsistent return points. [Security/Core] UserInterface::getPassword() can return null [Router] Fix TraceableUrlMatcher behaviour with trailing slash Revert "bug #33092 [DependencyInjection] Improve an exception message (fabpot)"
2 parents b6b803a + 2eaa3f0 commit b933434

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

Crawler.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1061,9 +1061,7 @@ private function relativize(string $xpath): string
10611061
*/
10621062
public function getNode($position)
10631063
{
1064-
if (isset($this->nodes[$position])) {
1065-
return $this->nodes[$position];
1066-
}
1064+
return isset($this->nodes[$position]) ? $this->nodes[$position] : null;
10671065
}
10681066

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

1181-
if ($node = $namespaces->item(0)) {
1182-
return $node->nodeValue;
1183-
}
1184-
1185-
return null;
1179+
return ($node = $namespaces->item(0)) ? $node->nodeValue : null;
11861180
}
11871181

11881182
private function findNamespacePrefixes(string $xpath): array

Field/FormField.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,8 @@ public function getLabel()
7272
}
7373

7474
$labels = $xpath->query('ancestor::label[1]', $this->node);
75-
if ($labels->length > 0) {
76-
return $labels->item(0);
77-
}
75+
76+
return $labels->length > 0 ? $labels->item(0) : null;
7877
}
7978

8079
/**

0 commit comments

Comments
 (0)