CallbackAbstract   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Importance

Changes 2
Bugs 1 Features 0
Metric Value
eloc 1
c 2
b 1
f 0
dl 0
loc 43
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A fail() 0 2 1
A progress() 0 2 1
A start() 0 2 1
A success() 0 2 1
1
<?php
2
3
/*
4
 * This file is part of NodalFlow.
5
 *     (c) Fabrice de Stefanis / https://github.com/fab2s/NodalFlow
6
 * This source file is licensed under the MIT license which you will
7
 * find in the LICENSE file or at https://opensource.org/licenses/MIT
8
 */
9
10
namespace fab2s\NodalFlow\Callbacks;
11
12
use fab2s\NodalFlow\Flows\FlowInterface;
13
use fab2s\NodalFlow\Nodes\NodeInterface;
14
15
/**
16
 * Abstract Class CallbackAbstract
17
 * Provide with dummy implementations to allow partial
18
 * and DRY usage (eg actually use some of the events)
19
 *
20
 * @deprecated use FlowEvent or implement FlowEventInterface instead
21
 */
22
abstract class CallbackAbstract implements CallbackInterface
0 ignored issues
show
Deprecated Code introduced by
The interface fab2s\NodalFlow\Callbacks\CallbackInterface has been deprecated: use FlowEvent or implement FlowEventInterface instead ( Ignorable by Annotation )

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

22
abstract class CallbackAbstract implements /** @scrutinizer ignore-deprecated */ CallbackInterface

This interface has been deprecated. The supplier of the interface has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the interface will be removed and what other interface to use instead.

Loading history...
23
{
24
    /**
25
     * Triggered when a Flow starts
26
     *
27
     * @param FlowInterface $flow
28
     */
29
    public function start(FlowInterface $flow)
30
    {
31
    }
32
33
    /**
34
     * Triggered when a Flow progresses,
35
     * eg exec once or generates once
36
     *
37
     * @param FlowInterface $flow
38
     * @param NodeInterface $node
39
     */
40
    public function progress(FlowInterface $flow, NodeInterface $node)
41
    {
42
    }
43
44
    /**
45
     * Triggered when a Flow completes without exceptions
46
     *
47
     * @param FlowInterface $flow
48
     */
49
    public function success(FlowInterface $flow)
50
    {
51
        /*
52
         * `if ($flow->getFlowStatus()->isDirty()) {
53
         *      // a node broke the flow
54
         * }`
55
         */
56
    }
57
58
    /**
59
     * Triggered when a Flow fails
60
     *
61
     * @param FlowInterface $flow
62
     */
63
    public function fail(FlowInterface $flow)
64
    {
65
    }
66
}
67