diff --git a/src/CSSList/CSSBlockList.php b/src/CSSList/CSSBlockList.php index bb5ff83a..76216279 100644 --- a/src/CSSList/CSSBlockList.php +++ b/src/CSSList/CSSBlockList.php @@ -20,14 +20,6 @@ */ abstract class CSSBlockList extends CSSList { - /** - * @param int<0, max> $lineNumber - */ - public function __construct($lineNumber = 0) - { - parent::__construct($lineNumber); - } - /** * @param array $result */ diff --git a/src/CSSList/CSSList.php b/src/CSSList/CSSList.php index 5e7cf294..e7acc842 100644 --- a/src/CSSList/CSSList.php +++ b/src/CSSList/CSSList.php @@ -38,14 +38,14 @@ abstract class CSSList implements Renderable, Commentable * * @internal since 8.8.0 */ - protected $comments; + protected $comments = []; /** * @var array * * @internal since 8.8.0 */ - protected $contents; + protected $contents = []; /** * @var int<0, max> @@ -59,8 +59,6 @@ abstract class CSSList implements Renderable, Commentable */ public function __construct($lineNumber = 0) { - $this->comments = []; - $this->contents = []; $this->lineNumber = $lineNumber; } diff --git a/src/CSSList/Document.php b/src/CSSList/Document.php index 5f073072..87595caa 100644 --- a/src/CSSList/Document.php +++ b/src/CSSList/Document.php @@ -18,14 +18,6 @@ */ class Document extends CSSBlockList { - /** - * @param int<0, max> $lineNumber - */ - public function __construct($lineNumber = 0) - { - parent::__construct($lineNumber); - } - /** * @throws SourceException * diff --git a/src/CSSList/KeyFrame.php b/src/CSSList/KeyFrame.php index 4ab558c6..1fce204b 100644 --- a/src/CSSList/KeyFrame.php +++ b/src/CSSList/KeyFrame.php @@ -19,16 +19,6 @@ class KeyFrame extends CSSList implements AtRule */ private $animationName; - /** - * @param int<0, max> $lineNumber - */ - public function __construct($lineNumber = 0) - { - parent::__construct($lineNumber); - $this->vendorKeyFrame = null; - $this->animationName = null; - } - /** * @param string $vendorKeyFrame */ diff --git a/src/OutputFormat.php b/src/OutputFormat.php index 98f394b0..7f3786be 100644 --- a/src/OutputFormat.php +++ b/src/OutputFormat.php @@ -217,12 +217,12 @@ class OutputFormat /** * @var OutputFormatter|null */ - private $oFormatter = null; + private $oFormatter; /** * @var OutputFormat|null */ - private $oNextLevelFormat = null; + private $oNextLevelFormat; /** * @var int diff --git a/src/Parsing/ParserState.php b/src/Parsing/ParserState.php index 4f98c0ed..10187617 100644 --- a/src/Parsing/ParserState.php +++ b/src/Parsing/ParserState.php @@ -37,7 +37,7 @@ class ParserState /** * @var int */ - private $iCurrentPosition; + private $iCurrentPosition = 0; /** * will only be used if the CSS does not contain an `@charset` declaration @@ -64,7 +64,6 @@ public function __construct($sText, Settings $oParserSettings, $lineNumber = 1) { $this->oParserSettings = $oParserSettings; $this->sText = $sText; - $this->iCurrentPosition = 0; $this->lineNumber = $lineNumber; $this->setCharset($this->oParserSettings->sDefaultCharset); } diff --git a/src/Property/CSSNamespace.php b/src/Property/CSSNamespace.php index eed63782..81f24e34 100644 --- a/src/Property/CSSNamespace.php +++ b/src/Property/CSSNamespace.php @@ -32,7 +32,7 @@ class CSSNamespace implements AtRule * * @internal since 8.8.0 */ - protected $comments; + protected $comments = []; /** * @param string $mUrl @@ -44,7 +44,6 @@ public function __construct($mUrl, $prefix = null, $lineNumber = 0) $this->mUrl = $mUrl; $this->prefix = $prefix; $this->lineNumber = $lineNumber; - $this->comments = []; } /** diff --git a/src/Property/Charset.php b/src/Property/Charset.php index 387f92d1..9addf369 100644 --- a/src/Property/Charset.php +++ b/src/Property/Charset.php @@ -35,7 +35,7 @@ class Charset implements AtRule * * @internal since 8.8.0 */ - protected $comments; + protected $comments = []; /** * @param int<0, max> $lineNumber @@ -44,7 +44,6 @@ public function __construct(CSSString $oCharset, $lineNumber = 0) { $this->oCharset = $oCharset; $this->lineNumber = $lineNumber; - $this->comments = []; } /** diff --git a/src/Property/Import.php b/src/Property/Import.php index 62dcb2b4..bc97d949 100644 --- a/src/Property/Import.php +++ b/src/Property/Import.php @@ -35,7 +35,7 @@ class Import implements AtRule * * @internal since 8.8.0 */ - protected $comments; + protected $comments = []; /** * @param string $mediaQuery @@ -46,7 +46,6 @@ public function __construct(URL $location, $mediaQuery, $lineNumber = 0) $this->location = $location; $this->mediaQuery = $mediaQuery; $this->lineNumber = $lineNumber; - $this->comments = []; } /** diff --git a/src/Rule/Rule.php b/src/Rule/Rule.php index 014a5030..a2cbbb86 100644 --- a/src/Rule/Rule.php +++ b/src/Rule/Rule.php @@ -34,12 +34,12 @@ class Rule implements Renderable, Commentable /** * @var bool */ - private $bIsImportant; + private $bIsImportant = false; /** * @var array */ - private $aIeHack; + private $aIeHack = []; /** * @var int @@ -58,7 +58,7 @@ class Rule implements Renderable, Commentable * * @internal since 8.8.0 */ - protected $comments; + protected $comments = []; /** * @param string $sRule @@ -68,12 +68,8 @@ class Rule implements Renderable, Commentable public function __construct($sRule, $lineNumber = 0, $iColNo = 0) { $this->sRule = $sRule; - $this->mValue = null; - $this->bIsImportant = false; - $this->aIeHack = []; $this->lineNumber = $lineNumber; $this->iColNo = $iColNo; - $this->comments = []; } /** diff --git a/src/RuleSet/DeclarationBlock.php b/src/RuleSet/DeclarationBlock.php index 11e1982d..a39eaaa8 100644 --- a/src/RuleSet/DeclarationBlock.php +++ b/src/RuleSet/DeclarationBlock.php @@ -27,16 +27,7 @@ class DeclarationBlock extends RuleSet /** * @var array */ - private $aSelectors; - - /** - * @param int<0, max> $lineNumber - */ - public function __construct($lineNumber = 0) - { - parent::__construct($lineNumber); - $this->aSelectors = []; - } + private $aSelectors = []; /** * @param CSSList|null $list diff --git a/src/RuleSet/RuleSet.php b/src/RuleSet/RuleSet.php index 231f3365..bb40bd23 100644 --- a/src/RuleSet/RuleSet.php +++ b/src/RuleSet/RuleSet.php @@ -27,7 +27,7 @@ abstract class RuleSet implements Renderable, Commentable /** * @var array */ - private $aRules; + private $aRules = []; /** * @var int<0, max> @@ -41,16 +41,14 @@ abstract class RuleSet implements Renderable, Commentable * * @internal since 8.8.0 */ - protected $comments; + protected $comments = []; /** * @param int<0, max> $lineNumber */ public function __construct($lineNumber = 0) { - $this->aRules = []; $this->lineNumber = $lineNumber; - $this->comments = []; } /** diff --git a/src/Value/PrimitiveValue.php b/src/Value/PrimitiveValue.php index 42728c73..f7f94092 100644 --- a/src/Value/PrimitiveValue.php +++ b/src/Value/PrimitiveValue.php @@ -4,13 +4,4 @@ namespace Sabberworm\CSS\Value; -abstract class PrimitiveValue extends Value -{ - /** - * @param int<0, max> $lineNumber - */ - public function __construct($lineNumber = 0) - { - parent::__construct($lineNumber); - } -} +abstract class PrimitiveValue extends Value {}