Plugin   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 3
Bugs 0 Features 2
Metric Value
eloc 6
c 3
b 0
f 2
dl 0
loc 22
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A console() 0 5 1
A bootstrap() 0 5 1
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