Skip to content

[CLEANUP] Autoformat the code and drop unused imports #1228

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

Merged
merged 1 commit into from
Mar 31, 2025
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: 0 additions & 1 deletion src/CSSList/CSSList.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
use Sabberworm\CSS\Property\CSSNamespace;
use Sabberworm\CSS\Property\Import;
use Sabberworm\CSS\Property\Selector;
use Sabberworm\CSS\Renderable;
use Sabberworm\CSS\RuleSet\AtRuleSet;
use Sabberworm\CSS\RuleSet\DeclarationBlock;
use Sabberworm\CSS\RuleSet\RuleSet;
Expand Down
8 changes: 4 additions & 4 deletions src/Position/Positionable.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ interface Positionable
public function getLineNumber(): ?int;

/**
* @deprecated in version 9.0.0, will be removed in v10.0. Use `getLineNumber()` instead.
*
* @return int<0, max>
*
* @deprecated in version 9.0.0, will be removed in v10.0. Use `getLineNumber()` instead.
*/
public function getLineNo(): int;

Expand All @@ -29,9 +29,9 @@ public function getLineNo(): int;
public function getColumnNumber(): ?int;

/**
* @deprecated in version 9.0.0, will be removed in v10.0. Use `getColumnNumber()` instead.
*
* @return int<0, max>
*
* @deprecated in version 9.0.0, will be removed in v10.0. Use `getColumnNumber()` instead.
*/
public function getColNo(): int;

Expand Down
2 changes: 0 additions & 2 deletions src/Property/AtRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@

namespace Sabberworm\CSS\Property;

use Sabberworm\CSS\Comment\Commentable;
use Sabberworm\CSS\CSSList\CSSListItem;
use Sabberworm\CSS\Renderable;

/**
* Note that `CSSListItem` extends both `Commentable` and `Renderable`,
Expand Down
1 change: 0 additions & 1 deletion src/RuleSet/RuleSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
use Sabberworm\CSS\Parsing\ParserState;
use Sabberworm\CSS\Parsing\UnexpectedEOFException;
use Sabberworm\CSS\Parsing\UnexpectedTokenException;
use Sabberworm\CSS\Renderable;
use Sabberworm\CSS\Rule\Rule;

/**
Expand Down
14 changes: 7 additions & 7 deletions tests/ParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -980,20 +980,20 @@ public function lineNumbersParsing(): void
// So a more explicit type check is required.
// TODO: tidy this up when an interface with `getLineNo()` is added.
if (
!$contentItem instanceof Charset &&
!$contentItem instanceof CSSList &&
!$contentItem instanceof CSSNamespace &&
!$contentItem instanceof Import &&
!$contentItem instanceof RuleSet
!$contentItem instanceof Charset
&& !$contentItem instanceof CSSList
&& !$contentItem instanceof CSSNamespace
&& !$contentItem instanceof Import
&& !$contentItem instanceof RuleSet
) {
self::fail('Content item is not of an expected type. It\'s a `' . \get_class($contentItem) . '`.');
}
$actual[$contentItem->getLineNo()] = [\get_class($contentItem)];
if ($contentItem instanceof KeyFrame) {
foreach ($contentItem->getContents() as $block) {
if (
!$block instanceof CSSList &&
!$block instanceof RuleSet
!$block instanceof CSSList
&& !$block instanceof RuleSet
) {
self::fail(
'KeyFrame content item is not of an expected type. It\'s a `' . \get_class($block) . '`.'
Expand Down
20 changes: 12 additions & 8 deletions tests/Unit/Comment/CommentContainerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,12 @@ public function provideCommentArray(): array
return [
'no comment' => [[]],
'one comment' => [[new Comment('Is this really a spoon?')]],
'two comments' => [[
new Comment('I’m a teapot.'),
new Comment('I’m a cafetière.'),
]],
'two comments' => [
[
new Comment('I’m a teapot.'),
new Comment('I’m a cafetière.'),
],
],
];
}

Expand Down Expand Up @@ -87,10 +89,12 @@ public function provideAlternativeCommentArray(): array
return [
'no comment' => [[]],
'one comment' => [[new Comment('Can I eat it with my hands?')]],
'two comments' => [[
new Comment('I’m a beer barrel.'),
new Comment('I’m a vineyard.'),
]],
'two comments' => [
[
new Comment('I’m a beer barrel.'),
new Comment('I’m a vineyard.'),
],
],
];
}

Expand Down