-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[DomCrawler/CssSelector] Fixed namespace using in filter by xpath #5886
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -502,6 +503,9 @@ public function filterXPath($xpath) | |||
} | |||
|
|||
$domxpath = new \DOMXPath($document); | |||
foreach($namespaces as $prefix=>$uri) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add space around =>
it is not clear that the new parameter must be an associated array with prefix => uri, could you document it somewhere ? phpdoc, doc ? |
Sorry, closed it by mistake. Reopen it again. More detailed comment for $namespaces param is added and code style is fixed |
It would be great if this feature is implemented in the DomCrawler component 👍 |
@@ -502,6 +503,9 @@ public function filterXPath($xpath) | |||
} | |||
|
|||
$domxpath = new \DOMXPath($document); | |||
foreach($namespaces as $prefix => $uri) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is a missing space after foreach
.
@fabpot Isn't this BC break? (adds new argument to method marked with |
@fabpot @tereschenkov I could work on namespace autodetection. |
} | ||
|
||
/** | ||
* @expectedException \PHPUnit_Framework_Error_Warning |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not appropriate exception we should expect here.
Closing in favor of #6650 |
Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes: #4845