Permalink
Browse files

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()
  • Loading branch information...
stof committed Nov 16, 2017
2 parents bdcc357 + e39e8c2 commit b2719d3176e6adcf8e08c0b7fa39f8430fb01280
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/Symfony/Component/DomCrawler/Crawler.php
@@ -1110,7 +1110,7 @@ private function createDOMXPath(\DOMDocument $document, array $prefixes = array(
/**
* @throws \InvalidArgumentException
*/
private function discoverNamespace(\DOMXPath $domxpath, string $prefix): string
private function discoverNamespace(\DOMXPath $domxpath, string $prefix): ?string
{
if (isset($this->namespaces[$prefix])) {
return $this->namespaces[$prefix];
@@ -1122,6 +1122,8 @@ private function discoverNamespace(\DOMXPath $domxpath, string $prefix): string
if ($node = $namespaces->item(0)) {
return $node->nodeValue;
}
return null;
}
private function findNamespacePrefixes(string $xpath): array

0 comments on commit b2719d3

Please sign in to comment.