Skip to content

Commit ef861cb

Browse files
Satisfy StyleCI
1 parent 510f779 commit ef861cb

File tree

2 files changed

+37
-31
lines changed

2 files changed

+37
-31
lines changed

src/Syllable.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -536,13 +536,13 @@ public function hyphenateHtmlText($html)
536536
{
537537
$charset = mb_detect_encoding($html);
538538
list($bodyContent, $beforeBodyContent, $afterBodyContent) = $this->parseHtmlText($html);
539-
$html = "<!DOCTYPE html PUBLIC '-//W3C//DTD HTML 4.0 Transitional//EN' 'http://www.w3.org/TR/REC-html40/loose.dtd'>" .
540-
"<html>" .
541-
"<head>" .
542-
"<meta http-equiv='content-type' content='text/html; charset=$charset'>" .
543-
"</head>" .
544-
"<body>$bodyContent</body>" .
545-
"</html>";
539+
$html = "<!DOCTYPE html PUBLIC '-//W3C//DTD HTML 4.0 Transitional//EN' 'http://www.w3.org/TR/REC-html40/loose.dtd'>".
540+
'<html>'.
541+
'<head>'.
542+
"<meta http-equiv='content-type' content='text/html; charset=$charset'>".
543+
'</head>'.
544+
"<body>$bodyContent</body>".
545+
'</html>';
546546

547547
$dom = new DOMDocument();
548548
$dom->resolveExternals = true;

tests/src/SyllableTest.php

Lines changed: 30 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -584,29 +584,29 @@ public function dataHyphenateHtmlText()
584584
'Ridicu-lous-ly <b class="unsplittable">com-pli-cat-ed</b> meta-text — with dash en-ti-ty.',
585585
],
586586
[
587-
'<html>' .
588-
'<body>' .
589-
'Ridiculously <b class="unsplittable">complicated</b> metatext — with dash entity.' .
590-
'</body>' .
587+
'<html>'.
588+
'<body>'.
589+
'Ridiculously <b class="unsplittable">complicated</b> metatext — with dash entity.'.
590+
'</body>'.
591591
'</html>',
592-
'<html>' .
593-
'<body>' .
594-
'Ridicu-lous-ly <b class="unsplittable">com-pli-cat-ed</b> meta-text — with dash en-ti-ty.' .
595-
'</body>' .
592+
'<html>'.
593+
'<body>'.
594+
'Ridicu-lous-ly <b class="unsplittable">com-pli-cat-ed</b> meta-text — with dash en-ti-ty.'.
595+
'</body>'.
596596
'</html>',
597597
],
598598
[
599-
'<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">' .
600-
'<html>' .
601-
'<body class="body-class">' .
602-
'Ridiculously <b class="unsplittable">complicated</b> metatext — with dash entity.' .
603-
'</body>' .
599+
'<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">'.
600+
'<html>'.
601+
'<body class="body-class">'.
602+
'Ridiculously <b class="unsplittable">complicated</b> metatext — with dash entity.'.
603+
'</body>'.
604604
'</html>',
605-
'<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">' .
606-
'<html>' .
607-
'<body class="body-class">' .
608-
'Ridicu-lous-ly <b class="unsplittable">com-pli-cat-ed</b> meta-text — with dash en-ti-ty.' .
609-
'</body>' .
605+
'<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">'.
606+
'<html>'.
607+
'<body class="body-class">'.
608+
'Ridicu-lous-ly <b class="unsplittable">com-pli-cat-ed</b> meta-text — with dash en-ti-ty.'.
609+
'</body>'.
610610
'</html>',
611611
],
612612
];
@@ -844,17 +844,23 @@ public function testUtf8Characters()
844844
$this->object->setHyphen('-');
845845

846846
$this->object->setLanguage('de');
847-
$this->assertEquals('Äu-ßerst kom-pli-zier-ter Me-ta-text.',
847+
$this->assertEquals(
848+
'Äu-ßerst kom-pli-zier-ter Me-ta-text.',
848849
$this->object->hyphenateText('Äußerst komplizierter Metatext.')
849850
);
850-
$this->assertEquals('Äu-ßerst <b class="unsplittable">kom-pli-zier-ter</b> Me-ta-text.',
851+
$this->assertEquals(
852+
'Äu-ßerst <b class="unsplittable">kom-pli-zier-ter</b> Me-ta-text.',
851853
$this->object->hyphenateHtmlText('Äußerst <b class="unsplittable">komplizierter</b> Metatext.')
852854
);
853855

854856
$this->object->setLanguage('uk');
855-
$this->assertEquals('Над-зви-чайно скла-дний ме-та-те-кст.',
856-
$this->object->hyphenateText('Надзвичайно складний метатекст.'));
857-
$this->assertEquals('Над-зви-чайно <b class="unsplittable">скла-дний</b> ме-та-те-кст.',
858-
$this->object->hyphenateHtmlText('Надзвичайно <b class="unsplittable">складний</b> метатекст.'));
857+
$this->assertEquals(
858+
'Над-зви-чайно скла-дний ме-та-те-кст.',
859+
$this->object->hyphenateText('Надзвичайно складний метатекст.')
860+
);
861+
$this->assertEquals(
862+
'Над-зви-чайно <b class="unsplittable">скла-дний</b> ме-та-те-кст.',
863+
$this->object->hyphenateHtmlText('Надзвичайно <b class="unsplittable">складний</b> метатекст.')
864+
);
859865
}
860866
}

0 commit comments

Comments
 (0)