Skip to content

Commit b2ee3d0

Browse files
authored
Merge pull request #57 from WyriHaximus-labs/php-8.5-deprecations
Fix PHP 8.5 deprecations
2 parents cb8ae23 + e9dca32 commit b2ee3d0

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
}
3434
},
3535
"require": {
36-
"php": ">=7.0.0",
36+
"php": ">=7.1.0",
3737
"voryx/event-loop": "^3.0.2 || ^2.0.2",
3838
"reactivex/rxphp": "^2.0.11",
3939
"react/promise": "^2.7.1 || ^3",

src/PgAsync/Client.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class Client
3838
/** @var Connection */
3939
private $listenConnection;
4040

41-
public function __construct(array $parameters, LoopInterface $loop = null, ConnectorInterface $connector = null)
41+
public function __construct(array $parameters, ?LoopInterface $loop = null, ?ConnectorInterface $connector = null)
4242
{
4343
$this->loop = $loop ?: \EventLoop\getLoop();
4444
$this->connector = $connector;

src/PgAsync/Connection.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ class Connection extends EventEmitter
155155
private $tlsConnectorFlags = [];
156156
private $password;
157157

158-
public function __construct(array $parameters, LoopInterface $loop, ConnectorInterface $connector = null)
158+
public function __construct(array $parameters, LoopInterface $loop, ?ConnectorInterface $connector = null)
159159
{
160160
if (!is_array($parameters) ||
161161
!isset($parameters['user']) ||
@@ -572,7 +572,7 @@ private function handleRowDescription(RowDescription $message)
572572
$this->addColumns($message->getColumns());
573573
}
574574

575-
private function failAllCommandsWith(\Throwable $e = null)
575+
private function failAllCommandsWith(?\Throwable $e = null)
576576
{
577577
$e = $e ?: new \Exception('unknown error');
578578

@@ -642,7 +642,7 @@ public function processQueue()
642642
public function query($query): Observable
643643
{
644644
return new AnonymousObservable(
645-
function (ObserverInterface $observer, SchedulerInterface $scheduler = null) use ($query) {
645+
function (ObserverInterface $observer, ?SchedulerInterface $scheduler = null) use ($query) {
646646
if ($this->connStatus === $this::CONNECTION_NEEDED) {
647647
$this->start();
648648
}
@@ -692,7 +692,7 @@ public function executeStatement(string $queryString, array $parameters = []): O
692692
*/
693693

694694
return new AnonymousObservable(
695-
function (ObserverInterface $observer, SchedulerInterface $scheduler = null) use ($queryString, $parameters) {
695+
function (ObserverInterface $observer, ?SchedulerInterface $scheduler = null) use ($queryString, $parameters) {
696696
if ($this->connStatus === $this::CONNECTION_NEEDED) {
697697
$this->start();
698698
}

0 commit comments

Comments
 (0)