Code Duplication    Length = 23-24 lines in 2 locations

src/Platfourm/Auth/Services/CheckMailService.php 1 location

@@ 20-43 (lines=24) @@
17
use App\Services\EntityService;
18
use App\Services\ServiceDispatcher;
19
20
class CheckMailService extends EntityService
21
{
22
    protected $repository;
23
    protected $authUserService;
24
25
    public function __construct(
26
        AuthUserServiceContract $authUserService,
27
        UserRepository $repository
28
    ) {
29
        $this->authUserService = $authUserService;
30
        $this->repository      = $repository;
31
    }
32
33
    public function run($mail)
34
    {
35
        if (!($this->repository instanceof Repository)) {
36
            throw new RepositoryNotFoundException;
37
        }
38
39
        $item = $this->repository->findBy('email', $mail);
40
41
        return $item;
42
    }
43
}
44

src/Platfourm/Auth/Services/RegisterUserService.php 1 location

@@ 18-40 (lines=23) @@
15
use App\Repositories\Repository;
16
use App\Services\EntityService;
17
18
class RegisterUserService extends EntityService
19
{
20
    protected $repository;
21
    protected $authUserService;
22
23
    public function __construct(UserRepository $repository)
24
    {
25
        $this->repository = $repository;
26
    }
27
28
    public function run(array $data)
29
    {
30
        if (!($this->repository instanceof Repository)) {
31
            throw new RepositoryNotFoundException;
32
        }
33
34
        $data['password'] = bcrypt($data['password']);
35
36
        $entity = $this->repository->create($data);
37
38
        return $entity;
39
    }
40
}
41