Fix implicitly nullable parameters in last version of scssphp that supports PHP 7.4

This commit is contained in:
Kijin Sung 2025-03-05 20:37:01 +09:00
parent b5823e97e4
commit 400d3bcec4
5 changed files with 9 additions and 9 deletions

View file

@ -5052,7 +5052,7 @@ EOL;
*
* @return array
*/
protected function multiplyMedia(Environment $env = null, $childQueries = null)
protected function multiplyMedia(?Environment $env = null, $childQueries = null)
{
if (
! isset($env) ||
@ -5144,7 +5144,7 @@ EOL;
*
* @return \ScssPhp\ScssPhp\Compiler\Environment
*/
protected function pushEnv(Block $block = null)
protected function pushEnv(?Block $block = null)
{
$env = new Environment();
$env->parent = $this->env;
@ -5208,7 +5208,7 @@ EOL;
*
* @return void
*/
protected function set($name, $value, $shadow = false, Environment $env = null, $valueUnreduced = null)
protected function set($name, $value, $shadow = false, ?Environment $env = null, $valueUnreduced = null)
{
$name = $this->normalizeName($name);
@ -5314,7 +5314,7 @@ EOL;
*
* @return mixed|null
*/
public function get($name, $shouldThrow = true, Environment $env = null, $unreduced = false)
public function get($name, $shouldThrow = true, ?Environment $env = null, $unreduced = false)
{
$normalizedName = $this->normalizeName($name);
$specialContentKey = static::$namespaces['special'] . 'content';
@ -5379,7 +5379,7 @@ EOL;
*
* @return bool
*/
protected function has($name, Environment $env = null)
protected function has($name, ?Environment $env = null)
{
return ! \is_null($this->get($name, false, $env));
}

View file

@ -272,7 +272,7 @@ abstract class Formatter
*
* @return string
*/
public function format(OutputBlock $block, SourceMapGenerator $sourceMapGenerator = null)
public function format(OutputBlock $block, ?SourceMapGenerator $sourceMapGenerator = null)
{
$this->sourceMapGenerator = null;

View file

@ -578,7 +578,7 @@ class Number extends Node implements \ArrayAccess, \JsonSerializable
*
* @return string
*/
public function output(Compiler $compiler = null)
public function output(?Compiler $compiler = null)
{
$dimension = round($this->dimension, self::PRECISION);

View file

@ -140,7 +140,7 @@ class Parser
* @param bool $cssOnly
* @param LoggerInterface|null $logger
*/
public function __construct($sourceName, $sourceIndex = 0, $encoding = 'utf-8', Cache $cache = null, $cssOnly = false, LoggerInterface $logger = null)
public function __construct($sourceName, $sourceIndex = 0, $encoding = 'utf-8', ?Cache $cache = null, $cssOnly = false, ?LoggerInterface $logger = null)
{
$this->sourceName = $sourceName ?: '(stdin)';
$this->sourceIndex = $sourceIndex;

View file

@ -59,7 +59,7 @@ final class Warn
*
* @internal
*/
public static function setCallback(callable $callback = null)
public static function setCallback(?callable $callback = null)
{
$previousCallback = self::$callback;
self::$callback = $callback;