diff --git a/config/php-cs-fixer.php b/config/php-cs-fixer.php index c814a0d5..7d58b240 100644 --- a/config/php-cs-fixer.php +++ b/config/php-cs-fixer.php @@ -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, diff --git a/src/CSSList/Document.php b/src/CSSList/Document.php index 810a6282..822f3995 100644 --- a/src/CSSList/Document.php +++ b/src/CSSList/Document.php @@ -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(); diff --git a/src/Parser.php b/src/Parser.php index 0a56608f..7cb04400 100644 --- a/src/Parser.php +++ b/src/Parser.php @@ -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(); diff --git a/src/RuleSet/RuleSet.php b/src/RuleSet/RuleSet.php index 02388e47..515984bf 100644 --- a/src/RuleSet/RuleSet.php +++ b/src/RuleSet/RuleSet.php @@ -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])) {