LoggableAction   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 7
c 1
b 0
f 0
dl 0
loc 24
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A afterAction() 0 2 1
A __construct() 0 5 1
A beforeAction() 0 5 1
1
<?php
2
3
/*
4
 * This file is part of the LightSAML-Core package.
5
 *
6
 * (c) Milos Tomic <[email protected]>
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
namespace LightSaml\Action;
13
14
use LightSaml\Context\ContextInterface;
15
use Psr\Log\LoggerInterface;
16
17
class LoggableAction extends WrappedAction
18
{
19
    /**
20
     * @var LoggerInterface
21
     */
22
    private $logger;
23
24
    public function __construct(ActionInterface $action, LoggerInterface $logger)
25
    {
26
        parent::__construct($action);
27
28
        $this->logger = $logger;
29
    }
30
31
    protected function beforeAction(ContextInterface $context)
32
    {
33
        $this->logger->debug(sprintf('Executing action "%s"', get_class($this->action)), [
34
            'context' => $context,
35
            'action' => $this->action,
36
        ]);
37
    }
38
39
    protected function afterAction(ContextInterface $context)
40
    {
41
    }
42
}
43