Completed
Push — master ( 613d98...fa04c9 )
by Rémi
20:40
created

TimeoutException   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 19
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A build() 0 8 1
1
<?php
2
3
namespace Burrow\Exception;
4
5
class TimeoutException extends BurrowException
6
{
7
    /**
8
     * Build the exception from another timeout exception.
9
     *
10
     * @param \Exception $e
11
     * @param int        $timeout
12
     *
13
     * @return TimeoutException
14
     */
15
    public static function build(\Exception $e, $timeout)
16
    {
17
        return new self(
18
            sprintf('The connection timed out after %d sec while awaiting incoming data', $timeout),
19
            $e->getCode(),
20
            $e
21
        );
22
    }
23
}
24