Passed
Push — master ( 6015fa...83e3bb )
by Tom
02:48
created

ParseException::getParseMessage()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
/* this file is part of pipelines */
4
5
namespace Ktomk\Pipelines\File;
6
7
use InvalidArgumentException;
8
9
/**
10
 * Bitbucket Pipelines file parsing exception
11
 */
12
class ParseException extends InvalidArgumentException
13
{
14
    /**
15
     * @var string
16
     */
17
    private $parseMessage;
18
19
    /**
20
     * Abstract method to throw this message
21
     *
22
     * @param string $message
23
     * @throws ParseException
24
     */
25 1
    public static function __($message)
26
    {
27 1
        $self = new self(
28 1
            sprintf('file parse error: %s', $message),
29 1
            2
30
        );
31
32 1
        $self->parseMessage = $message;
33
34 1
        throw $self;
35
    }
36
37
    /**
38
     * @return string
39
     */
40 1
    public function getParseMessage()
41
    {
42 1
        return $this->parseMessage;
43
    }
44
}
45