Completed
Push — master ( dd8846...82fafa )
by Amine
03:04
created

RenderCommand   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 3
dl 0
loc 24
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A init() 0 10 1
A execute() 0 9 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