update deps & install rector

This commit is contained in:
Dominik Liebler
2019-12-14 12:50:05 +01:00
parent 04acce6759
commit 579a5ac946
87 changed files with 2432 additions and 786 deletions

View File

@@ -2,17 +2,12 @@
namespace DesignPatterns\More\Repository;
use OutOfBoundsException;
class InMemoryPersistence implements Persistence
{
/**
* @var array
*/
private $data = [];
/**
* @var int
*/
private $lastId = 0;
private array $data = [];
private int $lastId = 0;
public function generateId(): int
{
@@ -29,7 +24,7 @@ class InMemoryPersistence implements Persistence
public function retrieve(int $id): array
{
if (!isset($this->data[$id])) {
throw new \OutOfBoundsException(sprintf('No data found for ID %d', $id));
throw new OutOfBoundsException(sprintf('No data found for ID %d', $id));
}
return $this->data[$id];
@@ -38,7 +33,7 @@ class InMemoryPersistence implements Persistence
public function delete(int $id)
{
if (!isset($this->data[$id])) {
throw new \OutOfBoundsException(sprintf('No data found for ID %d', $id));
throw new OutOfBoundsException(sprintf('No data found for ID %d', $id));
}
unset($this->data[$id]);