Skip to content
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
8 changes: 0 additions & 8 deletions src/CSSList/CSSBlockList.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,6 @@
*/
abstract class CSSBlockList extends CSSList
{
/**
* @param int<0, max> $lineNumber
*/
public function __construct($lineNumber = 0)
{
parent::__construct($lineNumber);
}

/**
* @param array<int, DeclarationBlock> $result
*/
Expand Down
6 changes: 2 additions & 4 deletions src/CSSList/CSSList.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ abstract class CSSList implements Renderable, Commentable
*
* @internal since 8.8.0
*/
protected $comments;
protected $comments = [];

/**
* @var array<int, RuleSet|CSSList|Import|Charset>
*
* @internal since 8.8.0
*/
protected $contents;
protected $contents = [];

/**
* @var int<0, max>
Expand All @@ -59,8 +59,6 @@ abstract class CSSList implements Renderable, Commentable
*/
public function __construct($lineNumber = 0)
{
$this->comments = [];
$this->contents = [];
$this->lineNumber = $lineNumber;
}

Expand Down
8 changes: 0 additions & 8 deletions src/CSSList/Document.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,6 @@
*/
class Document extends CSSBlockList
{
/**
* @param int<0, max> $lineNumber
*/
public function __construct($lineNumber = 0)
{
parent::__construct($lineNumber);
}

/**
* @throws SourceException
*
Expand Down
10 changes: 0 additions & 10 deletions src/CSSList/KeyFrame.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
4 changes: 2 additions & 2 deletions src/OutputFormat.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,12 +217,12 @@ class OutputFormat
/**
* @var OutputFormatter|null
*/
private $oFormatter = null;
private $oFormatter;

/**
* @var OutputFormat|null
*/
private $oNextLevelFormat = null;
private $oNextLevelFormat;

/**
* @var int
Expand Down
3 changes: 1 addition & 2 deletions src/Parsing/ParserState.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
}
Expand Down
3 changes: 1 addition & 2 deletions src/Property/CSSNamespace.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class CSSNamespace implements AtRule
*
* @internal since 8.8.0
*/
protected $comments;
protected $comments = [];

/**
* @param string $mUrl
Expand All @@ -44,7 +44,6 @@ public function __construct($mUrl, $prefix = null, $lineNumber = 0)
$this->mUrl = $mUrl;
$this->prefix = $prefix;
$this->lineNumber = $lineNumber;
$this->comments = [];
}

/**
Expand Down
3 changes: 1 addition & 2 deletions src/Property/Charset.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class Charset implements AtRule
*
* @internal since 8.8.0
*/
protected $comments;
protected $comments = [];

/**
* @param int<0, max> $lineNumber
Expand All @@ -44,7 +44,6 @@ public function __construct(CSSString $oCharset, $lineNumber = 0)
{
$this->oCharset = $oCharset;
$this->lineNumber = $lineNumber;
$this->comments = [];
}

/**
Expand Down
3 changes: 1 addition & 2 deletions src/Property/Import.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class Import implements AtRule
*
* @internal since 8.8.0
*/
protected $comments;
protected $comments = [];

/**
* @param string $mediaQuery
Expand All @@ -46,7 +46,6 @@ public function __construct(URL $location, $mediaQuery, $lineNumber = 0)
$this->location = $location;
$this->mediaQuery = $mediaQuery;
$this->lineNumber = $lineNumber;
$this->comments = [];
}

/**
Expand Down
10 changes: 3 additions & 7 deletions src/Rule/Rule.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ class Rule implements Renderable, Commentable
/**
* @var bool
*/
private $bIsImportant;
private $bIsImportant = false;

/**
* @var array<int, int>
*/
private $aIeHack;
private $aIeHack = [];

/**
* @var int
Expand All @@ -58,7 +58,7 @@ class Rule implements Renderable, Commentable
*
* @internal since 8.8.0
*/
protected $comments;
protected $comments = [];

/**
* @param string $sRule
Expand All @@ -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 = [];
}

/**
Expand Down
11 changes: 1 addition & 10 deletions src/RuleSet/DeclarationBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,7 @@ class DeclarationBlock extends RuleSet
/**
* @var array<int, Selector|string>
*/
private $aSelectors;

/**
* @param int<0, max> $lineNumber
*/
public function __construct($lineNumber = 0)
{
parent::__construct($lineNumber);
$this->aSelectors = [];
}
private $aSelectors = [];

/**
* @param CSSList|null $list
Expand Down
6 changes: 2 additions & 4 deletions src/RuleSet/RuleSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ abstract class RuleSet implements Renderable, Commentable
/**
* @var array<string, Rule>
*/
private $aRules;
private $aRules = [];

/**
* @var int<0, max>
Expand All @@ -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 = [];
}

/**
Expand Down
11 changes: 1 addition & 10 deletions src/Value/PrimitiveValue.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}