RenderCommand   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A init() 0 8 1
A execute() 0 8 1
1
<?php namespace Tarsana\Command\Examples;
2
3
use Tarsana\Command\Command;
4
5
class RenderCommand extends Command {
6
7
    protected function init ()
8
    {
9
        $this->name('Render')
10
             ->version('1.0.0')
11
             ->description('Renders the hello template.')
12
             ->syntax('name: (string:You)')
13
             ->describe('name', 'Your name.')
14
             ->templatesPath(TEMPLATES_PATH);
15
             // this points to /tests/resources/templates
16
    }
17
18
    protected function execute()
19
    {
20
        $message = $this->template('hello')
21
            ->render([
22
                'name' => $this->args->name
23
            ]);
24
25
        $this->console->line($message);
26
    }
27
28
}
29