Completed
Pull Request — develop (#25)
by Barney
05:15
created

FormatterExceptionAbstract::msg()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 7
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 4
c 1
b 0
f 0
nc 1
nop 1
dl 7
loc 7
rs 9.4285
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\Formatter\Exception;
13
14
use RuntimeException;
15
16 View Code Duplication
abstract class FormatterExceptionAbstract extends RuntimeException
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
17
{
18
    /**
19
     * @param \Exception|null $e An optional previous Exception
20
     *
21
     * @return static
22
     */
23
    public static function msg(
24
        \Exception $e = null
25
    ) {
26
        return new static(
27
            static::MSG_MESSAGE,
0 ignored issues
show
Bug introduced by
The constant Shrikeh\GuzzleMiddleware...onAbstract::MSG_MESSAGE was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
28
            static::MSG_CODE,
0 ignored issues
show
Bug introduced by
The constant Shrikeh\GuzzleMiddleware...ptionAbstract::MSG_CODE was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
29
            $e
30
        );
31
    }
32
33
    /**
34
     * @param \Exception|null $e An optional previous Exception
35
     *
36
     * @return static
37
     */
38
    public static function level(
39
        \Exception $e = null
40
    ) {
41
        return new static(
42
            static::LEVEL_MESSAGE,
0 ignored issues
show
Bug introduced by
The constant Shrikeh\GuzzleMiddleware...Abstract::LEVEL_MESSAGE was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
43
            static::LEVEL_CODE,
0 ignored issues
show
Bug introduced by
The constant Shrikeh\GuzzleMiddleware...ionAbstract::LEVEL_CODE was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
44
            $e
45
        );
46
    }
47
}
48