Fix code style

This commit is contained in:
Loz Calver 2017-06-28 15:21:53 +01:00 committed by Guy Sartorelli
parent 749405170c
commit 8e0e797b40
No known key found for this signature in database
GPG Key ID: F313E3B9504D496A
4 changed files with 10 additions and 10 deletions

View File

@ -104,7 +104,7 @@ class MySQLStatement extends Query
public function getIterator()
{
while($this->statement->fetch()) {
while ($this->statement->fetch()) {
// Dereferenced row
$row = [];
foreach ($this->boundValues as $key => $value) {

View File

@ -263,21 +263,21 @@ class Map implements ArrayAccess, Countable, IteratorAggregate
$keyField = $this->keyField;
$valueField = $this->valueField;
foreach($this->firstItems as $k => $v) {
foreach ($this->firstItems as $k => $v) {
yield $k => $v;
}
foreach($this->list as $record) {
if(isset($this->firstItems[$record->$keyField])) {
foreach ($this->list as $record) {
if (isset($this->firstItems[$record->$keyField])) {
continue;
}
if(isset($this->lastItems[$record->$keyField])) {
if (isset($this->lastItems[$record->$keyField])) {
continue;
}
yield $this->extractValue($record, $this->keyField) => $this->extractValue($record, $this->valueField);
}
foreach($this->lastItems as $k => $v) {
foreach ($this->lastItems as $k => $v) {
yield $k => $v;
}
}

View File

@ -233,7 +233,7 @@ class PaginatedList extends ListDecorator
$result = [];
// Use getIterator()
foreach($this as $record) {
foreach ($this as $record) {
$result[] = $record;
}

View File

@ -46,7 +46,7 @@ class MySQLDatabaseTest extends SapphireTest
// Iterating one level should not buffer, but return the right result
$result1Array = [];
foreach($result1 as $record) {
foreach ($result1 as $record) {
$result1Array[] = $record;
}
$this->assertEquals(
@ -67,7 +67,7 @@ class MySQLDatabaseTest extends SapphireTest
// Test second statement
$result2Array = [];
foreach($result2 as $record) {
foreach ($result2 as $record) {
$result2Array[] = $record;
break;
}
@ -80,7 +80,7 @@ class MySQLDatabaseTest extends SapphireTest
// Test non-prepared query
$result3Array = [];
foreach($result3 as $record) {
foreach ($result3 as $record) {
$result3Array[] = $record;
break;
}