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

IgnitionSolutionsRepository::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 3
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
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