Completed
Push — master ( aa5c9c...a87303 )
by Johnny
02:10
created

actions_priority.php ➔ otherFunction()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
namespace Sandbox\Demos;
3
4
use Redbox\Hooks\Actions;
5
6
require 'autoload.php';
7
8
/**
9
 * This function is going to be called second.
10
 */
11
function otherFunction()
12
{
13
    echo "Called second\n";
14
}
15
16
/**
17
 * This function is going to be called first.
18
 */
19
function oneFunction()
20
{
21
    echo "Called first\n";
22
}
23
24
Actions::addAction('say_hello', 'Sandbox\Demos\oneFunction', 0);
25
Actions::addAction('say_hello', 'Sandbox\Demos\otherFunction', 1);
26
Actions::doAction('say_hello');
27
28
/**
29
 * This is not required in your code. I have to add this to reset my unit tests.
30
 */
31
Actions::removeAllActions('say_hello');