Completed
Push — stable ( cbd099...ce6aca )
by Nuno
14:51 queued 11s
created

IgnitionSolutionsRepository   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getFromThrowable() 0 4 1
1
<?php
2
3
/**
4
 * This file is part of Collision.
5
 *
6
 * (c) Nuno Maduro <[email protected]>
7
 *
8
 *  For the full copyright and license information, please view the LICENSE
9
 *  file that was distributed with this source code.
10
 */
11
12
namespace NunoMaduro\Collision\Adapters\Laravel;
13
14
use Facade\IgnitionContracts\SolutionProviderRepository;
15
use NunoMaduro\Collision\Contracts\SolutionsRepository;
16
use Throwable;
17
18
/**
19
 * This is an Collision Laravel Adapter Solutions Provider implementation.
20
 *
21
 * Registers the Error Handler on Laravel.
22
 *
23
 * @author Nuno Maduro <[email protected]>
24
 */
25
class IgnitionSolutionsRepository implements SolutionsRepository
26
{
27
    /**
28
     * Holds an instance of ignition solutions provider repository.
29
     *
30
     * @var \Facade\IgnitionContracts\SolutionProviderRepository
31
     */
32
    protected $solutionProviderRepository;
33
34
    /**
35
     * IgnitionSolutionsRepository constructor.
36
     *
37
     * @param  \Facade\IgnitionContracts\SolutionProviderRepository  $solutionProviderRepository
38
     */
39
    public function __construct(SolutionProviderRepository $solutionProviderRepository)
40
    {
41
        $this->solutionProviderRepository = $solutionProviderRepository;
42
    }
43
44
    /**
45
     * {@inheritdoc}
46
     */
47
    public function getFromThrowable(Throwable $throwable): array
48
    {
49
        return $this->solutionProviderRepository->getSolutionsForThrowable($throwable);
50
    }
51
}
52