Fix PHP 8.4 deprecation errors

Remove type declarations for parameters that are nullable to get rid of
deprecation errors in a backwards compatible way.
This commit is contained in:
Toni Viemerö 2025-04-29 17:53:45 +03:00
parent 73e6281e43
commit 46ee454f68
3 changed files with 4 additions and 4 deletions

View file

@ -77,7 +77,7 @@ if ( !class_exists(StateStore::class, false) ):
* @param Update|null $update * @param Update|null $update
* @return $this * @return $this
*/ */
public function setUpdate(Update $update = null) { public function setUpdate($update = null) {
$this->lazyLoad(); $this->lazyLoad();
$this->update = $update; $this->update = $update;
return $this; return $this;

View file

@ -459,7 +459,7 @@ if ( !class_exists(UpdateChecker::class, false) ):
* *
* @param Metadata|null $update * @param Metadata|null $update
*/ */
protected function fixSupportedWordpressVersion(Metadata $update = null) { protected function fixSupportedWordpressVersion($update = null) {
if ( !isset($update->tested) || !preg_match('/^\d++\.\d++$/', $update->tested) ) { if ( !isset($update->tested) || !preg_match('/^\d++\.\d++$/', $update->tested) ) {
return; return;
} }

View file

@ -648,7 +648,7 @@ class Parsedown
# #
# Setext # Setext


protected function blockSetextHeader($Line, array $Block = null) protected function blockSetextHeader($Line, $Block = null)
{ {
if ( ! isset($Block) or isset($Block['type']) or isset($Block['interrupted'])) if ( ! isset($Block) or isset($Block['type']) or isset($Block['interrupted']))
{ {
@ -786,7 +786,7 @@ class Parsedown
# #
# Table # Table


protected function blockTable($Line, array $Block = null) protected function blockTable($Line, $Block = null)
{ {
if ( ! isset($Block) or isset($Block['type']) or isset($Block['interrupted'])) if ( ! isset($Block) or isset($Block['type']) or isset($Block['interrupted']))
{ {