Skip to content

Commit

Permalink
Drop PHP 8.0 support
Browse files Browse the repository at this point in the history
  • Loading branch information
thomascorthals committed Dec 30, 2024
1 parent 9f86b09 commit 731c0da
Show file tree
Hide file tree
Showing 52 changed files with 136 additions and 145 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, 8.4]
php: [8.1, 8.2, 8.3, 8.4]
solr: [7, 8, 9]
mode: [cloud, server]

Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to the Solarium library will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Removed
- PHP 8.0 support

## [6.3.6]
### Added
- PHP 8.4 support
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Please see the [docs](http://solarium.readthedocs.io/en/stable/) for a more deta

## Requirements

Solarium 6.3.2 and up only supports PHP 8.0 and up.
Solarium 6.3.7 and up only supports PHP 8.1 and up.

It's highly recommended to have cURL enabled in your PHP environment. However if you don't have cURL available you can
switch from using cURL (the default) to a pure PHP based HTTP client adapter which works for the essential stuff but
Expand Down
2 changes: 1 addition & 1 deletion src/Component/Result/Debug/Detail.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ public function debugDump(int $depth = 0): string
/**
* {@inheritdoc}
*/
public function __toString()
public function __toString(): string
{
return $this->debugDump();
}
Expand Down
2 changes: 1 addition & 1 deletion src/Component/Result/Debug/Document.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public function count(): int
/**
* {@inheritdoc}
*/
public function __toString()
public function __toString(): string
{
$string = '';
foreach ($this->getDetails() as $detail) {
Expand Down
2 changes: 2 additions & 0 deletions src/Component/Result/Grouping/Result.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ public function getGroup(string $key)
if (isset($this->groups[$key])) {
return $this->groups[$key];
}

return null;
}

/**
Expand Down
32 changes: 16 additions & 16 deletions src/Core/Client/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,7 @@ public function createResult(QueryInterface $query, $response): ResultInterface
*
* @return ResultInterface
*/
public function execute(QueryInterface $query, $endpoint = null): ResultInterface
public function execute(QueryInterface $query, Endpoint|string|null $endpoint = null): ResultInterface
{
$event = new PreExecuteEvent($query);
$this->eventDispatcher->dispatch($event);
Expand All @@ -833,7 +833,7 @@ public function execute(QueryInterface $query, $endpoint = null): ResultInterfac
*
* @return Response
*/
public function executeRequest(Request $request, $endpoint = null): Response
public function executeRequest(Request $request, Endpoint|string|null $endpoint = null): Response
{
// load endpoint by string or by using the default one in case of a null value
if (!($endpoint instanceof Endpoint)) {
Expand Down Expand Up @@ -872,7 +872,7 @@ public function executeRequest(Request $request, $endpoint = null): Response
*
* @return ResultInterface|\Solarium\QueryType\Ping\Result
*/
public function ping(QueryInterface $query, $endpoint = null): PingResult
public function ping(QueryInterface $query, Endpoint|string|null $endpoint = null): PingResult
{
return $this->execute($query, $endpoint);
}
Expand All @@ -896,7 +896,7 @@ public function ping(QueryInterface $query, $endpoint = null): PingResult
*
* @return ResultInterface|\Solarium\QueryType\Update\Result
*/
public function update(QueryInterface $query, $endpoint = null): UpdateResult
public function update(QueryInterface $query, Endpoint|string|null $endpoint = null): UpdateResult
{
return $this->execute($query, $endpoint);
}
Expand All @@ -919,7 +919,7 @@ public function update(QueryInterface $query, $endpoint = null): UpdateResult
*
* @return ResultInterface|\Solarium\QueryType\Select\Result\Result
*/
public function select(QueryInterface $query, $endpoint = null): SelectResult
public function select(QueryInterface $query, Endpoint|string|null $endpoint = null): SelectResult
{
return $this->execute($query, $endpoint);
}
Expand All @@ -942,7 +942,7 @@ public function select(QueryInterface $query, $endpoint = null): SelectResult
*
* @return ResultInterface|\Solarium\QueryType\MoreLikeThis\Result
*/
public function moreLikeThis(QueryInterface $query, $endpoint = null): MoreLikeThisResult
public function moreLikeThis(QueryInterface $query, Endpoint|string|null $endpoint = null): MoreLikeThisResult
{
return $this->execute($query, $endpoint);
}
Expand All @@ -958,7 +958,7 @@ public function moreLikeThis(QueryInterface $query, $endpoint = null): MoreLikeT
*
* @return ResultInterface|\Solarium\QueryType\Analysis\Result\Document|\Solarium\QueryType\Analysis\Result\Field
*/
public function analyze(QueryInterface $query, $endpoint = null): ResultInterface
public function analyze(QueryInterface $query, Endpoint|string|null $endpoint = null): ResultInterface
{
return $this->execute($query, $endpoint);
}
Expand All @@ -974,7 +974,7 @@ public function analyze(QueryInterface $query, $endpoint = null): ResultInterfac
*
* @return ResultInterface|\Solarium\QueryType\Terms\Result
*/
public function terms(QueryInterface $query, $endpoint = null): TermsResult
public function terms(QueryInterface $query, Endpoint|string|null $endpoint = null): TermsResult
{
return $this->execute($query, $endpoint);
}
Expand All @@ -990,7 +990,7 @@ public function terms(QueryInterface $query, $endpoint = null): TermsResult
*
* @return ResultInterface|\Solarium\QueryType\Spellcheck\Result\Result
*/
public function spellcheck(QueryInterface $query, $endpoint = null): SpellcheckResult
public function spellcheck(QueryInterface $query, Endpoint|string|null $endpoint = null): SpellcheckResult
{
return $this->execute($query, $endpoint);
}
Expand All @@ -1006,7 +1006,7 @@ public function spellcheck(QueryInterface $query, $endpoint = null): SpellcheckR
*
* @return ResultInterface|\Solarium\QueryType\Suggester\Result\Result
*/
public function suggester(QueryInterface $query, $endpoint = null): SuggesterResult
public function suggester(QueryInterface $query, Endpoint|string|null $endpoint = null): SuggesterResult
{
return $this->execute($query, $endpoint);
}
Expand All @@ -1022,7 +1022,7 @@ public function suggester(QueryInterface $query, $endpoint = null): SuggesterRes
*
* @return ResultInterface|\Solarium\QueryType\Extract\Result
*/
public function extract(QueryInterface $query, $endpoint = null): ExtractResult
public function extract(QueryInterface $query, Endpoint|string|null $endpoint = null): ExtractResult
{
return $this->execute($query, $endpoint);
}
Expand All @@ -1038,7 +1038,7 @@ public function extract(QueryInterface $query, $endpoint = null): ExtractResult
*
* @return ResultInterface|\Solarium\QueryType\RealtimeGet\Result
*/
public function realtimeGet(QueryInterface $query, $endpoint = null): RealtimeGetResult
public function realtimeGet(QueryInterface $query, Endpoint|string|null $endpoint = null): RealtimeGetResult
{
return $this->execute($query, $endpoint);
}
Expand All @@ -1054,7 +1054,7 @@ public function realtimeGet(QueryInterface $query, $endpoint = null): RealtimeGe
*
* @return ResultInterface|\Solarium\QueryType\Luke\Result\Result
*/
public function luke(QueryInterface $query, $endpoint = null): LukeResult
public function luke(QueryInterface $query, Endpoint|string|null $endpoint = null): LukeResult
{
return $this->execute($query, $endpoint);
}
Expand All @@ -1070,7 +1070,7 @@ public function luke(QueryInterface $query, $endpoint = null): LukeResult
*
* @return ResultInterface|\Solarium\QueryType\Server\CoreAdmin\Result\Result
*/
public function coreAdmin(QueryInterface $query, $endpoint = null): CoreAdminResult
public function coreAdmin(QueryInterface $query, Endpoint|string|null $endpoint = null): CoreAdminResult
{
return $this->execute($query, $endpoint);
}
Expand All @@ -1086,7 +1086,7 @@ public function coreAdmin(QueryInterface $query, $endpoint = null): CoreAdminRes
*
* @return ResultInterface|\Solarium\QueryType\Server\Collections\Result\ClusterStatusResult
*/
public function collections(QueryInterface $query, $endpoint = null): ResultInterface
public function collections(QueryInterface $query, Endpoint|string|null $endpoint = null): ResultInterface
{
return $this->execute($query, $endpoint);
}
Expand All @@ -1102,7 +1102,7 @@ public function collections(QueryInterface $query, $endpoint = null): ResultInte
*
* @return ResultInterface|\Solarium\QueryType\Server\Configsets\Result\ListConfigsetsResult
*/
public function configsets(QueryInterface $query, $endpoint = null): ResultInterface
public function configsets(QueryInterface $query, Endpoint|string|null $endpoint = null): ResultInterface
{
return $this->execute($query, $endpoint);
}
Expand Down
32 changes: 16 additions & 16 deletions src/Core/Client/ClientInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ public function createResult(QueryInterface $query, $response): ResultInterface;
*
* @return ResultInterface
*/
public function execute(QueryInterface $query, $endpoint = null): ResultInterface;
public function execute(QueryInterface $query, Endpoint|string|null $endpoint = null): ResultInterface;

/**
* Execute a request and return the response.
Expand All @@ -327,7 +327,7 @@ public function execute(QueryInterface $query, $endpoint = null): ResultInterfac
*
* @return Response
*/
public function executeRequest(Request $request, $endpoint = null): Response;
public function executeRequest(Request $request, Endpoint|string|null $endpoint = null): Response;

/**
* Execute a ping query.
Expand All @@ -349,7 +349,7 @@ public function executeRequest(Request $request, $endpoint = null): Response;
*
* @return ResultInterface|\Solarium\QueryType\Ping\Result
*/
public function ping(QueryInterface $query, $endpoint = null): PingResult;
public function ping(QueryInterface $query, Endpoint|string|null $endpoint = null): PingResult;

/**
* Execute an update query.
Expand All @@ -373,7 +373,7 @@ public function ping(QueryInterface $query, $endpoint = null): PingResult;
*
* @return ResultInterface|\Solarium\QueryType\Update\Result
*/
public function update(QueryInterface $query, $endpoint = null): UpdateResult;
public function update(QueryInterface $query, Endpoint|string|null $endpoint = null): UpdateResult;

/**
* Execute a select query.
Expand All @@ -396,7 +396,7 @@ public function update(QueryInterface $query, $endpoint = null): UpdateResult;
*
* @return ResultInterface|\Solarium\QueryType\Select\Result\Result
*/
public function select(QueryInterface $query, $endpoint = null): SelectResult;
public function select(QueryInterface $query, Endpoint|string|null $endpoint = null): SelectResult;

/**
* Execute a MoreLikeThis query.
Expand All @@ -419,7 +419,7 @@ public function select(QueryInterface $query, $endpoint = null): SelectResult;
*
* @return ResultInterface|\Solarium\QueryType\MoreLikeThis\Result
*/
public function moreLikeThis(QueryInterface $query, $endpoint = null): MoreLikeThisResult;
public function moreLikeThis(QueryInterface $query, Endpoint|string|null $endpoint = null): MoreLikeThisResult;

/**
* Execute an analysis query.
Expand All @@ -432,7 +432,7 @@ public function moreLikeThis(QueryInterface $query, $endpoint = null): MoreLikeT
*
* @return ResultInterface|\Solarium\QueryType\Analysis\Result\Document|\Solarium\QueryType\Analysis\Result\Field
*/
public function analyze(QueryInterface $query, $endpoint = null): ResultInterface;
public function analyze(QueryInterface $query, Endpoint|string|null $endpoint = null): ResultInterface;

/**
* Execute a terms query.
Expand All @@ -445,7 +445,7 @@ public function analyze(QueryInterface $query, $endpoint = null): ResultInterfac
*
* @return ResultInterface|\Solarium\QueryType\Terms\Result
*/
public function terms(QueryInterface $query, $endpoint = null): TermsResult;
public function terms(QueryInterface $query, Endpoint|string|null $endpoint = null): TermsResult;

/**
* Execute a spellcheck query.
Expand All @@ -458,7 +458,7 @@ public function terms(QueryInterface $query, $endpoint = null): TermsResult;
*
* @return ResultInterface|\Solarium\QueryType\Spellcheck\Result\Result
*/
public function spellcheck(QueryInterface $query, $endpoint = null): SpellcheckResult;
public function spellcheck(QueryInterface $query, Endpoint|string|null $endpoint = null): SpellcheckResult;

/**
* Execute a suggester query.
Expand All @@ -471,7 +471,7 @@ public function spellcheck(QueryInterface $query, $endpoint = null): SpellcheckR
*
* @return ResultInterface|\Solarium\QueryType\Suggester\Result\Result
*/
public function suggester(QueryInterface $query, $endpoint = null): SuggesterResult;
public function suggester(QueryInterface $query, Endpoint|string|null $endpoint = null): SuggesterResult;

/**
* Execute an extract query.
Expand All @@ -484,7 +484,7 @@ public function suggester(QueryInterface $query, $endpoint = null): SuggesterRes
*
* @return ResultInterface|\Solarium\QueryType\Extract\Result
*/
public function extract(QueryInterface $query, $endpoint = null): ExtractResult;
public function extract(QueryInterface $query, Endpoint|string|null $endpoint = null): ExtractResult;

/**
* Execute a RealtimeGet query.
Expand All @@ -497,7 +497,7 @@ public function extract(QueryInterface $query, $endpoint = null): ExtractResult;
*
* @return ResultInterface|\Solarium\QueryType\RealtimeGet\Result
*/
public function realtimeGet(QueryInterface $query, $endpoint = null): RealtimeGetResult;
public function realtimeGet(QueryInterface $query, Endpoint|string|null $endpoint = null): RealtimeGetResult;

/**
* Execute a Luke query.
Expand All @@ -510,7 +510,7 @@ public function realtimeGet(QueryInterface $query, $endpoint = null): RealtimeGe
*
* @return ResultInterface|\Solarium\QueryType\Luke\Result\Result
*/
public function luke(QueryInterface $query, $endpoint = null): LukeResult;
public function luke(QueryInterface $query, Endpoint|string|null $endpoint = null): LukeResult;

/**
* Execute a CoreAdmin query.
Expand All @@ -523,7 +523,7 @@ public function luke(QueryInterface $query, $endpoint = null): LukeResult;
*
* @return ResultInterface|\Solarium\QueryType\Server\CoreAdmin\Result\Result
*/
public function coreAdmin(QueryInterface $query, $endpoint = null): CoreAdminResult;
public function coreAdmin(QueryInterface $query, Endpoint|string|null $endpoint = null): CoreAdminResult;

/**
* Execute a Collections API query.
Expand All @@ -536,7 +536,7 @@ public function coreAdmin(QueryInterface $query, $endpoint = null): CoreAdminRes
*
* @return ResultInterface|\Solarium\QueryType\Server\Collections\Result\ClusterStatusResult
*/
public function collections(QueryInterface $query, $endpoint = null): ResultInterface;
public function collections(QueryInterface $query, Endpoint|string|null $endpoint = null): ResultInterface;

/**
* Execute a Configsets API query.
Expand All @@ -549,7 +549,7 @@ public function collections(QueryInterface $query, $endpoint = null): ResultInte
*
* @return ResultInterface|\Solarium\QueryType\Server\Configsets\Result\ListConfigsetsResult
*/
public function configsets(QueryInterface $query, $endpoint = null): ResultInterface;
public function configsets(QueryInterface $query, Endpoint|string|null $endpoint = null): ResultInterface;

/**
* Create a query instance.
Expand Down
2 changes: 1 addition & 1 deletion src/Core/Client/Endpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class Endpoint extends Configurable
*
* @return string
*/
public function __toString()
public function __toString(): string
{
$output = __CLASS__.'::__toString'."\n".'host: '.$this->getHost()."\n".'port: '.$this->getPort()."\n".'path: '.$this->getPath()."\n".'context: '.$this->getContext()."\n".'collection: '.$this->getCollection()."\n".'core: '.$this->getCore()."\n".'authentication: '.print_r($this->getAuthentication() + $this->getAuthorizationToken(), true);

Expand Down
2 changes: 1 addition & 1 deletion src/Core/Client/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class Request extends Configurable implements RequestParamsInterface
*
* @return string
*/
public function __toString()
public function __toString(): string
{
$output =
__CLASS__.'::__toString'."\n"
Expand Down
6 changes: 3 additions & 3 deletions src/Core/Query/AbstractRequestBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ abstract class AbstractRequestBuilder implements RequestBuilderInterface
protected $helper;

/**
* Build request for a select query.
* Build request for a generic query.
*
* @param AbstractQuery|QueryInterface $query
* @param QueryInterface|AbstractQuery $query
*
* @return Request
*/
public function build(AbstractQuery $query): Request
public function build(QueryInterface|AbstractQuery $query): Request
{
$request = new Request();
$request->setHandler($query->getHandler());
Expand Down
Loading

0 comments on commit 731c0da

Please sign in to comment.