Completed
Push — master ( 971dc1...d579c1 )
by Andrii
15:48
created

ReadmeController   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
lcom 1
cbo 1
dl 0
loc 16
rs 10
c 1
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A actionIndex() 0 4 1
A getPath() 0 4 2
1
<?php
2
/**
3
 * README plugin for HiDev
4
 *
5
 * @link      https://github.com/hiqdev/hidev-readme
6
 * @package   hidev-readme
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2015-2017, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hidev\readme\console;
12
13
14
/**
15
 * README file generation.
16
 * @author Andrii Vasyliev <[email protected]>
17
 */
18
class ReadmeController extends \hidev\base\Controller
19
{
20
    public $path;
21
22
    public $type = 'markdown';
23
24
    public function actionIndex()
25
    {
26
        $this->take('readme')->save($this->getPath(), $this->type);
27
    }
28
29
    public function getPath()
30
    {
31
        return $this->path ?: $this->id;
32
    }
33
}
34