Failure   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A execute() 0 7 1
1
<?php
2
3
/**
4
 * This file is part of CaptainHook
5
 *
6
 * (c) Sebastian Feldmann <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace CaptainHook\App\Hook\Debug;
13
14
use CaptainHook\App\Config;
15
use CaptainHook\App\Console\IO;
16
use CaptainHook\App\Exception\ActionFailed;
17
use CaptainHook\App\Hook\Debug;
18
use SebastianFeldmann\Git\Repository;
19
20
/**
21
 * Debug hook to test hook triggering that fails the hook execution
22
 *
23
 * @package CaptainHook
24
 * @author  Sebastian Feldmann <[email protected]>
25
 * @link    https://github.com/captainhook-git/captainhook
26
 * @since   Class available since Release 5.20.1
27
 */
28
class Failure extends Debug
29
{
30
    /**
31
     * Executes the action
32
     *
33
     * @param  \CaptainHook\App\Config           $config
34
     * @param  \CaptainHook\App\Console\IO       $io
35
     * @param  \SebastianFeldmann\Git\Repository $repository
36
     * @param  \CaptainHook\App\Config\Action    $action
37
     * @return void
38
     * @throws \Exception
39
     */
40 1
    public function execute(Config $config, IO $io, Repository $repository, Config\Action $action): void
41
    {
42 1
        $this->debugOutput($io, $repository);
43
44 1
        throw new ActionFailed(
45 1
            'The \'Debug\' action is only for debugging purposes, '
46 1
            . 'please remove the \'Debug\' action from your config'
47 1
        );
48
    }
49
}
50