Skip to content

Commit 6e43258

Browse files
authored
[TASK] Use native type declarations for Renderable (#891)
1 parent a9eaea4 commit 6e43258

31 files changed

+60
-72
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Please also have a look at our
2424
- Only allow `string` for some `OutputFormat` properties (#885)
2525
- Make all non-private properties `@internal` (#886)
2626
- Use more native type declarations and strict mode
27-
(#641, #772, #774, #778, #804, #841, #873, #875)
27+
(#641, #772, #774, #778, #804, #841, #873, #875, #891)
2828
- Add visibility to all class/interface constants (#469)
2929

3030
### Deprecated

src/CSSList/AtRuleBlockList.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class AtRuleBlockList extends CSSBlockList implements AtRule
2525
/**
2626
* @param string $type
2727
* @param string $arguments
28-
* @param int $lineNumber
28+
* @param int<0, max> $lineNumber
2929
*/
3030
public function __construct($type, $arguments = '', $lineNumber = 0)
3131
{

src/CSSList/CSSBlockList.php

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

src/CSSList/CSSList.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,14 @@ abstract class CSSList implements Renderable, Commentable
4848
protected $contents;
4949

5050
/**
51-
* @var int
51+
* @var int<0, max>
5252
*
5353
* @internal since 8.8.0
5454
*/
5555
protected $lineNumber;
5656

5757
/**
58-
* @param int $lineNumber
58+
* @param int<0, max> $lineNumber
5959
*/
6060
public function __construct($lineNumber = 0)
6161
{
@@ -255,9 +255,9 @@ private static function identifierIs($identifier, string $match): bool
255255
}
256256

257257
/**
258-
* @return int
258+
* @return int<0, max>
259259
*/
260-
public function getLineNo()
260+
public function getLineNo(): int
261261
{
262262
return $this->lineNumber;
263263
}

src/CSSList/Document.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
class Document extends CSSBlockList
2020
{
2121
/**
22-
* @param int $lineNumber
22+
* @param int<0, max> $lineNumber
2323
*/
2424
public function __construct($lineNumber = 0)
2525
{

src/CSSList/KeyFrame.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class KeyFrame extends CSSList implements AtRule
2020
private $animationName;
2121

2222
/**
23-
* @param int $lineNumber
23+
* @param int<0, max> $lineNumber
2424
*/
2525
public function __construct($lineNumber = 0)
2626
{

src/Comment/Comment.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
class Comment implements Renderable
1111
{
1212
/**
13-
* @var int
13+
* @var int<0, max>
1414
*
1515
* @internal since 8.8.0
1616
*/
@@ -25,7 +25,7 @@ class Comment implements Renderable
2525

2626
/**
2727
* @param string $commentText
28-
* @param int $lineNumber
28+
* @param int<0, max> $lineNumber
2929
*/
3030
public function __construct($commentText = '', $lineNumber = 0)
3131
{
@@ -42,9 +42,9 @@ public function getComment()
4242
}
4343

4444
/**
45-
* @return int
45+
* @return int<0, max>
4646
*/
47-
public function getLineNo()
47+
public function getLineNo(): int
4848
{
4949
return $this->lineNumber;
5050
}

src/Parser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class Parser
2020

2121
/**
2222
* @param string $sText the complete CSS as text (i.e., usually the contents of a CSS file)
23-
* @param int $lineNumber the line number (starting from 1, not from 0)
23+
* @param int<0, max> $lineNumber the line number (starting from 1, not from 0)
2424
*/
2525
public function __construct($sText, ?Settings $oParserSettings = null, $lineNumber = 1)
2626
{

src/Parsing/OutputException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ final class OutputException extends SourceException
1111
{
1212
/**
1313
* @param string $sMessage
14-
* @param int $lineNumber
14+
* @param int<0, max> $lineNumber
1515
*/
1616
public function __construct($sMessage, $lineNumber = 0)
1717
{

src/Parsing/ParserState.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class ParserState
5858

5959
/**
6060
* @param string $sText the complete CSS as text (i.e., usually the contents of a CSS file)
61-
* @param int $lineNumber
61+
* @param int<0, max> $lineNumber
6262
*/
6363
public function __construct($sText, Settings $oParserSettings, $lineNumber = 1)
6464
{

0 commit comments

Comments
 (0)