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

+1-1
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

+3-1
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

+1-1
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

+3-1
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

+3-1
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

+1-1
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

+3-1
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

+3-1
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

+3-1
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

+3-1
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

src/Rule/Rule.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -344,9 +344,11 @@ public function __toString()
344344
}
345345

346346
/**
347+
* @param OutputFormat|null $oOutputFormat
348+
*
347349
* @return string
348350
*/
349-
public function render(OutputFormat $oOutputFormat)
351+
public function render($oOutputFormat)
350352
{
351353
$sResult = "{$oOutputFormat->comments($this)}{$this->sRule}:{$oOutputFormat->spaceAfterRuleName()}";
352354
if ($this->mValue instanceof Value) { // Can also be a ValueList

src/RuleSet/AtRuleSet.php

+3-1
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
$sResult = $oOutputFormat->comments($this);
6870
$sArgs = $this->sArgs;

src/RuleSet/DeclarationBlock.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -836,11 +836,13 @@ public function __toString()
836836
}
837837

838838
/**
839+
* @param OutputFormat|null $oOutputFormat
840+
*
839841
* @return string
840842
*
841843
* @throws OutputException
842844
*/
843-
public function render(OutputFormat $oOutputFormat)
845+
public function render($oOutputFormat)
844846
{
845847
$sResult = $oOutputFormat->comments($this);
846848
if (count($this->aSelectors) === 0) {

src/Value/CSSFunction.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,11 @@ public function __toString()
8888
}
8989

9090
/**
91+
* @param OutputFormat|null $oOutputFormat
92+
*
9193
* @return string
9294
*/
93-
public function render(OutputFormat $oOutputFormat)
95+
public function render($oOutputFormat)
9496
{
9597
$aArguments = parent::render($oOutputFormat);
9698
return "{$this->sName}({$aArguments})";

src/Value/CSSString.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,11 @@ public function __toString()
9999
}
100100

101101
/**
102+
* @param OutputFormat|null $oOutputFormat
103+
*
102104
* @return string
103105
*/
104-
public function render(OutputFormat $oOutputFormat)
106+
public function render($oOutputFormat)
105107
{
106108
$sString = addslashes($this->sString);
107109
$sString = str_replace("\n", '\A', $sString);

src/Value/CalcRuleValueList.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@ public function __construct($iLineNo = 0)
1515
}
1616

1717
/**
18+
* @param OutputFormat|null $oOutputFormat
19+
*
1820
* @return string
1921
*/
20-
public function render(OutputFormat $oOutputFormat)
22+
public function render($oOutputFormat)
2123
{
2224
return $oOutputFormat->implode(' ', $this->aComponents);
2325
}

src/Value/Color.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,11 @@ public function __toString()
160160
}
161161

162162
/**
163+
* @param OutputFormat|null $oOutputFormat
164+
*
163165
* @return string
164166
*/
165-
public function render(OutputFormat $oOutputFormat)
167+
public function render($oOutputFormat)
166168
{
167169
// Shorthand RGB color values
168170
if ($oOutputFormat->getRGBHashNotation() && implode('', array_keys($this->aComponents)) === 'rgb') {

src/Value/LineName.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,11 @@ public function __toString()
5656
}
5757

5858
/**
59+
* @param OutputFormat|null $oOutputFormat
60+
*
5961
* @return string
6062
*/
61-
public function render(OutputFormat $oOutputFormat)
63+
public function render($oOutputFormat)
6264
{
6365
return '[' . parent::render(OutputFormat::createCompact()) . ']';
6466
}

src/Value/Size.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -216,9 +216,11 @@ public function __toString()
216216
}
217217

218218
/**
219+
* @param OutputFormat|null $oOutputFormat
220+
*
219221
* @return string
220222
*/
221-
public function render(OutputFormat $oOutputFormat)
223+
public function render($oOutputFormat)
222224
{
223225
$l = localeconv();
224226
$sPoint = preg_quote($l['decimal_point'], '/');

src/Value/URL.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,11 @@ public function __toString()
8686
}
8787

8888
/**
89+
* @param OutputFormat|null $oOutputFormat
90+
*
8991
* @return string
9092
*/
91-
public function render(OutputFormat $oOutputFormat)
93+
public function render($oOutputFormat)
9294
{
9395
return "url({$this->oURL->render($oOutputFormat)})";
9496
}

src/Value/ValueList.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,11 @@ public function __toString()
9393
}
9494

9595
/**
96+
* @param OutputFormat|null $oOutputFormat
97+
*
9698
* @return string
9799
*/
98-
public function render(OutputFormat $oOutputFormat)
100+
public function render($oOutputFormat)
99101
{
100102
return $oOutputFormat->implode(
101103
$oOutputFormat->spaceBeforeListArgumentSeparator($this->sSeparator) . $this->sSeparator

0 commit comments

Comments
 (0)