Completed
Push — master ( db079f...ae1003 )
by Thomas
06:44 queued 04:24
created

MyViewExtension   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 9
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A register() 0 7 1
1
<?php
2
3
namespace example\components;
4
5
use Tebe\Pvc\View\ViewExtension;
6
use Tebe\Pvc\View\View;
7
8
class MyViewExtension implements ViewExtension
9
{
10
    public function register(View $view)
11
    {
12
        $view->registerHelper('hello', function (string $name = '') {
13
            return sprintf("Hallo %s", $name);
14
        });
15
        $view->registerHelper('add', function (float ...$operands) {
16
            return array_sum($operands);
17
        });
18
    }
19
}
20