|
2 | 2 |
|
3 | 3 | namespace Application\Controller; |
4 | 4 |
|
5 | | -use Application\Service\RepositoryRetriever; |
| 5 | +use Application\Entity; |
| 6 | +use Application\Service; |
6 | 7 | use Zend\Mvc\Controller\AbstractActionController; |
7 | 8 | use Zend\View\Model\ViewModel; |
8 | 9 |
|
9 | 10 | class ContributorsController extends AbstractActionController |
10 | 11 | { |
11 | 12 | /** |
12 | | - * @var RepositoryRetriever |
| 13 | + * @var Service\RepositoryRetriever |
13 | 14 | */ |
14 | 15 | private $repositoryRetriever; |
15 | 16 |
|
16 | 17 | /** |
17 | | - * @var array |
| 18 | + * @var Entity\Repository |
18 | 19 | */ |
19 | | - private $repositoryData; |
| 20 | + private $repository; |
20 | 21 |
|
21 | 22 | /** |
22 | | - * @param RepositoryRetriever $repositoryRetriever |
23 | | - * @param array $repositoryData |
| 23 | + * @param Service\RepositoryRetriever $repositoryRetriever |
| 24 | + * @param Entity\Repository $repository |
24 | 25 | */ |
25 | | - public function __construct(RepositoryRetriever $repositoryRetriever, array $repositoryData) |
| 26 | + public function __construct(Service\RepositoryRetriever $repositoryRetriever, Entity\Repository $repository) |
26 | 27 | { |
27 | 28 | $this->repositoryRetriever = $repositoryRetriever; |
28 | | - $this->repositoryData = $repositoryData; |
| 29 | + $this->repository = $repository; |
29 | 30 | } |
30 | 31 |
|
31 | 32 | public function indexAction() |
32 | 33 | { |
33 | 34 | $contributors = $this->repositoryRetriever->getContributors( |
34 | | - $this->repositoryData['owner'], |
35 | | - $this->repositoryData['name'] |
| 35 | + $this->repository->owner(), |
| 36 | + $this->repository->name() |
36 | 37 | ); |
37 | 38 |
|
38 | 39 | shuffle($contributors); |
39 | 40 |
|
40 | 41 | $metadata = $this->repositoryRetriever->getUserRepositoryMetadata( |
41 | | - $this->repositoryData['owner'], |
42 | | - $this->repositoryData['name'] |
| 42 | + $this->repository->owner(), |
| 43 | + $this->repository->name() |
43 | 44 | ); |
44 | 45 |
|
45 | 46 | return new ViewModel([ |
|
0 commit comments