From 0015bf0805712aba78da81cc59f6a28c0c12ca3d Mon Sep 17 00:00:00 2001 From: Fran Moreno Date: Tue, 19 Jul 2022 15:30:39 +0200 Subject: [PATCH 1/9] Fixed `Term::setTerm()` PHPDoc allowing scalar values for `$value` parameter (#2096) --- CHANGELOG.md | 1 + src/AbstractUpdateAction.php | 2 ++ src/Query/Term.php | 6 +++--- tests/BulkTest.php | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e8928a39c5..41344eeeac 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,6 +38,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * Fixed `Http` PHPDoc adding `\CurlHandle` type for Curl connection by @franmomu [#2086](https://github.com/ruflin/Elastica/pull/2086) * Fixed case mismatch in method calls by @franmomu [#2087](https://github.com/ruflin/Elastica/pull/2087) * Fixed `MoreLikeThis::setLike()` PHPDoc allowing `Document` by @franmomu [#2091](https://github.com/ruflin/Elastica/pull/2091) +* Fixed `Term::setTerm()` PHPDoc allowing scalar values for `$value` parameter by @franmomu [#2094](https://github.com/ruflin/Elastica/pull/2094) ### Security diff --git a/src/AbstractUpdateAction.php b/src/AbstractUpdateAction.php index 009a12cfc6..6ddbf84163 100644 --- a/src/AbstractUpdateAction.php +++ b/src/AbstractUpdateAction.php @@ -19,6 +19,8 @@ class AbstractUpdateAction extends Param /** * Sets the id of the document. + * + * @return $this */ public function setId(?string $id = null): self { diff --git a/src/Query/Term.php b/src/Query/Term.php index 1ff857bb85..67ee8f7ddc 100644 --- a/src/Query/Term.php +++ b/src/Query/Term.php @@ -35,9 +35,9 @@ public function setRawTerm(array $term): self /** * Adds a term to the term query. * - * @param string $key Key to query - * @param array|string $value Values(s) for the query. Boost can be set with array - * @param float $boost OPTIONAL Boost value (default = 1.0) + * @param string $key Key to query + * @param bool|float|int|string $value Values(s) for the query + * @param float $boost OPTIONAL Boost value (default = 1.0) * * @return $this */ diff --git a/tests/BulkTest.php b/tests/BulkTest.php index 0da7098e71..07dcdf52d4 100644 --- a/tests/BulkTest.php +++ b/tests/BulkTest.php @@ -711,7 +711,7 @@ public function testSetShardTimeout(): void { $bulk = new Bulk($this->_getClient()); - $this->assertSame($bulk, $bulk->setShardTimeout(10)); + $this->assertSame($bulk, $bulk->setShardTimeout('10s')); } /** From d4849e2c671235fc52e5011f268c0d3724cd24aa Mon Sep 17 00:00:00 2001 From: Vincent Langlet Date: Mon, 11 Jul 2022 11:29:24 +0200 Subject: [PATCH 2/9] Fix `DateHistogram` deprecation: use `fixed_internal` or `calendar_interval` instead of `interval` --- CHANGELOG.md | 1 + src/Aggregation/DateHistogram.php | 51 +++++++++++++++++++ src/Aggregation/Histogram.php | 2 +- tests/Aggregation/DateHistogramTest.php | 38 +++++++++++++- .../Aggregation/NormalizeAggregationTest.php | 2 +- 5 files changed, 90 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 41344eeeac..45a0967747 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,6 +39,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * Fixed case mismatch in method calls by @franmomu [#2087](https://github.com/ruflin/Elastica/pull/2087) * Fixed `MoreLikeThis::setLike()` PHPDoc allowing `Document` by @franmomu [#2091](https://github.com/ruflin/Elastica/pull/2091) * Fixed `Term::setTerm()` PHPDoc allowing scalar values for `$value` parameter by @franmomu [#2094](https://github.com/ruflin/Elastica/pull/2094) +* Fixed `DateHistogram` deprecation: use `fixed_internal` or `calendar_interval` instead of `interval` by @VincentLanglet [#2099](https://github.com/ruflin/Elastica/pull/2099) ### Security diff --git a/src/Aggregation/DateHistogram.php b/src/Aggregation/DateHistogram.php index a673c2c47f..208acb72e9 100644 --- a/src/Aggregation/DateHistogram.php +++ b/src/Aggregation/DateHistogram.php @@ -11,6 +11,57 @@ class DateHistogram extends Histogram { public const DEFAULT_TIMEZONE_VALUE = 'UTC'; + private const CALENDAR_INTERVAL_VALUES = [ + '1m', + 'minute', + '1h', + 'hour', + '1d', + 'day', + '1w', + 'week', + '1M', + 'month', + '1q', + 'quarter', + '1y', + 'year', + ]; + + /** + * Set the interval by which documents will be bucketed. + * + * @param int|string $interval + * + * @return $this + */ + public function setInterval($interval) + { + $interval = (string) $interval; + + if (\in_array($interval, self::CALENDAR_INTERVAL_VALUES, true)) { + return $this->setCalendarInterval($interval); + } + + return $this->setFixedInterval($interval); + } + + /** + * @return $this + */ + public function setCalendarInterval(string $interval): self + { + return $this->setParam('calendar_interval', $interval); + } + + /** + * @return $this + */ + public function setFixedInterval(string $interval): self + { + return $this->setParam('fixed_interval', $interval); + } + /** * Set time_zone option. * diff --git a/src/Aggregation/Histogram.php b/src/Aggregation/Histogram.php index 99aa38d3a2..d951e9f3bd 100644 --- a/src/Aggregation/Histogram.php +++ b/src/Aggregation/Histogram.php @@ -31,7 +31,7 @@ public function __construct(string $name, string $field, $interval) * * @return $this */ - public function setInterval($interval): self + public function setInterval($interval) { return $this->setParam('interval', $interval); } diff --git a/tests/Aggregation/DateHistogramTest.php b/tests/Aggregation/DateHistogramTest.php index 5b27830e80..d164be9a45 100644 --- a/tests/Aggregation/DateHistogramTest.php +++ b/tests/Aggregation/DateHistogramTest.php @@ -13,6 +13,40 @@ */ class DateHistogramTest extends BaseAggregationTest { + /** + * @group unit + */ + public function testConstructForCalendarInterval(): void + { + $agg = new DateHistogram('hist', 'created', '1h'); + + $expected = [ + 'date_histogram' => [ + 'field' => 'created', + 'calendar_interval' => '1h', + ], + ]; + + $this->assertSame($expected, $agg->toArray()); + } + + /** + * @group unit + */ + public function testConstructForFixedInterval(): void + { + $agg = new DateHistogram('hist', 'created', '2h'); + + $expected = [ + 'date_histogram' => [ + 'field' => 'created', + 'fixed_interval' => '2h', + ], + ]; + + $this->assertSame($expected, $agg->toArray()); + } + /** * @group functional */ @@ -99,7 +133,7 @@ public function testSetOffset(): void $expected = [ 'date_histogram' => [ 'field' => 'created', - 'interval' => '1h', + 'calendar_interval' => '1h', 'offset' => '3m', ], ]; @@ -134,7 +168,7 @@ public function testSetTimezone(): void $expected = [ 'date_histogram' => [ 'field' => 'created', - 'interval' => '1h', + 'calendar_interval' => '1h', 'time_zone' => '-02:30', ], ]; diff --git a/tests/Aggregation/NormalizeAggregationTest.php b/tests/Aggregation/NormalizeAggregationTest.php index 9c3c66fc93..4f2a7edf11 100644 --- a/tests/Aggregation/NormalizeAggregationTest.php +++ b/tests/Aggregation/NormalizeAggregationTest.php @@ -26,7 +26,7 @@ public function testToArray(): void $expected = [ 'date_histogram' => [ 'field' => 'date', - 'interval' => 'day', + 'calendar_interval' => 'day', ], 'aggs' => [ 'sum_agg' => [ From 066c5b0febb54baf869b810e75135077067d2917 Mon Sep 17 00:00:00 2001 From: Fran Moreno Date: Sat, 23 Jul 2022 13:32:14 +0200 Subject: [PATCH 3/9] Remove tests calling methods with wrong type (#2100) --- tests/Query/MatchQueryTest.php | 33 --------------------------------- tests/SearchTest.php | 13 ------------- 2 files changed, 46 deletions(-) diff --git a/tests/Query/MatchQueryTest.php b/tests/Query/MatchQueryTest.php index 355de60ed8..736dca002f 100644 --- a/tests/Query/MatchQueryTest.php +++ b/tests/Query/MatchQueryTest.php @@ -124,39 +124,6 @@ public function testMatchSetFieldBoost(): void $this->assertEquals(4, $resultSet->count()); } - /** - * @group functional - */ - public function testMatchSetFieldBoostWithString(): void - { - $client = $this->_getClient(); - $index = $client->getIndex('test'); - $index->create([], [ - 'recreate' => true, - ]); - - $index->addDocuments([ - new Document('1', ['name' => 'Basel-Stadt']), - new Document('2', ['name' => 'New York']), - new Document('3', ['name' => 'New Hampshire']), - new Document('4', ['name' => 'Basel Land']), - ]); - - $index->refresh(); - - $field = 'name'; - $operator = 'or'; - - $query = new MatchQuery(); - $query->setFieldQuery($field, 'Basel New'); - $query->setFieldOperator($field, $operator); - $query->setFieldBoost($field, '1.2'); - - $resultSet = $index->search($query); - - $this->assertEquals(4, $resultSet->count()); - } - /** * @group functional */ diff --git a/tests/SearchTest.php b/tests/SearchTest.php index f5df6f9882..9d35e0db18 100644 --- a/tests/SearchTest.php +++ b/tests/SearchTest.php @@ -97,19 +97,6 @@ public function testAddIndexInvalid(): void $search->addIndex(new \stdClass()); } - /** - * @group unit - */ - public function testAddNumericIndex(): void - { - $client = $this->_getClient(); - $search = new Search($client); - - $search->addIndex(1); - - $this->assertContains('1', $search->getIndices(), 'Make sure it has been added and converted to string'); - } - /** * @group functional */ From 88fb974130ac68643130e8c21caad156b540741c Mon Sep 17 00:00:00 2001 From: Fran Moreno Date: Tue, 2 Aug 2022 09:52:08 +0200 Subject: [PATCH 4/9] Fix deprecation message for version 7.2.0 (#2107) --- src/Reindex.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Reindex.php b/src/Reindex.php index 5bfc4c6aab..751c1a98fa 100644 --- a/src/Reindex.php +++ b/src/Reindex.php @@ -85,7 +85,7 @@ public function setWaitForCompletion($value): void if (\is_bool($value)) { $value = $value ? 'true' : 'false'; } else { - \trigger_deprecation('ruflin/elastica', '7.1.6', 'Passing anything else than a boolean as 1st argument to "%s()" is deprecated, pass a boolean instead. It will be removed in 8.0.', __METHOD__); + \trigger_deprecation('ruflin/elastica', '7.2.0', 'Passing anything else than a boolean as 1st argument to "%s()" is deprecated, pass a boolean instead. It will be removed in 8.0.', __METHOD__); } $this->setParam(self::WAIT_FOR_COMPLETION, $value); From 8a3cf51c98a6e9659d148f331cdef7480f5a3fb2 Mon Sep 17 00:00:00 2001 From: Emanuele Panzeri Date: Tue, 2 Aug 2022 14:42:36 +0200 Subject: [PATCH 5/9] Deprecate passing string to Search::addIndex, hasIndex and addIndices (#2106) Co-authored-by: Fran Moreno --- CHANGELOG.md | 4 + src/Search.php | 69 +++++++++++++++- tests/IndexTest.php | 2 +- tests/ScrollTest.php | 2 +- tests/SearchTest.php | 182 +++++++++++++++++++++++++++++++++++++++++-- 5 files changed, 248 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 45a0967747..6deec2d563 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * Added coverage check to CI by @franmomu [#2071](https://github.com/ruflin/Elastica/pull/2071) * Added `string` as a valid type for `data` in `Request` by @franmomu [#2078](https://github.com/ruflin/Elastica/pull/2078) * Added missing `throws` PHPDoc tags by @franmomu [#2077](https://github.com/ruflin/Elastica/pull/2077) +* Added `Search::addIndexByName()`, `Search::hasIndexByName()` and `Search::addIndicesByName()` by @franmomu [#2103](https://github.com/ruflin/Elastica/pull/2103) ### Changed * Updated `symfony/phpunit-bridge` to `6.0` by @franmomu [#2067](https://github.com/ruflin/Elastica/pull/2067) @@ -28,6 +29,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Deprecated * Deprecated `Elastica\Reindex::WAIT_FOR_COMPLETION_FALSE`, use a boolean as parameter instead by @franmomu [#2070](https://github.com/ruflin/Elastica/pull/2070) * Passing anything else than a boolean as 1st argument to `Reindex::setWaitForCompletion`, pass a boolean instead by @franmomu [#2070](https://github.com/ruflin/Elastica/pull/2070) +* Deprecated passing a `string` as 1st argument to `Search::addIndex()` and `Search::hasIndex()`, pass an Index instance instead by @franmomu [#2103](https://github.com/ruflin/Elastica/pull/2103) +* Deprecated passing an array of `string` as 1st argument to `Search::addIndices()`, use an array of Index instances by @franmomu [#2103](https://github.com/ruflin/Elastica/pull/2103) + ### Removed * Removed `egeloen/http-adapter` as suggested package since the project is abandoned by @franmomu [#2069](https://github.com/ruflin/Elastica/pull/2069) * Removed `0` as valid request data using Analyze API by @franmomu [#2068](https://github.com/ruflin/Elastica/pull/2068) diff --git a/src/Search.php b/src/Search.php index 9fd666be95..ce1feff0a8 100644 --- a/src/Search.php +++ b/src/Search.php @@ -80,7 +80,7 @@ public function __construct(Client $client, ?BuilderInterface $builder = null) /** * Adds a index to the list. * - * @param Index|string $index Index object or string + * @param Index $index Index object or string * * @throws InvalidException */ @@ -88,13 +88,29 @@ public function addIndex($index): self { if ($index instanceof Index) { $index = $index->getName(); + } else { + \trigger_deprecation( + 'ruflin/elastica', + '7.2.0', + 'Passing a string as 1st argument to "%s()" is deprecated, pass an Index instance or use "addIndexByName" instead. It will throw a %s in 8.0.', + __METHOD__, + \TypeError::class + ); } if (!\is_scalar($index)) { throw new InvalidException('Invalid param type'); } - $this->_indices[] = (string) $index; + return $this->addIndexByName((string) $index); + } + + /** + * Adds an index to the list. + */ + public function addIndexByName(string $index): self + { + $this->_indices[] = $index; return $this; } @@ -102,17 +118,49 @@ public function addIndex($index): self /** * Add array of indices at once. * - * @param Index[]|string[] $indices + * @param Index[] $indices */ public function addIndices(array $indices = []): self { foreach ($indices as $index) { + if (\is_string($index)) { + \trigger_deprecation( + 'ruflin/elastica', + '7.2.0', + 'Passing a array of strings as 1st argument to "%s()" is deprecated, pass an array of Indexes or use "addIndicesByName" instead. It will throw a %s in 8.0.', + __METHOD__, + \TypeError::class + ); + $this->addIndexByName($index); + + continue; + } + + if (!$index instanceof Index) { + throw new InvalidException('Invalid param type for addIndices(), expected Index[]'); + } + $this->addIndex($index); } return $this; } + /** + * @param string[] $indices + */ + public function addIndicesByName(array $indices = []): self + { + foreach ($indices as $index) { + if (!\is_string($index)) { + throw new InvalidException('Invalid param type for addIndicesByName(), expected string[]'); + } + $this->addIndexByName($index); + } + + return $this; + } + /** * @param AbstractQuery|AbstractSuggest|array|Collapse|Query|string|Suggest $query */ @@ -213,14 +261,27 @@ public function hasIndices(): bool } /** - * @param Index|string $index + * @param Index $index */ public function hasIndex($index): bool { if ($index instanceof Index) { $index = $index->getName(); + } else { + \trigger_deprecation( + 'ruflin/elastica', + '7.2.0', + 'Passing a string as 1st argument to "%s()" is deprecated, pass an Index instance or use "hasIndexByName" instead. It will throw a %s in 8.0.', + __METHOD__, + \TypeError::class + ); } + return $this->hasIndexByName($index); + } + + public function hasIndexByName(string $index): bool + { return \in_array($index, $this->_indices, true); } diff --git a/tests/IndexTest.php b/tests/IndexTest.php index 0171d59456..a7ff55fc6d 100644 --- a/tests/IndexTest.php +++ b/tests/IndexTest.php @@ -765,7 +765,7 @@ public function testCreateSearch(): void $this->assertEquals($expected, $search->getQuery()->toArray()); $this->assertEquals(['test'], $search->getIndices()); $this->assertTrue($search->hasIndices()); - $this->assertTrue($search->hasIndex('test')); + $this->assertTrue($search->hasIndexByName('test')); $this->assertTrue($search->hasIndex($index)); } diff --git a/tests/ScrollTest.php b/tests/ScrollTest.php index 8780e31b60..3123f3880b 100644 --- a/tests/ScrollTest.php +++ b/tests/ScrollTest.php @@ -108,7 +108,7 @@ public function testEmptyScroll(): void public function testScrollWithIgnoreUnavailable(): void { $search = $this->_prepareSearch(); - $search->addIndex('unavailable_index'); + $search->addIndexByName('unavailable_index'); $search->setOption($search::OPTION_SEARCH_IGNORE_UNAVAILABLE, 'true'); $scroll = new Scroll($search); $count = 1; diff --git a/tests/SearchTest.php b/tests/SearchTest.php index 9d35e0db18..02f2939ccb 100644 --- a/tests/SearchTest.php +++ b/tests/SearchTest.php @@ -18,12 +18,15 @@ use Elastica\Search; use Elastica\Suggest; use Elastica\Test\Base as BaseTest; +use Symfony\Bridge\PhpUnit\ExpectDeprecationTrait; /** * @internal */ class SearchTest extends BaseTest { + use ExpectDeprecationTrait; + /** * @group unit */ @@ -58,13 +61,109 @@ public function testAddIndex(): void $this->assertContains($index1->getName(), $indices); $this->assertContains($index2->getName(), $indices); + } + + /** + * @group functional + */ + public function testAddIndexByName(): void + { + $client = $this->_getClient(); + $search = new Search($client); + + $search->addIndexByName('index1'); + $indices = $search->getIndices(); + + $this->assertCount(1, $indices); + $this->assertContains('index1', $indices); + } + + /** + * @group functional + * @group legacy + */ + public function testAddIndexTriggersDeprecationWithString(): void + { + $client = $this->_getClient(); + $search = new Search($client); + + $index1 = $this->_createIndex(); + + $search->addIndex($index1); + $indices = $search->getIndices(); + + $this->assertCount(1, $indices); - // Add string - $search->addIndex('test3'); + $this->assertContains($index1->getName(), $indices); + + $this->expectDeprecation('Since ruflin/elastica 7.2.0: Passing a string as 1st argument to "Elastica\Search::addIndex()" is deprecated, pass an Index instance or use "addIndexByName" instead. It will throw a TypeError in 8.0.'); + + $search->addIndex('test2'); $indices = $search->getIndices(); - $this->assertCount(3, $indices); - $this->assertContains('test3', $indices); + $this->assertCount(2, $indices); + $this->assertContains('test2', $indices); + } + + /** + * @group functional + */ + public function testHasIndex(): void + { + $client = $this->_getClient(); + $search = new Search($client); + + $index1 = $this->_createIndex(); + $index2 = $this->_createIndex(); + + $this->assertFalse($search->hasIndex($index1)); + $this->assertFalse($search->hasIndex($index2)); + + $search->addIndex($index1); + $search->addIndex($index2); + + $this->assertTrue($search->hasIndex($index1)); + $this->assertTrue($search->hasIndex($index2)); + } + + /** + * @group functional + */ + public function testHasIndexByName(): void + { + $client = $this->_getClient(); + $search = new Search($client); + + $indexName1 = 'index1'; + $indexName2 = 'index2'; + + $this->assertFalse($search->hasIndexByName($indexName1)); + $this->assertFalse($search->hasIndexByName($indexName2)); + + $search->addIndexByName($indexName1); + $search->addIndexByName($indexName2); + + $this->assertTrue($search->hasIndexByName($indexName1)); + $this->assertTrue($search->hasIndexByName($indexName2)); + } + + /** + * @group functional + * @group legacy + */ + public function testHasIndexTriggersDeprecationWithString(): void + { + $client = $this->_getClient(); + $search = new Search($client); + + $indexName = 'index1'; + + $this->expectDeprecation('Since ruflin/elastica 7.2.0: Passing a string as 1st argument to "Elastica\Search::hasIndex()" is deprecated, pass an Index instance or use "hasIndexByName" instead. It will throw a TypeError in 8.0.'); + + $this->assertFalse($search->hasIndex($indexName)); + + $search->addIndexByName($indexName); + $this->assertTrue($search->hasIndex($indexName)); } /** @@ -75,9 +174,53 @@ public function testAddIndices(): void $client = $this->_getClient(); $search = new Search($client); + $indices = [ + $client->getIndex('elastica_test1'), + $client->getIndex('elastica_test2'), + ]; + + $search->addIndices($indices); + $this->assertCount(2, $search->getIndices()); + } + + /** + * @group unit + */ + public function testAddIndicesWithInvalidParametersThrowsException(): void + { + $client = $this->_getClient(); + $search = new Search($client); + + $this->expectException(InvalidException::class); + $search->addIndices([new \stdClass()]); + } + + /** + * @group unit + */ + public function testAddIndicesByName(): void + { + $client = $this->_getClient(); + $search = new Search($client); + $search->addIndicesByName(['elastica_test1', 'elastica_test2']); + + $this->assertCount(2, $search->getIndices()); + } + + /** + * @group unit + * @group legacy + */ + public function testAddIndicesTriggersDeprecationWithIndexAsString(): void + { + $client = $this->_getClient(); + $search = new Search($client); + $indices = []; $indices[] = $client->getIndex('elastica_test1'); - $indices[] = $client->getIndex('elastica_test2'); + $indices[] = 'elastica_test2'; + + $this->expectDeprecation('Since ruflin/elastica 7.2.0: Passing a array of strings as 1st argument to "Elastica\Search::addIndices()" is deprecated, pass an array of Indexes or use "addIndicesByName" instead. It will throw a TypeError in 8.0.'); $search->addIndices($indices); @@ -87,6 +230,19 @@ public function testAddIndices(): void /** * @group unit */ + public function testAddIndicesByNameWithInvalidParametersThrowsException(): void + { + $client = $this->_getClient(); + $search = new Search($client); + + $this->expectException(InvalidException::class); + $search->addIndicesByName([new \stdClass()]); + } + + /** + * @group unit + * @group legacy + */ public function testAddIndexInvalid(): void { $this->expectException(InvalidException::class); @@ -97,6 +253,22 @@ public function testAddIndexInvalid(): void $search->addIndex(new \stdClass()); } + /** + * @group unit + * @group legacy + */ + public function testAddNumericIndex(): void + { + $client = $this->_getClient(); + $search = new Search($client); + + $this->expectDeprecation('Since ruflin/elastica 7.2.0: Passing a string as 1st argument to "Elastica\Search::addIndex()" is deprecated, pass an Index instance or use "addIndexByName" instead. It will throw a TypeError in 8.0.'); + + $search->addIndex(1); + + $this->assertContains('1', $search->getIndices(), 'Make sure it has been added and converted to string'); + } + /** * @group functional */ From 8fe61767b604a10e40b0b59c9511c4317cae3cb8 Mon Sep 17 00:00:00 2001 From: Emanuele Panzeri Date: Tue, 2 Aug 2022 15:28:12 +0200 Subject: [PATCH 6/9] Prepare release 7.2.0 (#2105) --- CHANGELOG.md | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6deec2d563..d7b6fd7c1c 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,16 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased](https://github.com/ruflin/Elastica/compare/7.1.5...master) +## [Unreleased](https://github.com/ruflin/Elastica/compare/7.2.0...master) +### Backward Compatibility Breaks +### Added +### Changed +### Deprecated +### Removed +### Fixed +### Security + +## [7.2.0](https://github.com/ruflin/Elastica/compare/7.2.0...7.1.5) ### Backward Compatibility Breaks * Changed `SetProcessor::setValue` signature to allow to pass any type, if you are overriding this method you must update the signature removing the `string` type-hint by @franmomu [#2082](https://github.com/ruflin/Elastica/pull/2082) * Changed `Settings::setMergePolicy` signature to allow to pass `int` and `string` as argument 2, if you are overriding this method you must update the signature removing the `string` type-hint by @franmomu [#2085](https://github.com/ruflin/Elastica/pull/2085) @@ -14,7 +23,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * Added `string` as a valid type for `data` in `Request` by @franmomu [#2078](https://github.com/ruflin/Elastica/pull/2078) * Added missing `throws` PHPDoc tags by @franmomu [#2077](https://github.com/ruflin/Elastica/pull/2077) * Added `Search::addIndexByName()`, `Search::hasIndexByName()` and `Search::addIndicesByName()` by @franmomu [#2103](https://github.com/ruflin/Elastica/pull/2103) - ### Changed * Updated `symfony/phpunit-bridge` to `6.0` by @franmomu [#2067](https://github.com/ruflin/Elastica/pull/2067) * Updated `php-cs-fixer` to `3.8.0` [#2074](https://github.com/ruflin/Elastica/pull/2074) @@ -25,7 +33,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * Updated `Query::create` PHPDoc to include supported types and propagate it to callers by @franmomu [#2088](https://github.com/ruflin/Elastica/pull/2088) * Update some iterable types in PHPDoc to be more specific by @franmomu [#2092](https://github.com/ruflin/Elastica/pull/2092) * Updated `AwsAuthV4Test` adding assertions for exception type by @franmomu [#2094](https://github.com/ruflin/Elastica/pull/2094) - ### Deprecated * Deprecated `Elastica\Reindex::WAIT_FOR_COMPLETION_FALSE`, use a boolean as parameter instead by @franmomu [#2070](https://github.com/ruflin/Elastica/pull/2070) * Passing anything else than a boolean as 1st argument to `Reindex::setWaitForCompletion`, pass a boolean instead by @franmomu [#2070](https://github.com/ruflin/Elastica/pull/2070) @@ -45,8 +52,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * Fixed `Term::setTerm()` PHPDoc allowing scalar values for `$value` parameter by @franmomu [#2094](https://github.com/ruflin/Elastica/pull/2094) * Fixed `DateHistogram` deprecation: use `fixed_internal` or `calendar_interval` instead of `interval` by @VincentLanglet [#2099](https://github.com/ruflin/Elastica/pull/2099) -### Security - ## [7.1.5](https://github.com/ruflin/Elastica/compare/7.1.5...7.1.4) ### Added * Added explicit return annotation to `Elastica\Multi\ResultSet::current()` and `Elastica\Multi\ResultSet::offsetGet()` by @franmomu [2056](https://github.com/ruflin/Elastica/pull/2056) From e29bf6835535e4f758194a795f3832ed1ec37eb5 Mon Sep 17 00:00:00 2001 From: Fran Moreno Date: Fri, 12 Aug 2022 13:51:18 +0200 Subject: [PATCH 7/9] Update php-cs-fixer to 3.9.5 (#2110) --- .github/workflows/continuous-integration.yaml | 2 +- CHANGELOG.md | 1 + phive.xml | 2 +- tests/Aggregation/AvgBucketTest.php | 2 +- tests/Aggregation/CumulativeSumTest.php | 2 +- tests/Aggregation/ExtendedStatsTest.php | 4 ++-- tests/Aggregation/StatsTest.php | 4 ++-- tests/Aggregation/SumBucketTest.php | 2 +- tests/Processor/ConvertProcessorTest.php | 4 ++-- tests/Processor/DateProcessorTest.php | 2 +- tests/Processor/DotExpanderProcessorTest.php | 2 +- tests/Processor/JoinProcessorTest.php | 2 +- tests/Processor/LowercaseProcessorTest.php | 4 ++-- tests/Processor/RenameProcessorTest.php | 2 +- tests/Processor/SortProcessorTest.php | 2 +- tests/Processor/SplitProcessorTest.php | 2 +- tests/Processor/TrimProcessorTest.php | 4 ++-- tests/Processor/UppercaseProcessorTest.php | 4 ++-- tests/ResultTest.php | 4 ++-- tests/Script/ScriptFieldsTest.php | 4 ++-- 20 files changed, 28 insertions(+), 27 deletions(-) diff --git a/.github/workflows/continuous-integration.yaml b/.github/workflows/continuous-integration.yaml index 8bb8b585aa..6a9ad89fd7 100644 --- a/.github/workflows/continuous-integration.yaml +++ b/.github/workflows/continuous-integration.yaml @@ -14,7 +14,7 @@ jobs: php-version: '7.4' coverage: 'none' extensions: 'json, mbstring, tokenizer' - tools: 'composer-normalize:2.28.0, php-cs-fixer:3.8.0' + tools: 'composer-normalize:2.28.0, php-cs-fixer:3.9.5' - name: 'Check PHP code' run: | diff --git a/CHANGELOG.md b/CHANGELOG.md index d7b6fd7c1c..97bbde1e11 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Backward Compatibility Breaks ### Added ### Changed +* Updated `php-cs-fixer` to `3.9.5` [#2110](https://github.com/ruflin/Elastica/pull/2110) ### Deprecated ### Removed ### Fixed diff --git a/phive.xml b/phive.xml index c949c0497b..fbfcbebed6 100644 --- a/phive.xml +++ b/phive.xml @@ -1,5 +1,5 @@ - + diff --git a/tests/Aggregation/AvgBucketTest.php b/tests/Aggregation/AvgBucketTest.php index 898a4aa9f5..4f7c1cb83b 100644 --- a/tests/Aggregation/AvgBucketTest.php +++ b/tests/Aggregation/AvgBucketTest.php @@ -35,7 +35,7 @@ public function testAvgBucketAggregation(): void ) ) ->addAggregation( - (new AvgBucket('avg_likes_by_page', 'pages>avg_likes')) + new AvgBucket('avg_likes_by_page', 'pages>avg_likes') ) ; diff --git a/tests/Aggregation/CumulativeSumTest.php b/tests/Aggregation/CumulativeSumTest.php index f2717e8628..d985823e5f 100644 --- a/tests/Aggregation/CumulativeSumTest.php +++ b/tests/Aggregation/CumulativeSumTest.php @@ -27,7 +27,7 @@ public function testCumulativeSumAggregation(): void ->setField('price') ) ->addAggregation( - (new CumulativeSum('cumulative_sales', 'sales')) + new CumulativeSum('cumulative_sales', 'sales') ) ) ; diff --git a/tests/Aggregation/ExtendedStatsTest.php b/tests/Aggregation/ExtendedStatsTest.php index 9d53fe85d2..b10b56b18f 100644 --- a/tests/Aggregation/ExtendedStatsTest.php +++ b/tests/Aggregation/ExtendedStatsTest.php @@ -28,7 +28,7 @@ public function testExtendedStatsAggregation(): void $this->assertEquals(1, $results['min']); $this->assertEquals(8, $results['max']); $this->assertEquals((5 + 8 + 1 + 3) / 4.0, $results['avg']); - $this->assertEquals((5 + 8 + 1 + 3), $results['sum']); + $this->assertEquals(5 + 8 + 1 + 3, $results['sum']); $this->assertArrayHasKey('sum_of_squares', $results); } @@ -49,7 +49,7 @@ public function testExtendedStatsAggregationWithMissing(): void $this->assertEquals(1, $results['min']); $this->assertEquals(10, $results['max']); $this->assertEquals((5 + 8 + 1 + 3 + 10) / 5.0, $results['avg']); - $this->assertEquals((5 + 8 + 1 + 3 + 10), $results['sum']); + $this->assertEquals(5 + 8 + 1 + 3 + 10, $results['sum']); $this->assertArrayHasKey('sum_of_squares', $results); } diff --git a/tests/Aggregation/StatsTest.php b/tests/Aggregation/StatsTest.php index cf7e9aa527..a65db25736 100644 --- a/tests/Aggregation/StatsTest.php +++ b/tests/Aggregation/StatsTest.php @@ -28,7 +28,7 @@ public function testStatsAggregation(): void $this->assertEquals(1, $results['min']); $this->assertEquals(8, $results['max']); $this->assertEquals((5 + 8 + 1 + 3) / 4.0, $results['avg']); - $this->assertEquals((5 + 8 + 1 + 3), $results['sum']); + $this->assertEquals(5 + 8 + 1 + 3, $results['sum']); } /** @@ -48,7 +48,7 @@ public function testStatsAggregationWithMissing(): void $this->assertEquals(1, $results['min']); $this->assertEquals(10, $results['max']); $this->assertEquals((5 + 8 + 1 + 3 + 10) / 5.0, $results['avg']); - $this->assertEquals((5 + 8 + 1 + 3 + 10), $results['sum']); + $this->assertEquals(5 + 8 + 1 + 3 + 10, $results['sum']); } protected function _getIndexForTest(): Index diff --git a/tests/Aggregation/SumBucketTest.php b/tests/Aggregation/SumBucketTest.php index db7579c06d..d0e10bb66c 100644 --- a/tests/Aggregation/SumBucketTest.php +++ b/tests/Aggregation/SumBucketTest.php @@ -35,7 +35,7 @@ public function testSumBucketAggregation(): void ) ) ->addAggregation( - (new SumBucket('sum_likes_by_page', 'pages>sum_likes')) + new SumBucket('sum_likes_by_page', 'pages>sum_likes') ) ; diff --git a/tests/Processor/ConvertProcessorTest.php b/tests/Processor/ConvertProcessorTest.php index 12eb927b65..020e5dd74d 100644 --- a/tests/Processor/ConvertProcessorTest.php +++ b/tests/Processor/ConvertProcessorTest.php @@ -98,7 +98,7 @@ public function testConvertField(): void $this->assertIsFloat($value['foo']); } - $this->assertSame(5.290, ($results[0]->getHit())['_source']['foo']); - $this->assertSame(6.908, ($results[1]->getHit())['_source']['foo']); + $this->assertSame(5.290, $results[0]->getHit()['_source']['foo']); + $this->assertSame(6.908, $results[1]->getHit()['_source']['foo']); } } diff --git a/tests/Processor/DateProcessorTest.php b/tests/Processor/DateProcessorTest.php index 3a22d305cf..b55e366bf8 100644 --- a/tests/Processor/DateProcessorTest.php +++ b/tests/Processor/DateProcessorTest.php @@ -99,6 +99,6 @@ public function testDateField(): void $results = $result->getResults(); - $this->assertEquals('2010-06-12T00:00:00.000+02:00', ($results[0]->getHit())['_source']['date_parsed']); + $this->assertEquals('2010-06-12T00:00:00.000+02:00', $results[0]->getHit()['_source']['date_parsed']); } } diff --git a/tests/Processor/DotExpanderProcessorTest.php b/tests/Processor/DotExpanderProcessorTest.php index 18bbfeb1ed..34827b2c12 100644 --- a/tests/Processor/DotExpanderProcessorTest.php +++ b/tests/Processor/DotExpanderProcessorTest.php @@ -81,6 +81,6 @@ public function testDotExpanderField(): void ], ]; $results = $result->getResults(); - $this->assertEquals($expect, ($results[0]->getHit())['_source']); + $this->assertEquals($expect, $results[0]->getHit()['_source']); } } diff --git a/tests/Processor/JoinProcessorTest.php b/tests/Processor/JoinProcessorTest.php index 18eea76a10..91c9b09429 100644 --- a/tests/Processor/JoinProcessorTest.php +++ b/tests/Processor/JoinProcessorTest.php @@ -74,6 +74,6 @@ public function testJoinField(): void $this->assertCount(1, $result->getResults()); $results = $result->getResults(); - $this->assertSame('abc-def-ghij', ($results[0]->getHit())['_source']['name']); + $this->assertSame('abc-def-ghij', $results[0]->getHit()['_source']['name']); } } diff --git a/tests/Processor/LowercaseProcessorTest.php b/tests/Processor/LowercaseProcessorTest.php index ac0d28f283..663db45e0f 100644 --- a/tests/Processor/LowercaseProcessorTest.php +++ b/tests/Processor/LowercaseProcessorTest.php @@ -77,7 +77,7 @@ public function testLowercaseField(): void $this->assertCount(2, $result->getResults()); $results = $result->getResults(); - $this->assertSame('ruflin', ($results[0]->getHit())['_source']['name']); - $this->assertSame('nicolas', ($results[1]->getHit())['_source']['name']); + $this->assertSame('ruflin', $results[0]->getHit()['_source']['name']); + $this->assertSame('nicolas', $results[1]->getHit()['_source']['name']); } } diff --git a/tests/Processor/RenameProcessorTest.php b/tests/Processor/RenameProcessorTest.php index 78101cb46a..ad8846d998 100644 --- a/tests/Processor/RenameProcessorTest.php +++ b/tests/Processor/RenameProcessorTest.php @@ -78,6 +78,6 @@ public function testRenameField(): void $this->assertCount(1, $result->getResults()); $results = $result->getResults(); - $this->assertArrayHasKey('packages', ($results[0]->getHit())['_source']); + $this->assertArrayHasKey('packages', $results[0]->getHit()['_source']); } } diff --git a/tests/Processor/SortProcessorTest.php b/tests/Processor/SortProcessorTest.php index 49817a584b..3f0bc02f40 100644 --- a/tests/Processor/SortProcessorTest.php +++ b/tests/Processor/SortProcessorTest.php @@ -74,6 +74,6 @@ public function testSortField(): void $this->assertCount(1, $result->getResults()); $results = $result->getResults(); - $this->assertSame([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], ($results[0]->getHit())['_source']['name']); + $this->assertSame([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], $results[0]->getHit()['_source']['name']); } } diff --git a/tests/Processor/SplitProcessorTest.php b/tests/Processor/SplitProcessorTest.php index 7a553afc37..b31bdc02c3 100644 --- a/tests/Processor/SplitProcessorTest.php +++ b/tests/Processor/SplitProcessorTest.php @@ -78,6 +78,6 @@ public function testSplitField(): void $this->assertCount(1, $result->getResults()); $results = $result->getResults(); - $this->assertSame(['nicolas', 'ruflin'], ($results[0]->getHit())['_source']['name']); + $this->assertSame(['nicolas', 'ruflin'], $results[0]->getHit()['_source']['name']); } } diff --git a/tests/Processor/TrimProcessorTest.php b/tests/Processor/TrimProcessorTest.php index f67eb5e0ad..b419ba59e0 100644 --- a/tests/Processor/TrimProcessorTest.php +++ b/tests/Processor/TrimProcessorTest.php @@ -77,7 +77,7 @@ public function testTrimField(): void $this->assertCount(2, $result->getResults()); $results = $result->getResults(); - $this->assertSame('ruflin', ($results[0]->getHit())['_source']['name']); - $this->assertSame('nicolas', ($results[1]->getHit())['_source']['name']); + $this->assertSame('ruflin', $results[0]->getHit()['_source']['name']); + $this->assertSame('nicolas', $results[1]->getHit()['_source']['name']); } } diff --git a/tests/Processor/UppercaseProcessorTest.php b/tests/Processor/UppercaseProcessorTest.php index 94d66f6f66..52792f5e47 100644 --- a/tests/Processor/UppercaseProcessorTest.php +++ b/tests/Processor/UppercaseProcessorTest.php @@ -77,7 +77,7 @@ public function testUppercaseField(): void $this->assertCount(2, $result->getResults()); $results = $result->getResults(); - $this->assertSame('RUFLIN', ($results[0]->getHit())['_source']['name']); - $this->assertSame('NICOLAS', ($results[1]->getHit())['_source']['name']); + $this->assertSame('RUFLIN', $results[0]->getHit()['_source']['name']); + $this->assertSame('NICOLAS', $results[1]->getHit()['_source']['name']); } } diff --git a/tests/ResultTest.php b/tests/ResultTest.php index ff71100b64..81a0588f36 100644 --- a/tests/ResultTest.php +++ b/tests/ResultTest.php @@ -110,7 +110,7 @@ public function testGetSort(): void $index->addDocument(new Document('3', ['username' => 'hans'])); $index->refresh(); - $query = (Query::create(null)->addSort(['_id' => 'desc'])); + $query = Query::create(null)->addSort(['_id' => 'desc']); $resultSet = $index->search($query); $this->assertCount(1, $resultSet->getResults()); @@ -129,7 +129,7 @@ public function testGetSortWithNoSorting(): void $index->addDocument(new Document('3', ['username' => 'hans'])); $index->refresh(); - $query = (Query::create(null)); + $query = Query::create(null); $resultSet = $index->search($query); $this->assertCount(1, $resultSet->getResults()); diff --git a/tests/Script/ScriptFieldsTest.php b/tests/Script/ScriptFieldsTest.php index 8b0127b1e6..afd7f2ea6f 100644 --- a/tests/Script/ScriptFieldsTest.php +++ b/tests/Script/ScriptFieldsTest.php @@ -160,7 +160,7 @@ public function testScriptFieldWithJoin(): void $resultSet = $index->search($query); $results = $resultSet->getResults(); - $this->assertEquals(1, ($results[0]->getHit())['fields']['text'][0]); - $this->assertEquals(2, ($results[1]->getHit())['fields']['text'][0]); + $this->assertEquals(1, $results[0]->getHit()['fields']['text'][0]); + $this->assertEquals(2, $results[1]->getHit()['fields']['text'][0]); } } From 1a2db5fa537ea3c7118fb595ffa970765094c39e Mon Sep 17 00:00:00 2001 From: Fran Moreno Date: Fri, 12 Aug 2022 13:54:07 +0200 Subject: [PATCH 8/9] Removed unused files (#2111) --- CHANGELOG.md | 1 + .../Strategy/CallbackStrategyTestHelper.php | 21 ------ tests/ErrorsCollector.php | 75 ------------------- 3 files changed, 1 insertion(+), 96 deletions(-) delete mode 100644 tests/Connection/Strategy/CallbackStrategyTestHelper.php delete mode 100644 tests/ErrorsCollector.php diff --git a/CHANGELOG.md b/CHANGELOG.md index 97bbde1e11..d5f1ad9385 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * Updated `php-cs-fixer` to `3.9.5` [#2110](https://github.com/ruflin/Elastica/pull/2110) ### Deprecated ### Removed +* Removed `CallbackStrategyTestHelper` and `ErrorsCollector` from `tests` [#2111](https://github.com/ruflin/Elastica/pull/2111) ### Fixed ### Security diff --git a/tests/Connection/Strategy/CallbackStrategyTestHelper.php b/tests/Connection/Strategy/CallbackStrategyTestHelper.php deleted file mode 100644 index 2f79cc71bd..0000000000 --- a/tests/Connection/Strategy/CallbackStrategyTestHelper.php +++ /dev/null @@ -1,21 +0,0 @@ - - */ -class ErrorsCollector -{ - private $errors = []; - - /** - * @var TestCase - */ - private $testCase; - - public function __construct(?TestCase $testCase = null) - { - $this->testCase = $testCase; - } - - public function add($error): void - { - $this->errors[] = $error; - } - - public function getCount() - { - return \count($this->errors); - } - - public function assertOnlyOneDeprecatedError($deprecationMessage): void - { - $this->testCase->assertSame(1, $this->getCount()); - $this->testCase->assertSame(1, $this->getDeprecatedCount()); - $this->testCase->assertSame($deprecationMessage, $this->getMessage(0)); - } - - public function assertOnlyDeprecatedErrors(array $deprecationMessages): void - { - $this->testCase->assertSame(\count($deprecationMessages), $this->getCount()); - $this->testCase->assertSame(\count($deprecationMessages), $this->getDeprecatedCount()); - - foreach ($deprecationMessages as $index => $message) { - $this->testCase->assertSame($message, $this->getMessage($index)); - } - } - - public function getDeprecatedCount() - { - $count = 0; - - foreach ($this->errors as $error) { - if (\E_USER_DEPRECATED === $error[0]) { - ++$count; - } - } - - return $count; - } - - public function getType($index) - { - return $this->errors[$index][0]; - } - - public function getMessage($index) - { - return $this->errors[$index][1]; - } -} From 535fb09e25d2121319b2d5c894a76f782d31f508 Mon Sep 17 00:00:00 2001 From: Fran Moreno Date: Mon, 15 Aug 2022 09:35:21 +0200 Subject: [PATCH 9/9] Test lowest dependencies in CI (#2113) * Simplify GA using composer-install * Bump elasticsearch/elasticsearch to 7.10 Co-authored-by: Nicolas Ruflin --- .github/workflows/continuous-integration.yaml | 45 ++++++------------- CHANGELOG.md | 2 + composer.json | 2 +- 3 files changed, 17 insertions(+), 32 deletions(-) diff --git a/.github/workflows/continuous-integration.yaml b/.github/workflows/continuous-integration.yaml index 6a9ad89fd7..a40945f768 100644 --- a/.github/workflows/continuous-integration.yaml +++ b/.github/workflows/continuous-integration.yaml @@ -36,8 +36,15 @@ jobs: - '7.4' - '8.0' - '8.1' + dependencies: + - 'highest' elasticsearch: - '7.15.2' + include: + # Test with the lowest set of dependencies + - dependencies: 'lowest' + php: '7.2' + elasticsearch: '7.15.2' fail-fast: false steps: - name: 'Checkout' @@ -51,23 +58,11 @@ jobs: tools: 'pecl, composer:v2' extensions: 'curl, json, mbstring, openssl' - - name: 'Get composer cache directory' - id: 'composer_cache' - run: | - echo "::set-output name=dir::$(composer config cache-files-dir)" - - - name: 'Cache dependencies' - uses: 'actions/cache@v2' + - name: 'Install dependencies with Composer' + uses: 'ramsey/composer-install@v2' with: - path: '${{ steps.composer_cache.outputs.dir }}' - key: '${{ runner.os }}-composer-php${{ matrix.php }}-${{ hashFiles(''**/composer.json'') }}' - restore-keys: | - ${{ runner.os }}-composer-php${{ matrix.php }}- - ${{ runner.os }}-composer- - - - name: 'Update dependencies' - run: | - composer update --prefer-dist --no-interaction --no-progress --ansi ${{ matrix.composer_flags }} + dependency-versions: '${{ matrix.dependencies }}' + composer-options: '--prefer-dist' - name: 'Run unit tests' run: | @@ -115,23 +110,11 @@ jobs: tools: 'pecl, composer:v2' extensions: 'curl, json, mbstring, openssl' - - name: 'Get composer cache directory' - id: 'composer_cache' - run: | - echo "::set-output name=dir::$(composer config cache-files-dir)" - - name: 'Cache dependencies' - uses: 'actions/cache@v2' + - name: 'Install dependencies with Composer' + uses: 'ramsey/composer-install@v2' with: - path: '${{ steps.composer_cache.outputs.dir }}' - key: '${{ runner.os }}-composer-php${{ matrix.php }}-${{ hashFiles(''**/composer.json'') }}' - restore-keys: | - ${{ runner.os }}-composer-php${{ matrix.php }}- - ${{ runner.os }}-composer- - - - name: 'Update dependencies' - run: | - composer update --prefer-dist --no-interaction --no-progress --ansi ${{ matrix.composer_flags }} + composer-options: '--prefer-dist' - name: 'Run phpstan' run: | diff --git a/CHANGELOG.md b/CHANGELOG.md index d5f1ad9385..4ecfa81e83 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Backward Compatibility Breaks ### Added ### Changed +* Use `ramsey/composer-install` to simplify CI jobs and test with the lowest set of dependencies [#2113](https://github.com/ruflin/Elastica/pull/2113) +* Bumped `elasticsearch/elasticsearch` to `7.10` to be able to use `OpenPointInTime` class [#2113](https://github.com/ruflin/Elastica/pull/2113) * Updated `php-cs-fixer` to `3.9.5` [#2110](https://github.com/ruflin/Elastica/pull/2110) ### Deprecated ### Removed diff --git a/composer.json b/composer.json index 936893b9ff..b6f59cff15 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ "require": { "php": "^7.2 || ^8.0", "ext-json": "*", - "elasticsearch/elasticsearch": "^7.1.1", + "elasticsearch/elasticsearch": "^7.10", "nyholm/dsn": "^2.0.0", "psr/log": "^1.0 || ^2.0 || ^3.0", "symfony/deprecation-contracts": "^2.2 || ^3.0",