Skip to content

[BUGFIX] Avoid implicit nullable parameters #746

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
Oct 25, 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
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This project adheres to [Semantic Versioning](https://semver.org/).

### Added

- Add support for PHP 8.4 (#675, #701)
- Add support for PHP 8.4 (#675, #701, #746)

### Changed

Expand Down
4 changes: 3 additions & 1 deletion src/CSSList/AtRuleBlockList.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,11 @@ public function __toString()
}

/**
* @param OutputFormat|null $oOutputFormat
*
* @return string
*/
public function render(OutputFormat $oOutputFormat)
public function render($oOutputFormat)
{
$sResult = $oOutputFormat->comments($this);
$sResult .= $oOutputFormat->sBeforeAtRuleBlock;
Expand Down
2 changes: 1 addition & 1 deletion src/CSSList/Document.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public function createShorthands()
*
* @return string
*/
public function render(OutputFormat $oOutputFormat = null)
public function render($oOutputFormat = null)
{
if ($oOutputFormat === null) {
$oOutputFormat = new OutputFormat();
Expand Down
4 changes: 3 additions & 1 deletion src/CSSList/KeyFrame.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,11 @@ public function __toString()
}

/**
* @param OutputFormat|null $oOutputFormat
*
* @return string
*/
public function render(OutputFormat $oOutputFormat)
public function render($oOutputFormat)
{
$sResult = $oOutputFormat->comments($this);
$sResult .= "@{$this->vendorKeyFrame} {$this->animationName}{$oOutputFormat->spaceBeforeOpeningBrace()}{";
Expand Down
4 changes: 3 additions & 1 deletion src/Comment/Comment.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,11 @@ public function __toString()
}

/**
* @param OutputFormat|null $oOutputFormat
*
* @return string
*/
public function render(OutputFormat $oOutputFormat)
public function render($oOutputFormat)
{
return '/*' . $this->sComment . '*/';
}
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, $oParserSettings = null, $iLineNo = 1)
{
if ($oParserSettings === null) {
$oParserSettings = Settings::create();
Expand Down
4 changes: 3 additions & 1 deletion src/Property/CSSNamespace.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,11 @@ public function __toString()
}

/**
* @param OutputFormat|null $oOutputFormat
*
* @return string
*/
public function render(OutputFormat $oOutputFormat)
public function render($oOutputFormat)
{
return '@namespace ' . ($this->sPrefix === null ? '' : $this->sPrefix . ' ')
. $this->mUrl->render($oOutputFormat) . ';';
Expand Down
4 changes: 3 additions & 1 deletion src/Property/Charset.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,11 @@ public function __toString()
}

/**
* @param OutputFormat|null $oOutputFormat
*
* @return string
*/
public function render(OutputFormat $oOutputFormat)
public function render($oOutputFormat)
{
return "{$oOutputFormat->comments($this)}@charset {$this->oCharset->render($oOutputFormat)};";
}
Expand Down
4 changes: 3 additions & 1 deletion src/Property/Import.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,11 @@ public function __toString()
}

/**
* @param OutputFormat|null $oOutputFormat
*
* @return string
*/
public function render(OutputFormat $oOutputFormat)
public function render($oOutputFormat)
{
return $oOutputFormat->comments($this) . "@import " . $this->oLocation->render($oOutputFormat)
. ($this->sMediaQuery === null ? '' : ' ' . $this->sMediaQuery) . ';';
Expand Down
4 changes: 3 additions & 1 deletion src/Renderable.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ interface Renderable
public function __toString();

/**
* @param OutputFormat|null $oOutputFormat
*
* @return string
*/
public function render(OutputFormat $oOutputFormat);
public function render($oOutputFormat);

/**
* @return int
Expand Down
4 changes: 3 additions & 1 deletion src/Rule/Rule.php
Original file line number Diff line number Diff line change
Expand Up @@ -344,9 +344,11 @@ public function __toString()
}

/**
* @param OutputFormat|null $oOutputFormat
*
* @return string
*/
public function render(OutputFormat $oOutputFormat)
public function render($oOutputFormat)
{
$sResult = "{$oOutputFormat->comments($this)}{$this->sRule}:{$oOutputFormat->spaceAfterRuleName()}";
if ($this->mValue instanceof Value) { // Can also be a ValueList
Expand Down
4 changes: 3 additions & 1 deletion src/RuleSet/AtRuleSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,11 @@ public function __toString()
}

/**
* @param OutputFormat|null $oOutputFormat
*
* @return string
*/
public function render(OutputFormat $oOutputFormat)
public function render($oOutputFormat)
{
$sResult = $oOutputFormat->comments($this);
$sArgs = $this->sArgs;
Expand Down
4 changes: 3 additions & 1 deletion src/RuleSet/DeclarationBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -836,11 +836,13 @@ public function __toString()
}

/**
* @param OutputFormat|null $oOutputFormat
*
* @return string
*
* @throws OutputException
*/
public function render(OutputFormat $oOutputFormat)
public function render($oOutputFormat)
{
$sResult = $oOutputFormat->comments($this);
if (count($this->aSelectors) === 0) {
Expand Down
4 changes: 3 additions & 1 deletion src/Value/CSSFunction.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,11 @@ public function __toString()
}

/**
* @param OutputFormat|null $oOutputFormat
*
* @return string
*/
public function render(OutputFormat $oOutputFormat)
public function render($oOutputFormat)
{
$aArguments = parent::render($oOutputFormat);
return "{$this->sName}({$aArguments})";
Expand Down
4 changes: 3 additions & 1 deletion src/Value/CSSString.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,11 @@ public function __toString()
}

/**
* @param OutputFormat|null $oOutputFormat
*
* @return string
*/
public function render(OutputFormat $oOutputFormat)
public function render($oOutputFormat)
{
$sString = addslashes($this->sString);
$sString = str_replace("\n", '\A', $sString);
Expand Down
4 changes: 3 additions & 1 deletion src/Value/CalcRuleValueList.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ public function __construct($iLineNo = 0)
}

/**
* @param OutputFormat|null $oOutputFormat
*
* @return string
*/
public function render(OutputFormat $oOutputFormat)
public function render($oOutputFormat)
{
return $oOutputFormat->implode(' ', $this->aComponents);
}
Expand Down
4 changes: 3 additions & 1 deletion src/Value/Color.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,11 @@ public function __toString()
}

/**
* @param OutputFormat|null $oOutputFormat
*
* @return string
*/
public function render(OutputFormat $oOutputFormat)
public function render($oOutputFormat)
{
// Shorthand RGB color values
if ($oOutputFormat->getRGBHashNotation() && implode('', array_keys($this->aComponents)) === 'rgb') {
Expand Down
4 changes: 3 additions & 1 deletion src/Value/LineName.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,11 @@ public function __toString()
}

/**
* @param OutputFormat|null $oOutputFormat
*
* @return string
*/
public function render(OutputFormat $oOutputFormat)
public function render($oOutputFormat)
{
return '[' . parent::render(OutputFormat::createCompact()) . ']';
}
Expand Down
4 changes: 3 additions & 1 deletion src/Value/Size.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,11 @@ public function __toString()
}

/**
* @param OutputFormat|null $oOutputFormat
*
* @return string
*/
public function render(OutputFormat $oOutputFormat)
public function render($oOutputFormat)
{
$l = localeconv();
$sPoint = preg_quote($l['decimal_point'], '/');
Expand Down
4 changes: 3 additions & 1 deletion src/Value/URL.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,11 @@ public function __toString()
}

/**
* @param OutputFormat|null $oOutputFormat
*
* @return string
*/
public function render(OutputFormat $oOutputFormat)
public function render($oOutputFormat)
{
return "url({$this->oURL->render($oOutputFormat)})";
}
Expand Down
4 changes: 3 additions & 1 deletion src/Value/ValueList.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,11 @@ public function __toString()
}

/**
* @param OutputFormat|null $oOutputFormat
*
* @return string
*/
public function render(OutputFormat $oOutputFormat)
public function render($oOutputFormat)
{
return $oOutputFormat->implode(
$oOutputFormat->spaceBeforeListArgumentSeparator($this->sSeparator) . $this->sSeparator
Expand Down