Passed
Push — master ( 7bee4d...457c92 )
by Sebastian
01:54
created

Hook::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 2
c 1
b 0
f 1
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
cc 1
nc 1
nop 2
crap 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.2.0
24
 */
25
abstract class Hook implements Change
26
{
27
    /**
28
     * @var \CaptainHook\App\Console\IO
29
     */
30
    protected $io;
31
32
    /**
33
     * Name of the hook to add the action to
34
     *
35
     * @var string
36
     */
37
    protected $hookToChange;
38
39
    /**
40
     * AddAction constructor
41
     *
42
     * @param \CaptainHook\App\Console\IO $io
43
     * @param string                      $hookToChange
44
     */
45 3
    public function __construct(IO $io, string $hookToChange)
46
    {
47 3
        $this->io           = $io;
48 3
        $this->hookToChange = $hookToChange;
49 3
    }
50
51
    /**
52
     * Apply changes to the given config
53
     *
54
     * @param  \CaptainHook\App\Config $config
55
     * @throws \Exception
56
     */
57
    abstract public function applyTo(Config $config);
58
}
59