Skip to content

Commit 6194f25

Browse files
authored
Merge pull request #24 from php-http/analysis-XVlRO3
Apply fixes from StyleCI
2 parents 21e55c2 + 1fe5321 commit 6194f25

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/Promise.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,11 @@ public function then(callable $onFulfilled = null, callable $onRejected = null)
7171
{
7272
$newPromise = new self($this->loop);
7373

74-
$onFulfilled = $onFulfilled !== null ? $onFulfilled : function (ResponseInterface $response) {
74+
$onFulfilled = null !== $onFulfilled ? $onFulfilled : function (ResponseInterface $response) {
7575
return $response;
7676
};
7777

78-
$onRejected = $onRejected !== null ? $onRejected : function (Exception $exception) {
78+
$onRejected = null !== $onRejected ? $onRejected : function (Exception $exception) {
7979
throw $exception;
8080
};
8181

@@ -95,11 +95,11 @@ public function then(callable $onFulfilled = null, callable $onRejected = null)
9595
}
9696
};
9797

98-
if ($this->state === HttpPromise::FULFILLED) {
98+
if (HttpPromise::FULFILLED === $this->state) {
9999
$this->doResolve($this->response);
100100
}
101101

102-
if ($this->state === HttpPromise::REJECTED) {
102+
if (HttpPromise::REJECTED === $this->state) {
103103
$this->doReject($this->exception);
104104
}
105105

@@ -115,7 +115,7 @@ public function then(callable $onFulfilled = null, callable $onRejected = null)
115115
*/
116116
public function resolve(ResponseInterface $response)
117117
{
118-
if ($this->state !== HttpPromise::PENDING) {
118+
if (HttpPromise::PENDING !== $this->state) {
119119
throw new \RuntimeException('Promise is already resolved');
120120
}
121121

@@ -142,7 +142,7 @@ private function doResolve(ResponseInterface $response)
142142
*/
143143
public function reject(Exception $exception)
144144
{
145-
if ($this->state !== HttpPromise::PENDING) {
145+
if (HttpPromise::PENDING !== $this->state) {
146146
throw new \RuntimeException('Promise is already resolved');
147147
}
148148

0 commit comments

Comments
 (0)