Total Complexity | 6 |
Total Lines | 50 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
23 | class Repository implements DomainRepository |
||
24 | { |
||
25 | /** |
||
26 | * @var DomainRepository |
||
27 | */ |
||
28 | private $repository; |
||
29 | |||
30 | /** |
||
31 | * @var Uuid[] |
||
32 | */ |
||
33 | private $modified = []; |
||
34 | |||
35 | public function __construct(DomainRepository $repository) |
||
36 | { |
||
37 | $this->modified = []; |
||
38 | $this->repository = $repository; |
||
39 | } |
||
40 | |||
41 | /** |
||
42 | * @param Uuid $uuid |
||
43 | * @return Board |
||
44 | * @throws BoardNotFoundException |
||
45 | */ |
||
46 | public function getBoardByUuid(Uuid $uuid): Board |
||
47 | { |
||
48 | $board = $this->repository->getBoardByUuid($uuid); |
||
49 | $this->modified[] = $uuid; |
||
50 | return $board; |
||
51 | } |
||
52 | |||
53 | /** |
||
54 | * @param Board $board |
||
55 | * @throws BoardExistException |
||
56 | */ |
||
57 | public function addBoard(Board $board): void |
||
58 | { |
||
59 | $this->repository->addBoard($board); |
||
60 | $this->modified[] = $board->getUuid(); |
||
61 | } |
||
62 | |||
63 | public function pullEvents(): Events |
||
73 | } |
||
74 | } |
||
75 |