Skip to content

Commit d96597d

Browse files
authored
[CLEANUP] Autoformat the code (#1401)
This avoids unrelated formatting changes when upcoming changes are introduced (where the code should be in an autoformatted state).
1 parent 573cc98 commit d96597d

File tree

3 files changed

+43
-43
lines changed

3 files changed

+43
-43
lines changed

src/Css/CssDocument.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function __construct(string $css, bool $debug)
6363
private function hasNestedAtRule(string $css): bool
6464
{
6565
return (new Preg())
66-
->match('/@(?:media|supports|(?:-webkit-|-moz-|-ms-|-o-)?+(keyframes|document))\\b/', $css) !== 0;
66+
->match('/@(?:media|supports|(?:-webkit-|-moz-|-ms-|-o-)?+(keyframes|document))\\b/', $css) !== 0;
6767
}
6868

6969
/**

tests/Support/Traits/CssDataProviders.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,19 @@ public function provideEquivalentCompleteCss(): array
2929
{
3030
$datasetsWithAtMediaRuleSelectorListAndPropertyDeclaration = self::crossDatasetWithItself([
3131
'unminified CSS with `@media` rule, selector list, and property declaration'
32-
=> ['@media screen { html, body { color: green; } }'],
32+
=> ['@media screen { html, body { color: green; } }'],
3333
'minified CSS with `@media` rule, selector list, and property declaration'
34-
=> ['@media screen{html,body{color:green}}'],
34+
=> ['@media screen{html,body{color:green}}'],
3535
'CSS with `@media` rule, selector list, and property declaration, with extra spaces'
36-
=> [' @media screen { html , body { color : green ; } } '],
36+
=> [' @media screen { html , body { color : green ; } } '],
3737
'CSS with `@media` rule, selector list, and property declaration, with linefeeds'
38-
=> ["\n@media\nscreen\n{\nhtml\n,\nbody\n{\ncolor\n:\ngreen\n;\n}\n}\n"],
38+
=> ["\n@media\nscreen\n{\nhtml\n,\nbody\n{\ncolor\n:\ngreen\n;\n}\n}\n"],
3939
'CSS with `@media` rule, selector list, and property declaration, with Windows line endings'
40-
=> ["\r\n@media\r\nscreen\r\n{\r\nhtml\r\n,\r\nbody\r\n{\r\ncolor\r\n:\r\ngreen\r\n;\r\n}\r\n}\r\n"],
40+
=> ["\r\n@media\r\nscreen\r\n{\r\nhtml\r\n,\r\nbody\r\n{\r\ncolor\r\n:\r\ngreen\r\n;\r\n}\r\n}\r\n"],
4141
'CSS with `@media` rule, selector list, and property declaration, with uppercase at-rule name'
42-
=> ['@MEDIA screen { html, body { color: green; } }'],
42+
=> ['@MEDIA screen { html, body { color: green; } }'],
4343
'CSS with `@media` rule, selector list, and property declaration, with mixed-case at-rule name'
44-
=> ['@MeDiA screen { html, body { color: green; } }'],
44+
=> ['@MeDiA screen { html, body { color: green; } }'],
4545
]);
4646

4747
$datasetsWithUrlPropertyValue = self::crossDatasetWithItself([
@@ -53,7 +53,7 @@ public function provideEquivalentCompleteCss(): array
5353
'CSS with single-quoted string in property value' => ['.new::before { content: \'New Entry! \'; }'],
5454
'CSS with double-quoted string in property value' => ['.new::before { content: "New Entry! "; }'],
5555
'CSS with quoted string in property value without trailing semicolon'
56-
=> ['.new::before { content: "New Entry! " }'],
56+
=> ['.new::before { content: "New Entry! " }'],
5757
'minified CSS with quoted string in property value' => ['.new::before{content:"New Entry! "}'],
5858
]);
5959

tests/Unit/HtmlProcessor/AbstractHtmlProcessorTest.php

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -224,9 +224,9 @@ public function provideHtmlWithOptionalTagsOmitted(): array
224224
// broken: OPTGROUP end tag omission with OPTGROUP element following
225225
'OPTGROUP end tag omission at end of list' => [
226226
'<select><optgroup><option> 1 </option><option> 2 </option></optgroup>'
227-
. '<optgroup><option> A </option><option> B </option></select>',
227+
. '<optgroup><option> A </option><option> B </option></select>',
228228
'<select><optgroup><option> 1 </option><option> 2 </option></optgroup>'
229-
. '<optgroup><option> A </option><option> B </option></optgroup></select>',
229+
. '<optgroup><option> A </option><option> B </option></optgroup></select>',
230230
],
231231
'OPTION end tag omission with OPTION element following' => [
232232
'<select><option> 1 <option> 2 </option></select>',
@@ -432,9 +432,9 @@ public function provideContentWithoutHtmlTag(): array
432432
'BODY element with Content-Type in text' => ['<body>Content-Type</body>'],
433433
'body content only with Content-Type in text' => ['<p>Content-Type</p>'],
434434
'BODY element containing Content-Type META tag'
435-
=> ['<body><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></body>'],
435+
=> ['<body><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></body>'],
436436
'body content only with Content-Type META tag'
437-
=> ['<p>hello</p><meta http-equiv="Content-Type" content="text/html; charset=utf-8">'],
437+
=> ['<p>hello</p><meta http-equiv="Content-Type" content="text/html; charset=utf-8">'],
438438
];
439439
}
440440

@@ -535,22 +535,22 @@ public function provideContentWithoutHeadTag(): array
535535
'BODY element' => ['<body></body>'],
536536
'HEADER element' => ['<header></header>'],
537537
'http-equiv META element (implicit HEAD)'
538-
=> ['<meta http-equiv="Content-Type" content="text/html; charset=utf-8">'],
538+
=> ['<meta http-equiv="Content-Type" content="text/html; charset=utf-8">'],
539539
'viewport META element (implicit HEAD)'
540-
=> ['<meta name="viewport" content="width=device-width, initial-scale=1.0">'],
540+
=> ['<meta name="viewport" content="width=device-width, initial-scale=1.0">'],
541541
'META element with Content-Type as a value' => ['<meta name="description" content="Content-Type">'],
542542
'BODY element with Content-Type in text' => ['<body>Content-Type</body>'],
543543
'body content only with Content-Type in text' => ['<p>Content-Type</p>'],
544544
'http-equiv META element within BODY (not allowed)'
545-
=> ['<body><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></body>'],
545+
=> ['<body><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></body>'],
546546
'http-equiv META element after P (implicit BODY, not allowed)'
547-
=> ['<p>hello</p><meta http-equiv="Content-Type" content="text/html; charset=utf-8">'],
547+
=> ['<p>hello</p><meta http-equiv="Content-Type" content="text/html; charset=utf-8">'],
548548
'http-equiv META element within P (not allowed)'
549-
=> ['<p><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></p>'],
549+
=> ['<p><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></p>'],
550550
'viewport META element within P (allowed)'
551-
=> ['<p><meta name="viewport" content="width=device-width, initial-scale=1.0"></p>'],
551+
=> ['<p><meta name="viewport" content="width=device-width, initial-scale=1.0"></p>'],
552552
'http-equiv META element within HEADER (not allowed)'
553-
=> ['<header><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></header>'],
553+
=> ['<header><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></header>'],
554554
];
555555
}
556556

@@ -585,21 +585,21 @@ public function provideContentWithHeadTag(): array
585585
'HEAD element and HEADER element' => ['<head></head><header></header>'],
586586
'HEAD element with Content-Type in comment' => ['<head><!-- Content-Type --></head>'],
587587
'HEAD element with Content-Type as META value'
588-
=> ['<head><meta name="description" content="Content-Type"></head>'],
588+
=> ['<head><meta name="description" content="Content-Type"></head>'],
589589
'with BODY element with Content-Type in text' => ['<head></head><body>Content-Type</body>'],
590590
'with implicit body content with Content-Type in text' => ['<head></head><p>Content-Type</p>'],
591591
'with BODY element containing Content-Type META tag'
592-
=> ['<head></head><body><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></body>'],
592+
=> ['<head></head><body><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></body>'],
593593
'with implicit body content with Content-Type META tag'
594-
=> ['<head></head><p>hello</p><meta http-equiv="Content-Type" content="text/html; charset=utf-8">'],
594+
=> ['<head></head><p>hello</p><meta http-equiv="Content-Type" content="text/html; charset=utf-8">'],
595595
'with end tag omitted and BODY element containing Content-Type META tag'
596-
=> ['<head><body><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></body>'],
596+
=> ['<head><body><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></body>'],
597597
'with end tag omitted and implicit body content with Content-Type META tag'
598-
=> ['<head><p>hello</p><meta http-equiv="Content-Type" content="text/html; charset=utf-8">'],
598+
=> ['<head><p>hello</p><meta http-equiv="Content-Type" content="text/html; charset=utf-8">'],
599599
'with Content-Type META tag after end tag'
600-
=> ['<head></head><meta http-equiv="Content-Type" content="text/html; charset=utf-8">'],
600+
=> ['<head></head><meta http-equiv="Content-Type" content="text/html; charset=utf-8">'],
601601
'with Content-Type META tag after uppercase end tag'
602-
=> ['<HEAD></HEAD><meta http-equiv="Content-Type" content="text/html; charset=utf-8">'],
602+
=> ['<HEAD></HEAD><meta http-equiv="Content-Type" content="text/html; charset=utf-8">'],
603603
];
604604
}
605605

@@ -766,15 +766,15 @@ public function normalizedDocumentTypeDataProvider(): array
766766
'HTML5, extra whitespace' => ['<!DOCTYPE html >', '<!DOCTYPE html>'],
767767
'HTML 4 transitional, uppercase' => [
768768
'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" '
769-
. '"http://www.w3.org/TR/REC-html40/loose.dtd">',
769+
. '"http://www.w3.org/TR/REC-html40/loose.dtd">',
770770
'<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" '
771-
. '"http://www.w3.org/TR/REC-html40/loose.dtd">',
771+
. '"http://www.w3.org/TR/REC-html40/loose.dtd">',
772772
],
773773
'HTML 4 transitional, lowercase' => [
774774
'<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" '
775-
. '"http://www.w3.org/TR/REC-html40/loose.dtd">',
775+
. '"http://www.w3.org/TR/REC-html40/loose.dtd">',
776776
'<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" '
777-
. '"http://www.w3.org/TR/REC-html40/loose.dtd">',
777+
. '"http://www.w3.org/TR/REC-html40/loose.dtd">',
778778
],
779779
];
780780
}
@@ -806,13 +806,13 @@ public function provideMalformedContentTypeMetaTag(): array
806806
'extra character before META' => ['<xmeta http-equiv="Content-Type" content="text/html; charset=utf-8">'],
807807
'extra character after META' => ['<metax http-equiv="Content-Type" content="text/html; charset=utf-8">'],
808808
'extra character before HTTP-EQUIV'
809-
=> ['<meta xhttp-equiv="Content-Type" content="text/html; charset=utf-8">'],
809+
=> ['<meta xhttp-equiv="Content-Type" content="text/html; charset=utf-8">'],
810810
'extra character after HTTP-EQUIV'
811-
=> ['<meta http-equivx="Content-Type" content="text/html; charset=utf-8">'],
811+
=> ['<meta http-equivx="Content-Type" content="text/html; charset=utf-8">'],
812812
'extra character before CONTENT-TYPE'
813-
=> ['<meta http-equiv=xContent-Type content="text/html; charset=utf-8">'],
813+
=> ['<meta http-equiv=xContent-Type content="text/html; charset=utf-8">'],
814814
'extra character after CONTENT-TYPE'
815-
=> ['<meta http-equiv=Content-Typex content="text/html; charset=utf-8">'],
815+
=> ['<meta http-equiv=Content-Typex content="text/html; charset=utf-8">'],
816816
];
817817
}
818818

@@ -854,7 +854,7 @@ public function provideContentTypeMetaTag(): array
854854
return [
855855
'double-quoted attribute values' => ['<meta http-equiv="Content-Type" content="text/html; charset=utf-8">'],
856856
'single-quoted attribute values'
857-
=> ['<meta http-equiv=\'Content-Type\' content=\'text/html; charset=utf-8\'>'],
857+
=> ['<meta http-equiv=\'Content-Type\' content=\'text/html; charset=utf-8\'>'],
858858
'unquoted attribute values' => ['<meta http-equiv=Content-Type content=text/html;charset=utf-8>'],
859859
'reverse order attributes' => ['<meta content="text/html; charset=utf-8" http-equiv="Content-Type">'],
860860
'without charset' => ['<meta http-equiv="Content-Type" content="text/html">'],
@@ -887,23 +887,23 @@ public function provideHtmlAroundContentType(): array
887887
'HEAD element with TAB after start tag' => ["<head>\t", '</head>'],
888888
'HEAD element with attribute' => ['<head lang="en">', '</head>'],
889889
'HTML, HEAD, and BODY with HEADER elements'
890-
=> ['<html><head>', '</head><body><header></header></body></html>'],
890+
=> ['<html><head>', '</head><body><header></header></body></html>'],
891891
'HEAD element with comment' => ['<head><!--Test-->', '</head>'],
892892
'HEAD element with commented-out BODY start tag' => ['<head><!--<body>-->', '</head>'],
893893
'HEAD element with BASE element' => ['<head><base href="https://example.com"/>', '</head>'],
894894
'HEAD element with COMMAND element' => ['<head><command type="command"/>', '</head>'],
895895
'HEAD element with LINK element'
896-
=> ['<head><link rel="stylesheet" href="https://example.org/css.css"/>', '</head>'],
896+
=> ['<head><link rel="stylesheet" href="https://example.org/css.css"/>', '</head>'],
897897
'HEAD element with another META element' => ['<head><meta name="title" content="Test"/>', '</head>'],
898898
'HEAD element with NOSCRIPT element'
899-
=> ['<head><noscript><style>p{color:green}</style></noscript>', '</head>'],
899+
=> ['<head><noscript><style>p{color:green}</style></noscript>', '</head>'],
900900
'HEAD element with SCRIPT element' => ['<head><script>console.log("Test");</script>', '</head>'],
901901
'HEAD element with STYLE element' => ['<head><style>p{color:green}</style>', '</head>'],
902902
'HEAD element with TEMPLATE element'
903-
=> ['<head><template id="test"><p>Test</p></template></title>', '</head>'],
903+
=> ['<head><template id="test"><p>Test</p></template></title>', '</head>'],
904904
'HEAD element with TITLE element' => ['<head><title>Test</title>', '</head>'],
905905
'HEAD element with uppercase TEMPLATE element'
906-
=> ['<head><TEMPLATE id="test"><p>Test</p></TEMPLATE></title>', '</head>'],
906+
=> ['<head><TEMPLATE id="test"><p>Test</p></TEMPLATE></title>', '</head>'],
907907
'HEAD element with uppercase TITLE element' => ['<head><TITLE>Test</TITLE>', '</head>'],
908908
'Second valid(ish) Content-Type in BODY' => [
909909
'<head>',
@@ -1260,8 +1260,8 @@ private static function assertContainsHtml(string $needle, string $haystack, str
12601260
$needleMatcher = \preg_quote($needle, '%');
12611261
$needleMatcherWithNewlines = (new Preg())->replace(
12621262
'%\\\\<(?:body|ul|dl|optgroup|table|tr|hr'
1263-
. '|/(?:li|dd|dt|option|optgroup|caption|colgroup|thead|tbody|tfoot|tr|td|th'
1264-
. '|p|dl|h[1-6]|menu|ol|pre|table|ul|address|blockquote|div|fieldset|form))\\\\>%',
1263+
. '|/(?:li|dd|dt|option|optgroup|caption|colgroup|thead|tbody|tfoot|tr|td|th'
1264+
. '|p|dl|h[1-6]|menu|ol|pre|table|ul|address|blockquote|div|fieldset|form))\\\\>%',
12651265
'$0\\n?+',
12661266
$needleMatcher
12671267
);

0 commit comments

Comments
 (0)