Skip to content

Commit 068853d

Browse files
authored
[BUGFIX] Avoid implicit nullable parameters (#746)
This avoids deprecation warnings in PHP 8.4. Unfortunately, we need to remove the native type declaration for this to keep supporting PHP down to version 5.6.
1 parent 81582a7 commit 068853d

21 files changed

+57
-21
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This project adheres to [Semantic Versioning](https://semver.org/).
77

88
### Added
99

10-
- Add support for PHP 8.4 (#675, #701)
10+
- Add support for PHP 8.4 (#675, #701, #746)
1111

1212
### Changed
1313

src/CSSList/AtRuleBlockList.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,11 @@ public function __toString()
5757
}
5858

5959
/**
60+
* @param OutputFormat|null $oOutputFormat
61+
*
6062
* @return string
6163
*/
62-
public function render(OutputFormat $oOutputFormat)
64+
public function render($oOutputFormat)
6365
{
6466
$sResult = $oOutputFormat->comments($this);
6567
$sResult .= $oOutputFormat->sBeforeAtRuleBlock;

src/CSSList/Document.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ public function createShorthands()
159159
*
160160
* @return string
161161
*/
162-
public function render(OutputFormat $oOutputFormat = null)
162+
public function render($oOutputFormat = null)
163163
{
164164
if ($oOutputFormat === null) {
165165
$oOutputFormat = new OutputFormat();

src/CSSList/KeyFrame.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,11 @@ public function __toString()
6868
}
6969

7070
/**
71+
* @param OutputFormat|null $oOutputFormat
72+
*
7173
* @return string
7274
*/
73-
public function render(OutputFormat $oOutputFormat)
75+
public function render($oOutputFormat)
7476
{
7577
$sResult = $oOutputFormat->comments($this);
7678
$sResult .= "@{$this->vendorKeyFrame} {$this->animationName}{$oOutputFormat->spaceBeforeOpeningBrace()}{";

src/Comment/Comment.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,11 @@ public function __toString()
6262
}
6363

6464
/**
65+
* @param OutputFormat|null $oOutputFormat
66+
*
6567
* @return string
6668
*/
67-
public function render(OutputFormat $oOutputFormat)
69+
public function render($oOutputFormat)
6870
{
6971
return '/*' . $this->sComment . '*/';
7072
}

src/Parser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class Parser
2121
* @param Settings|null $oParserSettings
2222
* @param int $iLineNo the line number (starting from 1, not from 0)
2323
*/
24-
public function __construct($sText, Settings $oParserSettings = null, $iLineNo = 1)
24+
public function __construct($sText, $oParserSettings = null, $iLineNo = 1)
2525
{
2626
if ($oParserSettings === null) {
2727
$oParserSettings = Settings::create();

src/Property/CSSNamespace.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,11 @@ public function __toString()
6060
}
6161

6262
/**
63+
* @param OutputFormat|null $oOutputFormat
64+
*
6365
* @return string
6466
*/
65-
public function render(OutputFormat $oOutputFormat)
67+
public function render($oOutputFormat)
6668
{
6769
return '@namespace ' . ($this->sPrefix === null ? '' : $this->sPrefix . ' ')
6870
. $this->mUrl->render($oOutputFormat) . ';';

src/Property/Charset.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,11 @@ public function __toString()
7878
}
7979

8080
/**
81+
* @param OutputFormat|null $oOutputFormat
82+
*
8183
* @return string
8284
*/
83-
public function render(OutputFormat $oOutputFormat)
85+
public function render($oOutputFormat)
8486
{
8587
return "{$oOutputFormat->comments($this)}@charset {$this->oCharset->render($oOutputFormat)};";
8688
}

src/Property/Import.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,11 @@ public function __toString()
7979
}
8080

8181
/**
82+
* @param OutputFormat|null $oOutputFormat
83+
*
8284
* @return string
8385
*/
84-
public function render(OutputFormat $oOutputFormat)
86+
public function render($oOutputFormat)
8587
{
8688
return $oOutputFormat->comments($this) . "@import " . $this->oLocation->render($oOutputFormat)
8789
. ($this->sMediaQuery === null ? '' : ' ' . $this->sMediaQuery) . ';';

src/Renderable.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ interface Renderable
1010
public function __toString();
1111

1212
/**
13+
* @param OutputFormat|null $oOutputFormat
14+
*
1315
* @return string
1416
*/
15-
public function render(OutputFormat $oOutputFormat);
17+
public function render($oOutputFormat);
1618

1719
/**
1820
* @return int

0 commit comments

Comments
 (0)