Skip to content

Commit 6bd939d

Browse files
committed
[TASK] Use native types for all constructor parameters
Part of #811
1 parent 4322d97 commit 6bd939d

31 files changed

+31
-60
lines changed

src/CSSList/AtRuleBlockList.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,9 @@ class AtRuleBlockList extends CSSBlockList implements AtRule
2323
private $sArgs;
2424

2525
/**
26-
* @param string $type
27-
* @param string $arguments
2826
* @param int<0, max> $lineNumber
2927
*/
30-
public function __construct($type, $arguments = '', $lineNumber = 0)
28+
public function __construct(string $type, string $arguments = '', int $lineNumber = 0)
3129
{
3230
parent::__construct($lineNumber);
3331
$this->type = $type;

src/CSSList/CSSBlockList.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ abstract class CSSBlockList extends CSSList
2323
/**
2424
* @param int<0, max> $lineNumber
2525
*/
26-
public function __construct($lineNumber = 0)
26+
public function __construct(int $lineNumber = 0)
2727
{
2828
parent::__construct($lineNumber);
2929
}

src/CSSList/CSSList.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ abstract class CSSList implements Renderable, Commentable
5757
/**
5858
* @param int<0, max> $lineNumber
5959
*/
60-
public function __construct($lineNumber = 0)
60+
public function __construct(int $lineNumber = 0)
6161
{
6262
$this->comments = [];
6363
$this->contents = [];

src/CSSList/Document.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class Document extends CSSBlockList
2121
/**
2222
* @param int<0, max> $lineNumber
2323
*/
24-
public function __construct($lineNumber = 0)
24+
public function __construct(int $lineNumber = 0)
2525
{
2626
parent::__construct($lineNumber);
2727
}

src/CSSList/KeyFrame.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class KeyFrame extends CSSList implements AtRule
2222
/**
2323
* @param int<0, max> $lineNumber
2424
*/
25-
public function __construct($lineNumber = 0)
25+
public function __construct(int $lineNumber = 0)
2626
{
2727
parent::__construct($lineNumber);
2828
$this->vendorKeyFrame = null;

src/Comment/Comment.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,9 @@ class Comment implements Renderable
2424
protected $commentText;
2525

2626
/**
27-
* @param string $commentText
2827
* @param int<0, max> $lineNumber
2928
*/
30-
public function __construct($commentText = '', $lineNumber = 0)
29+
public function __construct(string $commentText = '', int $lineNumber = 0)
3130
{
3231
$this->commentText = $commentText;
3332
$this->lineNumber = $lineNumber;

src/Parser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class Parser
2222
* @param string $sText the complete CSS as text (i.e., usually the contents of a CSS file)
2323
* @param int<0, max> $lineNumber the line number (starting from 1, not from 0)
2424
*/
25-
public function __construct($sText, ?Settings $oParserSettings = null, $lineNumber = 1)
25+
public function __construct(string $sText, ?Settings $oParserSettings = null, int $lineNumber = 1)
2626
{
2727
if ($oParserSettings === null) {
2828
$oParserSettings = Settings::create();

src/Parsing/Anchor.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@ class Anchor
1919
*/
2020
private $parserState;
2121

22-
/**
23-
* @param int $iPosition
24-
*/
25-
public function __construct($iPosition, ParserState $parserState)
22+
public function __construct(int $iPosition, ParserState $parserState)
2623
{
2724
$this->iPosition = $iPosition;
2825
$this->parserState = $parserState;

src/Parsing/OutputException.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,9 @@
1010
final class OutputException extends SourceException
1111
{
1212
/**
13-
* @param string $sMessage
1413
* @param int<0, max> $lineNumber
1514
*/
16-
public function __construct($sMessage, $lineNumber = 0)
15+
public function __construct(string $sMessage, int $lineNumber = 0)
1716
{
1817
parent::__construct($sMessage, $lineNumber);
1918
}

src/Parsing/ParserState.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class ParserState
6060
* @param string $sText the complete CSS as text (i.e., usually the contents of a CSS file)
6161
* @param int<0, max> $lineNumber
6262
*/
63-
public function __construct($sText, Settings $oParserSettings, $lineNumber = 1)
63+
public function __construct(string $sText, Settings $oParserSettings, int $lineNumber = 1)
6464
{
6565
$this->oParserSettings = $oParserSettings;
6666
$this->sText = $sText;

0 commit comments

Comments
 (0)