ExtensionHandler   A
last analyzed

Complexity

Total Complexity 10

Size/Duplication

Total Lines 89
Duplicated Lines 0 %

Test Coverage

Coverage 90%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 10
eloc 1
c 1
b 0
f 0
dl 0
loc 89
ccs 18
cts 20
cp 0.9
rs 10

10 Methods

Rating   Name   Duplication   Size   Complexity  
A onScheduleFailure() 0 2 1
A onTaskSuccess() 0 2 1
A onTaskFailure() 0 2 1
A afterTask() 0 2 1
A onScheduleSuccess() 0 2 1
A filterSchedule() 0 2 1
A afterSchedule() 0 2 1
A beforeTask() 0 2 1
A filterTask() 0 2 1
A beforeSchedule() 0 2 1
1
<?php
2
3
namespace Zenstruck\ScheduleBundle\Schedule\Extension;
4
5
use Zenstruck\ScheduleBundle\Schedule\Exception\SkipSchedule;
6
use Zenstruck\ScheduleBundle\Schedule\Exception\SkipTask;
7
use Zenstruck\ScheduleBundle\Schedule\ScheduleRunContext;
8
use Zenstruck\ScheduleBundle\Schedule\Task\TaskRunContext;
9
10
/**
11
 * @author Kevin Bond <[email protected]>
12
 */
13
abstract class ExtensionHandler
14
{
15
    /**
16
     * Skip entire schedule if \Zenstruck\ScheduleBundle\Schedule\Exception\SkipSchedule
17
     * exception is thrown.
18
     *
19
     * @throws SkipSchedule
20
     */
21 5
    public function filterSchedule(ScheduleRunContext $context, object $extension): void
0 ignored issues
show
Unused Code introduced by
The parameter $context is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

21
    public function filterSchedule(/** @scrutinizer ignore-unused */ ScheduleRunContext $context, object $extension): void

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $extension is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

21
    public function filterSchedule(ScheduleRunContext $context, /** @scrutinizer ignore-unused */ object $extension): void

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
22
    {
23
        // noop
24 5
    }
25
26
    /**
27
     * Executes before the schedule runs.
28
     */
29 5
    public function beforeSchedule(ScheduleRunContext $context, object $extension): void
0 ignored issues
show
Unused Code introduced by
The parameter $context is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

29
    public function beforeSchedule(/** @scrutinizer ignore-unused */ ScheduleRunContext $context, object $extension): void

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $extension is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

29
    public function beforeSchedule(ScheduleRunContext $context, /** @scrutinizer ignore-unused */ object $extension): void

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
30
    {
31
        // noop
32 5
    }
33
34
    /**
35
     * Executes after the schedule runs.
36
     */
37 5
    public function afterSchedule(ScheduleRunContext $context, object $extension): void
0 ignored issues
show
Unused Code introduced by
The parameter $extension is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

37
    public function afterSchedule(ScheduleRunContext $context, /** @scrutinizer ignore-unused */ object $extension): void

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $context is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

37
    public function afterSchedule(/** @scrutinizer ignore-unused */ ScheduleRunContext $context, object $extension): void

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
38
    {
39
        // noop
40 5
    }
41
42
    /**
43
     * Executes if the schedule ran with no failures.
44
     */
45 2
    public function onScheduleSuccess(ScheduleRunContext $context, object $extension): void
0 ignored issues
show
Unused Code introduced by
The parameter $extension is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

45
    public function onScheduleSuccess(ScheduleRunContext $context, /** @scrutinizer ignore-unused */ object $extension): void

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $context is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

45
    public function onScheduleSuccess(/** @scrutinizer ignore-unused */ ScheduleRunContext $context, object $extension): void

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
46
    {
47
        // noop
48 2
    }
49
50
    /**
51
     * Executes if the schedule ran with failures.
52
     */
53
    public function onScheduleFailure(ScheduleRunContext $context, object $extension): void
0 ignored issues
show
Unused Code introduced by
The parameter $extension is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

53
    public function onScheduleFailure(ScheduleRunContext $context, /** @scrutinizer ignore-unused */ object $extension): void

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $context is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

53
    public function onScheduleFailure(/** @scrutinizer ignore-unused */ ScheduleRunContext $context, object $extension): void

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
54
    {
55
        // noop
56
    }
57
58
    /**
59
     * Skip task if \Zenstruck\ScheduleBundle\Schedule\Exception\SkipTask exception
60
     * is thrown.
61
     *
62
     * @throws SkipTask
63
     */
64 10
    public function filterTask(TaskRunContext $context, object $extension): void
0 ignored issues
show
Unused Code introduced by
The parameter $extension is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

64
    public function filterTask(TaskRunContext $context, /** @scrutinizer ignore-unused */ object $extension): void

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $context is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

64
    public function filterTask(/** @scrutinizer ignore-unused */ TaskRunContext $context, object $extension): void

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
65
    {
66
        // noop
67 10
    }
68
69
    /**
70
     * Executes before the task runs (not if skipped).
71
     */
72 16
    public function beforeTask(TaskRunContext $context, object $extension): void
0 ignored issues
show
Unused Code introduced by
The parameter $extension is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

72
    public function beforeTask(TaskRunContext $context, /** @scrutinizer ignore-unused */ object $extension): void

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $context is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

72
    public function beforeTask(/** @scrutinizer ignore-unused */ TaskRunContext $context, object $extension): void

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
73
    {
74
        // noop
75 16
    }
76
77
    /**
78
     * Executes after the task runs (not if skipped).
79
     */
80 13
    public function afterTask(TaskRunContext $context, object $extension): void
0 ignored issues
show
Unused Code introduced by
The parameter $context is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

80
    public function afterTask(/** @scrutinizer ignore-unused */ TaskRunContext $context, object $extension): void

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $extension is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

80
    public function afterTask(TaskRunContext $context, /** @scrutinizer ignore-unused */ object $extension): void

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
81
    {
82
        // noop
83 13
    }
84
85
    /**
86
     * Executes if the task ran successfully (not if skipped).
87
     */
88 4
    public function onTaskSuccess(TaskRunContext $context, object $extension): void
0 ignored issues
show
Unused Code introduced by
The parameter $extension is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

88
    public function onTaskSuccess(TaskRunContext $context, /** @scrutinizer ignore-unused */ object $extension): void

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $context is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

88
    public function onTaskSuccess(/** @scrutinizer ignore-unused */ TaskRunContext $context, object $extension): void

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
89
    {
90
        // noop
91 4
    }
92
93
    /**
94
     * Executes if the task failed (not if skipped).
95
     */
96 8
    public function onTaskFailure(TaskRunContext $context, object $extension): void
0 ignored issues
show
Unused Code introduced by
The parameter $extension is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

96
    public function onTaskFailure(TaskRunContext $context, /** @scrutinizer ignore-unused */ object $extension): void

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $context is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

96
    public function onTaskFailure(/** @scrutinizer ignore-unused */ TaskRunContext $context, object $extension): void

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
97
    {
98
        // noop
99 8
    }
100
101
    abstract public function supports(object $extension): bool;
102
}
103