Completed
Push — master ( 7a82a2...eef030 )
by Pavel
02:12
created

RestActionAbstract   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 45
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A response() 0 3 1
A __construct() 0 4 1
A repository() 0 3 1
1
<?php namespace Pz\Doctrine\Rest\Action;
2
3
use Pz\Doctrine\Rest\RestRepository;
4
use Pz\Doctrine\Rest\RestRequestAbstract;
5
use Pz\Doctrine\Rest\RestResponse;
6
use Pz\Doctrine\Rest\RestResponseFactory;
7
8
abstract class RestActionAbstract
9
{
10
    /**
11
     * @var RestRepository
12
     */
13
    protected $repository;
14
15
    /**
16
     * @var RestResponseFactory
17
     */
18
    protected $response;
19
20
    /**
21
     * @param RestRequestAbstract $request
22
     *
23
     * @return RestResponse
24
     */
25
    abstract public function handle(RestRequestAbstract $request);
26
27
    /**
28
     * RestActionAbstract constructor.
29
     *
30
     * @param RestRepository      $repository
31
     * @param RestResponseFactory $response
32
     */
33 3
    public function __construct(RestRepository $repository, RestResponseFactory $response)
34
    {
35 3
        $this->repository = $repository;
36 3
        $this->response = $response;
37 3
    }
38
39
    /**
40
     * @return RestRepository
41
     */
42 3
    public function repository()
43
    {
44 3
        return $this->repository;
45
    }
46
47
    /**
48
     * @return RestResponseFactory
49
     */
50 2
    public function response()
51
    {
52 2
        return $this->response;
53
    }
54
}
55