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,6 +2,7 @@
namespace DesignPatterns\More\Repository;
use OutOfBoundsException;
use DesignPatterns\More\Repository\Domain\Post;
use DesignPatterns\More\Repository\Domain\PostId;
@@ -16,10 +17,7 @@ use DesignPatterns\More\Repository\Domain\PostId;
*/
class PostRepository
{
/**
* @var Persistence
*/
private $persistence;
private Persistence $persistence;
public function __construct(Persistence $persistence)
{
@@ -35,8 +33,8 @@ class PostRepository
{
try {
$arrayData = $this->persistence->retrieve($id->toInt());
} catch (\OutOfBoundsException $e) {
throw new \OutOfBoundsException(sprintf('Post with id %d does not exist', $id->toInt()), 0, $e);
} catch (OutOfBoundsException $e) {
throw new OutOfBoundsException(sprintf('Post with id %d does not exist', $id->toInt()), 0, $e);
}
return Post::fromState($arrayData);