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

ReadmeController::actionIndex()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 4
rs 10
c 1
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
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