Completed
Push — spike ( a372d1...20d8a1 )
by Akihito
04:14
created

CommandsProvider::get()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 9
ccs 4
cts 4
cp 1
rs 9.6666
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 0
crap 1
1
<?php
2
/**
3
 * This file is part of the BEAR.QueryRepository package.
4
 *
5
 * @license http://opensource.org/licenses/MIT MIT
6
 */
7
namespace BEAR\QueryRepository;
8
9
use BEAR\Resource\ResourceInterface;
10
use Ray\Di\ProviderInterface;
11
12
class CommandsProvider implements ProviderInterface
13
{
14
    /**
15
     * @var QueryRepositoryInterface
16
     */
17
    private $repository;
18
19
    /**
20
     * @var ResourceInterface
21
     */
22
    private $resource;
23
24 11
    public function __construct(
25
        QueryRepositoryInterface $repository,
26
        ResourceInterface $resource
27
    ) {
28 11
        $this->repository = $repository;
29 11
        $this->resource = $resource;
30 11
    }
31
32
    /**
33
     * {@inheritdoc}
34
     */
35 11
    public function get()
36
    {
37
        $commands = [
38 11
            new RefreshSameCommand($this->repository),
39 11
            new RefreshAnnotatedCommand($this->repository, $this->resource)
40
        ];
41
42 11
        return $commands;
43
    }
44
}
45