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

Commit3324505

Browse files
Julien Paulinicolas-grekas
Julien Pauli
authored andcommitted
[Cache] fix warning on PHP 7.4
1 parent3f43186 commit3324505

File tree

9 files changed

+13
-13
lines changed

9 files changed

+13
-13
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ protected function __construct($namespace = '', $defaultLifetime = 0)
4949
thrownewInvalidArgumentException(sprintf('Namespace must be %d chars max, %d given ("%s")',$this->maxIdLength -24,\strlen($namespace),$namespace));
5050
}
5151
$this->createCacheItem = \Closure::bind(
52-
function ($key,$value,$isHit)use ($defaultLifetime) {
52+
staticfunction ($key,$value,$isHit)use ($defaultLifetime) {
5353
$item =newCacheItem();
5454
$item->key =$key;
5555
$item->value =$value;
@@ -63,7 +63,7 @@ function ($key, $value, $isHit) use ($defaultLifetime) {
6363
);
6464
$getId =function ($key) {return$this->getId((string)$key); };
6565
$this->mergeByLifetime = \Closure::bind(
66-
function ($deferred,$namespace, &$expiredIds)use ($getId) {
66+
staticfunction ($deferred,$namespace, &$expiredIds)use ($getId) {
6767
$byLifetime = [];
6868
$now =time();
6969
$expiredIds = [];

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function __construct($defaultLifetime = 0, $storeSerialized = true)
3434
{
3535
$this->storeSerialized =$storeSerialized;
3636
$this->createCacheItem = \Closure::bind(
37-
function ($key,$value,$isHit)use ($defaultLifetime) {
37+
staticfunction ($key,$value,$isHit)use ($defaultLifetime) {
3838
$item =newCacheItem();
3939
$item->key =$key;
4040
$item->value =$value;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public function __construct(array $adapters, $defaultLifetime = 0)
5656
$this->adapterCount =\count($this->adapters);
5757

5858
$this->syncItem = \Closure::bind(
59-
function ($sourceItem,$item)use ($defaultLifetime) {
59+
staticfunction ($sourceItem,$item)use ($defaultLifetime) {
6060
$item->value =$sourceItem->value;
6161
$item->expiry =$sourceItem->expiry;
6262
$item->isHit =$sourceItem->isHit;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function __construct($file, AdapterInterface $fallbackPool)
4242
$this->pool =$fallbackPool;
4343
$this->zendDetectUnicode =filter_var(ini_get('zend.detect_unicode'),FILTER_VALIDATE_BOOLEAN);
4444
$this->createCacheItem = \Closure::bind(
45-
function ($key,$value,$isHit) {
45+
staticfunction ($key,$value,$isHit) {
4646
$item =newCacheItem();
4747
$item->key =$key;
4848
$item->value =$value;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function __construct(CacheItemPoolInterface $pool, $namespace = '', $defa
4242
$this->namespace ='' ===$namespace ?'' : CacheItem::validateKey($namespace);
4343
$this->namespaceLen =\strlen($namespace);
4444
$this->createCacheItem = \Closure::bind(
45-
function ($key,$innerItem)use ($defaultLifetime,$poolHash) {
45+
staticfunction ($key,$innerItem)use ($defaultLifetime,$poolHash) {
4646
$item =newCacheItem();
4747
$item->key =$key;
4848
$item->defaultLifetime =$defaultLifetime;

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function __construct(AdapterInterface $itemsPool, AdapterInterface $tagsP
4242
$this->tags =$tagsPool ?:$itemsPool;
4343
$this->knownTagVersionsTtl =$knownTagVersionsTtl;
4444
$this->createCacheItem = \Closure::bind(
45-
function ($key,$value,CacheItem$protoItem) {
45+
staticfunction ($key,$value,CacheItem$protoItem) {
4646
$item =newCacheItem();
4747
$item->key =$key;
4848
$item->value =$value;
@@ -56,7 +56,7 @@ function ($key, $value, CacheItem $protoItem) {
5656
CacheItem::class
5757
);
5858
$this->setCacheItemTags = \Closure::bind(
59-
function (CacheItem$item,$key,array &$itemTags) {
59+
staticfunction (CacheItem$item,$key,array &$itemTags) {
6060
if (!$item->isHit) {
6161
return$item;
6262
}
@@ -76,7 +76,7 @@ function (CacheItem $item, $key, array &$itemTags) {
7676
CacheItem::class
7777
);
7878
$this->getTagsByKey = \Closure::bind(
79-
function ($deferred) {
79+
staticfunction ($deferred) {
8080
$tagsByKey = [];
8181
foreach ($deferredas$key =>$item) {
8282
$tagsByKey[$key] =$item->tags;
@@ -88,7 +88,7 @@ function ($deferred) {
8888
CacheItem::class
8989
);
9090
$this->invalidateTags = \Closure::bind(
91-
function (AdapterInterface$tagsAdapter,array$tags) {
91+
staticfunction (AdapterInterface$tagsAdapter,array$tags) {
9292
foreach ($tagsas$v) {
9393
$v->defaultLifetime =0;
9494
$v->expiry =null;

‎src/Symfony/Component/Cache/Simple/Psr6Cache.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function __construct(CacheItemPoolInterface $pool)
4141
}
4242
$cacheItemPrototype = &$this->cacheItemPrototype;
4343
$createCacheItem = \Closure::bind(
44-
function ($key,$value,$allowInt =false)use (&$cacheItemPrototype) {
44+
staticfunction ($key,$value,$allowInt =false)use (&$cacheItemPrototype) {
4545
$item =clone$cacheItemPrototype;
4646
$item->key =$allowInt &&\is_int($key) ? (string)$key : CacheItem::validateKey($key);
4747
$item->value =$value;

‎src/Symfony/Component/ExpressionLanguage/ParserCache/ParserCacheAdapter.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function __construct(ParserCacheInterface $pool)
3030
$this->pool =$pool;
3131

3232
$this->createCacheItem = \Closure::bind(
33-
function ($key,$value,$isHit) {
33+
staticfunction ($key,$value,$isHit) {
3434
$item =newCacheItem();
3535
$item->key =$key;
3636
$item->value =$value;

‎src/Symfony/Component/Routing/Loader/PhpFileLoader.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function load($file, $type = null)
4040

4141
// the closure forbids access to the private scope in the included file
4242
$loader =$this;
43-
$load = \Closure::bind(function ($file)use ($loader) {
43+
$load = \Closure::bind(staticfunction ($file)use ($loader) {
4444
returninclude$file;
4545
},null, ProtectedPhpFileLoader::class);
4646

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp