Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8d70d80

Browse files
[Cache]Add Union Type
1 parentf1372e4 commit8d70d80

31 files changed

+81
-88
lines changed

‎src/Symfony/Component/Cache/Adapter/AdapterInterface.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ interface AdapterInterface extends CacheItemPoolInterface
2929
*
3030
* @return CacheItem
3131
*/
32-
publicfunctiongetItem($key);
32+
publicfunctiongetItem(mixed$key);
3333

3434
/**
3535
* {@inheritdoc}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ protected function doFetch(array $ids)
7777
/**
7878
* {@inheritdoc}
7979
*/
80-
protectedfunctiondoHave(string$id)
80+
protectedfunctiondoHave(mixed$id)
8181
{
8282
returnapcu_exists($id);
8383
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public function delete(string $key): bool
100100
*
101101
* @return bool
102102
*/
103-
publicfunctionhasItem($key)
103+
publicfunctionhasItem(mixed$key)
104104
{
105105
if (\is_string($key) &&isset($this->expiries[$key]) &&$this->expiries[$key] >microtime(true)) {
106106
if ($this->maxItems) {
@@ -120,7 +120,7 @@ public function hasItem($key)
120120
/**
121121
* {@inheritdoc}
122122
*/
123-
publicfunctiongetItem($key)
123+
publicfunctiongetItem(mixed$key)
124124
{
125125
if (!$isHit =$this->hasItem($key)) {
126126
$value =null;
@@ -151,7 +151,7 @@ public function getItems(array $keys = [])
151151
*
152152
* @return bool
153153
*/
154-
publicfunctiondeleteItem($key)
154+
publicfunctiondeleteItem(mixed$key)
155155
{
156156
\assert('' !== CacheItem::validateKey($key));
157157
unset($this->values[$key],$this->expiries[$key]);

‎src/Symfony/Component/Cache/Adapter/ChainAdapter.php‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ public function get(string $key, callable $callback, float $beta = null, array &
120120
/**
121121
* {@inheritdoc}
122122
*/
123-
publicfunctiongetItem($key)
123+
publicfunctiongetItem(mixed$key)
124124
{
125125
$syncItem =self::$syncItem;
126126
$misses = [];
@@ -186,7 +186,7 @@ private function generateItems(iterable $items, int $adapterIndex)
186186
*
187187
* @return bool
188188
*/
189-
publicfunctionhasItem($key)
189+
publicfunctionhasItem(mixed$key)
190190
{
191191
foreach ($this->adaptersas$adapter) {
192192
if ($adapter->hasItem($key)) {
@@ -223,7 +223,7 @@ public function clear(string $prefix = '')
223223
*
224224
* @return bool
225225
*/
226-
publicfunctiondeleteItem($key)
226+
publicfunctiondeleteItem(mixed$key)
227227
{
228228
$deleted =true;
229229
$i =$this->adapterCount;

‎src/Symfony/Component/Cache/Adapter/CouchbaseBucketAdapter.php‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,7 @@ public function __construct(\CouchbaseBucket $bucket, string $namespace = '', in
5454
$this->marshaller =$marshaller ??newDefaultMarshaller();
5555
}
5656

57-
/**
58-
* @param array|string $servers
59-
*/
60-
publicstaticfunctioncreateConnection($servers,array$options = []):\CouchbaseBucket
57+
publicstaticfunctioncreateConnection(array |string$servers,array$options = []):\CouchbaseBucket
6158
{
6259
if (\is_string($servers)) {
6360
$servers = [$servers];
@@ -182,15 +179,15 @@ protected function doFetch(array $ids)
182179
/**
183180
* {@inheritdoc}
184181
*/
185-
protectedfunctiondoHave($id):bool
182+
protectedfunctiondoHave(mixed$id):bool
186183
{
187184
returnfalse !==$this->bucket->get($id);
188185
}
189186

190187
/**
191188
* {@inheritdoc}
192189
*/
193-
protectedfunctiondoClear($namespace):bool
190+
protectedfunctiondoClear(string$namespace):bool
194191
{
195192
if ('' ===$namespace) {
196193
$this->bucket->manager()->flush();

‎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-
protectedfunctiondoHave(string$id)
68+
protectedfunctiondoHave(mixed$id)
6969
{
7070
return$this->provider->contains($id);
7171
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public static function isSupported()
9696
*
9797
* @throws \ErrorException When invalid options or servers are provided
9898
*/
99-
publicstaticfunctioncreateConnection($servers,array$options = [])
99+
publicstaticfunctioncreateConnection(array |string$servers,array$options = [])
100100
{
101101
if (\is_string($servers)) {
102102
$servers = [$servers];
@@ -285,7 +285,7 @@ protected function doFetch(array $ids)
285285
/**
286286
* {@inheritdoc}
287287
*/
288-
protectedfunctiondoHave(string$id)
288+
protectedfunctiondoHave(mixed$id)
289289
{
290290
returnfalse !==$this->getClient()->get(self::encodeKey($id)) ||$this->checkResultCode(\Memcached::RES_SUCCESS ===$this->client->getResultCode());
291291
}

‎src/Symfony/Component/Cache/Adapter/NullAdapter.php‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function get(string $key, callable $callback, float $beta = null, array &
5050
/**
5151
* {@inheritdoc}
5252
*/
53-
publicfunctiongetItem($key)
53+
publicfunctiongetItem(mixed$key)
5454
{
5555
return (self::$createCacheItem)($key);
5656
}
@@ -68,7 +68,7 @@ public function getItems(array $keys = [])
6868
*
6969
* @return bool
7070
*/
71-
publicfunctionhasItem($key)
71+
publicfunctionhasItem(mixed$key)
7272
{
7373
returnfalse;
7474
}
@@ -88,7 +88,7 @@ public function clear(string $prefix = '')
8888
*
8989
* @return bool
9090
*/
91-
publicfunctiondeleteItem($key)
91+
publicfunctiondeleteItem(mixed$key)
9292
{
9393
returntrue;
9494
}
@@ -136,7 +136,7 @@ public function commit()
136136
/**
137137
* {@inheritdoc}
138138
*/
139-
publicfunctiondelete(string$key):bool
139+
publicfunctiondelete(mixed$key):bool
140140
{
141141
return$this->deleteItem($key);
142142
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class PdoAdapter extends AbstractAdapter implements PruneableInterface
6666
* @throws InvalidArgumentException When PDO error mode is not PDO::ERRMODE_EXCEPTION
6767
* @throws InvalidArgumentException When namespace contains invalid characters
6868
*/
69-
publicfunction__construct($connOrDsn,string$namespace ='',int$defaultLifetime =0,array$options = [],MarshallerInterface$marshaller =null)
69+
publicfunction__construct(\PDO |Connection |string$connOrDsn,string$namespace ='',int$defaultLifetime =0,array$options = [],MarshallerInterface$marshaller =null)
7070
{
7171
if (isset($namespace[0]) &&preg_match('#[^-+.A-Za-z0-9]#',$namespace,$match)) {
7272
thrownewInvalidArgumentException(sprintf('Namespace contains "%s" but only characters in [-+.A-Za-z0-9] are allowed.',$match[0]));
@@ -259,7 +259,7 @@ protected function doFetch(array $ids)
259259
/**
260260
* {@inheritdoc}
261261
*/
262-
protectedfunctiondoHave(string$id)
262+
protectedfunctiondoHave(mixed$id)
263263
{
264264
$sql ="SELECT 1 FROM$this->table WHERE$this->idCol = :id AND ($this->lifetimeCol IS NULL OR$this->lifetimeCol +$this->timeCol > :time)";
265265
$stmt =$this->getConnection()->prepare($sql);

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public function get(string $key, callable $callback, float $beta = null, array &
116116
/**
117117
* {@inheritdoc}
118118
*/
119-
publicfunctiongetItem($key)
119+
publicfunctiongetItem(mixed$key)
120120
{
121121
if (!\is_string($key)) {
122122
thrownewInvalidArgumentException(sprintf('Cache key must be string, "%s" given.',get_debug_type($key)));
@@ -167,7 +167,7 @@ public function getItems(array $keys = [])
167167
*
168168
* @return bool
169169
*/
170-
publicfunctionhasItem($key)
170+
publicfunctionhasItem(mixed$key)
171171
{
172172
if (!\is_string($key)) {
173173
thrownewInvalidArgumentException(sprintf('Cache key must be string, "%s" given.',get_debug_type($key)));
@@ -184,7 +184,7 @@ public function hasItem($key)
184184
*
185185
* @return bool
186186
*/
187-
publicfunctiondeleteItem($key)
187+
publicfunctiondeleteItem(mixed$key)
188188
{
189189
if (!\is_string($key)) {
190190
thrownewInvalidArgumentException(sprintf('Cache key must be string, "%s" given.',get_debug_type($key)));

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp