Skip to content

[TASK] Ensure PHP 8.4 compatibility for nullable parameters #643

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions config/php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@

// function notation
'native_function_invocation' => ['include' => ['@all']],
'nullable_type_declaration' => [
'syntax' => 'question_mark',
],
'nullable_type_declaration_for_default_null_value' => true,

// import
'no_unused_imports' => true,
Expand Down
2 changes: 1 addition & 1 deletion src/CSSList/Document.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public function createShorthands(): void
*
* @param OutputFormat|null $oOutputFormat
*/
public function render(OutputFormat $oOutputFormat = null): string
public function render(?OutputFormat $oOutputFormat = null): string
{
if ($oOutputFormat === null) {
$oOutputFormat = new OutputFormat();
Expand Down
2 changes: 1 addition & 1 deletion src/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Parser
* @param Settings|null $oParserSettings
* @param int $iLineNo the line number (starting from 1, not from 0)
*/
public function __construct($sText, Settings $oParserSettings = null, $iLineNo = 1)
public function __construct($sText, ?Settings $oParserSettings = null, $iLineNo = 1)
{
if ($oParserSettings === null) {
$oParserSettings = Settings::create();
Expand Down
2 changes: 1 addition & 1 deletion src/RuleSet/RuleSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public function getLineNo()
/**
* @param Rule|null $oSibling
*/
public function addRule(Rule $oRule, Rule $oSibling = null): void
public function addRule(Rule $oRule, ?Rule $oSibling = null): void
{
$sRule = $oRule->getRule();
if (!isset($this->aRules[$sRule])) {
Expand Down