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

AdminException   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 20
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 10 1
1
<?php
2
3
namespace LAG\AdminBundle\Admin\Exception;
4
5
use Exception;
6
use LAG\AdminBundle\Admin\AdminInterface;
7
8
class AdminException extends Exception
9
{
10
    /**
11
     * AdminException constructor. Append the admin and the action name to the exception message
12
     *
13
     * @param string $message
14
     * @param string $actionName
15
     * @param AdminInterface $admin
16
     */
17
    public function __construct($message, $actionName = '', AdminInterface $admin)
18
    {
19
        $message .= sprintf(
20
            ', for Admin %s and action %s',
21
            $admin->getName(),
22
            $actionName
23
        );
24
25
        parent::__construct($message);
26
    }
27
}
28