Skip to content

Commit c58a957

Browse files
Drop PHP 8.0 support
1 parent 9f86b09 commit c58a957

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+135
-144
lines changed

.github/workflows/run-tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414

1515
strategy:
1616
matrix:
17-
php: [8.0, 8.1, 8.2, 8.3, 8.4]
17+
php: [8.1, 8.2, 8.3, 8.4]
1818
solr: [7, 8, 9]
1919
mode: [cloud, server]
2020

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to the Solarium library will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [Unreleased]
8+
### Removed
9+
- PHP 8.0 support
10+
711
## [6.3.6]
812
### Added
913
- PHP 8.4 support

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Please see the [docs](http://solarium.readthedocs.io/en/stable/) for a more deta
1010

1111
## Requirements
1212

13-
Solarium 6.3.2 and up only supports PHP 8.0 and up.
13+
Solarium 6.3.7 and up only supports PHP 8.1 and up.
1414

1515
It's highly recommended to have cURL enabled in your PHP environment. However if you don't have cURL available you can
1616
switch from using cURL (the default) to a pure PHP based HTTP client adapter which works for the essential stuff but

src/Component/Result/Debug/Detail.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ public function debugDump(int $depth = 0): string
182182
/**
183183
* {@inheritdoc}
184184
*/
185-
public function __toString()
185+
public function __toString(): string
186186
{
187187
return $this->debugDump();
188188
}

src/Component/Result/Debug/Document.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public function count(): int
8787
/**
8888
* {@inheritdoc}
8989
*/
90-
public function __toString()
90+
public function __toString(): string
9191
{
9292
$string = '';
9393
foreach ($this->getDetails() as $detail) {

src/Component/Result/Grouping/Result.php

+2
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ public function getGroup(string $key)
5555
if (isset($this->groups[$key])) {
5656
return $this->groups[$key];
5757
}
58+
59+
return null;
5860
}
5961

6062
/**

src/Core/Client/Client.php

+16-16
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,7 @@ public function createResult(QueryInterface $query, $response): ResultInterface
807807
*
808808
* @return ResultInterface
809809
*/
810-
public function execute(QueryInterface $query, $endpoint = null): ResultInterface
810+
public function execute(QueryInterface $query, Endpoint|string|null $endpoint = null): ResultInterface
811811
{
812812
$event = new PreExecuteEvent($query);
813813
$this->eventDispatcher->dispatch($event);
@@ -833,7 +833,7 @@ public function execute(QueryInterface $query, $endpoint = null): ResultInterfac
833833
*
834834
* @return Response
835835
*/
836-
public function executeRequest(Request $request, $endpoint = null): Response
836+
public function executeRequest(Request $request, Endpoint|string|null $endpoint = null): Response
837837
{
838838
// load endpoint by string or by using the default one in case of a null value
839839
if (!($endpoint instanceof Endpoint)) {
@@ -872,7 +872,7 @@ public function executeRequest(Request $request, $endpoint = null): Response
872872
*
873873
* @return ResultInterface|\Solarium\QueryType\Ping\Result
874874
*/
875-
public function ping(QueryInterface $query, $endpoint = null): PingResult
875+
public function ping(QueryInterface $query, Endpoint|string|null $endpoint = null): PingResult
876876
{
877877
return $this->execute($query, $endpoint);
878878
}
@@ -896,7 +896,7 @@ public function ping(QueryInterface $query, $endpoint = null): PingResult
896896
*
897897
* @return ResultInterface|\Solarium\QueryType\Update\Result
898898
*/
899-
public function update(QueryInterface $query, $endpoint = null): UpdateResult
899+
public function update(QueryInterface $query, Endpoint|string|null $endpoint = null): UpdateResult
900900
{
901901
return $this->execute($query, $endpoint);
902902
}
@@ -919,7 +919,7 @@ public function update(QueryInterface $query, $endpoint = null): UpdateResult
919919
*
920920
* @return ResultInterface|\Solarium\QueryType\Select\Result\Result
921921
*/
922-
public function select(QueryInterface $query, $endpoint = null): SelectResult
922+
public function select(QueryInterface $query, Endpoint|string|null $endpoint = null): SelectResult
923923
{
924924
return $this->execute($query, $endpoint);
925925
}
@@ -942,7 +942,7 @@ public function select(QueryInterface $query, $endpoint = null): SelectResult
942942
*
943943
* @return ResultInterface|\Solarium\QueryType\MoreLikeThis\Result
944944
*/
945-
public function moreLikeThis(QueryInterface $query, $endpoint = null): MoreLikeThisResult
945+
public function moreLikeThis(QueryInterface $query, Endpoint|string|null $endpoint = null): MoreLikeThisResult
946946
{
947947
return $this->execute($query, $endpoint);
948948
}
@@ -958,7 +958,7 @@ public function moreLikeThis(QueryInterface $query, $endpoint = null): MoreLikeT
958958
*
959959
* @return ResultInterface|\Solarium\QueryType\Analysis\Result\Document|\Solarium\QueryType\Analysis\Result\Field
960960
*/
961-
public function analyze(QueryInterface $query, $endpoint = null): ResultInterface
961+
public function analyze(QueryInterface $query, Endpoint|string|null $endpoint = null): ResultInterface
962962
{
963963
return $this->execute($query, $endpoint);
964964
}
@@ -974,7 +974,7 @@ public function analyze(QueryInterface $query, $endpoint = null): ResultInterfac
974974
*
975975
* @return ResultInterface|\Solarium\QueryType\Terms\Result
976976
*/
977-
public function terms(QueryInterface $query, $endpoint = null): TermsResult
977+
public function terms(QueryInterface $query, Endpoint|string|null $endpoint = null): TermsResult
978978
{
979979
return $this->execute($query, $endpoint);
980980
}
@@ -990,7 +990,7 @@ public function terms(QueryInterface $query, $endpoint = null): TermsResult
990990
*
991991
* @return ResultInterface|\Solarium\QueryType\Spellcheck\Result\Result
992992
*/
993-
public function spellcheck(QueryInterface $query, $endpoint = null): SpellcheckResult
993+
public function spellcheck(QueryInterface $query, Endpoint|string|null $endpoint = null): SpellcheckResult
994994
{
995995
return $this->execute($query, $endpoint);
996996
}
@@ -1006,7 +1006,7 @@ public function spellcheck(QueryInterface $query, $endpoint = null): SpellcheckR
10061006
*
10071007
* @return ResultInterface|\Solarium\QueryType\Suggester\Result\Result
10081008
*/
1009-
public function suggester(QueryInterface $query, $endpoint = null): SuggesterResult
1009+
public function suggester(QueryInterface $query, Endpoint|string|null $endpoint = null): SuggesterResult
10101010
{
10111011
return $this->execute($query, $endpoint);
10121012
}
@@ -1022,7 +1022,7 @@ public function suggester(QueryInterface $query, $endpoint = null): SuggesterRes
10221022
*
10231023
* @return ResultInterface|\Solarium\QueryType\Extract\Result
10241024
*/
1025-
public function extract(QueryInterface $query, $endpoint = null): ExtractResult
1025+
public function extract(QueryInterface $query, Endpoint|string|null $endpoint = null): ExtractResult
10261026
{
10271027
return $this->execute($query, $endpoint);
10281028
}
@@ -1038,7 +1038,7 @@ public function extract(QueryInterface $query, $endpoint = null): ExtractResult
10381038
*
10391039
* @return ResultInterface|\Solarium\QueryType\RealtimeGet\Result
10401040
*/
1041-
public function realtimeGet(QueryInterface $query, $endpoint = null): RealtimeGetResult
1041+
public function realtimeGet(QueryInterface $query, Endpoint|string|null $endpoint = null): RealtimeGetResult
10421042
{
10431043
return $this->execute($query, $endpoint);
10441044
}
@@ -1054,7 +1054,7 @@ public function realtimeGet(QueryInterface $query, $endpoint = null): RealtimeGe
10541054
*
10551055
* @return ResultInterface|\Solarium\QueryType\Luke\Result\Result
10561056
*/
1057-
public function luke(QueryInterface $query, $endpoint = null): LukeResult
1057+
public function luke(QueryInterface $query, Endpoint|string|null $endpoint = null): LukeResult
10581058
{
10591059
return $this->execute($query, $endpoint);
10601060
}
@@ -1070,7 +1070,7 @@ public function luke(QueryInterface $query, $endpoint = null): LukeResult
10701070
*
10711071
* @return ResultInterface|\Solarium\QueryType\Server\CoreAdmin\Result\Result
10721072
*/
1073-
public function coreAdmin(QueryInterface $query, $endpoint = null): CoreAdminResult
1073+
public function coreAdmin(QueryInterface $query, Endpoint|string|null $endpoint = null): CoreAdminResult
10741074
{
10751075
return $this->execute($query, $endpoint);
10761076
}
@@ -1086,7 +1086,7 @@ public function coreAdmin(QueryInterface $query, $endpoint = null): CoreAdminRes
10861086
*
10871087
* @return ResultInterface|\Solarium\QueryType\Server\Collections\Result\ClusterStatusResult
10881088
*/
1089-
public function collections(QueryInterface $query, $endpoint = null): ResultInterface
1089+
public function collections(QueryInterface $query, Endpoint|string|null $endpoint = null): ResultInterface
10901090
{
10911091
return $this->execute($query, $endpoint);
10921092
}
@@ -1102,7 +1102,7 @@ public function collections(QueryInterface $query, $endpoint = null): ResultInte
11021102
*
11031103
* @return ResultInterface|\Solarium\QueryType\Server\Configsets\Result\ListConfigsetsResult
11041104
*/
1105-
public function configsets(QueryInterface $query, $endpoint = null): ResultInterface
1105+
public function configsets(QueryInterface $query, Endpoint|string|null $endpoint = null): ResultInterface
11061106
{
11071107
return $this->execute($query, $endpoint);
11081108
}

src/Core/Client/ClientInterface.php

+16-16
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ public function createResult(QueryInterface $query, $response): ResultInterface;
317317
*
318318
* @return ResultInterface
319319
*/
320-
public function execute(QueryInterface $query, $endpoint = null): ResultInterface;
320+
public function execute(QueryInterface $query, Endpoint|string|null $endpoint = null): ResultInterface;
321321

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

554554
/**
555555
* Create a query instance.

src/Core/Client/Endpoint.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class Endpoint extends Configurable
4444
*
4545
* @return string
4646
*/
47-
public function __toString()
47+
public function __toString(): string
4848
{
4949
$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);
5050

src/Core/Client/Request.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ class Request extends Configurable implements RequestParamsInterface
116116
*
117117
* @return string
118118
*/
119-
public function __toString()
119+
public function __toString(): string
120120
{
121121
$output =
122122
__CLASS__.'::__toString'."\n"

src/Core/Query/AbstractRequestBuilder.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ abstract class AbstractRequestBuilder implements RequestBuilderInterface
2626
protected $helper;
2727

2828
/**
29-
* Build request for a select query.
29+
* Build request for a generic query.
3030
*
31-
* @param AbstractQuery|QueryInterface $query
31+
* @param QueryInterface $query
3232
*
3333
* @return Request
3434
*/
35-
public function build(AbstractQuery $query): Request
35+
public function build(QueryInterface $query): Request
3636
{
3737
$request = new Request();
3838
$request->setHandler($query->getHandler());

0 commit comments

Comments
 (0)