Completed
Push — feature/rewrite ( dad4c8...db5d15 )
by Alexandre
01:44
created

WriteRepository   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 1
Bugs 1 Features 0
Metric Value
wmc 3
c 1
b 1
f 0
lcom 1
cbo 1
dl 0
loc 33
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A add() 0 4 1
A update() 0 4 1
1
<?php
2
3
namespace Black\Page\Infrastructure\Persistence\CQRS;
4
5
use Black\Page\Domain\Model\WebPage;
6
use Black\Page\Domain\Model\WebPageRepository;
7
8
/**
9
 * Class WriteRepository
10
 */
11
class WriteRepository
12
{
13
    /**
14
     * @var WebPageRepository
15
     */
16
    protected $repository;
17
18
    /**
19
     * WriteRepository constructor.
20
     *
21
     * @param WebPageRepository $repository
22
     */
23
    public function __construct(WebPageRepository $repository)
24
    {
25
        $this->repository = $repository;
26
    }
27
28
    /**
29
     * @param WebPage $webpage
30
     */
31
    public function add(WebPage $webpage)
32
    {
33
        $this->repository->add($webpage);
34
    }
35
36
    /**
37
     * @param WebPage $webpage
38
     */
39
    public function update(WebPage $webpage)
40
    {
41
        $this->repository->update($webpage);
42
    }
43
}
44