Skip to content

Commit 618f178

Browse files
committed
chore: introduce more deprecated things
1 parent 2f548bf commit 618f178

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

lib/EmitterInterface.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function once(string $eventName, callable $callBack, int $priority = 100)
4747
* Lastly, if there are 5 event handlers for an event. The continueCallback
4848
* will be called at most 4 times.
4949
*/
50-
public function emit(string $eventName, array $arguments = [], ?callable $continueCallBack = null): bool;
50+
public function emit(string $eventName, array $arguments = [], callable $continueCallBack = null): bool;
5151

5252
/**
5353
* Returns the list of listeners for an event.

lib/EmitterTrait.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public function once(string $eventName, callable $callBack, int $priority = 100)
7373
* Lastly, if there are 5 event handlers for an event. The continueCallback
7474
* will be called at most 4 times.
7575
*/
76-
public function emit(string $eventName, array $arguments = [], ?callable $continueCallBack = null): bool
76+
public function emit(string $eventName, array $arguments = [], callable $continueCallBack = null): bool
7777
{
7878
if (\is_null($continueCallBack)) {
7979
foreach ($this->listeners($eventName) as $listener) {

lib/Promise.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class Promise
5858
* Each are callbacks that map to $this->fulfill and $this->reject.
5959
* Using the executor is optional.
6060
*/
61-
public function __construct(?callable $executor = null)
61+
public function __construct(callable $executor = null)
6262
{
6363
if ($executor) {
6464
$executor(
@@ -87,7 +87,7 @@ public function __construct(?callable $executor = null)
8787
* If either of the callbacks throw an exception, the returned promise will
8888
* be rejected and the exception will be passed back.
8989
*/
90-
public function then(?callable $onFulfilled = null, ?callable $onRejected = null): Promise
90+
public function then(callable $onFulfilled = null, callable $onRejected = null): Promise
9191
{
9292
// This new subPromise will be returned from this function, and will
9393
// be fulfilled with the result of the onFulfilled or onRejected event
@@ -220,7 +220,7 @@ public function wait()
220220
* correctly, and any chained promises are also correctly fulfilled or
221221
* rejected.
222222
*/
223-
private function invokeCallback(Promise $subPromise, ?callable $callBack = null)
223+
private function invokeCallback(Promise $subPromise, callable $callBack = null)
224224
{
225225
// We use 'nextTick' to ensure that the event handlers are always
226226
// triggered outside of the calling stack in which they were originally

lib/WildcardEmitterTrait.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public function once(string $eventName, callable $callBack, int $priority = 100)
8282
* Lastly, if there are 5 event handlers for an event. The continueCallback
8383
* will be called at most 4 times.
8484
*/
85-
public function emit(string $eventName, array $arguments = [], ?callable $continueCallBack = null): bool
85+
public function emit(string $eventName, array $arguments = [], callable $continueCallBack = null): bool
8686
{
8787
if (\is_null($continueCallBack)) {
8888
foreach ($this->listeners($eventName) as $listener) {
@@ -195,7 +195,7 @@ public function removeListener(string $eventName, callable $listener): bool
195195
* removed. If it is not specified, every listener for every event is
196196
* removed.
197197
*/
198-
public function removeAllListeners(?string $eventName = null)
198+
public function removeAllListeners(string $eventName = null)
199199
{
200200
if (\is_null($eventName)) {
201201
$this->listeners = [];

0 commit comments

Comments
 (0)