Completed
Pull Request — master (#59)
by Tobias
07:03
created

DiscoveryFailedException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 2
c 2
b 0
f 0
lcom 0
cbo 0
dl 0
loc 25
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
     * @param $exceptions
19
     */
20
    public function __construct($message, array $exceptions = [])
21
    {
22
        $this->exceptions = $exceptions;
23
24
        parent::__construct($message, 0, array_shift($exceptions));
25
    }
26
27
    /**
28
     * @return array
29
     */
30
    public function getExceptions()
31
    {
32
        return $this->exceptions;
33
    }
34
}
35