Skip to content

Commit

Permalink
[CLEANUP] Autoformat the code
Browse files Browse the repository at this point in the history
Autoformat the code with the default PhpStorm settings (and re-run
`composer fix:php` to minimize formatting-related changes when
code is changed and autoformatted.
  • Loading branch information
oliverklee committed Feb 3, 2024
1 parent d518539 commit 337a850
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
1 change: 1 addition & 0 deletions src/OutputFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ public function removeLastSemicolon($sString)
/**
*
* @param array<Commentable> $aComments
*
* @return string
*/
public function comments(Commentable $oCommentable)
Expand Down
6 changes: 3 additions & 3 deletions src/Value/Value.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ public static function parseValue(ParserState $oParserState, array $aListDelimit
//Build a list of delimiters and parsed values
while (
!($oParserState->comes('}') || $oParserState->comes(';') || $oParserState->comes('!')
|| $oParserState->comes(')')
|| $oParserState->comes('\\')
|| $oParserState->isEnd())
|| $oParserState->comes(')')
|| $oParserState->comes('\\')
|| $oParserState->isEnd())
) {
if (count($aStack) > 0) {
$bFoundDelimiter = false;
Expand Down
14 changes: 7 additions & 7 deletions tests/Comment/CommentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,11 @@ public function keepCommentsInOutput()
', $oCss->render(OutputFormat::createPretty()));
self::assertSame(
'/** Number 11 **//**' . "\n"
. ' * Comments' . "\n"
. ' *//* Hell */@import url("some/url.css") screen;'
. '/* Number 4 *//* Number 5 */.foo,#bar{'
. '/* Number 6 */background-color:#000;}@media screen{'
. '/** Number 10 **/#foo.bar{/** Number 10b **/position:absolute;}}',
. ' * Comments' . "\n"
. ' *//* Hell */@import url("some/url.css") screen;'
. '/* Number 4 *//* Number 5 */.foo,#bar{'
. '/* Number 6 */background-color:#000;}@media screen{'
. '/** Number 10 **/#foo.bar{/** Number 10b **/position:absolute;}}',
$oCss->render(OutputFormat::createCompact()->setRenderComments(true))
);
}
Expand All @@ -170,8 +170,8 @@ public function stripCommentsFromOutput()
', $oCss->render(OutputFormat::createPretty()->setRenderComments(false)));
self::assertSame(
'@import url("some/url.css") screen;'
. '.foo,#bar{background-color:#000;}'
. '@media screen{#foo.bar{position:absolute;}}',
. '.foo,#bar{background-color:#000;}'
. '@media screen{#foo.bar{position:absolute;}}',
$oCss->render(OutputFormat::createCompact())
);
}
Expand Down

0 comments on commit 337a850

Please sign in to comment.