HelloController::actionIndex()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 5
rs 10
1
<?php
2
3
/**
4
 * @link https://www.yiiframework.com/
5
 * @copyright Copyright (c) 2008 Yii Software LLC
6
 * @license https://www.yiiframework.com/license/
7
 */
8
9
namespace app\commands;
10
11
use yii\console\Controller;
12
use yii\console\ExitCode;
13
14
/**
15
 * This command echoes the first argument that you have entered.
16
 *
17
 * This command is provided as an example for you to learn how to create console commands.
18
 *
19
 * @author Qiang Xue <[email protected]>
20
 * @since 2.0
21
 */
22
class HelloController extends Controller
23
{
24
    /**
25
     * This command echoes what you have entered as the message.
26
     * @param string $message the message to be echoed.
27
     * @return int Exit code
28
     */
29
    public function actionIndex($message = 'hello world')
30
    {
31
        echo $message . "\n";
32
33
        return ExitCode::OK;
34
    }
35
}
36