Issues (194)

src/console/controllers/AutocompleteController.php (15 issues)

1
<?php
2
/**
3
 * Autocomplete module for Craft CMS
4
 *
5
 * Provides Twig template IDE autocomplete of Craft CMS & plugin variables
6
 *
7
 * @link      https://nystudio107.com
0 ignored issues
show
The tag in position 1 should be the @copyright tag
Loading history...
8
 * @link      https://putyourlightson.com
9
 * @copyright Copyright (c) nystudio107
0 ignored issues
show
@copyright tag must contain a year and the name of the copyright holder
Loading history...
10
 * @copyright Copyright (c) PutYourLightsOn
0 ignored issues
show
@copyright tag must contain a year and the name of the copyright holder
Loading history...
11
 */
0 ignored issues
show
PHP version not specified
Loading history...
Missing @category tag in file comment
Loading history...
Missing @package tag in file comment
Loading history...
Missing @author tag in file comment
Loading history...
Missing @license tag in file comment
Loading history...
12
13
namespace nystudio107\autocomplete\console\controllers;
14
15
use nystudio107\autocomplete\Autocomplete;
16
use yii\console\Controller;
17
use yii\console\ExitCode;
18
use yii\helpers\BaseConsole;
19
20
/**
21
 * Manages autocomplete classes.
22
 */
0 ignored issues
show
Missing @category tag in class comment
Loading history...
Missing @package tag in class comment
Loading history...
Missing @author tag in class comment
Loading history...
Missing @license tag in class comment
Loading history...
Missing @link tag in class comment
Loading history...
23
class AutocompleteController extends Controller
24
{
25
    /**
26
     * Generates all autocomplete classes that do not already exist.
27
     */
0 ignored issues
show
Missing @return tag in function comment
Loading history...
28
    public function actionGenerate(): int
29
    {
30
        $this->stdout('Generating autocomplete classes ... ', BaseConsole::FG_YELLOW);
31
        /* @noinspection NullPointerExceptionInspection */
32
        Autocomplete::getInstance()->generateAutocompleteClasses();
33
        $this->stdout('done' . PHP_EOL, BaseConsole::FG_GREEN);
34
35
        return ExitCode::OK;
36
    }
37
38
    /**
39
     * Regenerates all autocomplete classes.
40
     */
0 ignored issues
show
Missing @return tag in function comment
Loading history...
41
    public function actionRegenerate(): int
42
    {
43
        $this->stdout('Regenerating autocomplete classes ... ', BaseConsole::FG_YELLOW);
44
        /* @noinspection NullPointerExceptionInspection */
45
        Autocomplete::getInstance()->regenerateAutocompleteClasses();
46
        $this->stdout('done' . PHP_EOL, BaseConsole::FG_GREEN);
47
48
        return ExitCode::OK;
49
    }
50
}
51