Skip to content

Commit 287b775

Browse files
author
Denis Goleshchikhin
committed
Fix PHP 8.4 deprecation errors
1 parent 44a67cb commit 287b775

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

composer.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "php-http/promise",
2+
"name": "plesk/php-http-promise",
33
"description": "Promise used for asynchronous HTTP requests",
44
"license": "MIT",
55
"keywords": ["promise"],
@@ -17,6 +17,9 @@
1717
"require": {
1818
"php" : "^7.1 || ^8.0"
1919
},
20+
"replace": {
21+
"php-http/promise": "~1.2.0"
22+
},
2023
"require-dev": {
2124
"friends-of-phpspec/phpspec-code-coverage" : "^4.3.2 || ^6.3",
2225
"phpspec/phpspec": "^5.1.2 || ^6.2 || ^7.4"

src/FulfilledPromise.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function __construct($result)
2929
/**
3030
* {@inheritdoc}
3131
*/
32-
public function then(callable $onFulfilled = null, callable $onRejected = null)
32+
public function then(?callable $onFulfilled = null, ?callable $onRejected = null)
3333
{
3434
if (null === $onFulfilled) {
3535
return $this;

src/Promise.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ interface Promise
4545
*
4646
* @template V
4747
*/
48-
public function then(callable $onFulfilled = null, callable $onRejected = null);
48+
public function then(?callable $onFulfilled = null, ?callable $onRejected = null);
4949

5050
/**
5151
* Returns the state of the promise, one of PENDING, FULFILLED or REJECTED.

src/RejectedPromise.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function __construct(\Exception $exception)
2626
/**
2727
* {@inheritdoc}
2828
*/
29-
public function then(callable $onFulfilled = null, callable $onRejected = null)
29+
public function then(?callable $onFulfilled = null, ?callable $onRejected = null)
3030
{
3131
if (null === $onRejected) {
3232
return $this;

0 commit comments

Comments
 (0)