-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from netlogix/bugfix/failing-builds
- Loading branch information
Showing
4 changed files
with
122 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace Netlogix\Migrations\Tests\Unit\Domain\Service; | ||
|
||
use ArrayObject; | ||
use Neos\Flow\Persistence\Doctrine\Query; | ||
use Neos\Flow\Persistence\QueryInterface; | ||
use Neos\Flow\Persistence\QueryResultInterface; | ||
|
||
class ArrayQueryResult implements QueryResultInterface | ||
{ | ||
|
||
private $result; | ||
private $iterator; | ||
|
||
public function __construct(array $result) | ||
{ | ||
$this->result = $result; | ||
$this->iterator = (new ArrayObject($result))->getIterator(); | ||
} | ||
|
||
public function current() | ||
{ | ||
return $this->iterator->current(); | ||
} | ||
|
||
public function next() | ||
{ | ||
$this->iterator->next(); | ||
} | ||
|
||
public function key() | ||
{ | ||
return $this->iterator->key(); | ||
} | ||
|
||
public function valid() | ||
{ | ||
return $this->iterator->valid(); | ||
} | ||
|
||
public function rewind() | ||
{ | ||
$this->iterator->rewind(); | ||
} | ||
|
||
public function offsetExists($offset) | ||
{ | ||
return $this->iterator->offsetExists($offset); | ||
} | ||
|
||
public function offsetGet($offset) | ||
{ | ||
return $this->iterator->offsetGet($offset); | ||
} | ||
|
||
public function offsetSet($offset, $value) | ||
{ | ||
$this->iterator->offsetSet($offset, $value); | ||
} | ||
|
||
public function offsetUnset($offset) | ||
{ | ||
$this->iterator->offsetUnset($offset); | ||
} | ||
|
||
public function count() | ||
{ | ||
return $this->iterator->count(); | ||
} | ||
|
||
public function getQuery(): QueryInterface | ||
{ | ||
return new Query('foo'); | ||
} | ||
|
||
public function getFirst() | ||
{ | ||
reset($this->result); | ||
|
||
return current($this->result); | ||
} | ||
|
||
public function toArray(): array | ||
{ | ||
return $this->result; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters