FindStripeAccountByIdTask   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 2
dl 0
loc 26
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A run() 0 9 2
1
<?php
2
3
namespace App\Containers\Stripe\Tasks;
4
5
use App\Containers\Stripe\Data\Repositories\StripeAccountRepository;
6
use App\Ship\Exceptions\NotFoundException;
7
use App\Ship\Parents\Tasks\Task;
8
use Exception;
9
10
class FindStripeAccountByIdTask extends Task
11
{
12
13
    protected $repository;
14
15
    public function __construct(StripeAccountRepository $repository)
16
    {
17
        $this->repository = $repository;
18
    }
19
20
    /**
21
     * @param $id
22
     *
23
     * @return mixed
24
     * @throws NotFoundException
25
     */
26
    public function run($id)
27
    {
28
        try {
29
            return $this->repository->find($id);
30
        }
31
        catch (Exception $exception) {
32
            throw new NotFoundException();
33
        }
34
    }
35
}
36