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

TimeoutException::build()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 2
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