ConfigurationException   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 2
dl 0
loc 19
ccs 0
cts 9
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A output() 0 4 1
1
<?php
2
/**
3
 * @author Gerard van Helden <[email protected]>
4
 * @copyright Zicht Online <http://zicht.nl>
5
 */
6
7
namespace Zicht\Tool\Container;
8
9
use Symfony\Component\Console\Output\OutputInterface;
10
use Symfony\Component\Yaml\Yaml;
11
12
/**
13
 * Exception wrapper for more verbosity in the config.
14
 */
15
class ConfigurationException extends \RuntimeException implements VerboseException
16
{
17
    /**
18
     * @{inheritDoc}
19
     */
20
    public function __construct($message = "", $code = 0, \Exception $previous = null, array $config = null)
21
    {
22
        parent::__construct($message, $code, $previous);
23
        $this->config = $config;
0 ignored issues
show
Bug introduced by
The property config does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
24
    }
25
26
    /**
27
     * @{inheritDoc}
28
     */
29
    public function output(OutputInterface $output)
30
    {
31
        $output->writeln("Source configuration:\n" . Yaml::dump($this->config));
32
    }
33
}
34