Passed
Push — master ( 3a6da4...ca4c8c )
by Sebastian
03:44
created

AddAction   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
eloc 5
dl 0
loc 15
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A applyTo() 0 7 1
1
<?php
2
/**
3
 * This file is part of CaptainHook.
4
 *
5
 * (c) Sebastian Feldmann <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
namespace CaptainHook\App\Runner\Config\Change;
11
12
use CaptainHook\App\Config;
13
use CaptainHook\App\Console\IO;
14
use CaptainHook\App\Runner\Config\Change;
15
use CaptainHook\App\Runner\Config\Setup\Advanced;
16
17
/**
18
 * Class AddAction
19
 *
20
 * @package CaptainHook
21
 * @author  Sebastian Feldmann <[email protected]>
22
 * @link    https://github.com/captainhookphp/captainhook
23
 * @since   Class available since Release 4.1.1
24
 */
25
class AddAction extends Hook
26
{
27
    /**
28
     * Apply changes to the given config
29
     *
30
     * @param  \CaptainHook\App\Config $config
31
     * @throws \Exception
32
     */
33 1
    public function applyTo(Config $config)
34
    {
35 1
        $hookConfig   = $config->getHookConfig($this->hookToChange);
36 1
        $setup        = new Advanced($this->io);
37 1
        $actionConfig = $setup->getActionConfig();
38
39 1
        $hookConfig->addAction($actionConfig);
40 1
    }
41
}
42