Skip to content

Commit

Permalink
Enable declare_strict_types option and apply @PHP80Migration set with…
Browse files Browse the repository at this point in the history
… risky rules
  • Loading branch information
sidz committed Jan 27, 2024
1 parent b713330 commit bb28ac4
Show file tree
Hide file tree
Showing 437 changed files with 910 additions and 41 deletions.
3 changes: 2 additions & 1 deletion .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
return (new PhpCsFixer\Config())
->setFinder($finder)
->setRules([
'@PHP71Migration' => true,
'@PHP80Migration' => true,
'@PHP80Migration:risky' => true,
'@PhpCsFixer' => true,
'@PHPUnit75Migration:risky' => true,
'@PSR2' => true,
Expand Down
2 changes: 2 additions & 0 deletions src/AbstractUpdateAction.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Elastica;

use Elastica\Exception\InvalidException;
Expand Down
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
Loading

0 comments on commit bb28ac4

Please sign in to comment.