Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CLEANUP] Autoformat the code #440

Merged
merged 1 commit into from
Feb 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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