Updating Symfony lib and dependencies:

Package operations: 2 installs, 23 updates, 0 removals
  - Updating psr/log (1.1.0 => 1.1.2)
  - Updating symfony/debug (v3.4.30 => v3.4.35)
  - Updating symfony/console (v3.4.30 => v3.4.35)
  - Updating symfony/dotenv (v3.4.30 => v3.4.35)
  - Updating symfony/routing (v3.4.30 => v3.4.35)
  - Updating symfony/finder (v3.4.30 => v3.4.35)
  - Updating symfony/filesystem (v3.4.30 => v3.4.35)
  - Installing symfony/polyfill-util (v1.12.0)
  - Installing symfony/polyfill-php56 (v1.12.0)
  - Updating symfony/http-foundation (v3.4.30 => v3.4.35)
  - Updating symfony/event-dispatcher (v3.4.30 => v3.4.35)
  - Updating symfony/http-kernel (v3.4.30 => v3.4.35)
  - Updating symfony/config (v3.4.30 => v3.4.35)
  - Updating symfony/dependency-injection (v3.4.30 => v3.4.35)
  - Updating symfony/class-loader (v3.4.30 => v3.4.35)
  - Updating symfony/cache (v3.4.30 => v3.4.35)
  - Updating symfony/framework-bundle (v3.4.30 => v3.4.35)
  - Updating twig/twig (v1.42.2 => v1.42.4)
  - Updating symfony/twig-bridge (v3.4.30 => v3.4.35)
  - Updating symfony/twig-bundle (v3.4.30 => v3.4.35)
  - Updating symfony/yaml (v3.4.30 => v3.4.35)
  - Updating symfony/stopwatch (v3.4.30 => v3.4.35)
  - Updating symfony/var-dumper (v3.4.30 => v3.4.35)
  - Updating symfony/web-profiler-bundle (v3.4.30 => v3.4.35)
  - Updating symfony/css-selector (v3.4.30 => v3.4.35)
This commit is contained in:
Molkobain
2019-11-18 18:04:32 +01:00
parent 532eb466a1
commit c76cccd2e7
633 changed files with 4154 additions and 4093 deletions

View File

@@ -49,7 +49,7 @@ abstract class AbstractAdapter implements AdapterInterface, LoggerAwareInterface
throw new InvalidArgumentException(sprintf('Namespace must be %d chars max, %d given ("%s")', $this->maxIdLength - 24, \strlen($namespace), $namespace));
}
$this->createCacheItem = \Closure::bind(
function ($key, $value, $isHit) use ($defaultLifetime) {
static function ($key, $value, $isHit) use ($defaultLifetime) {
$item = new CacheItem();
$item->key = $key;
$item->value = $value;
@@ -63,7 +63,7 @@ abstract class AbstractAdapter implements AdapterInterface, LoggerAwareInterface
);
$getId = function ($key) { return $this->getId((string) $key); };
$this->mergeByLifetime = \Closure::bind(
function ($deferred, $namespace, &$expiredIds) use ($getId) {
static function ($deferred, $namespace, &$expiredIds) use ($getId) {
$byLifetime = [];
$now = time();
$expiredIds = [];
@@ -86,11 +86,10 @@ abstract class AbstractAdapter implements AdapterInterface, LoggerAwareInterface
}
/**
* @param string $namespace
* @param int $defaultLifetime
* @param string $version
* @param string $directory
* @param LoggerInterface|null $logger
* @param string $namespace
* @param int $defaultLifetime
* @param string $version
* @param string $directory
*
* @return AdapterInterface
*/
@@ -276,6 +275,16 @@ abstract class AbstractAdapter implements AdapterInterface, LoggerAwareInterface
return $ok;
}
public function __sleep()
{
throw new \BadMethodCallException('Cannot serialize '.__CLASS__);
}
public function __wakeup()
{
throw new \BadMethodCallException('Cannot unserialize '.__CLASS__);
}
public function __destruct()
{
if ($this->deferred) {

View File

@@ -34,7 +34,7 @@ class ArrayAdapter implements AdapterInterface, LoggerAwareInterface, Resettable
{
$this->storeSerialized = $storeSerialized;
$this->createCacheItem = \Closure::bind(
function ($key, $value, $isHit) use ($defaultLifetime) {
static function ($key, $value, $isHit) use ($defaultLifetime) {
$item = new CacheItem();
$item->key = $key;
$item->value = $value;

View File

@@ -56,7 +56,7 @@ class ChainAdapter implements AdapterInterface, PruneableInterface, ResettableIn
$this->adapterCount = \count($this->adapters);
$this->syncItem = \Closure::bind(
function ($sourceItem, $item) use ($defaultLifetime) {
static function ($sourceItem, $item) use ($defaultLifetime) {
$item->value = $sourceItem->value;
$item->expiry = $sourceItem->expiry;
$item->isHit = $sourceItem->isHit;

View File

@@ -19,9 +19,8 @@ class DoctrineAdapter extends AbstractAdapter
use DoctrineTrait;
/**
* @param CacheProvider $provider
* @param string $namespace
* @param int $defaultLifetime
* @param string $namespace
* @param int $defaultLifetime
*/
public function __construct(CacheProvider $provider, $namespace = '', $defaultLifetime = 0)
{

View File

@@ -42,7 +42,7 @@ class PhpArrayAdapter implements AdapterInterface, PruneableInterface, Resettabl
$this->pool = $fallbackPool;
$this->zendDetectUnicode = filter_var(ini_get('zend.detect_unicode'), FILTER_VALIDATE_BOOLEAN);
$this->createCacheItem = \Closure::bind(
function ($key, $value, $isHit) {
static function ($key, $value, $isHit) {
$item = new CacheItem();
$item->key = $key;
$item->value = $value;
@@ -266,7 +266,7 @@ class PhpArrayAdapter implements AdapterInterface, PruneableInterface, Resettabl
/**
* @throws \ReflectionException When $class is not found and is required
*
* @internal
* @internal to be removed in Symfony 5.0
*/
public static function throwOnRequiredClass($class)
{

View File

@@ -31,9 +31,8 @@ class ProxyAdapter implements AdapterInterface, PruneableInterface, ResettableIn
private $poolHash;
/**
* @param CacheItemPoolInterface $pool
* @param string $namespace
* @param int $defaultLifetime
* @param string $namespace
* @param int $defaultLifetime
*/
public function __construct(CacheItemPoolInterface $pool, $namespace = '', $defaultLifetime = 0)
{
@@ -42,7 +41,7 @@ class ProxyAdapter implements AdapterInterface, PruneableInterface, ResettableIn
$this->namespace = '' === $namespace ? '' : CacheItem::validateKey($namespace);
$this->namespaceLen = \strlen($namespace);
$this->createCacheItem = \Closure::bind(
function ($key, $innerItem) use ($defaultLifetime, $poolHash) {
static function ($key, $innerItem) use ($defaultLifetime, $poolHash) {
$item = new CacheItem();
$item->key = $key;
$item->defaultLifetime = $defaultLifetime;

View File

@@ -42,7 +42,7 @@ class TagAwareAdapter implements TagAwareAdapterInterface, PruneableInterface, R
$this->tags = $tagsPool ?: $itemsPool;
$this->knownTagVersionsTtl = $knownTagVersionsTtl;
$this->createCacheItem = \Closure::bind(
function ($key, $value, CacheItem $protoItem) {
static function ($key, $value, CacheItem $protoItem) {
$item = new CacheItem();
$item->key = $key;
$item->value = $value;
@@ -56,7 +56,7 @@ class TagAwareAdapter implements TagAwareAdapterInterface, PruneableInterface, R
CacheItem::class
);
$this->setCacheItemTags = \Closure::bind(
function (CacheItem $item, $key, array &$itemTags) {
static function (CacheItem $item, $key, array &$itemTags) {
if (!$item->isHit) {
return $item;
}
@@ -76,7 +76,7 @@ class TagAwareAdapter implements TagAwareAdapterInterface, PruneableInterface, R
CacheItem::class
);
$this->getTagsByKey = \Closure::bind(
function ($deferred) {
static function ($deferred) {
$tagsByKey = [];
foreach ($deferred as $key => $item) {
$tagsByKey[$key] = $item->tags;
@@ -88,7 +88,7 @@ class TagAwareAdapter implements TagAwareAdapterInterface, PruneableInterface, R
CacheItem::class
);
$this->invalidateTags = \Closure::bind(
function (AdapterInterface $tagsAdapter, array $tags) {
static function (AdapterInterface $tagsAdapter, array $tags) {
foreach ($tags as $v) {
$v->defaultLifetime = 0;
$v->expiry = null;
@@ -156,7 +156,14 @@ class TagAwareAdapter implements TagAwareAdapterInterface, PruneableInterface, R
if (!$this->pool->hasItem($key)) {
return false;
}
if (!$itemTags = $this->pool->getItem(static::TAGS_PREFIX.$key)->get()) {
$itemTags = $this->pool->getItem(static::TAGS_PREFIX.$key);
if (!$itemTags->isHit()) {
return false;
}
if (!$itemTags = $itemTags->get()) {
return true;
}
@@ -177,6 +184,8 @@ class TagAwareAdapter implements TagAwareAdapterInterface, PruneableInterface, R
foreach ($this->getItems([$key]) as $item) {
return $item;
}
return null;
}
/**
@@ -273,6 +282,16 @@ class TagAwareAdapter implements TagAwareAdapterInterface, PruneableInterface, R
return $this->invalidateTags([]);
}
public function __sleep()
{
throw new \BadMethodCallException('Cannot serialize '.__CLASS__);
}
public function __wakeup()
{
throw new \BadMethodCallException('Cannot unserialize '.__CLASS__);
}
public function __destruct()
{
$this->commit();
@@ -294,7 +313,10 @@ class TagAwareAdapter implements TagAwareAdapterInterface, PruneableInterface, R
}
unset($tagKeys[$key]);
$itemTags[$key] = $item->get() ?: [];
if ($item->isHit()) {
$itemTags[$key] = $item->get() ?: [];
}
if (!$tagKeys) {
$tagVersions = $this->getTagVersions($itemTags);
@@ -348,7 +370,7 @@ class TagAwareAdapter implements TagAwareAdapterInterface, PruneableInterface, R
continue;
}
$version -= $this->knownTagVersions[$tag][1];
if ((0 !== $version && 1 !== $version) || $this->knownTagVersionsTtl > $now - $this->knownTagVersions[$tag][0]) {
if ((0 !== $version && 1 !== $version) || $now - $this->knownTagVersions[$tag][0] >= $this->knownTagVersionsTtl) {
// reuse previously fetched tag versions up to the ttl, unless we are storing items or a potential miss arises
$fetchTagVersions = true;
} else {