Skip to content

Commit 18ccd77

Browse files
Remove deprecations for Solarium 7 (#1164)
Co-authored-by: Markus Kalkbrenner <git@kalki.de>
1 parent a0a14df commit 18ccd77

File tree

7 files changed

+5
-120
lines changed

7 files changed

+5
-120
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1414
- Added `void` return type to `Solarium\Core\Plugin\AbstractPlugin::initPluginType()` method signature
1515
- Changed return type of some Facets methods from `self`to `static`
1616

17+
### Removed
18+
- Solarium\Component\Result\Stats\FacetValue::getFacets(), always returned `null`
19+
- Solarium\Core\Query\AbstractQuery::setTimeAllowed() and getTimeAllowed(), moved to Solarium\QueryType\Select\Query\Query
20+
- Solarium\Core\Query\Helper::cacheControl(), use Solarium\QueryType\Select\Query\FilterQuery::setCache() and setCost() instead
21+
1722

1823
## [6.4.1]
1924
### Added

src/Component/Result/Stats/FacetValue.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,4 @@ public function getValue(): ?string
4444
{
4545
return $this->value;
4646
}
47-
48-
/**
49-
* Get facet stats.
50-
*
51-
* @return array|null
52-
*
53-
* @deprecated Will be removed in Solarium 7
54-
*/
55-
public function getFacets(): ?array
56-
{
57-
return null;
58-
}
5947
}

src/Core/Query/AbstractQuery.php

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -92,34 +92,6 @@ public function getResultClass(): ?string
9292
return $this->getOption('resultclass');
9393
}
9494

95-
/**
96-
* Set timeAllowed option.
97-
*
98-
* @param int $value
99-
*
100-
* @return self Provides fluent interface
101-
*
102-
* @deprecated Will be removed in Solarium 7. This parameter is only relevant for Select queries.
103-
*/
104-
public function setTimeAllowed(int $value): self
105-
{
106-
$this->setOption('timeallowed', $value);
107-
108-
return $this;
109-
}
110-
111-
/**
112-
* Get timeAllowed option.
113-
*
114-
* @return int|null
115-
*
116-
* @deprecated Will be removed in Solarium 7. This parameter is only relevant for Select queries.
117-
*/
118-
public function getTimeAllowed(): ?int
119-
{
120-
return $this->getOption('timeallowed');
121-
}
122-
12395
/**
12496
* Set omitHeader option.
12597
*

src/Core/Query/Helper.php

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -457,37 +457,6 @@ public function qparserTerm(string $field, float $weight): string
457457
return $this->qparser('term', ['f' => $field]).$weight;
458458
}
459459

460-
/**
461-
* Render cache control param for use in filterquery.
462-
*
463-
* This is a Solr 3.4+ feature.
464-
*
465-
* @see https://solr.apache.org/guide/common-query-parameters.html#cache-parameter
466-
*
467-
* @param bool $useCache
468-
* @param float|null $cost
469-
*
470-
* @return string
471-
*
472-
* @deprecated Will be removed in Solarium 6. Use FilterQuery::setCache() and FilterQuery::setCost() instead.
473-
*/
474-
public function cacheControl(bool $useCache, ?float $cost = null): string
475-
{
476-
$cache = 'false';
477-
478-
if (true === $useCache) {
479-
$cache = 'true';
480-
}
481-
482-
$result = '{!cache='.$cache;
483-
if (null !== $cost) {
484-
$result .= ' cost='.$cost;
485-
}
486-
$result .= '}';
487-
488-
return $result;
489-
}
490-
491460
/**
492461
* Filters control characters that cause issues with servlet containers.
493462
*

tests/Core/Query/HelperTest.php

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -718,28 +718,6 @@ public function testQparserTerm(): void
718718
);
719719
}
720720

721-
/**
722-
* @deprecated Will be removed in Solarium 6
723-
*/
724-
public function testCacheControlWithCost(): void
725-
{
726-
$this->assertSame(
727-
'{!cache=false cost=6}',
728-
$this->helper->cacheControl(false, 6)
729-
);
730-
}
731-
732-
/**
733-
* @deprecated Will be removed in Solarium 6
734-
*/
735-
public function testCacheControlWithoutCost(): void
736-
{
737-
$this->assertSame(
738-
'{!cache=true}',
739-
$this->helper->cacheControl(true)
740-
);
741-
}
742-
743721
public function testFilterControlCharacters(): void
744722
{
745723
$this->assertSame(

tests/Core/Query/QueryTest.php

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -86,25 +86,6 @@ public function testSetAndGetResponseWriter(): void
8686
$this->assertSame('phps', $query->getResponseWriter());
8787
}
8888

89-
/**
90-
* @deprecated Will be removed in Solarium 7. This parameter is only relevant for Select queries.
91-
*/
92-
public function testGetDefaultTimeAllowed(): void
93-
{
94-
$query = new TestQuery();
95-
$this->assertNull($query->getTimeAllowed());
96-
}
97-
98-
/**
99-
* @deprecated Will be removed in Solarium 7. This parameter is only relevant for Select queries.
100-
*/
101-
public function testSetAndGetTimeAllowed(): void
102-
{
103-
$query = new TestQuery();
104-
$query->setTimeAllowed(1200);
105-
$this->assertSame(1200, $query->getTimeAllowed());
106-
}
107-
10889
public function testSetAndGetNow(): void
10990
{
11091
$query = new TestQuery();

tests/QueryType/Select/Result/Stats/FacetValueTest.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,6 @@ public function testGetCardinality(): void
109109
$this->assertSame($this->stats['cardinality'], $this->result->getCardinality());
110110
}
111111

112-
/**
113-
* @deprecated Will be removed in Solarium 7
114-
*/
115-
public function testGetFacets(): void
116-
{
117-
$this->assertNull($this->result->getFacets());
118-
}
119-
120112
public function testGetStatValue(): void
121113
{
122114
$this->assertSame($this->stats['dummy'], $this->result->getStatValue('dummy'));

0 commit comments

Comments
 (0)