Passed
Pull Request — master (#149)
by Dmitriy
10:21
created

ConfigBuildException::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 15
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 15
ccs 0
cts 3
cp 0
rs 10
cc 1
nc 1
nop 2
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Composer\Config\Exception;
6
7
use Throwable;
8
9
final class ConfigBuildException extends Exception
10
{
11
    public function __construct($path, Throwable $previous = null)
12
    {
13
        $message = sprintf(
14
            <<<TEXT
15
                An error occured during configuration build.
16
                The file being processed: "%s".
17
                Error text:
18
                    %s
19
                Please, take care of fixing errors in this file before you continue.
20
                TEXT,
21
            $path,
22
            $previous->getMessage()
0 ignored issues
show
Bug introduced by
The method getMessage() does not exist on null. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

22
            $previous->/** @scrutinizer ignore-call */ 
23
                       getMessage()

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
23
        );
24
25
        parent::__construct($message);
26
    }
27
}
28