Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f800d01

Browse files
committed
minor #32298 [Cache] finish type-hints (Tobion)
This PR was merged into the 5.0-dev branch. Discussion ---------- [Cache] finish type-hints | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | #32179 | License | MIT | Doc PR | symfony/symfony-docs#... <!-- required for new features --> Finish leftovers from #32282 Commits ------- 1919c7d [Cache] finish type-hints
2 parents 0541034 + 1919c7d commit f800d01

14 files changed

+12
-19
lines changed

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,6 @@ function ($deferred, $namespace, &$expiredIds) use ($getId) {
9999
*
100100
* Using ApcuAdapter makes system caches compatible with read-only filesystems.
101101
*
102-
* @param string $namespace
103-
* @param int $defaultLifetime
104-
* @param string $version
105-
* @param string $directory
106-
* @param LoggerInterface|null $logger
107-
*
108102
* @return AdapterInterface
109103
*/
110104
public static function createSystemCache(string $namespace, int $defaultLifetime, string $version, string $directory, LoggerInterface $logger = null)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ static function ($deferred, &$expiredIds) use ($getId, $tagPrefix) {
128128
*
129129
* @return array The identifiers that failed to be cached or a boolean stating if caching succeeded or not
130130
*/
131-
abstract protected function doSave(array $values, ?int $lifetime, array $addTagData = [], array $removeTagData = []): array;
131+
abstract protected function doSave(array $values, int $lifetime, array $addTagData = [], array $removeTagData = []): array;
132132

133133
/**
134134
* Removes multiple items from the pool and their corresponding tags.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ protected function doFetch(array $ids)
7272
/**
7373
* {@inheritdoc}
7474
*/
75-
protected function doHave($id)
75+
protected function doHave(string $id)
7676
{
7777
return apcu_exists($id);
7878
}

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ class ArrayAdapter implements AdapterInterface, CacheInterface, LoggerAwareInter
3131
private $createCacheItem;
3232

3333
/**
34-
* @param int $defaultLifetime
3534
* @param bool $storeSerialized Disabling serialization can lead to cache corruptions when storing mutable values but increases performance otherwise
3635
*/
3736
public function __construct(int $defaultLifetime = 0, bool $storeSerialized = true)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ protected function doFetch(array $ids)
6565
/**
6666
* {@inheritdoc}
6767
*/
68-
protected function doHave($id)
68+
protected function doHave(string $id)
6969
{
7070
return $this->provider->contains($id);
7171
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function __construct(string $namespace = '', int $defaultLifetime = 0, st
5151
/**
5252
* {@inheritdoc}
5353
*/
54-
protected function doSave(array $values, ?int $lifetime, array $addTagData = [], array $removeTagData = []): array
54+
protected function doSave(array $values, int $lifetime, array $addTagData = [], array $removeTagData = []): array
5555
{
5656
$failed = $this->doSaveCache($values, $lifetime);
5757

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ protected function doFetch(array $ids)
276276
/**
277277
* {@inheritdoc}
278278
*/
279-
protected function doHave($id)
279+
protected function doHave(string $id)
280280
{
281281
return false !== $this->getClient()->get(rawurlencode($id)) || $this->checkResultCode(\Memcached::RES_SUCCESS === $this->client->getResultCode());
282282
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ protected function doFetch(array $ids)
236236
/**
237237
* {@inheritdoc}
238238
*/
239-
protected function doHave($id)
239+
protected function doHave(string $id)
240240
{
241241
$sql = "SELECT 1 FROM $this->table WHERE $this->idCol = :id AND ($this->lifetimeCol IS NULL OR $this->lifetimeCol + $this->timeCol > :time)";
242242
$stmt = $this->getConnection()->prepare($sql);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ function ($key, $value, $isHit) {
6969
*
7070
* @return CacheItemPoolInterface
7171
*/
72-
public static function create($file, CacheItemPoolInterface $fallbackPool)
72+
public static function create(string $file, CacheItemPoolInterface $fallbackPool)
7373
{
7474
// Shared memory is available in PHP 7.0+ with OPCache enabled
7575
if (filter_var(ini_get('opcache.enable'), FILTER_VALIDATE_BOOLEAN)) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ protected function doFetch(array $ids)
165165
/**
166166
* {@inheritdoc}
167167
*/
168-
protected function doHave($id)
168+
protected function doHave(string $id)
169169
{
170170
if ($this->appendOnly && isset($this->values[$id])) {
171171
return true;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ protected function doFetch(array $ids)
5555
/**
5656
* {@inheritdoc}
5757
*/
58-
protected function doHave($id)
58+
protected function doHave(string $id)
5959
{
6060
return $this->pool->has($id);
6161
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public function __construct($redisClient, string $namespace = '', int $defaultLi
8888
/**
8989
* {@inheritdoc}
9090
*/
91-
protected function doSave(array $values, ?int $lifetime, array $addTagData = [], array $delTagData = []): array
91+
protected function doSave(array $values, int $lifetime, array $addTagData = [], array $delTagData = []): array
9292
{
9393
// serialize values
9494
if (!$serialized = $this->marshaller->marshall($values, $failed)) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ protected function doFetch(array $ids)
8181
/**
8282
* {@inheritdoc}
8383
*/
84-
protected function doHave($id)
84+
protected function doHave(string $id)
8585
{
8686
$file = $this->getFile($id);
8787

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ protected function doFetch(array $ids)
324324
/**
325325
* {@inheritdoc}
326326
*/
327-
protected function doHave($id)
327+
protected function doHave(string $id)
328328
{
329329
return (bool) $this->redis->exists($id);
330330
}

0 commit comments

Comments
 (0)