Skip to content

Commit a1fe98e

Browse files
Merge branch '4.4'
* 4.4: 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 cs fix cs fix Fix missing exporter in PHPUnit constraint poylfill added `Process::getLastOutputTime()` method [Router] Fix TraceableUrlMatcher behaviour with trailing slash [HttpKernel] Remove outdated docblock comment Fix handling for session parameters Revert "bug #33092 [DependencyInjection] Improve an exception message (fabpot)"
2 parents 8de0507 + b933434 commit a1fe98e

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
@@ -1007,9 +1007,7 @@ private function relativize(string $xpath): string
10071007
*/
10081008
public function getNode(int $position)
10091009
{
1010-
if (isset($this->nodes[$position])) {
1011-
return $this->nodes[$position];
1012-
}
1010+
return isset($this->nodes[$position]) ? $this->nodes[$position] : null;
10131011
}
10141012

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

1126-
if ($node = $namespaces->item(0)) {
1127-
return $node->nodeValue;
1128-
}
1129-
1130-
return null;
1124+
return ($node = $namespaces->item(0)) ? $node->nodeValue : null;
11311125
}
11321126

11331127
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)