From 9392f806db727b9afa10e5b554adb97fa935ad26 Mon Sep 17 00:00:00 2001 From: Hidde Wieringa Date: Sat, 24 Oct 2015 15:53:44 +0200 Subject: [PATCH 1/3] Updated CssSelector code example to use the new Converter --- components/css_selector.rst | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/components/css_selector.rst b/components/css_selector.rst index 3935f3c85ee..8d5f0d658b5 100644 --- a/components/css_selector.rst +++ b/components/css_selector.rst @@ -47,11 +47,14 @@ The CssSelector Component ~~~~~~~~~~~~~~~~~~~~~~~~~ The component's only goal is to convert CSS selectors to their XPath -equivalents:: +equivalents, using :method:`Converter::toXPath() ` - use Symfony\Component\CssSelector\CssSelector; +.. code-block:: php - var_dump(CssSelector::toXPath('div.item > h4 > a')); + use Symfony\Component\CssSelector\Converter; + + $converter = new Converter(); + var_dump($converter->toXPath('div.item > h4 > a')); This gives the following output: From df4fc7ec58c4c233a9f27988131457ac29e5b8ac Mon Sep 17 00:00:00 2001 From: Hidde Wieringa Date: Sun, 25 Oct 2015 10:40:02 +0100 Subject: [PATCH 2/3] Updated for CssSelectorConverter class name --- components/css_selector.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/css_selector.rst b/components/css_selector.rst index 8d5f0d658b5..d77fb89469f 100644 --- a/components/css_selector.rst +++ b/components/css_selector.rst @@ -47,13 +47,13 @@ The CssSelector Component ~~~~~~~~~~~~~~~~~~~~~~~~~ The component's only goal is to convert CSS selectors to their XPath -equivalents, using :method:`Converter::toXPath() ` +equivalents, using :method:`Symfony\\Component\\CssSelector\\CssSelectorConverter::toXPath` .. code-block:: php - use Symfony\Component\CssSelector\Converter; + use Symfony\Component\CssSelector\CssSelectorConverter; - $converter = new Converter(); + $converter = new CssSelectorConverter(); var_dump($converter->toXPath('div.item > h4 > a')); This gives the following output: From dfb9b16d3a0d6ac0a5b14ad1f5f345f27cc3fb24 Mon Sep 17 00:00:00 2001 From: Hidde Wieringa Date: Sun, 25 Oct 2015 17:48:05 +0100 Subject: [PATCH 3/3] Used :: for code block --- components/css_selector.rst | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/components/css_selector.rst b/components/css_selector.rst index d77fb89469f..588582fb371 100644 --- a/components/css_selector.rst +++ b/components/css_selector.rst @@ -47,9 +47,7 @@ The CssSelector Component ~~~~~~~~~~~~~~~~~~~~~~~~~ The component's only goal is to convert CSS selectors to their XPath -equivalents, using :method:`Symfony\\Component\\CssSelector\\CssSelectorConverter::toXPath` - -.. code-block:: php +equivalents, using :method:`Symfony\\Component\\CssSelector\\CssSelectorConverter::toXPath`:: use Symfony\Component\CssSelector\CssSelectorConverter;