bug #25606 Updating message to inform the user how to install the component (weaverryan)

This PR was submitted for the 4.0 branch but it was squashed and merged into the 3.4 branch instead (closes #25606).

Discussion
----------

Updating message to inform the user how to install the component

| Q             | A
| ------------- | ---
| Branch?       | 4.0
| Bug fix?      | yes-ish
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | none
| License       | MIT
| Doc PR        | n/a

Simple: direct the user exactly what to do if they hit this :)

Commits
-------

07ac535 Updating message to inform the user how to install the component
This commit is contained in:
Nicolas Grekas 2017-12-27 11:16:14 +01:00
commit 02524ee5cd

View File

@ -691,8 +691,8 @@ class Crawler implements \Countable, \IteratorAggregate
*/
public function filter($selector)
{
if (!class_exists('Symfony\\Component\\CssSelector\\CssSelectorConverter')) {
throw new \RuntimeException('Unable to filter with a CSS selector as the Symfony CssSelector 2.8+ is not installed (you can use filterXPath instead).');
if (!class_exists(CssSelectorConverter::class)) {
throw new \RuntimeException('To filter with a CSS selector, install the CssSelector component ("composer require symfony/css-selector"). Or use filterXpath instead.');
}
$converter = new CssSelectorConverter($this->isHtml);