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

CommandsProvider   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 2
dl 0
loc 33
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A get() 0 9 1
A __construct() 0 7 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