Skip to content

Commit

Permalink
Add strict types to Aggregation namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
sidz committed Mar 24, 2024
1 parent 78d5a9e commit c5e6d8c
Show file tree
Hide file tree
Showing 57 changed files with 115 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/Aggregation/AbstractAggregation.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Elastica\Aggregation;

use Elastica\Exception\InvalidException;
Expand Down
2 changes: 2 additions & 0 deletions src/Aggregation/AbstractSimpleAggregation.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Elastica\Aggregation;

use Elastica\Exception\InvalidException;
Expand Down
2 changes: 2 additions & 0 deletions src/Aggregation/AbstractTermsAggregation.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Elastica\Aggregation;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/Aggregation/AdjacencyMatrix.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Elastica\Aggregation;

use Elastica\Query\AbstractQuery;
Expand Down
2 changes: 2 additions & 0 deletions src/Aggregation/AutoDateHistogram.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Elastica\Aggregation;

use Elastica\Aggregation\Traits\MissingTrait;
Expand Down
2 changes: 2 additions & 0 deletions src/Aggregation/Avg.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Elastica\Aggregation;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/Aggregation/AvgBucket.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Elastica\Aggregation;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/Aggregation/BucketScript.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Elastica\Aggregation;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/Aggregation/BucketSelector.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Elastica\Aggregation;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/Aggregation/Cardinality.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Elastica\Aggregation;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/Aggregation/Children.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Elastica\Aggregation;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/Aggregation/Composite.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Elastica\Aggregation;

class Composite extends AbstractAggregation
Expand Down
2 changes: 2 additions & 0 deletions src/Aggregation/CumulativeSum.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Elastica\Aggregation;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/Aggregation/DateHistogram.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Elastica\Aggregation;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/Aggregation/DateRange.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Elastica\Aggregation;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/Aggregation/Derivative.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Elastica\Aggregation;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/Aggregation/DiversifiedSampler.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Elastica\Aggregation;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/Aggregation/ExtendedStats.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Elastica\Aggregation;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/Aggregation/ExtendedStatsBucket.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Elastica\Aggregation;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/Aggregation/Filter.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Elastica\Aggregation;

use Elastica\Exception\InvalidException;
Expand Down
2 changes: 2 additions & 0 deletions src/Aggregation/Filters.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Elastica\Aggregation;

use Elastica\Exception\InvalidException;
Expand Down
2 changes: 2 additions & 0 deletions src/Aggregation/GapPolicyInterface.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Elastica\Aggregation;

use Elastica\Aggregation\Traits\GapPolicyTrait;
Expand Down
2 changes: 2 additions & 0 deletions src/Aggregation/GeoBounds.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Elastica\Aggregation;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/Aggregation/GeoCentroid.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Elastica\Aggregation;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/Aggregation/GeoDistance.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Elastica\Aggregation;

use Elastica\Exception\InvalidException;
Expand Down
4 changes: 3 additions & 1 deletion src/Aggregation/GeohashGrid.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Elastica\Aggregation;

/**
Expand Down Expand Up @@ -46,7 +48,7 @@ public function setField(string $field): self
public function setPrecision($precision): self
{
if (!\is_int($precision) && !\is_string($precision)) {
throw new \TypeError(\sprintf('Argument 1 passed to "%s()" must be of type int|string, %s given.', __METHOD__, \is_object($precision) ? \get_class($precision) : \gettype($precision)));
throw new \TypeError(\sprintf('Argument 1 passed to "%s()" must be of type int|string, %s given.', __METHOD__, \is_object($precision) ? $precision::class : \gettype($precision)));
}

return $this->setParam('precision', $precision);
Expand Down
2 changes: 2 additions & 0 deletions src/Aggregation/GeotileGridAggregation.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Elastica\Aggregation;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/Aggregation/GlobalAggregation.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Elastica\Aggregation;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/Aggregation/Histogram.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Elastica\Aggregation;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/Aggregation/IpRange.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Elastica\Aggregation;

use Elastica\Exception\InvalidException;
Expand Down
2 changes: 2 additions & 0 deletions src/Aggregation/Max.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Elastica\Aggregation;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/Aggregation/Min.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Elastica\Aggregation;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/Aggregation/Missing.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Elastica\Aggregation;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/Aggregation/Nested.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Elastica\Aggregation;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/Aggregation/NormalizeAggregation.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Elastica\Aggregation;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/Aggregation/ParentAggregation.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Elastica\Aggregation;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/Aggregation/Percentiles.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Elastica\Aggregation;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/Aggregation/PercentilesBucket.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Elastica\Aggregation;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/Aggregation/Range.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Elastica\Aggregation;

use Elastica\Exception\InvalidException;
Expand Down
2 changes: 2 additions & 0 deletions src/Aggregation/ReverseNested.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Elastica\Aggregation;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/Aggregation/Sampler.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Elastica\Aggregation;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/Aggregation/ScriptedMetric.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Elastica\Aggregation;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/Aggregation/SerialDiff.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Elastica\Aggregation;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/Aggregation/SignificantTerms.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Elastica\Aggregation;

use Elastica\Query\AbstractQuery;
Expand Down
2 changes: 2 additions & 0 deletions src/Aggregation/Stats.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Elastica\Aggregation;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/Aggregation/StatsBucket.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Elastica\Aggregation;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/Aggregation/Sum.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Elastica\Aggregation;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/Aggregation/SumBucket.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Elastica\Aggregation;

/**
Expand Down
Loading

0 comments on commit c5e6d8c

Please sign in to comment.