Completed
Pull Request — master (#59)
by Tobias
08:06
created

DiscoveryFailedException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getExceptions() 0 4 1
1
<?php
2
3
namespace Http\Discovery\Exception;
4
5
/**
6
 * Thrown when all discovery strategies fails to find a resource.
7
 *
8
 * @author Tobias Nyholm <[email protected]>
9
 */
10
final class DiscoveryFailedException extends \RuntimeException
11
{
12
    /**
13
     * @var array
14
     */
15
    private $exceptions;
16
17
    /**
18
     *
19
     * @param $exceptions
20
     */
21
    public function __construct($message, array $exceptions = [])
22
    {
23
        $this->exceptions = $exceptions;
24
25
        parent::__construct($message, 0, array_shift($exceptions));
26
    }
27
28
    /**
29
     * @return array
30
     */
31
    public function getExceptions()
32
    {
33
        return $this->exceptions;
34
    }
35
}
36