diff --git a/CHANGELOG.md b/CHANGELOG.md index 0bfe424..93d04a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [Unreleased] + +### Fixed + +- PHP `8.4` deprecations + ## 4.4.0 - 2024-03-10 ### Changed diff --git a/src/Continuation.php b/src/Continuation.php index aa85ee2..7ac3e6a 100644 --- a/src/Continuation.php +++ b/src/Continuation.php @@ -23,7 +23,7 @@ private function __construct( Client $client, mixed $carry, bool $closed = false, - Message $response = null, + ?Message $response = null, bool $stop = false, ) { $this->client = $client; diff --git a/src/Factory.php b/src/Factory.php index 857576f..7f219db 100644 --- a/src/Factory.php +++ b/src/Factory.php @@ -11,8 +11,8 @@ final class Factory { public static function build( OperatingSystem $os, - Path $sockets = null, - ElapsedPeriod $heartbeat = null, + ?Path $sockets = null, + ?ElapsedPeriod $heartbeat = null, ): IPC { $sockets ??= $os->status()->tmp()->resolve(Path::of('innmind/ipc/')); $heartbeat ??= new ElapsedPeriod(1000); // default to 1 second diff --git a/src/IPC.php b/src/IPC.php index e7a1d27..0cc0ef8 100644 --- a/src/IPC.php +++ b/src/IPC.php @@ -25,6 +25,6 @@ public function exist(Process\Name $name): bool; /** * @return Maybe */ - public function wait(Process\Name $name, ElapsedPeriod $timeout = null): Maybe; - public function listen(Process\Name $self, ElapsedPeriod $timeout = null): Server; + public function wait(Process\Name $name, ?ElapsedPeriod $timeout = null): Maybe; + public function listen(Process\Name $self, ?ElapsedPeriod $timeout = null): Server; } diff --git a/src/IPC/Unix.php b/src/IPC/Unix.php index 0702ef9..0d9d2d4 100644 --- a/src/IPC/Unix.php +++ b/src/IPC/Unix.php @@ -99,7 +99,7 @@ public function exist(Process\Name $name): bool return $this->filesystem->contains(FileName::of("{$name->toString()}.sock")); } - public function wait(Process\Name $name, ElapsedPeriod $timeout = null): Maybe + public function wait(Process\Name $name, ?ElapsedPeriod $timeout = null): Maybe { $start = $this->clock->now(); @@ -118,7 +118,7 @@ public function wait(Process\Name $name, ElapsedPeriod $timeout = null): Maybe return $this->get($name); } - public function listen(Process\Name $self, ElapsedPeriod $timeout = null): Server + public function listen(Process\Name $self, ?ElapsedPeriod $timeout = null): Server { return new Server\Unix( $this->sockets, diff --git a/src/Process.php b/src/Process.php index 6f873cf..e1b0d11 100644 --- a/src/Process.php +++ b/src/Process.php @@ -24,7 +24,7 @@ public function send(Sequence $messages): Maybe; /** * @return Maybe */ - public function wait(ElapsedPeriod $timeout = null): Maybe; + public function wait(?ElapsedPeriod $timeout = null): Maybe; /** * @return Maybe Returns nothing when couldn't close the connection properly diff --git a/src/Process/Unix.php b/src/Process/Unix.php index f2f89db..2976945 100644 --- a/src/Process/Unix.php +++ b/src/Process/Unix.php @@ -101,7 +101,7 @@ public function send(Sequence $messages): Maybe ); } - public function wait(ElapsedPeriod $timeout = null): Maybe + public function wait(?ElapsedPeriod $timeout = null): Maybe { do { if ($this->closed()) { @@ -209,7 +209,7 @@ private function cut(): Maybe return $this->socket->close()->maybe(); } - private function timedout(ElapsedPeriod $timeout = null): bool + private function timedout(?ElapsedPeriod $timeout = null): bool { if ($timeout === null) { return false; diff --git a/src/Server/Unix.php b/src/Server/Unix.php index 0863809..0397197 100644 --- a/src/Server/Unix.php +++ b/src/Server/Unix.php @@ -41,7 +41,7 @@ public function __construct( Signals $signals, Address $address, ElapsedPeriod $heartbeat, - ElapsedPeriod $timeout = null, + ?ElapsedPeriod $timeout = null, ) { $this->sockets = $sockets; $this->protocol = $protocol;