Skip to content

Commit 9283b27

Browse files
Jakub-FajkusSpamercz
authored andcommitted
Drop nette 2.4 and ES 2.4
1 parent 90a0d59 commit 9283b27

2 files changed

Lines changed: 13 additions & 48 deletions

File tree

composer.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,9 @@
2828
"ext-json": "*",
2929
"ext-curl": "*",
3030
"spameri/elastic-query": "^v1.0.0-alpha.10",
31-
"elasticsearch/elasticsearch": "^2.4.0 || ^7.12.0",
32-
"nette/di": "^2.4.17 || ^3.0",
33-
"nette/utils": "^2.5.7 || ^3.0",
34-
"kdyby/console": "^4.0.0",
31+
"elasticsearch/elasticsearch": "^7.12.0",
32+
"nette/di": "^3.0",
33+
"nette/utils": "^3.0",
3534
"symfony/console": "^4",
3635
"tracy/tracy": "^2.6.7",
3736
"monolog/monolog": "^2.0.2",
@@ -43,8 +42,9 @@
4342
"nette/tester": "^2.4",
4443
"phpstan/phpstan": "0.12.84",
4544
"php-coveralls/php-coveralls": "^2.1",
46-
"nette/bootstrap": "~2.4.6 || ^3.0",
47-
"nette/http": "^2.4.12 || ^3.0",
45+
"nette/bootstrap": "^3.0",
46+
"nette/http": "^3.0",
47+
"kdyby/console": "^4.0.0",
4848
"mockery/mockery": "^1.2"
4949
},
5050
"autoload": {

src/DI/SpameriElasticSearchExtension.php

Lines changed: 7 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -31,29 +31,17 @@ public function loadConfiguration(): void
3131

3232
$services = $this->toggleDebugBar($config, $services);
3333

34-
if ( ! \class_exists(\Symfony\Component\Console\Command\Command::class)) {
35-
$services = $this->removeCommandDefinitions($services);
36-
}
37-
3834
$services = $this->setConfigOptions($services, $config);
3935

40-
if (\method_exists($this->compiler, 'loadDefinitionsFromConfig')) {
41-
$aliasedServices = [];
42-
foreach ($services['services'] as $key => $service) {
43-
$aliasedServices['spameriElasticSearch.' . $key] = $service;
44-
}
36+
$aliasedServices = [];
37+
foreach ($services['services'] as $key => $service) {
38+
$aliasedServices['spameriElasticSearch.' . $key] = $service;
39+
}
4540

46-
$this->compiler->loadDefinitionsFromConfig(
47-
$aliasedServices
48-
);
41+
$this->compiler->loadDefinitionsFromConfig(
42+
$aliasedServices
43+
);
4944

50-
} else {
51-
$this->compiler::loadDefinitions(
52-
$this->getContainerBuilder(),
53-
$services['services'],
54-
$this->name
55-
);
56-
}
5745
}
5846

5947

@@ -104,27 +92,4 @@ public function toggleDebugBar(
10492
return $services;
10593
}
10694

107-
108-
/**
109-
* @param array<mixed> $services
110-
* @return array<mixed>
111-
*/
112-
public function removeCommandDefinitions(
113-
array $services
114-
): array
115-
{
116-
$iterableServices = $services['services'];
117-
foreach ($iterableServices as $serviceKey => $serviceArray) {
118-
if (isset($serviceArray['tags'])) {
119-
foreach ($serviceArray['tags'] as $tag) {
120-
if ($tag === 'kdyby.console.command') {
121-
unset($services[$serviceKey]);
122-
}
123-
}
124-
}
125-
}
126-
127-
return $services;
128-
}
129-
13095
}

0 commit comments

Comments
 (0)