Skip to content

Commit 241746d

Browse files
committed
minor #14005 CS: Convert double quotes to single quotes (keradus)
This PR was merged into the 2.3 branch. Discussion ---------- CS: Convert double quotes to single quotes | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | N/A | License | MIT | Doc PR | N/A Changes generated automatically by upcoming PHP CS Fixer. To keep fabbot.io happy ;) Commits ------- f99c22c CS: Convert double quotes to single quotes
2 parents 033ec5c + df39b80 commit 241746d

File tree

3 files changed

+35
-35
lines changed

3 files changed

+35
-35
lines changed

Tests/CssSelectorTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,23 +37,23 @@ public function testParseExceptions()
3737
$this->fail('->parse() throws an Exception if the css selector is not valid');
3838
} catch (\Exception $e) {
3939
$this->assertInstanceOf('\Symfony\Component\CssSelector\Exception\ParseException', $e, '->parse() throws an Exception if the css selector is not valid');
40-
$this->assertEquals("Expected identifier, but <eof at 3> found.", $e->getMessage(), '->parse() throws an Exception if the css selector is not valid');
40+
$this->assertEquals('Expected identifier, but <eof at 3> found.', $e->getMessage(), '->parse() throws an Exception if the css selector is not valid');
4141
}
4242
}
4343

4444
public function getCssToXPathWithoutPrefixTestData()
4545
{
4646
return array(
47-
array('h1', "h1"),
48-
array('foo|h1', "foo:h1"),
49-
array('h1, h2, h3', "h1 | h2 | h3"),
47+
array('h1', 'h1'),
48+
array('foo|h1', 'foo:h1'),
49+
array('h1, h2, h3', 'h1 | h2 | h3'),
5050
array('h1:nth-child(3n+1)', "*/*[name() = 'h1' and (position() - 1 >= 0 and (position() - 1) mod 3 = 0)]"),
51-
array('h1 > p', "h1/p"),
51+
array('h1 > p', 'h1/p'),
5252
array('h1#foo', "h1[@id = 'foo']"),
5353
array('h1.foo', "h1[@class and contains(concat(' ', normalize-space(@class), ' '), ' foo ')]"),
5454
array('h1[class*="foo bar"]', "h1[@class and contains(@class, 'foo bar')]"),
5555
array('h1[foo|class*="foo bar"]', "h1[@foo:class and contains(@foo:class, 'foo bar')]"),
56-
array('h1[class]', "h1[@class]"),
56+
array('h1[class]', 'h1[@class]'),
5757
array('h1 .foo', "h1/descendant-or-self::*/*[@class and contains(concat(' ', normalize-space(@class), ' '), ' foo ')]"),
5858
array('h1 #foo', "h1/descendant-or-self::*/*[@id = 'foo']"),
5959
array('h1 [class*=foo]', "h1/descendant-or-self::*/*[@class and contains(@class, 'foo')]"),

Tests/XPath/TranslatorTest.php

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,12 @@ public function getXpathLiteralTestData()
9090
public function getCssToXPathTestData()
9191
{
9292
return array(
93-
array('*', "*"),
94-
array('e', "e"),
95-
array('*|e', "e"),
96-
array('e|f', "e:f"),
97-
array('e[foo]', "e[@foo]"),
98-
array('e[foo|bar]', "e[@foo:bar]"),
93+
array('*', '*'),
94+
array('e', 'e'),
95+
array('*|e', 'e'),
96+
array('e|f', 'e:f'),
97+
array('e[foo]', 'e[@foo]'),
98+
array('e[foo|bar]', 'e[@foo:bar]'),
9999
array('e[foo="bar"]', "e[@foo = 'bar']"),
100100
array('e[foo~="bar"]', "e[@foo and contains(concat(' ', normalize-space(@foo), ' '), ' bar ')]"),
101101
array('e[foo^="bar"]', "e[@foo and starts-with(@foo, 'bar')]"),
@@ -105,29 +105,29 @@ public function getCssToXPathTestData()
105105
array('e:nth-child(1)', "*/*[name() = 'e' and (position() = 1)]"),
106106
array('e:nth-last-child(1)', "*/*[name() = 'e' and (position() = last() - 0)]"),
107107
array('e:nth-last-child(2n+2)', "*/*[name() = 'e' and (last() - position() - 1 >= 0 and (last() - position() - 1) mod 2 = 0)]"),
108-
array('e:nth-of-type(1)', "*/e[position() = 1]"),
109-
array('e:nth-last-of-type(1)', "*/e[position() = last() - 0]"),
108+
array('e:nth-of-type(1)', '*/e[position() = 1]'),
109+
array('e:nth-last-of-type(1)', '*/e[position() = last() - 0]'),
110110
array('div e:nth-last-of-type(1) .aclass', "div/descendant-or-self::*/e[position() = last() - 0]/descendant-or-self::*/*[@class and contains(concat(' ', normalize-space(@class), ' '), ' aclass ')]"),
111111
array('e:first-child', "*/*[name() = 'e' and (position() = 1)]"),
112112
array('e:last-child', "*/*[name() = 'e' and (position() = last())]"),
113-
array('e:first-of-type', "*/e[position() = 1]"),
114-
array('e:last-of-type', "*/e[position() = last()]"),
113+
array('e:first-of-type', '*/e[position() = 1]'),
114+
array('e:last-of-type', '*/e[position() = last()]'),
115115
array('e:only-child', "*/*[name() = 'e' and (last() = 1)]"),
116-
array('e:only-of-type', "e[last() = 1]"),
117-
array('e:empty', "e[not(*) and not(string-length())]"),
118-
array('e:EmPTY', "e[not(*) and not(string-length())]"),
119-
array('e:root', "e[not(parent::*)]"),
120-
array('e:hover', "e[0]"),
116+
array('e:only-of-type', 'e[last() = 1]'),
117+
array('e:empty', 'e[not(*) and not(string-length())]'),
118+
array('e:EmPTY', 'e[not(*) and not(string-length())]'),
119+
array('e:root', 'e[not(parent::*)]'),
120+
array('e:hover', 'e[0]'),
121121
array('e:contains("foo")', "e[contains(string(.), 'foo')]"),
122122
array('e:ConTains(foo)', "e[contains(string(.), 'foo')]"),
123123
array('e.warning', "e[@class and contains(concat(' ', normalize-space(@class), ' '), ' warning ')]"),
124124
array('e#myid', "e[@id = 'myid']"),
125-
array('e:not(:nth-child(odd))', "e[not(position() - 1 >= 0 and (position() - 1) mod 2 = 0)]"),
126-
array('e:nOT(*)', "e[0]"),
127-
array('e f', "e/descendant-or-self::*/f"),
128-
array('e > f', "e/f"),
125+
array('e:not(:nth-child(odd))', 'e[not(position() - 1 >= 0 and (position() - 1) mod 2 = 0)]'),
126+
array('e:nOT(*)', 'e[0]'),
127+
array('e f', 'e/descendant-or-self::*/f'),
128+
array('e > f', 'e/f'),
129129
array('e + f', "e/following-sibling::*[name() = 'f' and (position() = 1)]"),
130-
array('e ~ f', "e/following-sibling::f"),
130+
array('e ~ f', 'e/following-sibling::f'),
131131
array('div#container p', "div[@id = 'container']/descendant-or-self::*/p"),
132132
);
133133
}

XPath/Extension/HtmlExtension.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@ public function translateLink(XPathExpr $xpath)
9898
public function translateDisabled(XPathExpr $xpath)
9999
{
100100
return $xpath->addCondition(
101-
"("
102-
."@disabled and"
103-
."("
101+
'('
102+
.'@disabled and'
103+
.'('
104104
."(name(.) = 'input' and @type != 'hidden')"
105105
." or name(.) = 'button'"
106106
." or name(.) = 'select'"
@@ -109,14 +109,14 @@ public function translateDisabled(XPathExpr $xpath)
109109
." or name(.) = 'fieldset'"
110110
." or name(.) = 'optgroup'"
111111
." or name(.) = 'option'"
112-
.")"
113-
.") or ("
112+
.')'
113+
.') or ('
114114
."(name(.) = 'input' and @type != 'hidden')"
115115
." or name(.) = 'button'"
116116
." or name(.) = 'select'"
117117
." or name(.) = 'textarea'"
118-
.")"
119-
." and ancestor::fieldset[@disabled]"
118+
.')'
119+
.' and ancestor::fieldset[@disabled]'
120120
);
121121
// todo: in the second half, add "and is not a descendant of that fieldset element's first legend element child, if any."
122122
}
@@ -150,10 +150,10 @@ public function translateEnabled(XPathExpr $xpath)
150150
." or name(.) = 'textarea'"
151151
." or name(.) = 'keygen'"
152152
.')'
153-
." and not (@disabled or ancestor::fieldset[@disabled])"
153+
.' and not (@disabled or ancestor::fieldset[@disabled])'
154154
.') or ('
155155
."name(.) = 'option' and not("
156-
."@disabled or ancestor::optgroup[@disabled]"
156+
.'@disabled or ancestor::optgroup[@disabled]'
157157
.')'
158158
.')'
159159
);

0 commit comments

Comments
 (0)