Skip to content

Commit

Permalink
PHP 8.4 support (#1134)
Browse files Browse the repository at this point in the history
  • Loading branch information
thomascorthals authored Oct 15, 2024
1 parent 9cdf3dd commit f378b43
Show file tree
Hide file tree
Showing 34 changed files with 184 additions and 183 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:

strategy:
matrix:
php: [8.0, 8.1, 8.2, 8.3]
php: [8.0, 8.1, 8.2, 8.3, 8.4]
solr: [7, 8, 9]
mode: [cloud, server]

Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]
### Added
- PHP 8.4 support
- Solarium\Core\Query\AbstractQuery::setCpuAllowed()

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion src/Component/ComponentAwareQueryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public function getComponents(): array;
*
* @return object|null
*/
public function getComponent(string $key, $autoload = false, array $config = null);
public function getComponent(string $key, $autoload = false, ?array $config = null);

/**
* Set a component instance.
Expand Down
2 changes: 1 addition & 1 deletion src/Component/ComponentAwareQueryTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public function getComponents(): array
*
* @return object|null
*/
public function getComponent(string $key, $autoload = false, array $config = null)
public function getComponent(string $key, $autoload = false, ?array $config = null)
{
if (isset($this->components[$key])) {
return $this->components[$key];
Expand Down
4 changes: 2 additions & 2 deletions src/Component/DisMax.php
Original file line number Diff line number Diff line change
Expand Up @@ -271,11 +271,11 @@ public function setBoostQuery(string $boostQuery): self
/**
* Get BoostQuery option.
*
* @param string $key
* @param string|null $key
*
* @return string|null
*/
public function getBoostQuery(string $key = null): ?string
public function getBoostQuery(?string $key = null): ?string
{
if (null !== $key) {
if (\array_key_exists($key, $this->boostQueries)) {
Expand Down
6 changes: 3 additions & 3 deletions src/Component/Facet/JsonFacetTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ public function getDomainFilter()
*
* This overwrites the current value.
*
* @param string $query
* @param array $bind Bind values for placeholders in the query string
* @param string $query
* @param array|null $bind Bind values for placeholders in the query string
*
* @return self Provides fluent interface
*/
public function setDomainFilterQuery(string $query, array $bind = null): self
public function setDomainFilterQuery(string $query, ?array $bind = null): self
{
if (null !== $bind) {
$helper = new Helper();
Expand Down
6 changes: 3 additions & 3 deletions src/Component/QueryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ interface QueryInterface
*
* This overwrites the current value of a query or 'q' parameter.
*
* @param string $query
* @param array $bind Bind values for placeholders in the query string
* @param string $query
* @param array|null $bind Bind values for placeholders in the query string
*
* @return self Provides fluent interface
*/
public function setQuery(string $query, array $bind = null): self;
public function setQuery(string $query, ?array $bind = null): self;

/**
* Get query option.
Expand Down
6 changes: 3 additions & 3 deletions src/Component/QueryTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ trait QueryTrait
*
* This overwrites the current value of a query or 'q' parameter.
*
* @param string $query
* @param array $bind Bind values for placeholders in the query string
* @param string $query
* @param array|null $bind Bind values for placeholders in the query string
*
* @return self Provides fluent interface
*/
public function setQuery(string $query, array $bind = null): QueryInterface
public function setQuery(string $query, ?array $bind = null): QueryInterface
{
if (null !== $bind) {
$helper = $this->getHelper();
Expand Down
8 changes: 4 additions & 4 deletions src/Component/Result/MoreLikeThis/Result.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ class Result implements \IteratorAggregate, \Countable
/**
* Constructor.
*
* @param int $numFound
* @param float $maxScore
* @param array $documents
* @param int $numFound
* @param float|null $maxScore
* @param array $documents
*/
public function __construct(int $numFound, float $maxScore = null, array $documents = [])
public function __construct(int $numFound, ?float $maxScore = null, array $documents = [])
{
$this->numFound = $numFound;
$this->maximumScore = $maxScore;
Expand Down
4 changes: 2 additions & 2 deletions src/Component/Stats/Stats.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ public function getResponseParser(): ?ComponentParserInterface
* When no key is supplied the field cannot be added, in that case you will need to add it manually
* after setting the key, by using the addField method.
*
* @param string|array $options
* @param string|array|null $options
*
* @return Field
*/
public function createField(string|array $options = null): Field
public function createField(string|array|null $options = null): Field
{
if (\is_string($options)) {
$fq = new Field();
Expand Down
Loading

0 comments on commit f378b43

Please sign in to comment.