Skip to content

Commit e1a6398

Browse files
committed
Merge remote-tracking branch 'remotes/origin/es7_support'
2 parents a27a4d9 + f535901 commit e1a6398

File tree

57 files changed

+201
-1026
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+201
-1026
lines changed

.travis.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,20 @@ php:
44
- 7.1
55
- 7.2
66
- 7.3
7+
- 7.4
78
env:
89
global:
9-
- ES_VERSION=6.2.3 ES_DOWNLOAD_URL=https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-${ES_VERSION}.tar.gz
10+
- ES_VERSION=7.5.2 ES_DOWNLOAD_URL=https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-${ES_VERSION}-linux-x86_64.tar.gz
1011
matrix:
11-
- SYMFONY="~3.4"
12-
- SYMFONY="^4.1"
12+
- SYMFONY="^4.4"
13+
- SYMFONY="^5.0"
14+
jobs:
15+
exclude:
16+
- php: 7.1
17+
env: SYMFONY="^5.0"
1318
install:
1419
- wget ${ES_DOWNLOAD_URL}
15-
- tar -xzf elasticsearch-${ES_VERSION}.tar.gz
20+
- tar -xzf elasticsearch-${ES_VERSION}-linux-x86_64.tar.gz
1621
- ./elasticsearch-${ES_VERSION}/bin/elasticsearch -d
1722
before_script:
1823
- composer require --no-update symfony/framework-bundle:${SYMFONY}
@@ -23,4 +28,4 @@ script:
2328
- vendor/bin/phpunit --coverage-clover=coverage.clover
2429
- vendor/bin/phpcs -p --standard=PSR2 --ignore=vendor/,Tests/app/,var/cache ./
2530
after_script:
26-
- travis_retry php vendor/bin/coveralls
31+
- travis_retry bash <(curl -s https://codecov.io/bash)

Annotation/Index.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,6 @@ final class Index extends AbstractAnnotation
3737

3838
public $numberOfReplicas = 1;
3939

40-
/**
41-
* We strongly recommend to not use this parameter in the index annotation. By default it will be set as `_doc`
42-
* type name. Eventually it will be removed.
43-
*
44-
* @deprecated will be removed in v7 since there will be no more types in the indexes.
45-
*/
46-
public $typeName = '_doc';
47-
4840
/**
4941
* You can select one of your indexes to be default. Useful for cli commands when you don't
5042
* need to define an alias name. If default is not set the first index found will be set as default one.

Command/AbstractIndexServiceAwareCommand.php

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,22 @@
1414
use ONGR\ElasticsearchBundle\DependencyInjection\Configuration;
1515
use ONGR\ElasticsearchBundle\Service\IndexService;
1616
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
17+
use Symfony\Component\Console\Command\Command;
1718
use Symfony\Component\Console\Input\InputOption;
19+
use Symfony\Component\DependencyInjection\Container;
1820

19-
abstract class AbstractIndexServiceAwareCommand extends ContainerAwareCommand
21+
abstract class AbstractIndexServiceAwareCommand extends Command
2022
{
23+
private $container;
24+
2125
const INDEX_OPTION = 'index';
2226

27+
public function __construct(Container $container)
28+
{
29+
$this->container = $container;
30+
parent::__construct();
31+
}
32+
2333
protected function configure()
2434
{
2535
$this->addOption(
@@ -32,19 +42,24 @@ protected function configure()
3242

3343
protected function getIndex($name): IndexService
3444
{
35-
$name = $name ?? $this->getContainer()->getParameter(Configuration::ONGR_DEFAULT_INDEX);
36-
$indexes = $this->getContainer()->getParameter(Configuration::ONGR_INDEXES);
45+
$name = $name ?? $this->container->getParameter(Configuration::ONGR_DEFAULT_INDEX);
46+
$indexes = $this->container->getParameter(Configuration::ONGR_INDEXES);
3747

38-
if (isset($indexes[$name]) && $this->getContainer()->has($indexes[$name])) {
39-
return $this->getContainer()->get($indexes[$name]);
48+
if (isset($indexes[$name]) && $this->container->has($indexes[$name])) {
49+
return $this->container->get($indexes[$name]);
4050
}
4151

4252
throw new \RuntimeException(
4353
sprintf(
4454
'There is no index under `%s` name found. Available options: `%s`.',
4555
$name,
46-
implode('`, `', array_keys($this->getContainer()->getParameter(Configuration::ONGR_INDEXES)))
56+
implode('`, `', array_keys($this->container->getParameter(Configuration::ONGR_INDEXES)))
4757
)
4858
);
4959
}
60+
61+
public function getContainer(): Container
62+
{
63+
return $this->container;
64+
}
5065
}

Command/CacheClearCommand.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
4646
$index->getIndexName()
4747
)
4848
);
49+
50+
return 0;
4951
}
5052
}

0 commit comments

Comments
 (0)