mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Fix code style
This commit is contained in:
parent
749405170c
commit
8e0e797b40
@ -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) {
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -233,7 +233,7 @@ class PaginatedList extends ListDecorator
|
||||
$result = [];
|
||||
|
||||
// Use getIterator()
|
||||
foreach($this as $record) {
|
||||
foreach ($this as $record) {
|
||||
$result[] = $record;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user