Skip to content

[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

Closed
wants to merge 2 commits into from
Closed

[DomCrawler/CssSelector] Fixed namespace using in filter by xpath #5886

wants to merge 2 commits into from

Conversation

tereschenkov
Copy link

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes: #4845

@@ -502,6 +503,9 @@ public function filterXPath($xpath)
}

$domxpath = new \DOMXPath($document);
foreach($namespaces as $prefix=>$uri) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add space around =>

@pborreli
Copy link
Contributor

pborreli commented Nov 1, 2012

it is not clear that the new parameter must be an associated array with prefix => uri, could you document it somewhere ? phpdoc, doc ?

@tereschenkov tereschenkov reopened this Nov 1, 2012
@tereschenkov
Copy link
Author

Sorry, closed it by mistake. Reopen it again. More detailed comment for $namespaces param is added and code style is fixed

@robinvdvleuten
Copy link
Contributor

It would be great if this feature is implemented in the DomCrawler component 👍

@fabpot
Copy link
Member

fabpot commented Jan 9, 2013

The automatic registration of detected namespaces (as suggested by @jakzal in #4845) would be a very good addition.

@@ -502,6 +503,9 @@ public function filterXPath($xpath)
}

$domxpath = new \DOMXPath($document);
foreach($namespaces as $prefix => $uri) {
Copy link
Member

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.

@stloyd
Copy link
Contributor

stloyd commented Jan 9, 2013

@fabpot Isn't this BC break? (adds new argument to method marked with @api)

@jakzal
Copy link
Contributor

jakzal commented Jan 9, 2013

@fabpot @tereschenkov I could work on namespace autodetection.

@tereschenkov
Copy link
Author

@jakzal @fabpot I cannot work on this patch right now, so if someone will take care of it I will really appreciate this

}

/**
* @expectedException \PHPUnit_Framework_Error_Warning
Copy link
Contributor

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.

@fabpot
Copy link
Member

fabpot commented Sep 13, 2013

Closing in favor of #6650

@fabpot fabpot closed this Sep 13, 2013
@tereschenkov tereschenkov deleted the 2.0 branch November 4, 2013 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants