Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0256ccc

Browse files
committed
[CssSelector] remove ConverterInterface
1 parent a76eae8 commit 0256ccc

File tree

4 files changed

+53
-80
lines changed

4 files changed

+53
-80
lines changed

src/Symfony/Component/CssSelector/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ CHANGELOG
44
2.8.0
55
-----
66

7-
* Added the ConverterInterface and the Converter implementation as a non-static API for the component.
7+
* Added the `Converter` class as a non-static API for the component.
88
* Deprecated the `CssSelector` static API of the component.
99

1010
2.1.0

src/Symfony/Component/CssSelector/Converter.php

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,12 @@
1919
use Symfony\Component\CssSelector\XPath\Translator;
2020

2121
/**
22-
* @author Christophe Coevoet <[email protected]>
22+
* Converter is the main entry point of the component and can convert CSS
23+
* selectors to XPath expressions.
2324
*
24-
* @api
25+
* @author Christophe Coevoet <[email protected]>
2526
*/
26-
class Converter implements ConverterInterface
27+
class Converter
2728
{
2829
private $translator;
2930

@@ -47,7 +48,15 @@ public function __construct($html = true)
4748
}
4849

4950
/**
50-
* {@inheritdoc}
51+
* Translates a CSS expression to its XPath equivalent.
52+
*
53+
* Optionally, a prefix can be added to the resulting XPath
54+
* expression with the $prefix parameter.
55+
*
56+
* @param string $cssExpr The CSS expression.
57+
* @param string $prefix An optional prefix for the XPath expression.
58+
*
59+
* @return string
5160
*/
5261
public function toXPath($cssExpr, $prefix = 'descendant-or-self::')
5362
{

src/Symfony/Component/CssSelector/ConverterInterface.php

Lines changed: 0 additions & 75 deletions
This file was deleted.

src/Symfony/Component/CssSelector/README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,42 @@ You can run the unit tests with the following command:
4545
$ cd path/to/Symfony/Component/CssSelector/
4646
$ composer install
4747
$ phpunit
48+
49+
License
50+
-------
51+
52+
This component is a port of the Python cssselect library,
53+
which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect.
54+
55+
Copyright (c) 2007-2012 Ian Bicking and contributors. See AUTHORS
56+
for more details.
57+
58+
All rights reserved.
59+
60+
Redistribution and use in source and binary forms, with or without
61+
modification, are permitted provided that the following conditions are
62+
met:
63+
64+
1. Redistributions of source code must retain the above copyright
65+
notice, this list of conditions and the following disclaimer.
66+
67+
2. Redistributions in binary form must reproduce the above copyright
68+
notice, this list of conditions and the following disclaimer in
69+
the documentation and/or other materials provided with the
70+
distribution.
71+
72+
3. Neither the name of Ian Bicking nor the names of its contributors may
73+
be used to endorse or promote products derived from this software
74+
without specific prior written permission.
75+
76+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
77+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
78+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
79+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL IAN BICKING OR
80+
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
81+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
82+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
83+
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
84+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
85+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
86+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

0 commit comments

Comments
 (0)