Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Cache][HttpClient] Made method signatures compatible with their corresponding traits #36908

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Symfony/Component/Cache/Adapter/Psr16Adapter.php
Expand Up @@ -79,7 +79,7 @@ protected function doDelete(array $ids)
/**
* {@inheritdoc}
*/
protected function doSave(array $values, $lifetime)
protected function doSave(array $values, ?int $lifetime)
{
return $this->pool->setMultiple($values, 0 === $lifetime ? null : $lifetime);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Cache/Traits/AbstractTrait.php
Expand Up @@ -78,7 +78,7 @@ abstract protected function doDelete(array $ids);
*
* @return array|bool The identifiers that failed to be cached or a boolean stating if caching succeeded or not
*/
abstract protected function doSave(array $values, $lifetime);
abstract protected function doSave(array $values, ?int $lifetime);

/**
* {@inheritdoc}
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Cache/Traits/ApcuTrait.php
Expand Up @@ -101,7 +101,7 @@ protected function doDelete(array $ids)
/**
* {@inheritdoc}
*/
protected function doSave(array $values, $lifetime)
protected function doSave(array $values, ?int $lifetime)
{
try {
if (false === $failures = apcu_store($values, null, $lifetime)) {
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Cache/Traits/DoctrineTrait.php
Expand Up @@ -91,7 +91,7 @@ protected function doDelete(array $ids)
/**
* {@inheritdoc}
*/
protected function doSave(array $values, $lifetime)
protected function doSave(array $values, ?int $lifetime)
{
return $this->provider->saveMultiple($values, $lifetime);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Cache/Traits/FilesystemTrait.php
Expand Up @@ -91,7 +91,7 @@ protected function doHave($id)
/**
* {@inheritdoc}
*/
protected function doSave(array $values, $lifetime)
protected function doSave(array $values, ?int $lifetime)
{
$expiresAt = $lifetime ? (time() + $lifetime) : 0;
$values = $this->marshaller->marshall($values, $failed);
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Cache/Traits/MemcachedTrait.php
Expand Up @@ -223,7 +223,7 @@ public static function createConnection($servers, array $options = [])
/**
* {@inheritdoc}
*/
protected function doSave(array $values, $lifetime)
protected function doSave(array $values, ?int $lifetime)
{
if (!$values = $this->marshaller->marshall($values, $failed)) {
return $failed;
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Cache/Traits/PdoTrait.php
Expand Up @@ -275,7 +275,7 @@ protected function doDelete(array $ids)
/**
* {@inheritdoc}
*/
protected function doSave(array $values, $lifetime)
protected function doSave(array $values, ?int $lifetime)
{
if (!$values = $this->marshaller->marshall($values, $failed)) {
return $failed;
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Cache/Traits/PhpFilesTrait.php
Expand Up @@ -194,7 +194,7 @@ protected function doHave($id)
/**
* {@inheritdoc}
*/
protected function doSave(array $values, $lifetime)
protected function doSave(array $values, ?int $lifetime)
{
$ok = true;
$expiry = $lifetime ? time() + $lifetime : 'PHP_INT_MAX';
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Cache/Traits/RedisTrait.php
Expand Up @@ -404,7 +404,7 @@ protected function doDelete(array $ids)
/**
* {@inheritdoc}
*/
protected function doSave(array $values, $lifetime)
protected function doSave(array $values, ?int $lifetime)
{
if (!$values = $this->marshaller->marshall($values, $failed)) {
return $failed;
Expand Down
9 changes: 7 additions & 2 deletions src/Symfony/Component/HttpClient/Response/CurlResponse.php
Expand Up @@ -15,6 +15,7 @@
use Symfony\Component\HttpClient\Chunk\FirstChunk;
use Symfony\Component\HttpClient\Chunk\InformationalChunk;
use Symfony\Component\HttpClient\Exception\TransportException;
use Symfony\Component\HttpClient\Internal\ClientState;
use Symfony\Component\HttpClient\Internal\CurlClientState;
use Symfony\Contracts\HttpClient\Exception\HttpExceptionInterface;
use Symfony\Contracts\HttpClient\ResponseInterface;
Expand Down Expand Up @@ -242,8 +243,10 @@ private static function schedule(self $response, array &$runningResponses): void

/**
* {@inheritdoc}
*
* @param CurlClientState $multi
*/
private static function perform(CurlClientState $multi, array &$responses = null): void
private static function perform(ClientState $multi, array &$responses = null): void
{
if (self::$performing) {
if ($responses) {
Expand Down Expand Up @@ -289,8 +292,10 @@ private static function perform(CurlClientState $multi, array &$responses = null

/**
* {@inheritdoc}
*
* @param CurlClientState $multi
*/
private static function select(CurlClientState $multi, float $timeout): int
private static function select(ClientState $multi, float $timeout): int
{
if (\PHP_VERSION_ID < 70123 || (70200 <= \PHP_VERSION_ID && \PHP_VERSION_ID < 70211)) {
// workaround https://bugs.php.net/76480
Expand Down
9 changes: 7 additions & 2 deletions src/Symfony/Component/HttpClient/Response/NativeResponse.php
Expand Up @@ -14,6 +14,7 @@
use Psr\Log\LoggerInterface;
use Symfony\Component\HttpClient\Chunk\FirstChunk;
use Symfony\Component\HttpClient\Exception\TransportException;
use Symfony\Component\HttpClient\Internal\ClientState;
use Symfony\Component\HttpClient\Internal\NativeClientState;
use Symfony\Contracts\HttpClient\Exception\HttpExceptionInterface;
use Symfony\Contracts\HttpClient\ResponseInterface;
Expand Down Expand Up @@ -214,8 +215,10 @@ private static function schedule(self $response, array &$runningResponses): void

/**
* {@inheritdoc}
*
* @param NativeClientState $multi
*/
private static function perform(NativeClientState $multi, array &$responses = null): void
private static function perform(ClientState $multi, array &$responses = null): void
{
// List of native handles for stream_select()
if (null !== $responses) {
Expand Down Expand Up @@ -326,8 +329,10 @@ private static function perform(NativeClientState $multi, array &$responses = nu

/**
* {@inheritdoc}
*
* @param NativeClientState $multi
*/
private static function select(NativeClientState $multi, float $timeout): int
private static function select(ClientState $multi, float $timeout): int
{
$_ = [];

Expand Down