Completed
Push — dev ( 243dfc...851a92 )
by Arnaud
9s
created

ConfigurationException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 19
rs 10
c 2
b 0
f 0

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
    public function __construct($message, $actionName, AdminInterface $admin = null)
11
    {
12
        if (null !== $admin) {
13
            $adminName = $admin->getName();
14
        } else {
15
            $adminName = 'unknown';
16
        }
17
18
        $message .= sprintf(
19
            ', for Admin %s and action %s',
20
            $adminName,
21
            $actionName
22
        );
23
24
        parent::__construct($message);
25
    }
26
}
27