Passed
Push — trunk ( 9dfcf5...f40966 )
by Christian
12:13 queued 13s
created

ElasticsearchUpdateMappingCommand::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 4
rs 10
c 1
b 0
f 0
1
<?php declare(strict_types=1);
2
3
namespace Shopware\Elasticsearch\Framework\Command;
4
5
use Shopware\Core\Framework\Context;
6
use Shopware\Core\Framework\Log\Package;
7
use Shopware\Elasticsearch\Framework\Indexing\IndexMappingUpdater;
8
use Symfony\Component\Console\Attribute\AsCommand;
9
use Symfony\Component\Console\Command\Command;
0 ignored issues
show
Bug introduced by
The type Symfony\Component\Console\Command\Command was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
10
use Symfony\Component\Console\Input\InputInterface;
11
use Symfony\Component\Console\Output\OutputInterface;
12
13
#[AsCommand(
14
    name: 'es:mapping:update',
15
    description: 'Update the Elasticsearch indices mapping',
16
)]
17
#[Package('core')]
18
class ElasticsearchUpdateMappingCommand extends Command
19
{
20
    /**
21
     * @internal
22
     */
23
    public function __construct(
24
        private readonly IndexMappingUpdater $indexMappingUpdater,
25
    ) {
26
        parent::__construct();
27
    }
28
29
    protected function execute(InputInterface $input, OutputInterface $output): int
30
    {
31
        $this->indexMappingUpdater->update(Context::createDefaultContext());
32
33
        return self::SUCCESS;
34
    }
35
}
36