HelloController   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A actionIndex() 0 6 1
A actionTelegram() 0 5 1
1
<?php
2
3
/**
4
 * @link http://www.yiiframework.com/
5
 * @copyright Copyright (c) 2008 Yii Software LLC
6
 * @license http://www.yiiframework.com/license/
7
 */
8
9
namespace app\commands;
10
11
use app\core\services\TelegramService;
12
use yii\console\Controller;
13
use yii\console\ExitCode;
14
15
/**
16
 * This command echoes the first argument that you have entered.
17
 *
18
 * This command is provided as an example for you to learn how to create console commands.
19
 *
20
 * @author Qiang Xue <[email protected]>
21
 * @since 2.0
22
 */
23
class HelloController extends Controller
24
{
25
    /**
26
     * This command echoes what you have entered as the message.
27
     * @param string $message the message to be echoed.
28
     * @return int Exit code
29
     */
30
    public function actionIndex($message = 'hello world')
31
    {
32
        echo $message . "\n";
33
34
        \Yii::error(['request_id' => \Yii::$app->requestId->id, 'test_request_id']);
35
        return ExitCode::OK;
36
    }
37
38
    public function actionTelegram()
39
    {
40
        $client = TelegramService::newClient();
41
        dump($client->getMe());
42
        return ExitCode::OK;
43
    }
44
}
45