Skip to content

Commit

Permalink
chore: introduce more deprecated things
Browse files Browse the repository at this point in the history
  • Loading branch information
phil-davis committed Jul 26, 2024
1 parent 2f548bf commit 618f178
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/EmitterInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function once(string $eventName, callable $callBack, int $priority = 100)
* Lastly, if there are 5 event handlers for an event. The continueCallback
* will be called at most 4 times.
*/
public function emit(string $eventName, array $arguments = [], ?callable $continueCallBack = null): bool;
public function emit(string $eventName, array $arguments = [], callable $continueCallBack = null): bool;

/**
* Returns the list of listeners for an event.
Expand Down
2 changes: 1 addition & 1 deletion lib/EmitterTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function once(string $eventName, callable $callBack, int $priority = 100)
* Lastly, if there are 5 event handlers for an event. The continueCallback
* will be called at most 4 times.
*/
public function emit(string $eventName, array $arguments = [], ?callable $continueCallBack = null): bool
public function emit(string $eventName, array $arguments = [], callable $continueCallBack = null): bool
{
if (\is_null($continueCallBack)) {
foreach ($this->listeners($eventName) as $listener) {
Expand Down
6 changes: 3 additions & 3 deletions lib/Promise.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class Promise
* Each are callbacks that map to $this->fulfill and $this->reject.
* Using the executor is optional.
*/
public function __construct(?callable $executor = null)
public function __construct(callable $executor = null)
{
if ($executor) {
$executor(
Expand Down Expand Up @@ -87,7 +87,7 @@ public function __construct(?callable $executor = null)
* If either of the callbacks throw an exception, the returned promise will
* be rejected and the exception will be passed back.
*/
public function then(?callable $onFulfilled = null, ?callable $onRejected = null): Promise
public function then(callable $onFulfilled = null, callable $onRejected = null): Promise
{
// This new subPromise will be returned from this function, and will
// be fulfilled with the result of the onFulfilled or onRejected event
Expand Down Expand Up @@ -220,7 +220,7 @@ public function wait()
* correctly, and any chained promises are also correctly fulfilled or
* rejected.
*/
private function invokeCallback(Promise $subPromise, ?callable $callBack = null)
private function invokeCallback(Promise $subPromise, callable $callBack = null)
{
// We use 'nextTick' to ensure that the event handlers are always
// triggered outside of the calling stack in which they were originally
Expand Down
4 changes: 2 additions & 2 deletions lib/WildcardEmitterTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public function once(string $eventName, callable $callBack, int $priority = 100)
* Lastly, if there are 5 event handlers for an event. The continueCallback
* will be called at most 4 times.
*/
public function emit(string $eventName, array $arguments = [], ?callable $continueCallBack = null): bool
public function emit(string $eventName, array $arguments = [], callable $continueCallBack = null): bool
{
if (\is_null($continueCallBack)) {
foreach ($this->listeners($eventName) as $listener) {
Expand Down Expand Up @@ -195,7 +195,7 @@ public function removeListener(string $eventName, callable $listener): bool
* removed. If it is not specified, every listener for every event is
* removed.
*/
public function removeAllListeners(?string $eventName = null)
public function removeAllListeners(string $eventName = null)
{
if (\is_null($eventName)) {
$this->listeners = [];
Expand Down

0 comments on commit 618f178

Please sign in to comment.