Completed
Push — master ( 753e69...36642f )
by Derek Stephen
02:06 queued 13s
created

AlertBox::register()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Bone\Mvc\View\Extension\Plates;
4
5
use Bone\View\Helper\AlertBox as AlertBoxHelper;
6
use League\Plates\Engine;
7
use League\Plates\Extension\ExtensionInterface;
8
9
class AlertBox implements ExtensionInterface
10
{
11
    /**
12
     * @param Engine $engine
13
     */
14 1
    public function register(Engine $engine)
15
    {
16 1
        $engine->registerFunction('alert', [$this, 'alertBox']);
17 1
    }
18
19
    /**
20
     * @param $message
21
     * @return string
22
     */
23
    public function alertBox($message) : string
24
    {
25
        $box = new AlertBoxHelper();
26
27
        return $box->alertBox($message);
28
    }
29
}
30