Completed
Push — master ( d86698...3d0fab )
by
unknown
03:08
created

CountUsersTask::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace App\Containers\User\Tasks;
4
5
use App\Containers\User\Data\Repositories\UserRepository;
6
use App\Ship\Parents\Tasks\Task;
7
8
/**
9
 * Class CountAllUsersTask.
10
 *
11
 * @author Mahmoud Zalt <[email protected]>
12
 */
13
class CountUsersTask extends Task
14
{
15
16
    protected $repository;
17
18
    public function __construct(UserRepository $repository)
19
    {
20
        $this->repository = $repository;
21
    }
22
23
    /**
24
     * @return  int
25
     */
26
    public function run(): int
27
    {
28
        return $this->repository->all()->count();
29
    }
30
31
}
32