Skip to content

Commit

Permalink
Merge branch 'master' into set_merge_policy
Browse files Browse the repository at this point in the history
  • Loading branch information
ruflin authored Jun 23, 2022
2 parents c3bf13f + 45b46cb commit 6eb2d19
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased](https://github.com/ruflin/Elastica/compare/7.1.5...master)
### Backward Compatibility Breaks
* 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.
* 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.
### Added
* Added `PHPStan` at level 3 by @franmomu [#2064](https://github.com/ruflin/Elastica/pull/2064)
* Added coverage check to CI by @franmomu [#2071](https://github.com/ruflin/Elastica/pull/2071)
Expand All @@ -19,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* Updated `composer-normalize` to `2.2.28` by @deguif [#2084](https://github.com/ruflin/Elastica/pull/2084)
* Increased `PHPStan` level to `4` [#2080](https://github.com/ruflin/Elastica/pull/2080)
* `ExceptionInterface` extends `Throwable` [#2083](https://github.com/ruflin/Elastica/pull/2083)
* Changed `value` in `SetProcessor` to accept `mixed` instead of `string`.
### 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)
Expand Down
9 changes: 7 additions & 2 deletions src/Processor/SetProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ class SetProcessor extends AbstractProcessor

public const DEFAULT_OVERRIDE_VALUE = true;

public function __construct(string $field, string $value)
/**
* @param mixed $value
*/
public function __construct(string $field, $value)
{
$this->setField($field);
$this->setValue($value);
Expand All @@ -25,9 +28,11 @@ public function __construct(string $field, string $value)
/**
* Set field value.
*
* @param mixed $value
*
* @return $this
*/
public function setValue(string $value): self
public function setValue($value): self
{
return $this->setParam('value', $value);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/PipelineTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function testPipelineCreate(): void

$this->assertSame('pipeline for Set', $result['my_custom_pipeline']['description']);
$this->assertSame('field4', $result['my_custom_pipeline']['processors'][0]['set']['field']);
$this->assertSame('333', $result['my_custom_pipeline']['processors'][0]['set']['value']);
$this->assertSame(333, $result['my_custom_pipeline']['processors'][0]['set']['value']);
$this->assertSame('field1', $result['my_custom_pipeline']['processors'][0]['trim']['field']);
}

Expand Down

0 comments on commit 6eb2d19

Please sign in to comment.