1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-23 15:22:40 +01:00

Fix implicitly nullable parameter declarations for PHP 8.4

Summary:
Followup to rARC99e57a70. This patch should cover all remaining issues now that PHPStan covers it (instead of the previous trial-and-error approach).

Implicitly nullable parameter declarations are deprecated in PHP 8.4:
https://php.watch/versions/8.4/implicitly-marking-parameter-type-nullable-deprecated

The proposed syntax was introduced in PHP 7.1 and Phorge requires PHP 7.2 now.

Test Plan: Run static code analysis.

Reviewers: O1 Blessed Committers, avivey

Reviewed By: O1 Blessed Committers, avivey

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25831
This commit is contained in:
Andre Klapper 2024-10-23 11:57:26 +02:00
parent 99e57a7021
commit 29ca3df112
6 changed files with 9 additions and 9 deletions

View file

@ -8,7 +8,7 @@ abstract class FutureProxy extends Future {
private $proxied; private $proxied;
public function __construct(Future $proxied = null) { public function __construct(?Future $proxied = null) {
if ($proxied) { if ($proxied) {
$this->setProxiedFuture($proxied); $this->setProxiedFuture($proxied);
} }

View file

@ -42,7 +42,7 @@ abstract class AASTNode extends Phobject {
return $this->parentNode; return $this->parentNode;
} }
final public function setParentNode(AASTNode $node = null) { final public function setParentNode(?AASTNode $node = null) {
$this->parentNode = $node; $this->parentNode = $node;
return $this; return $this;
} }
@ -51,7 +51,7 @@ abstract class AASTNode extends Phobject {
return $this->previousSibling; return $this->previousSibling;
} }
final public function setPreviousSibling(AASTNode $node = null) { final public function setPreviousSibling(?AASTNode $node = null) {
$this->previousSibling = $node; $this->previousSibling = $node;
return $this; return $this;
} }
@ -60,7 +60,7 @@ abstract class AASTNode extends Phobject {
return $this->nextSibling; return $this->nextSibling;
} }
final public function setNextSibling(AASTNode $node = null) { final public function setNextSibling(?AASTNode $node = null) {
$this->nextSibling = $node; $this->nextSibling = $node;
return $this; return $this;
} }

View file

@ -174,7 +174,7 @@ final class ArcanistMarkerRef
return $this->getHardpoint(self::HARDPOINT_WORKINGCOPYSTATEREF); return $this->getHardpoint(self::HARDPOINT_WORKINGCOPYSTATEREF);
} }
public function attachRemoteRef(ArcanistRemoteRef $ref = null) { public function attachRemoteRef(?ArcanistRemoteRef $ref = null) {
return $this->attachHardpoint(self::HARDPOINT_REMOTEREF, $ref); return $this->attachHardpoint(self::HARDPOINT_REMOTEREF, $ref);
} }

View file

@ -7,11 +7,11 @@ final class ArcanistMercurialRepositoryMarkerQuery
return $this->newMarkers(); return $this->newMarkers();
} }
protected function newRemoteRefMarkers(ArcanistRemoteRef $remote = null) { protected function newRemoteRefMarkers(?ArcanistRemoteRef $remote = null) {
return $this->newMarkers($remote); return $this->newMarkers($remote);
} }
private function newMarkers(ArcanistRemoteRef $remote = null) { private function newMarkers(?ArcanistRemoteRef $remote = null) {
$api = $this->getRepositoryAPI(); $api = $this->getRepositoryAPI();
// In native Mercurial it is difficult to identify remote markers, and // In native Mercurial it is difficult to identify remote markers, and

View file

@ -111,7 +111,7 @@ final class ArcanistUnitTestResult extends Phobject {
* "extra data" allows an implementation to store additional key/value * "extra data" allows an implementation to store additional key/value
* metadata along with the result of the test run. * metadata along with the result of the test run.
*/ */
public function setExtraData(array $extra_data = null) { public function setExtraData(?array $extra_data = null) {
$this->extraData = $extra_data; $this->extraData = $extra_data;
return $this; return $this;
} }

View file

@ -78,7 +78,7 @@ abstract class ArcanistUnitTestEngine extends Phobject {
return $this->enableCoverage; return $this->enableCoverage;
} }
final public function setRenderer(ArcanistUnitRenderer $renderer = null) { final public function setRenderer(?ArcanistUnitRenderer $renderer = null) {
$this->renderer = $renderer; $this->renderer = $renderer;
return $this; return $this;
} }