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()
|
public function getIterator()
|
||||||
{
|
{
|
||||||
while($this->statement->fetch()) {
|
while ($this->statement->fetch()) {
|
||||||
// Dereferenced row
|
// Dereferenced row
|
||||||
$row = [];
|
$row = [];
|
||||||
foreach ($this->boundValues as $key => $value) {
|
foreach ($this->boundValues as $key => $value) {
|
||||||
|
@ -263,21 +263,21 @@ class Map implements ArrayAccess, Countable, IteratorAggregate
|
|||||||
$keyField = $this->keyField;
|
$keyField = $this->keyField;
|
||||||
$valueField = $this->valueField;
|
$valueField = $this->valueField;
|
||||||
|
|
||||||
foreach($this->firstItems as $k => $v) {
|
foreach ($this->firstItems as $k => $v) {
|
||||||
yield $k => $v;
|
yield $k => $v;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach($this->list as $record) {
|
foreach ($this->list as $record) {
|
||||||
if(isset($this->firstItems[$record->$keyField])) {
|
if (isset($this->firstItems[$record->$keyField])) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if(isset($this->lastItems[$record->$keyField])) {
|
if (isset($this->lastItems[$record->$keyField])) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
yield $this->extractValue($record, $this->keyField) => $this->extractValue($record, $this->valueField);
|
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;
|
yield $k => $v;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -233,7 +233,7 @@ class PaginatedList extends ListDecorator
|
|||||||
$result = [];
|
$result = [];
|
||||||
|
|
||||||
// Use getIterator()
|
// Use getIterator()
|
||||||
foreach($this as $record) {
|
foreach ($this as $record) {
|
||||||
$result[] = $record;
|
$result[] = $record;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ class MySQLDatabaseTest extends SapphireTest
|
|||||||
|
|
||||||
// Iterating one level should not buffer, but return the right result
|
// Iterating one level should not buffer, but return the right result
|
||||||
$result1Array = [];
|
$result1Array = [];
|
||||||
foreach($result1 as $record) {
|
foreach ($result1 as $record) {
|
||||||
$result1Array[] = $record;
|
$result1Array[] = $record;
|
||||||
}
|
}
|
||||||
$this->assertEquals(
|
$this->assertEquals(
|
||||||
@ -67,7 +67,7 @@ class MySQLDatabaseTest extends SapphireTest
|
|||||||
|
|
||||||
// Test second statement
|
// Test second statement
|
||||||
$result2Array = [];
|
$result2Array = [];
|
||||||
foreach($result2 as $record) {
|
foreach ($result2 as $record) {
|
||||||
$result2Array[] = $record;
|
$result2Array[] = $record;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -80,7 +80,7 @@ class MySQLDatabaseTest extends SapphireTest
|
|||||||
|
|
||||||
// Test non-prepared query
|
// Test non-prepared query
|
||||||
$result3Array = [];
|
$result3Array = [];
|
||||||
foreach($result3 as $record) {
|
foreach ($result3 as $record) {
|
||||||
$result3Array[] = $record;
|
$result3Array[] = $record;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user