Completed
Pull Request — master (#92)
by Arnaud
17:46
created

ConfigurationException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 90%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 16 2
1
<?php
2
3
namespace LAG\AdminBundle\Action\Configuration;
4
5
use Exception;
6
use LAG\AdminBundle\Admin\AdminInterface;
7
8
class ConfigurationException extends Exception
9
{
10 2
    public function __construct($message, $actionName, AdminInterface $admin = null)
11
    {
12 2
        if (null !== $admin) {
13 1
            $adminName = $admin->getName();
14
        } else {
15 1
            $adminName = 'unknown';
16
        }
17
18 2
        $message .= sprintf(
19 2
            ', for Admin %s and action %s',
20
            $adminName,
21 2
            $actionName
22
        );
23
24 2
        parent::__construct($message);
25 2
    }
26
}
27