Skip to content

Commit afa00f5

Browse files
authored
Merge pull request #184 from glensc/codestyle
Apply code style fixes
2 parents 3958a27 + 8833122 commit afa00f5

File tree

4 files changed

+16
-21
lines changed

4 files changed

+16
-21
lines changed

src/Jira/Api.php

+6-8
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public function __construct(
110110
$this->setEndPoint($endpoint);
111111
$this->authentication = $authentication;
112112

113-
if ( is_null($client) ) {
113+
if ( $client === null ) {
114114
$client = new CurlClient();
115115
}
116116

@@ -689,7 +689,7 @@ public function createRemoteLink(
689689
'object' => $object,
690690
);
691691

692-
if ( !is_null($application) ) {
692+
if ( $application !== null ) {
693693
$options['application'] = $application;
694694
}
695695

@@ -744,13 +744,11 @@ public function api(
744744
if ( $return_as_array ) {
745745
return $json;
746746
}
747-
else {
748-
return new Result($json);
749-
}
750-
}
751-
else {
752-
return false;
747+
748+
return new Result($json);
753749
}
750+
751+
return false;
754752
}
755753

756754
/**

src/Jira/Api/Client/CurlClient.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
namespace chobie\Jira\Api\Client;
2626

2727

28+
use chobie\Jira\Api\Authentication\Anonymous;
2829
use chobie\Jira\Api\Authentication\AuthenticationInterface;
2930
use chobie\Jira\Api\Authentication\Basic;
30-
use chobie\Jira\Api\Authentication\Anonymous;
3131
use chobie\Jira\Api\Exception;
3232
use chobie\Jira\Api\UnauthorizedException;
3333

@@ -146,7 +146,7 @@ public function sendRequest(
146146
}
147147

148148
// @codeCoverageIgnoreStart
149-
if ( is_null($response) ) {
149+
if ( $response === null ) {
150150
throw new Exception('JIRA Rest server returns unexpected result.');
151151
}
152152
// @codeCoverageIgnoreEnd

src/Jira/Api/Client/PHPClient.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ public function sendRequest(
181181
}
182182

183183
// @codeCoverageIgnoreStart
184-
if ( is_null($response) ) {
184+
if ( $response === null ) {
185185
throw new Exception('JIRA Rest server returns unexpected result.');
186186
}
187187
// @codeCoverageIgnoreEnd

src/Jira/Issues/Walker.php

+7-10
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,8 @@ public function current()
157157

158158
return $callback($tmp);
159159
}
160-
else {
161-
return $this->issues[$this->offset];
162-
}
160+
161+
return $this->issues[$this->offset];
163162
}
164163

165164
/**
@@ -184,9 +183,8 @@ public function key()
184183
if ( $this->startAt > 0 ) {
185184
return $this->offset + (($this->startAt - 1) * $this->perPage);
186185
}
187-
else {
188-
return 0;
189-
}
186+
187+
return 0;
190188
}
191189

192190
/**
@@ -200,7 +198,7 @@ public function key()
200198
*/
201199
public function valid()
202200
{
203-
if ( is_null($this->jql) ) {
201+
if ( $this->jql === null ) {
204202
throw new \Exception('you have to call Jira_Walker::push($jql, $fields) at first');
205203
}
206204

@@ -247,9 +245,8 @@ public function valid()
247245
if ( ($this->startAt - 1) * $this->perPage + $this->offset < $this->total ) {
248246
return true;
249247
}
250-
else {
251-
return false;
252-
}
248+
249+
return false;
253250
}
254251
}
255252
}

0 commit comments

Comments
 (0)