8000 bug #24975 [DomCrawler] Type fix Crawler:: discoverNamespace() (VolCh) · symfony/symfony@b2719d3 · GitHub
[go: up one dir, main page]

Skip to content

Commit b2719d3

Browse files
committed
bug #24975 [DomCrawler] Type fix Crawler:: discoverNamespace() (VolCh)
This PR was merged into the 4.0-dev branch. Discussion ---------- [DomCrawler] Type fix Crawler:: discoverNamespace() Based on 3.x behavior | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? |no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | <!-- - Bug fixes must be submitted against the lowest branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against the master branch. - Please fill in this template according to the PR you're about to submit. - Replace this comment by a description of what your PR is solving. --> Commits ------- e39e8c2 [DomCrawler] Fix return type Crawler:: discoverNamespace()
2 parents bdcc357 + e39e8c2 commit b2719d3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Symfony/Component/DomCrawler/Crawler.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1110,7 +1110,7 @@ private function createDOMXPath(\DOMDocument $document, array $prefixes = array(
11101110
/**
11111111
* @throws \InvalidArgumentException
11121112
*/
1113-
private function discoverNamespace(\DOMXPath $domxpath, string $prefix): string
1113+
private function discoverNamespace(\DOMXPath $domxpath, string $prefix): ?string
11141114
{
11151115
if (isset($this->namespaces[$prefix])) {
11161116
return $this->namespaces[$prefix];
@@ -1122,6 +1122,8 @@ private function discoverNamespace(\DOMXPath $domxpath, string $prefix): string
11221122
if ($node = $namespaces->item(0)) {
11231123
return $node->nodeValue;
11241124
}
1125+
1126+
return null;
11251127
}
11261128

11271129
private function findNamespacePrefixes(string $xpath): array

0 commit comments

Comments
 (0)
0