From 05cca5264b35aee39e5ea2995b09302a1b238103 Mon Sep 17 00:00:00 2001 From: Oliver Klee Date: Sat, 19 Jun 2021 14:38:17 +0200 Subject: [PATCH] Fix more PSR-12 style issues --- src/Comment/Commentable.php | 1 - src/Property/KeyframeSelector.php | 1 - src/Property/Selector.php | 1 - src/Rule/Rule.php | 1 - src/RuleSet/RuleSet.php | 4 ++-- src/Value/CSSFunction.php | 1 - src/Value/CSSString.php | 1 - src/Value/Color.php | 1 - src/Value/Size.php | 1 - src/Value/URL.php | 1 - src/Value/ValueList.php | 1 - tests/CSSList/AtRuleBlockListTest.php | 1 - tests/CSSList/DocumentTest.php | 1 - tests/ParserTest.php | 1 - tests/RuleSet/DeclarationBlockTest.php | 1 - tests/RuleSet/LenientParsingTest.php | 1 - 16 files changed, 2 insertions(+), 17 deletions(-) diff --git a/src/Comment/Commentable.php b/src/Comment/Commentable.php index 8ecf8dcc..f9eb5e51 100644 --- a/src/Comment/Commentable.php +++ b/src/Comment/Commentable.php @@ -4,7 +4,6 @@ interface Commentable { - /** * @param array $aComments Array of comments. */ diff --git a/src/Property/KeyframeSelector.php b/src/Property/KeyframeSelector.php index e1a170ab..8d6b6e78 100644 --- a/src/Property/KeyframeSelector.php +++ b/src/Property/KeyframeSelector.php @@ -4,7 +4,6 @@ class KeyframeSelector extends Selector { - //Regexes for specificity calculations const SELECTOR_VALIDATION_RX = '/ diff --git a/src/Property/Selector.php b/src/Property/Selector.php index b79ecba6..d2459fb1 100644 --- a/src/Property/Selector.php +++ b/src/Property/Selector.php @@ -8,7 +8,6 @@ */ class Selector { - //Regexes for specificity calculations const NON_ID_ATTRIBUTES_AND_PSEUDO_CLASSES_RX = '/ (\.[\w]+) # classes diff --git a/src/Rule/Rule.php b/src/Rule/Rule.php index 3d20c18b..09873a6f 100644 --- a/src/Rule/Rule.php +++ b/src/Rule/Rule.php @@ -14,7 +14,6 @@ */ class Rule implements Renderable, Commentable { - private $sRule; private $mValue; diff --git a/src/RuleSet/RuleSet.php b/src/RuleSet/RuleSet.php index 70b3e8da..ff36ea1d 100644 --- a/src/RuleSet/RuleSet.php +++ b/src/RuleSet/RuleSet.php @@ -14,7 +14,6 @@ */ abstract class RuleSet implements Renderable, Commentable { - private $aRules; protected $iLineNo; @@ -128,7 +127,8 @@ public function getRules($mRule = null) // or the search rule ends in “-” and the found rule starts with the search rule. if ( !$mRule || $sName === $mRule - || (strrpos($mRule, '-') === strlen($mRule) - strlen('-') + || ( + strrpos($mRule, '-') === strlen($mRule) - strlen('-') && (strpos($sName, $mRule) === 0 || $sName === substr($mRule, 0, -1)) ) ) { diff --git a/src/Value/CSSFunction.php b/src/Value/CSSFunction.php index 041c555b..5688a93b 100644 --- a/src/Value/CSSFunction.php +++ b/src/Value/CSSFunction.php @@ -4,7 +4,6 @@ class CSSFunction extends ValueList { - protected $sName; /** diff --git a/src/Value/CSSString.php b/src/Value/CSSString.php index 6aedf2b0..de43bc23 100644 --- a/src/Value/CSSString.php +++ b/src/Value/CSSString.php @@ -7,7 +7,6 @@ class CSSString extends PrimitiveValue { - private $sString; public function __construct($sString, $iLineNo = 0) diff --git a/src/Value/Color.php b/src/Value/Color.php index f93983c3..0aa5c096 100644 --- a/src/Value/Color.php +++ b/src/Value/Color.php @@ -6,7 +6,6 @@ class Color extends CSSFunction { - public function __construct(array $aColor, $iLineNo = 0) { parent::__construct(implode('', array_keys($aColor)), $aColor, ',', $iLineNo); diff --git a/src/Value/Size.php b/src/Value/Size.php index 0afe2a71..ea6d717d 100644 --- a/src/Value/Size.php +++ b/src/Value/Size.php @@ -6,7 +6,6 @@ class Size extends PrimitiveValue { - /** * vh/vw/vm(ax)/vmin/rem are absolute insofar as they don’t scale to the immediate parent (only the viewport) * diff --git a/src/Value/URL.php b/src/Value/URL.php index aed5e274..c2a3a908 100644 --- a/src/Value/URL.php +++ b/src/Value/URL.php @@ -6,7 +6,6 @@ class URL extends PrimitiveValue { - private $oURL; public function __construct(CSSString $oURL, $iLineNo = 0) diff --git a/src/Value/ValueList.php b/src/Value/ValueList.php index 124b3a68..77197711 100644 --- a/src/Value/ValueList.php +++ b/src/Value/ValueList.php @@ -4,7 +4,6 @@ abstract class ValueList extends Value { - protected $aComponents; protected $sSeparator; diff --git a/tests/CSSList/AtRuleBlockListTest.php b/tests/CSSList/AtRuleBlockListTest.php index 673e4c61..e8662d88 100644 --- a/tests/CSSList/AtRuleBlockListTest.php +++ b/tests/CSSList/AtRuleBlockListTest.php @@ -6,7 +6,6 @@ class AtRuleBlockListTest extends \PHPUnit\Framework\TestCase { - public function testMediaQueries() { $sCss = '@media(min-width: 768px){.class{color:red}}'; diff --git a/tests/CSSList/DocumentTest.php b/tests/CSSList/DocumentTest.php index 425aa1f1..6c632f1d 100644 --- a/tests/CSSList/DocumentTest.php +++ b/tests/CSSList/DocumentTest.php @@ -6,7 +6,6 @@ class DocumentTest extends \PHPUnit\Framework\TestCase { - public function testOverrideContents() { $sCss = '.thing { left: 10px; }'; diff --git a/tests/ParserTest.php b/tests/ParserTest.php index bf40f410..fcfbccb2 100644 --- a/tests/ParserTest.php +++ b/tests/ParserTest.php @@ -19,7 +19,6 @@ class ParserTest extends \PHPUnit\Framework\TestCase { - public function testFiles() { $sDirectory = __DIR__ . '/fixtures'; diff --git a/tests/RuleSet/DeclarationBlockTest.php b/tests/RuleSet/DeclarationBlockTest.php index 32a0af32..1b2ce31c 100644 --- a/tests/RuleSet/DeclarationBlockTest.php +++ b/tests/RuleSet/DeclarationBlockTest.php @@ -8,7 +8,6 @@ class DeclarationBlockTest extends \PHPUnit\Framework\TestCase { - /** * @dataProvider expandBorderShorthandProvider * */ diff --git a/tests/RuleSet/LenientParsingTest.php b/tests/RuleSet/LenientParsingTest.php index 01f204f8..6eb8086c 100644 --- a/tests/RuleSet/LenientParsingTest.php +++ b/tests/RuleSet/LenientParsingTest.php @@ -7,7 +7,6 @@ class LenientParsingTest extends \PHPUnit\Framework\TestCase { - /** * @expectedException \Sabberworm\CSS\Parsing\UnexpectedTokenException */