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

DiscoveryFailedException::getExceptions()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
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