Skip to content

Commit 3e098ad

Browse files
committed
Added phpcs configuration file and fixed coding standards issues
1 parent 0cfdd2e commit 3e098ad

File tree

3 files changed

+17
-5
lines changed

3 files changed

+17
-5
lines changed

.phpcs.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0"?>
2+
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="krystalcode/api-iterator" xsi:noNamespaceSchemaLocation="phpcs.xsd">
3+
<description>The coding standard for the API iterator library.</description>
4+
5+
<file>src</file>
6+
7+
<!-- Include the PSR standards -->
8+
<rule ref="PSR1"></rule>
9+
<rule ref="PSR2"></rule>
10+
<rule ref="PSR12"></rule>
11+
12+
</ruleset>

src/ClientInterface.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,4 @@ interface ClientInterface
4949
* paging.
5050
*/
5151
public function list(array $options = [], array $query = []);
52-
5352
}

src/Iterator.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,8 @@ public function current(): \CachingIterator
172172
$this->query
173173
);
174174

175-
if ($count === FALSE) {
176-
$this->count = count($this->pages);
175+
if ($count === false) {
176+
$this->count = count($this->pages);
177177
}
178178

179179
$this->pages[$this->position]->rewind();
@@ -230,7 +230,7 @@ public function valid(): bool
230230

231231
// We don't always know the total number of pages.
232232
// See the comments in the `count` method.
233-
if ($this->count !== NULL && $this->position > $this->count) {
233+
if ($this->count !== null && $this->position > $this->count) {
234234
return false;
235235
}
236236

@@ -335,7 +335,8 @@ public function getAllItems()
335335
* @throws \InvalidArgumentException
336336
* When the delay is set but in an incorrect format.
337337
*/
338-
protected function validateDelay() {
338+
protected function validateDelay()
339+
{
339340
if (!isset($this->delay)) {
340341
return;
341342
}

0 commit comments

Comments
 (0)