Skip to content

Commit 01c452f

Browse files
authored
Merge pull request #12 from dachcom-digital/coding-standard/refactor-main
[CS] Refactor
2 parents 663909b + 3c07360 commit 01c452f

25 files changed

+302
-35
lines changed

src/Builder/ClientBuilder.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
<?php
22

3+
/*
4+
* This source file is available under two different licenses:
5+
* - GNU General Public License version 3 (GPLv3)
6+
* - DACHCOM Commercial License (DCL)
7+
* Full copyright and license information is available in
8+
* LICENSE.md which is distributed with this source code.
9+
*
10+
* @copyright Copyright (c) DACHCOM.DIGITAL AG (https://www.dachcom-digital.com)
11+
* @license GPLv3 and DCL
12+
*/
13+
314
namespace DsOpenSearchBundle\Builder;
415

516
use DynamicSearchBundle\Logger\LoggerInterface;
@@ -9,7 +20,8 @@ class ClientBuilder implements ClientBuilderInterface
920
{
1021
public function __construct(
1122
protected LoggerInterface $logger
12-
) {}
23+
) {
24+
}
1325

1426
public function build(array $indexOptions): Client
1527
{

src/Builder/ClientBuilderInterface.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
<?php
22

3+
/*
4+
* This source file is available under two different licenses:
5+
* - GNU General Public License version 3 (GPLv3)
6+
* - DACHCOM Commercial License (DCL)
7+
* Full copyright and license information is available in
8+
* LICENSE.md which is distributed with this source code.
9+
*
10+
* @copyright Copyright (c) DACHCOM.DIGITAL AG (https://www.dachcom-digital.com)
11+
* @license GPLv3 and DCL
12+
*/
13+
314
namespace DsOpenSearchBundle\Builder;
415

516
use OpenSearch\Client;

src/Command/RebuildIndexCommand.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
<?php
22

3+
/*
4+
* This source file is available under two different licenses:
5+
* - GNU General Public License version 3 (GPLv3)
6+
* - DACHCOM Commercial License (DCL)
7+
* Full copyright and license information is available in
8+
* LICENSE.md which is distributed with this source code.
9+
*
10+
* @copyright Copyright (c) DACHCOM.DIGITAL AG (https://www.dachcom-digital.com)
11+
* @license GPLv3 and DCL
12+
*/
13+
314
namespace DsOpenSearchBundle\Command;
415

516
use DsOpenSearchBundle\Manager\IndexManager;
@@ -34,6 +45,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
3445

3546
if (empty($contextName)) {
3647
$output->writeln('<error>no context definition name given</error>');
48+
3749
return Command::FAILURE;
3850
}
3951

@@ -52,6 +64,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
5264
$this->indexManager->rebuildIndex($contextName);
5365
} catch (\Throwable $e) {
5466
$output->writeln(sprintf('<error>Error rebuilding index mapping: %s</error>', $e->getMessage()));
67+
5568
return Command::FAILURE;
5669
}
5770

src/Controller/Admin/IndexController.php

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
<?php
22

3+
/*
4+
* This source file is available under two different licenses:
5+
* - GNU General Public License version 3 (GPLv3)
6+
* - DACHCOM Commercial License (DCL)
7+
* Full copyright and license information is available in
8+
* LICENSE.md which is distributed with this source code.
9+
*
10+
* @copyright Copyright (c) DACHCOM.DIGITAL AG (https://www.dachcom-digital.com)
11+
* @license GPLv3 and DCL
12+
*/
13+
314
namespace DsOpenSearchBundle\Controller\Admin;
415

516
use DsOpenSearchBundle\Manager\IndexManager;
@@ -11,8 +22,7 @@ class IndexController extends AdminAbstractController
1122
{
1223
public function __construct(
1324
protected IndexManager $indexManager
14-
)
15-
{
25+
) {
1626
}
1727

1828
public function rebuildMappingAction(Request $request): Response
@@ -31,5 +41,4 @@ public function rebuildMappingAction(Request $request): Response
3141

3242
return new Response();
3343
}
34-
3544
}

src/DependencyInjection/Configuration.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
<?php
22

3+
/*
4+
* This source file is available under two different licenses:
5+
* - GNU General Public License version 3 (GPLv3)
6+
* - DACHCOM Commercial License (DCL)
7+
* Full copyright and license information is available in
8+
* LICENSE.md which is distributed with this source code.
9+
*
10+
* @copyright Copyright (c) DACHCOM.DIGITAL AG (https://www.dachcom-digital.com)
11+
* @license GPLv3 and DCL
12+
*/
13+
314
namespace DsOpenSearchBundle\DependencyInjection;
415

516
use Symfony\Component\Config\Definition\Builder\TreeBuilder;

src/DependencyInjection/DsOpenSearchExtension.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,22 @@
11
<?php
22

3+
/*
4+
* This source file is available under two different licenses:
5+
* - GNU General Public License version 3 (GPLv3)
6+
* - DACHCOM Commercial License (DCL)
7+
* Full copyright and license information is available in
8+
* LICENSE.md which is distributed with this source code.
9+
*
10+
* @copyright Copyright (c) DACHCOM.DIGITAL AG (https://www.dachcom-digital.com)
11+
* @license GPLv3 and DCL
12+
*/
13+
314
namespace DsOpenSearchBundle\DependencyInjection;
415

16+
use Symfony\Component\Config\FileLocator;
17+
use Symfony\Component\DependencyInjection\ContainerBuilder;
518
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
619
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
7-
use Symfony\Component\DependencyInjection\ContainerBuilder;
8-
use Symfony\Component\Config\FileLocator;
920

1021
class DsOpenSearchExtension extends Extension
1122
{

src/DsOpenSearchBundle.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,20 @@
11
<?php
22

3+
/*
4+
* This source file is available under two different licenses:
5+
* - GNU General Public License version 3 (GPLv3)
6+
* - DACHCOM Commercial License (DCL)
7+
* Full copyright and license information is available in
8+
* LICENSE.md which is distributed with this source code.
9+
*
10+
* @copyright Copyright (c) DACHCOM.DIGITAL AG (https://www.dachcom-digital.com)
11+
* @license GPLv3 and DCL
12+
*/
13+
314
namespace DsOpenSearchBundle;
415

516
use DynamicSearchBundle\Provider\Extension\ProviderBundleInterface;
617
use Pimcore\Extension\Bundle\AbstractPimcoreBundle;
7-
use Symfony\Component\HttpKernel\Bundle\Bundle;
818

919
final class DsOpenSearchBundle extends AbstractPimcoreBundle implements ProviderBundleInterface
1020
{

src/DsOpenSearchEvents.php

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,32 @@
11
<?php
22

3+
/*
4+
* This source file is available under two different licenses:
5+
* - GNU General Public License version 3 (GPLv3)
6+
* - DACHCOM Commercial License (DCL)
7+
* Full copyright and license information is available in
8+
* LICENSE.md which is distributed with this source code.
9+
*
10+
* @copyright Copyright (c) DACHCOM.DIGITAL AG (https://www.dachcom-digital.com)
11+
* @license GPLv3 and DCL
12+
*/
13+
314
namespace DsOpenSearchBundle;
415

516
final class DsOpenSearchEvents
617
{
718
/**
8-
* The BULK event occurs before during the processing of bulk method
19+
* The BULK event occurs before during the processing of bulk method.
920
*/
1021
public const BULK = 'ds_opensearch.bulk';
1122

1223
/**
13-
* The PRE_COMMIT event occurs before committing queries to ES
24+
* The PRE_COMMIT event occurs before committing queries to ES.
1425
*/
1526
public const PRE_COMMIT = 'ds_opensearch.pre_commit';
1627

1728
/**
18-
* The POST_COMMIT event occurs after committing queries to ES
29+
* The POST_COMMIT event occurs after committing queries to ES.
1930
*/
2031
public const POST_COMMIT = 'ds_opensearch.post_commit';
2132

src/EventListener/Admin/AssetListener.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
<?php
22

3+
/*
4+
* This source file is available under two different licenses:
5+
* - GNU General Public License version 3 (GPLv3)
6+
* - DACHCOM Commercial License (DCL)
7+
* Full copyright and license information is available in
8+
* LICENSE.md which is distributed with this source code.
9+
*
10+
* @copyright Copyright (c) DACHCOM.DIGITAL AG (https://www.dachcom-digital.com)
11+
* @license GPLv3 and DCL
12+
*/
13+
314
namespace DsOpenSearchBundle\EventListener\Admin;
415

516
use Pimcore\Event\BundleManager\PathsEvent;
@@ -21,5 +32,4 @@ public function addJsFiles(PathsEvent $event): void
2132
'/bundles/dsopensearch/js/backend/settings.js',
2233
]);
2334
}
24-
2535
}

src/Exception/ClientException.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
<?php
22

3+
/*
4+
* This source file is available under two different licenses:
5+
* - GNU General Public License version 3 (GPLv3)
6+
* - DACHCOM Commercial License (DCL)
7+
* Full copyright and license information is available in
8+
* LICENSE.md which is distributed with this source code.
9+
*
10+
* @copyright Copyright (c) DACHCOM.DIGITAL AG (https://www.dachcom-digital.com)
11+
* @license GPLv3 and DCL
12+
*/
13+
314
namespace DsOpenSearchBundle\Exception;
415

516
final class ClientException extends \Exception

0 commit comments

Comments
 (0)