Plugin::console()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 2
Metric Value
cc 1
eloc 3
c 2
b 0
f 2
nc 1
nop 1
dl 0
loc 5
rs 10
1
<?php
2
declare(strict_types=1);
3
4
namespace BEdita\ElasticSearch;
5
6
use BEdita\ElasticSearch\Command\CreateIndexCommand;
7
use BEdita\ElasticSearch\Command\UpdateIndexCommand;
8
use Cake\Console\CommandCollection;
9
use Cake\Core\BasePlugin;
10
use Cake\Core\PluginApplicationInterface;
11
use Cake\ElasticSearch\Plugin as ElasticSearchPlugin;
12
13
/**
14
 * Plugin for BEdita ElasticSearch
15
 */
16
class Plugin extends BasePlugin
17
{
18
    /**
19
     * {@inheritDoc}
20
     *
21
     * @codeCoverageIgnore
22
     */
23
    public function bootstrap(PluginApplicationInterface $app): void
24
    {
25
        parent::bootstrap($app);
26
27
        $app->addPlugin(ElasticSearchPlugin::class);
28
    }
29
30
    /**
31
     * @inheritDoc
32
     */
33
    public function console(CommandCollection $commands): CommandCollection
34
    {
35
        return parent::console($commands)
36
            ->add('elastic:createIndex', CreateIndexCommand::class)
37
            ->add('elastic:updateIndex', UpdateIndexCommand::class);
38
    }
39
}
40