8000 bug #36908 [Cache][HttpClient] Made method signatures compatible with… · symfony/symfony@a25e88b · GitHub
[go: up one dir, main page]

Skip to content

Commit a25e88b

Browse files
bug #36908 [Cache][HttpClient] Made method signatures compatible with their corresponding traits (derrabus)
This PR was merged into the 4.4 branch. Discussion ---------- [Cache][HttpClient] Made method signatures compatible with their corresponding traits | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | #36872 | License | MIT | Doc PR | N/A Apparently, php 8 is less forgiving about method signature differences between a trait and the class that uses the trait. This PR makes minimal adjustments to get rid of fatal errors triggered by php 8. Commits ------- 6fda276 Made method signatures compatible with their corresponding traits.
2 parents 6d7c696 + 6fda276 commit a25e88b

File tree

11 files changed

+23
-13
lines changed

11 files changed

+23
-13
lines changed

src/Symfony/Component/Cache/Adapter/Psr16Adapter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ protected function doDelete(array $ids)
7979
/**
8080
* {@inheritdoc}
8181
*/
82-
protected function doSave(array $values, $lifetime)
82+
protected function doSave(array $values, ?int $lifetime)
8383
{
8484
return $this->pool->setMultiple($values, 0 === $lifetime ? null : $lifetime);
8585
}

src/Symfony/Component/Cache/Traits/AbstractTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ abstract protected function doDelete(array $ids);
7878
*
7979
* @return array|bool The identifiers that failed to be cached or a boolean stating if caching succeeded or not
8080
*/
81-
abstract protected function doSave(array $values, $lifetime);
81+
abstract protected function doSave(array $values, ?int $lifetime);
8282

8383
/**
8484
* {@inheritdoc}

src/Symfony/Component/Cache/Traits/ApcuTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ protected function doDelete(array $ids)
101101
/**
102102
* {@inheritdoc}
103103
*/
104-
protected function doSave(array $values, $lifetime)
104+
protected function doSave(array $values, ?int $lifetime)
105105
{
106106
try {
107107
if (false === $failures = apcu_store($values, null, $lifetime)) {

src/Symfony/Component/Cache/Traits/DoctrineTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ protected function doDelete(array $ids)
9191
/**
9292
* {@inheritdoc}
9393
*/
94-
protected function doSave(array $values, $lifetime)
94+
protected function doSave(array $values, ?int $lifetime)
9595
{
9696
return $this->provider->saveMultiple($values, $lifetime);
9797
}

src/Symfony/Component/Cache/Traits/FilesystemTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ protected function doHave($id)
9191
/**
9292
* {@inheritdoc}
9393
*/
94-
protected function doSave(array $values, $lifetime)
94+
protected function doSave(array $values, ?int $lifetime)
9595
{
9696
$expiresAt = $lifetime ? (time() + $lifetime) : 0;
9797
$values = $this->marshaller->marshall($values, $failed);

src/Symfony/Component/Cache/Traits/MemcachedTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ public static function createConnection($servers, array $options = [])
223223
/**
224224
* {@inheritdoc}
225225
*/
226-
protected function doSave(array $values, $lifetime)
226+
protected function doSave(array $values, ?int $lifetime)
227227
{
228228
if (!$values = $this->marshaller->marshall($values, $failed)) {
229229
return $failed;

src/Symfony/Component/Cache/Traits/PdoTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ protected function doDelete(array $ids)
275275
/**
276276
* {@inheritdoc}
277277
*/
278-
protected function doSave(array $values, $lifetime)
278+
protected function doSave(array $values, ?int $lifetime)
279279
{
280280
if (!$values = $this->marshaller->marshall($values, $failed)) {
281281
return $failed;

src/Symfony/Component/Cache/Traits/PhpFilesTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ protected function doHave($id)
194194
/**
195195
* {@inheritdoc}
196196
*/
197-
protected function doSave(array $values, $lifetime)
197+
protected function doSave(array $values, ?int $lifetime)
198198
{
199199
$ok = true;
200200
$expiry = $lifetime ? time() + $lifetime : 'PHP_INT_MAX';

src/Symfony/Component/Cache/Traits/RedisTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ protected function doDelete(array $ids)
404404
/**
405405
* {@inheritdoc}
406406
*/
407-
protected function doSave(array $values, $lifetime)
407+
protected function doSave(array $values, ?int $lifetime)
408408
{
409409
if (!$values = $this->marshaller->marshall($values, $failed)) {
410410
return $failed;

src/Symfony/Component/HttpClient/Response/CurlResponse.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Symfony\Component\HttpClient\Chunk\FirstChunk;
1616
use Symfony\Component\HttpClient\Chunk\InformationalChunk;
1717
use Symfony\Component\HttpClient\Exception\TransportException;
18+
use Symfony\Component\HttpClient\Internal\ClientState;
1819
use Symfony\Component\HttpClient\Internal\CurlClientState;
1920
use Symfony\Contracts\HttpClient\Exception\HttpExceptionInterface;
2021
use Symfony\Contracts\HttpClient\ResponseInterface;
@@ -242,8 +243,10 @@ private static function schedule(self $response, array &$runningResponses): void
242243

243244
/**
244245
* {@inheritdoc}
246+
*
247+
* @param CurlClientState $multi
245248
*/
246-
private static function perform(CurlClientState $multi, array &$responses = null): void
249+
private static function perform(ClientState $multi, array &$responses = null): void
247250
{
248251
if (self::$performing) {
249252
if ($responses) {
@@ -289,8 +292,10 @@ private static function perform(CurlClientState $multi, array &$responses = null
289292

290293
/**
291294
* {@inheritdoc}
295+
*
296+
* @param CurlClientState $multi
292297
*/
293-
private static function select(CurlClientState $multi, float $timeout): int
298+
private static function select(ClientState $multi, float $timeout): int
294299
{
295300
if (\PHP_VERSION_ID < 70123 || (70200 <= \PHP_VERSION_ID && \PHP_VERSION_ID < 70211)) {
296301
// workaround https://bugs.php.net/76480

0 commit comments

Comments
 (0)
0