Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions .github/workflows/test-application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

steps:
- name: Checkout project
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Install and configure PHP
uses: shivammathur/setup-php@v2
Expand All @@ -26,7 +26,7 @@ jobs:
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache dependencies
uses: actions/cache@v3
uses: actions/cache@v4
id: composer-cache
with:
path: ${{ steps.composer-cache-dir.outputs.dir }}
Expand All @@ -38,14 +38,14 @@ jobs:
run: composer install --no-interaction --prefer-dist

- name: Check code style
run: vendor/bin/ecs
run: vendor/bin/php-cs-fixer fix --dry-run

phpstan:
runs-on: ubuntu-latest

steps:
- name: Checkout project
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Install and configure PHP
uses: shivammathur/setup-php@v2
Expand All @@ -58,7 +58,7 @@ jobs:
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache dependencies
uses: actions/cache@v3
uses: actions/cache@v4
id: composer-cache
with:
path: ${{ steps.composer-cache-dir.outputs.dir }}
Expand All @@ -79,11 +79,11 @@ jobs:
strategy:
fail-fast: false
matrix:
php-version: [ '8.1', '8.2', '8.3', '8.4' ]
php-version: ['8.3', '8.4', '8.5' ]

steps:
- name: Checkout project
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Install and configure PHP
uses: shivammathur/setup-php@v2
Expand All @@ -96,7 +96,7 @@ jobs:
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache dependencies
uses: actions/cache@v3
uses: actions/cache@v4
id: composer-cache
with:
path: ${{ steps.composer-cache-dir.outputs.dir }}
Expand All @@ -120,14 +120,14 @@ jobs:
fail-fast: false
matrix:
include:
- opensearch-version: '1'
opensearch-composer-version: '^1'
- opensearch-version: '2'
opensearch-composer-version: '^2'
- opensearch-version: '3'
opensearch-composer-version: '^2'

steps:
- name: Checkout project
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Install and configure PHP
uses: shivammathur/setup-php@v2
Expand All @@ -140,7 +140,7 @@ jobs:
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache dependencies
uses: actions/cache@v3
uses: actions/cache@v4
id: composer-cache
with:
path: ${{ steps.composer-cache-dir.outputs.dir }}
Expand Down
18 changes: 8 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
"name": "smoench/opensearch-dsl",
"description": "OpenSearch DSL library",
"type": "library",
"homepage": "http://ongr.io",
"license": "MIT",
"authors": [
{
"name": "ONGR team",
"homepage": "http://www.ongr.io"
"name": "ONGR team"
},
{
"name": "Handcrafted in the Alps Team",
Expand All @@ -19,15 +17,15 @@
}
],
"require": {
"php": "8.1.* || 8.2.* || 8.3.* || 8.4.*",
"opensearch-project/opensearch-php": "^1.0 || ^2.3.1"
"php": "8.3.* || 8.4.* || 8.5.*",
"opensearch-project/opensearch-php": "^2.3.1"
},
"require-dev": {
"phpunit/phpunit": "^10.5.40",
"phpstan/phpstan": "1.12.14",
"phpstan/phpstan-phpunit": "1.4.2",
"rector/rector": "^1.2.10",
"symplify/easy-coding-standard": "^12.5.5"
"phpunit/phpunit": "^12.5.2",
"phpstan/phpstan": "2.1.33",
"phpstan/phpstan-phpunit": "2.0.10",
"rector/rector": "2.2.14",
"friendsofphp/php-cs-fixer": "3.91.3"
},
"autoload": {
"psr-4": {
Expand Down
30 changes: 0 additions & 30 deletions ecs.php

This file was deleted.

6 changes: 3 additions & 3 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
return static function (RectorConfig $rectorConfig): void {
$rectorConfig->paths([
__DIR__ . '/src',
__DIR__ . '/tests'
__DIR__ . '/tests',
]);

// register a single rule
Expand All @@ -24,8 +24,8 @@
]);

$rectorConfig->sets([
LevelSetList::UP_TO_PHP_81,
PHPUnitSetList::PHPUNIT_100,
LevelSetList::UP_TO_PHP_83,
PHPUnitSetList::PHPUNIT_120,
SetList::CODE_QUALITY,
]);
};
2 changes: 1 addition & 1 deletion src/Aggregation/Bucketing/AdjacencyMatrixAggregation.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class AdjacencyMatrixAggregation extends AbstractAggregation
{
use BucketingTrait;

final public const FILTERS = 'filters';
final public const string FILTERS = 'filters';

/**
* @var array<string, array<string, array|null>>
Expand Down
2 changes: 1 addition & 1 deletion src/Aggregation/Bucketing/DateRangeAggregation.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public function addRange($from = null, $to = null, $key = null)
'to' => $to,
'key' => $key,
],
fn ($v) => null !== $v
fn($v) => null !== $v
);

if ($range === []) {
Expand Down
1 change: 1 addition & 0 deletions src/Aggregation/Bucketing/FilterAggregation.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public function getFilter(): ?BuilderInterface
return $this->filter;
}

#[\Override]
public function setField($field): static
{
throw new LogicException("Filter aggregation, doesn't support `field` parameter");
Expand Down
1 change: 1 addition & 0 deletions src/Aggregation/Bucketing/GlobalAggregation.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class GlobalAggregation extends AbstractAggregation
{
use BucketingTrait;

#[\Override]
public function setField($field): static
{
throw new LogicException("Global aggregation, doesn't support `field` parameter");
Expand Down
6 changes: 3 additions & 3 deletions src/Aggregation/Bucketing/HistogramAggregation.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ class HistogramAggregation extends AbstractAggregation
{
use BucketingTrait;

final public const DIRECTION_ASC = 'asc';
final public const string DIRECTION_ASC = 'asc';

final public const DIRECTION_DESC = 'desc';
final public const string DIRECTION_DESC = 'desc';

private ?int $interval = null;

Expand Down Expand Up @@ -161,7 +161,7 @@ public function getArray(): array
'keyed' => $this->isKeyed(),
'order' => $this->getOrder(),
],
fn ($val) => $val || is_numeric($val)
fn($val) => $val || is_numeric($val)
);
$this->checkRequiredParameters($out, ['field', 'interval']);

Expand Down
1 change: 1 addition & 0 deletions src/Aggregation/Bucketing/SignificantTermsAggregation.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
*/
class SignificantTermsAggregation extends TermsAggregation
{
#[\Override]
public function getType(): string
{
return 'significant_terms';
Expand Down
1 change: 1 addition & 0 deletions src/Aggregation/Bucketing/SignificantTextAggregation.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
*/
class SignificantTextAggregation extends TermsAggregation
{
#[\Override]
public function getType(): string
{
return 'significant_text';
Expand Down
1 change: 1 addition & 0 deletions src/Aggregation/Metric/AvgAggregation.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
*/
class AvgAggregation extends StatsAggregation
{
#[\Override]
public function getType(): string
{
return 'avg';
Expand Down
2 changes: 1 addition & 1 deletion src/Aggregation/Metric/CardinalityAggregation.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function getArray(): array
'precision_threshold' => $this->getPrecisionThreshold(),
'rehash' => $this->isRehash(),
],
fn ($val) => $val || is_bool($val)
fn($val) => $val || is_bool($val)
);

$this->checkRequiredFields($out);
Expand Down
2 changes: 1 addition & 1 deletion src/Aggregation/Metric/ExtendedStatsAggregation.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public function getArray(): array
'script' => $this->getScript(),
'sigma' => $this->getSigma(),
],
fn ($val) => $val || is_numeric($val)
fn($val) => $val || is_numeric($val)
);
}
}
1 change: 1 addition & 0 deletions src/Aggregation/Metric/MaxAggregation.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
*/
class MaxAggregation extends StatsAggregation
{
#[\Override]
public function getType(): string
{
return 'max';
Expand Down
1 change: 1 addition & 0 deletions src/Aggregation/Metric/MinAggregation.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
*/
class MinAggregation extends StatsAggregation
{
#[\Override]
public function getType(): string
{
return 'min';
Expand Down
2 changes: 1 addition & 1 deletion src/Aggregation/Metric/PercentileRanksAggregation.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public function getArray(): array
'values' => $this->getValues(),
'compression' => $this->getCompression(),
],
fn ($val) => $val || is_numeric($val)
fn($val) => $val || is_numeric($val)
);

$this->isRequiredParametersSet($out);
Expand Down
2 changes: 1 addition & 1 deletion src/Aggregation/Metric/PercentilesAggregation.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public function getArray(): array
'field' => $this->getField(),
'script' => $this->getScript(),
],
fn ($val) => $val || is_numeric($val)
fn($val) => $val || is_numeric($val)
);

$this->isRequiredParametersSet($out);
Expand Down
1 change: 1 addition & 0 deletions src/Aggregation/Metric/SumAggregation.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
*/
class SumAggregation extends StatsAggregation
{
#[\Override]
public function getType(): string
{
return 'sum';
Expand Down
2 changes: 1 addition & 1 deletion src/Aggregation/Metric/TopHitsAggregation.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public function getArray(): array|stdClass
'size' => $this->getSize(),
'from' => $this->getFrom(),
],
static fn ($value) => $value !== null
static fn($value) => $value !== null
);

return $output === [] ? new stdClass() : $output;
Expand Down
1 change: 1 addition & 0 deletions src/Aggregation/Metric/ValueCountAggregation.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
*/
class ValueCountAggregation extends StatsAggregation
{
#[\Override]
public function getType(): string
{
return 'value_count';
Expand Down
1 change: 1 addition & 0 deletions src/Aggregation/Pipeline/BucketScriptAggregation.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public function getType(): string
return 'bucket_script';
}

#[\Override]
public function getArray(): array
{
if ($this->getScript() === null) {
Expand Down
1 change: 1 addition & 0 deletions src/Aggregation/Pipeline/BucketSelectorAggregation.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
*/
class BucketSelectorAggregation extends BucketScriptAggregation
{
#[\Override]
public function getType(): string
{
return 'bucket_selector';
Expand Down
1 change: 1 addition & 0 deletions src/Aggregation/Pipeline/BucketSortAggregation.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public function getType(): string
return 'bucket_sort';
}

#[\Override]
public function getArray(): array
{
return array_filter(
Expand Down
1 change: 1 addition & 0 deletions src/Aggregation/Pipeline/PercentilesBucketAggregation.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public function setPercents(array $percents)
return $this;
}

#[\Override]
public function getArray(): array
{
$data = [
Expand Down
2 changes: 1 addition & 1 deletion src/BuilderBag.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public function all(?string $type = null): array
{
return array_filter(
$this->bag,
static fn (BuilderInterface $builder) => $type === null || $builder->getType() === $type
static fn(BuilderInterface $builder) => $type === null || $builder->getType() === $type
);
}

Expand Down
5 changes: 2 additions & 3 deletions src/FieldCollapse/FieldCollapse.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ class FieldCollapse implements BuilderInterface

public function __construct(
private readonly string $field
) {
}
) {}

public function addInnerHits(InnerHits $innerHits): self
{
Expand All @@ -42,7 +41,7 @@ public function toArray(): array|stdClass

if ($this->innerHits !== []) {
$array['inner_hits'] = array_map(
static fn (InnerHits $innerHits) => $innerHits->toArray(),
static fn(InnerHits $innerHits) => $innerHits->toArray(),
$this->innerHits
);
}
Expand Down
Loading