8000 Add return types to Promises (#1151) · geocoder-php/Geocoder@e87c4b4 · GitHub
[go: up one dir, main page]

Skip to content

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

8000
Appearance settings

Commit e87c4b4

Browse files
authored
Add return types to Promises (#1151)
Add return types
1 parent 2634e65 commit e87c4b4

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/Plugin/Promise/GeocoderFulfilledPromise.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function __construct(Collection $collection)
3636
/**
3737
* {@inheritdoc}
3838
*/
39-
public function then(callable $onFulfilled = null, callable $onRejected = null)
39+
public function then(callable $onFulfilled = null, callable $onRejected = null): Promise
4040
{
4141
if (null === $onFulfilled) {
4242
return $this;
@@ -52,13 +52,15 @@ public function then(callable $onFulfilled = null, callable $onRejected = null)
5252
/**
5353
* {@inheritdoc}
5454
*/
55-
public function getState()
55+
public function getState(): string
5656
{
5757
return Promise::FULFILLED;
5858
}
5959

6060
/**
6161
* {@inheritdoc}
62+
*
63+
* @return mixed
6264
*/
6365
public function wait($unwrap = true)
6466
{

src/Plugin/Promise/GeocoderRejectedPromise.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function __construct(Exception $exception)
3535
/**
3636
* {@inheritdoc}
3737
*/
38-
public function then(callable $onFulfilled = null, callable $onRejected = null)
38+
public function then(callable $onFulfilled = null, callable $onRejected = null): Promise
3939
{
4040
if (null === $onRejected) {
4141
return $this;
@@ -51,13 +51,15 @@ public function then(callable $onFulfilled = null, callable $onRejected = null)
5151
/**
5252
* {@inheritdoc}
5353
*/
54-
public function getState()
54+
public function getState(): string
5555
{
5656
return Promise::REJECTED;
5757
}
5858

5959
/**
6060
* {@inheritdoc}
61+
*
62+
* @return mixed
6163
*/
6264
public function wait($unwrap = true)
6365
{

0 commit comments

Comments
 (0)
0