Completed
Push — develop ( cc8c81...372a4c )
by Barney
14s
created

ResponseLogStopException::stop()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 1
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
1
<?php
2
/**
3
 * @codingStandardsIgnoreStart
4
 *
5
 * @author       Barney Hanlon <[email protected]>
6
 * @copyright    Barney Hanlon 2017
7
 * @license      https://opensource.org/licenses/MIT
8
 *
9
 * @codingStandardsIgnoreEnd
10
 */
11
12
namespace Shrikeh\GuzzleMiddleware\TimerLogger\ResponseLogger\Exception;
13
14
use Exception;
15
use RuntimeException;
16
17
/**
18
 * Class ResponseLogStartException.
19
 */
20
final class ResponseLogStopException extends RuntimeException
21
{
22
    const STOP_MSG = 'An error occurred while attempting to log the request end';
23
    const STOP_CODE = 8;
24
25
    /**
26
     * @param \Exception $e The previous exception
27
     *
28
     * @return ResponseLogStopException
29
     */
30
    public static function stop(Exception $e)
31
    {
32
        return new self(
33
            self::STOP_MSG,
34
            self::STOP_CODE,
35
            $e
36
        );
37
    }
38
}
39