Skip to content

Commit a0b106a

Browse files
committed
[BUGFIX] Ensure PHP 8.4 compatibility for nullable parameters
Ensure that parameters that have a `null` default value also have `null` as part of their type annotations. Also remove native type declarations for nullable parameters (as nullable parameters are not possible with some of the PHP versions we currently support). https://php.watch/versions/8.4/implicitly-marking-parameter-type-nullable-deprecated Fixes #634
1 parent ddd9ea7 commit a0b106a

File tree

6 files changed

+7
-7
lines changed

6 files changed

+7
-7
lines changed

src/CSSList/CSSList.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,8 @@ public function append($oItem)
286286
* Splices the list of contents.
287287
*
288288
* @param int $iOffset
289-
* @param int $iLength
290-
* @param array<int, RuleSet|CSSList|Import|Charset> $mReplacement
289+
* @param int|null $iLength
290+
* @param array<int, RuleSet|CSSList|Import|Charset>|null $mReplacement
291291
*
292292
* @return void
293293
*/

src/CSSList/Document.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function getAllRuleSets()
7878
/**
7979
* Returns all `Value` objects found recursively in `Rule`s in the tree.
8080
*
81-
* @param CSSList|RuleSet|string $mElement
81+
* @param CSSList|RuleSet|string|null $mElement
8282
* the `CSSList` or `RuleSet` to start the search from (defaults to the whole document).
8383
* If a string is given, it is used as rule name filter.
8484
* @param bool $bSearchInFunctionArguments whether to also return Value objects used as Function arguments.
@@ -155,7 +155,7 @@ public function createShorthands()
155155
*
156156
* @return string
157157
*/
158-
public function render(OutputFormat $oOutputFormat = null)
158+
public function render($oOutputFormat = null)
159159
{
160160
if ($oOutputFormat === null) {
161161
$oOutputFormat = new OutputFormat();

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/Renderable.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public function __toString();
1212
/**
1313
* @return string
1414
*/
15-
public function render(OutputFormat $oOutputFormat);
15+
public function render($oOutputFormat);
1616

1717
/**
1818
* @return int

src/RuleSet/RuleSet.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public function getLineNo()
102102
*
103103
* @return void
104104
*/
105-
public function addRule(Rule $oRule, Rule $oSibling = null)
105+
public function addRule(Rule $oRule, $oSibling = null)
106106
{
107107
$sRule = $oRule->getRule();
108108
if (!isset($this->aRules[$sRule])) {

true,

Whitespace-only changes.

0 commit comments

Comments
 (0)