DummyHookPlugin   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 9
c 0
b 0
f 0
dl 0
loc 25
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A beforeHook() 0 3 1
A afterHook() 0 3 1
A beforeAction() 0 3 1
A afterAction() 0 3 1
1
<?php
2
3
namespace CaptainHook\App\Plugin;
4
5
use CaptainHook\App\Config;
6
use CaptainHook\App\Runner\Hook as RunnerHook;
7
8
class DummyHookPlugin extends Hook\Base
9
{
10
    public static int $beforeHookCalled = 0;
11
    public static int $beforeActionCalled = 0;
12
    public static int $afterActionCalled = 0;
13
    public static int $afterHookCalled = 0;
14
15
    public function beforeHook(RunnerHook $hook): void
16
    {
17
        self::$beforeHookCalled++;
18
    }
19
20
    public function beforeAction(RunnerHook $hook, Config\Action $action): void
21
    {
22
        self::$beforeActionCalled++;
23
    }
24
25
    public function afterAction(RunnerHook $hook, Config\Action $action): void
26
    {
27
        self::$afterActionCalled++;
28
    }
29
30
    public function afterHook(RunnerHook $hook): void
31
    {
32
        self::$afterHookCalled++;
33
    }
34
}
35