diff options
| author | Greg Roach <fisharebest@webtrees.net> | 2019-01-07 16:45:05 +0000 |
|---|---|---|
| committer | Greg Roach <fisharebest@webtrees.net> | 2019-01-07 16:45:05 +0000 |
| commit | 5bcdfc98762e27505526568ee9ad3b742a00e726 (patch) | |
| tree | cfd1cd634dec05f13acfc37df52cd735967c5f6d /vendor/symfony | |
| parent | 25366223eb30b309b137279bf74b779083e0a64e (diff) | |
| download | webtrees-5bcdfc98762e27505526568ee9ad3b742a00e726.tar.gz webtrees-5bcdfc98762e27505526568ee9ad3b742a00e726.tar.bz2 webtrees-5bcdfc98762e27505526568ee9ad3b742a00e726.zip | |
Update vendor dependencies
Diffstat (limited to 'vendor/symfony')
58 files changed, 302 insertions, 141 deletions
diff --git a/vendor/symfony/cache/Adapter/ArrayAdapter.php b/vendor/symfony/cache/Adapter/ArrayAdapter.php index 47db1271b2..97b6b7f780 100644 --- a/vendor/symfony/cache/Adapter/ArrayAdapter.php +++ b/vendor/symfony/cache/Adapter/ArrayAdapter.php @@ -124,7 +124,7 @@ class ArrayAdapter implements AdapterInterface, CacheInterface, LoggerAwareInter return true; } - if ($this->storeSerialized && null === $value = $this->freeze($value)) { + if ($this->storeSerialized && null === $value = $this->freeze($value, $key)) { return false; } if (null === $expiry && 0 < $item["\0*\0defaultLifetime"]) { diff --git a/vendor/symfony/cache/Adapter/PhpFilesAdapter.php b/vendor/symfony/cache/Adapter/PhpFilesAdapter.php index 1f4e05e176..10938a0a9e 100644 --- a/vendor/symfony/cache/Adapter/PhpFilesAdapter.php +++ b/vendor/symfony/cache/Adapter/PhpFilesAdapter.php @@ -31,8 +31,8 @@ class PhpFilesAdapter extends AbstractAdapter implements PruneableInterface self::$startTime = self::$startTime ?? $_SERVER['REQUEST_TIME'] ?? time(); parent::__construct('', $defaultLifetime); $this->init($namespace, $directory); - - $e = new \Exception(); - $this->includeHandler = function () use ($e) { throw $e; }; + $this->includeHandler = static function ($type, $msg, $file, $line) { + throw new \ErrorException($msg, 0, $type, $file, $line); + }; } } diff --git a/vendor/symfony/cache/LICENSE b/vendor/symfony/cache/LICENSE index fcd3fa7697..3c464ca943 100644 --- a/vendor/symfony/cache/LICENSE +++ b/vendor/symfony/cache/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2016-2018 Fabien Potencier +Copyright (c) 2016-2019 Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/vendor/symfony/cache/Simple/ArrayCache.php b/vendor/symfony/cache/Simple/ArrayCache.php index 9185e5fa55..6785943787 100644 --- a/vendor/symfony/cache/Simple/ArrayCache.php +++ b/vendor/symfony/cache/Simple/ArrayCache.php @@ -129,7 +129,7 @@ class ArrayCache implements CacheInterface, LoggerAwareInterface, ResettableInte $expiry = 0 < $ttl ? microtime(true) + $ttl : PHP_INT_MAX; foreach ($valuesArray as $key => $value) { - if ($this->storeSerialized && null === $value = $this->freeze($value)) { + if ($this->storeSerialized && null === $value = $this->freeze($value, $key)) { return false; } $this->values[$key] = $value; diff --git a/vendor/symfony/cache/Simple/PhpFilesCache.php b/vendor/symfony/cache/Simple/PhpFilesCache.php index 19ac8b4152..37432c5af8 100644 --- a/vendor/symfony/cache/Simple/PhpFilesCache.php +++ b/vendor/symfony/cache/Simple/PhpFilesCache.php @@ -31,8 +31,8 @@ class PhpFilesCache extends AbstractCache implements PruneableInterface self::$startTime = self::$startTime ?? $_SERVER['REQUEST_TIME'] ?? time(); parent::__construct('', $defaultLifetime); $this->init($namespace, $directory); - - $e = new \Exception(); - $this->includeHandler = function () use ($e) { throw $e; }; + $this->includeHandler = static function ($type, $msg, $file, $line) { + throw new \ErrorException($msg, 0, $type, $file, $line); + }; } } diff --git a/vendor/symfony/cache/Simple/Psr6Cache.php b/vendor/symfony/cache/Simple/Psr6Cache.php index 853d46e26b..6330a4fadc 100644 --- a/vendor/symfony/cache/Simple/Psr6Cache.php +++ b/vendor/symfony/cache/Simple/Psr6Cache.php @@ -29,6 +29,8 @@ class Psr6Cache implements CacheInterface, PruneableInterface, ResettableInterfa { use ProxyTrait; + private const METADATA_EXPIRY_OFFSET = 1527506807; + private $createCacheItem; private $cacheItemPrototype; @@ -58,7 +60,7 @@ class Psr6Cache implements CacheInterface, PruneableInterface, ResettableInterfa } $this->createCacheItem = $createCacheItem; - return $createCacheItem($key, $value, $allowInt); + return $createCacheItem($key, null, $allowInt)->set($value); }; } @@ -147,8 +149,29 @@ class Psr6Cache implements CacheInterface, PruneableInterface, ResettableInterfa } $values = array(); + if (!$this->pool instanceof AdapterInterface) { + foreach ($items as $key => $item) { + $values[$key] = $item->isHit() ? $item->get() : $default; + } + + return $value; + } + foreach ($items as $key => $item) { - $values[$key] = $item->isHit() ? $item->get() : $default; + if (!$item->isHit()) { + $values[$key] = $default; + continue; + } + $values[$key] = $item->get(); + + if (!$metadata = $item->getMetadata()) { + continue; + } + unset($metadata[CacheItem::METADATA_TAGS]); + + if ($metadata) { + $values[$key] = array("\x9D".pack('VN', (int) $metadata[CacheItem::METADATA_EXPIRY] - self::METADATA_EXPIRY_OFFSET, $metadata[CacheItem::METADATA_CTIME])."\x5F" => $values[$key]); + } } return $values; diff --git a/vendor/symfony/cache/Tests/Adapter/AdapterTestCase.php b/vendor/symfony/cache/Tests/Adapter/AdapterTestCase.php index 72d143e3c0..e473c7b084 100644 --- a/vendor/symfony/cache/Tests/Adapter/AdapterTestCase.php +++ b/vendor/symfony/cache/Tests/Adapter/AdapterTestCase.php @@ -34,6 +34,7 @@ abstract class AdapterTestCase extends CachePoolTest } $cache = $this->createCachePool(); + $cache->clear(); $value = mt_rand(); diff --git a/vendor/symfony/cache/Tests/Adapter/PhpArrayAdapterTest.php b/vendor/symfony/cache/Tests/Adapter/PhpArrayAdapterTest.php index 96e63e64e3..1a6898de58 100644 --- a/vendor/symfony/cache/Tests/Adapter/PhpArrayAdapterTest.php +++ b/vendor/symfony/cache/Tests/Adapter/PhpArrayAdapterTest.php @@ -146,13 +146,13 @@ class PhpArrayAdapterWrapper extends PhpArrayAdapter public function save(CacheItemInterface $item) { - \call_user_func(\Closure::bind(function () use ($item) { + (\Closure::bind(function () use ($item) { $key = $item->getKey(); $this->keys[$key] = $id = \count($this->values); $this->data[$key] = $this->values[$id] = $item->get(); $this->warmUp($this->data); list($this->keys, $this->values) = eval(substr(file_get_contents($this->file), 6)); - }, $this, PhpArrayAdapter::class)); + }, $this, PhpArrayAdapter::class))(); return true; } diff --git a/vendor/symfony/cache/Tests/Adapter/SimpleCacheAdapterTest.php b/vendor/symfony/cache/Tests/Adapter/SimpleCacheAdapterTest.php index 460f3b0954..089a4f33fa 100644 --- a/vendor/symfony/cache/Tests/Adapter/SimpleCacheAdapterTest.php +++ b/vendor/symfony/cache/Tests/Adapter/SimpleCacheAdapterTest.php @@ -11,8 +11,9 @@ namespace Symfony\Component\Cache\Tests\Adapter; +use Symfony\Component\Cache\Adapter\FilesystemAdapter; use Symfony\Component\Cache\Adapter\SimpleCacheAdapter; -use Symfony\Component\Cache\Simple\FilesystemCache; +use Symfony\Component\Cache\Simple\Psr6Cache; /** * @group time-sensitive @@ -25,6 +26,6 @@ class SimpleCacheAdapterTest extends AdapterTestCase public function createCachePool($defaultLifetime = 0) { - return new SimpleCacheAdapter(new FilesystemCache(), '', $defaultLifetime); + return new SimpleCacheAdapter(new Psr6Cache(new FilesystemAdapter()), '', $defaultLifetime); } } diff --git a/vendor/symfony/cache/Tests/CacheItemTest.php b/vendor/symfony/cache/Tests/CacheItemTest.php index 6049f3ec9b..395c003bd3 100644 --- a/vendor/symfony/cache/Tests/CacheItemTest.php +++ b/vendor/symfony/cache/Tests/CacheItemTest.php @@ -62,9 +62,9 @@ class CacheItemTest extends TestCase $this->assertSame($item, $item->tag('foo')); $this->assertSame($item, $item->tag(array('bar', 'baz'))); - \call_user_func(\Closure::bind(function () use ($item) { + (\Closure::bind(function () use ($item) { $this->assertSame(array('foo' => 'foo', 'bar' => 'bar', 'baz' => 'baz'), $item->newMetadata[CacheItem::METADATA_TAGS]); - }, $this, CacheItem::class)); + }, $this, CacheItem::class))(); } /** diff --git a/vendor/symfony/cache/Tests/Simple/PhpArrayCacheTest.php b/vendor/symfony/cache/Tests/Simple/PhpArrayCacheTest.php index e0c7285802..724744cb9a 100644 --- a/vendor/symfony/cache/Tests/Simple/PhpArrayCacheTest.php +++ b/vendor/symfony/cache/Tests/Simple/PhpArrayCacheTest.php @@ -134,11 +134,11 @@ class PhpArrayCacheWrapper extends PhpArrayCache public function set($key, $value, $ttl = null) { - \call_user_func(\Closure::bind(function () use ($key, $value) { + (\Closure::bind(function () use ($key, $value) { $this->data[$key] = $value; $this->warmUp($this->data); list($this->keys, $this->values) = eval(substr(file_get_contents($this->file), 6)); - }, $this, PhpArrayCache::class)); + }, $this, PhpArrayCache::class))(); return true; } @@ -148,13 +148,13 @@ class PhpArrayCacheWrapper extends PhpArrayCache if (!\is_array($values) && !$values instanceof \Traversable) { return parent::setMultiple($values, $ttl); } - \call_user_func(\Closure::bind(function () use ($values) { + (\Closure::bind(function () use ($values) { foreach ($values as $key => $value) { $this->data[$key] = $value; } $this->warmUp($this->data); list($this->keys, $this->values) = eval(substr(file_get_contents($this->file), 6)); - }, $this, PhpArrayCache::class)); + }, $this, PhpArrayCache::class))(); return true; } diff --git a/vendor/symfony/cache/Traits/ArrayTrait.php b/vendor/symfony/cache/Traits/ArrayTrait.php index cfa73fa7b0..8268e40db4 100644 --- a/vendor/symfony/cache/Traits/ArrayTrait.php +++ b/vendor/symfony/cache/Traits/ArrayTrait.php @@ -113,7 +113,7 @@ trait ArrayTrait } } - private function freeze($value) + private function freeze($value, $key) { if (null === $value) { return 'N;'; diff --git a/vendor/symfony/cache/Traits/PhpFilesTrait.php b/vendor/symfony/cache/Traits/PhpFilesTrait.php index 4dacec8cfc..636ad3d99b 100644 --- a/vendor/symfony/cache/Traits/PhpFilesTrait.php +++ b/vendor/symfony/cache/Traits/PhpFilesTrait.php @@ -54,7 +54,11 @@ trait PhpFilesTrait set_error_handler($this->includeHandler); try { foreach (new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($this->directory, \FilesystemIterator::SKIP_DOTS), \RecursiveIteratorIterator::LEAVES_ONLY) as $file) { - list($expiresAt) = include $file; + try { + list($expiresAt) = include $file; + } catch (\ErrorException $e) { + $expiresAt = $time; + } if ($time >= $expiresAt) { $pruned = $this->doUnlink($file) && !file_exists($file) && $pruned; @@ -111,7 +115,7 @@ trait PhpFilesTrait if ($now >= $expiresAt) { unset($this->values[$id], $missingIds[$k]); } - } catch (\Exception $e) { + } catch (\ErrorException $e) { unset($missingIds[$k]); } } @@ -137,6 +141,8 @@ trait PhpFilesTrait try { $file = $this->files[$id] ?? $this->files[$id] = $this->getFile($id); list($expiresAt, $value) = include $file; + } catch (\ErrorException $e) { + return false; } finally { restore_error_handler(); } diff --git a/vendor/symfony/cache/Traits/RedisTrait.php b/vendor/symfony/cache/Traits/RedisTrait.php index dc9d9590be..a7224d216f 100644 --- a/vendor/symfony/cache/Traits/RedisTrait.php +++ b/vendor/symfony/cache/Traits/RedisTrait.php @@ -96,7 +96,7 @@ trait RedisTrait return 'file:'.($m[1] ?? ''); }, $dsn); - if (false === $params = parse_url($dsn)) { + if (false === $params = parse_url($params)) { throw new InvalidArgumentException(sprintf('Invalid Redis DSN: %s', $dsn)); } diff --git a/vendor/symfony/debug/DebugClassLoader.php b/vendor/symfony/debug/DebugClassLoader.php index 6d5fc9c2c3..19e80af78f 100644 --- a/vendor/symfony/debug/DebugClassLoader.php +++ b/vendor/symfony/debug/DebugClassLoader.php @@ -151,7 +151,7 @@ class DebugClassLoader require $file; } } else { - \call_user_func($this->classLoader, $class); + ($this->classLoader)($class); $file = false; } } finally { @@ -218,7 +218,7 @@ class DebugClassLoader $len = 0; $ns = ''; } else { - $ns = \substr($class, 0, $len); + $ns = \str_replace('_', '\\', \substr($class, 0, $len)); } // Detect annotations on the class @@ -249,13 +249,13 @@ class DebugClassLoader if (!isset(self::$checkedClasses[$use])) { $this->checkClass($use); } - if (isset(self::$deprecated[$use]) && \strncmp($ns, $use, $len)) { + if (isset(self::$deprecated[$use]) && \strncmp($ns, \str_replace('_', '\\', $use), $len)) { $type = class_exists($class, false) ? 'class' : (interface_exists($class, false) ? 'interface' : 'trait'); $verb = class_exists($use, false) || interface_exists($class, false) ? 'extends' : (interface_exists($use, false) ? 'implements' : 'uses'); $deprecations[] = sprintf('The "%s" %s %s "%s" that is deprecated%s.', $class, $type, $verb, $use, self::$deprecated[$use]); } - if (isset(self::$internal[$use]) && \strncmp($ns, $use, $len)) { + if (isset(self::$internal[$use]) && \strncmp($ns, \str_replace('_', '\\', $use), $len)) { $deprecations[] = sprintf('The "%s" %s is considered internal%s. It may change without further notice. You should not use it from "%s".', $use, class_exists($use, false) ? 'class' : (interface_exists($use, false) ? 'interface' : 'trait'), self::$internal[$use], $class); } } diff --git a/vendor/symfony/debug/ErrorHandler.php b/vendor/symfony/debug/ErrorHandler.php index ecae93dbc1..2eb058ebe1 100644 --- a/vendor/symfony/debug/ErrorHandler.php +++ b/vendor/symfony/debug/ErrorHandler.php @@ -560,7 +560,7 @@ class ErrorHandler $this->exceptionHandler = null; try { if (null !== $exceptionHandler) { - return \call_user_func($exceptionHandler, $exception); + return $exceptionHandler($exception); } $handlerException = $handlerException ?: $exception; } catch (\Throwable $handlerException) { diff --git a/vendor/symfony/debug/ExceptionHandler.php b/vendor/symfony/debug/ExceptionHandler.php index ea666b1ac3..2483a57ab7 100644 --- a/vendor/symfony/debug/ExceptionHandler.php +++ b/vendor/symfony/debug/ExceptionHandler.php @@ -142,7 +142,7 @@ class ExceptionHandler $this->caughtBuffer = null; try { - \call_user_func($this->handler, $exception); + ($this->handler)($exception); $this->caughtLength = $caughtLength; } catch (\Exception $e) { if (!$caughtLength) { diff --git a/vendor/symfony/debug/LICENSE b/vendor/symfony/debug/LICENSE index 21d7fb9e2f..a677f43763 100644 --- a/vendor/symfony/debug/LICENSE +++ b/vendor/symfony/debug/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2004-2018 Fabien Potencier +Copyright (c) 2004-2019 Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php b/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php index 92000b6bf5..d421941fc2 100644 --- a/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php +++ b/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php @@ -29,7 +29,7 @@ class TraceableEventDispatcher implements TraceableEventDispatcherInterface protected $logger; protected $stopwatch; - private $called; + private $callStack; private $dispatcher; private $wrappedListeners; private $orphanedEvents; @@ -39,7 +39,6 @@ class TraceableEventDispatcher implements TraceableEventDispatcherInterface $this->dispatcher = $dispatcher; $this->stopwatch = $stopwatch; $this->logger = $logger; - $this->called = array(); $this->wrappedListeners = array(); $this->orphanedEvents = array(); } @@ -125,6 +124,10 @@ class TraceableEventDispatcher implements TraceableEventDispatcherInterface */ public function dispatch($eventName, Event $event = null) { + if (null === $this->callStack) { + $this->callStack = new \SplObjectStorage(); + } + if (null === $event) { $event = new Event(); } @@ -160,11 +163,15 @@ class TraceableEventDispatcher implements TraceableEventDispatcherInterface */ public function getCalledListeners() { + if (null === $this->callStack) { + return array(); + } + $called = array(); - foreach ($this->called as $eventName => $listeners) { - foreach ($listeners as $listener) { - $called[$eventName.'.'.$listener->getPretty()] = $listener->getInfo($eventName); - } + foreach ($this->callStack as $listener) { + list($eventName) = $this->callStack->getInfo(); + + $called[] = $listener->getInfo($eventName); } return $called; @@ -190,9 +197,9 @@ class TraceableEventDispatcher implements TraceableEventDispatcherInterface foreach ($allListeners as $eventName => $listeners) { foreach ($listeners as $listener) { $called = false; - if (isset($this->called[$eventName])) { - foreach ($this->called[$eventName] as $l) { - if ($l->getWrappedListener() === $listener) { + if (null !== $this->callStack) { + foreach ($this->callStack as $calledListener) { + if ($calledListener->getWrappedListener() === $listener) { $called = true; break; @@ -204,12 +211,12 @@ class TraceableEventDispatcher implements TraceableEventDispatcherInterface if (!$listener instanceof WrappedListener) { $listener = new WrappedListener($listener, null, $this->stopwatch, $this); } - $notCalled[$eventName.'.'.$listener->getPretty()] = $listener->getInfo($eventName); + $notCalled[] = $listener->getInfo($eventName); } } } - uasort($notCalled, array($this, 'sortListenersByPriority')); + uasort($notCalled, array($this, 'sortNotCalledListeners')); return $notCalled; } @@ -221,7 +228,7 @@ class TraceableEventDispatcher implements TraceableEventDispatcherInterface public function reset() { - $this->called = array(); + $this->callStack = null; $this->orphanedEvents = array(); } @@ -272,6 +279,7 @@ class TraceableEventDispatcher implements TraceableEventDispatcherInterface $this->wrappedListeners[$eventName][] = $wrappedListener; $this->dispatcher->removeListener($eventName, $listener); $this->dispatcher->addListener($eventName, $wrappedListener, $priority); + $this->callStack->attach($wrappedListener, array($eventName)); } } @@ -300,8 +308,8 @@ class TraceableEventDispatcher implements TraceableEventDispatcherInterface if (!isset($this->called[$eventName])) { $this->called[$eventName] = new \SplObjectStorage(); } - - $this->called[$eventName]->attach($listener); + } else { + $this->callStack->detach($listener); } if (null !== $this->logger && $skipped) { @@ -318,8 +326,12 @@ class TraceableEventDispatcher implements TraceableEventDispatcherInterface } } - private function sortListenersByPriority($a, $b) + private function sortNotCalledListeners(array $a, array $b) { + if (0 !== $cmp = strcmp($a['event'], $b['event'])) { + return $cmp; + } + if (\is_int($a['priority']) && !\is_int($b['priority'])) { return 1; } diff --git a/vendor/symfony/event-dispatcher/Debug/WrappedListener.php b/vendor/symfony/event-dispatcher/Debug/WrappedListener.php index d49f69de72..6acaa38ef8 100644 --- a/vendor/symfony/event-dispatcher/Debug/WrappedListener.php +++ b/vendor/symfony/event-dispatcher/Debug/WrappedListener.php @@ -108,7 +108,7 @@ class WrappedListener $e = $this->stopwatch->start($this->name, 'event_listener'); - \call_user_func($this->listener, $event, $eventName, $this->dispatcher ?: $dispatcher); + ($this->listener)($event, $eventName, $this->dispatcher ?: $dispatcher); if ($e->isStarted()) { $e->stop(); diff --git a/vendor/symfony/event-dispatcher/EventDispatcher.php b/vendor/symfony/event-dispatcher/EventDispatcher.php index 4e75c63e4f..4c90ce5bd5 100644 --- a/vendor/symfony/event-dispatcher/EventDispatcher.php +++ b/vendor/symfony/event-dispatcher/EventDispatcher.php @@ -209,7 +209,7 @@ class EventDispatcher implements EventDispatcherInterface if ($event->isPropagationStopped()) { break; } - \call_user_func($listener, $event, $eventName, $this); + $listener($event, $eventName, $this); } } diff --git a/vendor/symfony/event-dispatcher/EventDispatcherInterface.php b/vendor/symfony/event-dispatcher/EventDispatcherInterface.php index d3d0cb8a45..bde753a12f 100644 --- a/vendor/symfony/event-dispatcher/EventDispatcherInterface.php +++ b/vendor/symfony/event-dispatcher/EventDispatcherInterface.php @@ -23,11 +23,11 @@ interface EventDispatcherInterface /** * Dispatches an event to all registered listeners. * - * @param string $eventName The name of the event to dispatch. The name of - * the event is the name of the method that is - * invoked on listeners. - * @param Event $event The event to pass to the event handlers/listeners - * If not supplied, an empty Event instance is created + * @param string $eventName The name of the event to dispatch. The name of + * the event is the name of the method that is + * invoked on listeners. + * @param Event|null $event The event to pass to the event handlers/listeners + * If not supplied, an empty Event instance is created * * @return Event */ @@ -46,7 +46,7 @@ interface EventDispatcherInterface /** * Adds an event subscriber. * - * The subscriber is asked for all the events he is + * The subscriber is asked for all the events it is * interested in and added as a listener for these events. */ public function addSubscriber(EventSubscriberInterface $subscriber); @@ -64,7 +64,7 @@ interface EventDispatcherInterface /** * Gets the listeners of a specific event or all listeners sorted by descending priority. * - * @param string $eventName The name of the event + * @param string|null $eventName The name of the event * * @return array The event listeners for the specified event, or all event listeners by event name */ @@ -85,7 +85,7 @@ interface EventDispatcherInterface /** * Checks whether an event has any registered listeners. * - * @param string $eventName The name of the event + * @param string|null $eventName The name of the event * * @return bool true if the specified event has any listeners, false otherwise */ diff --git a/vendor/symfony/event-dispatcher/EventSubscriberInterface.php b/vendor/symfony/event-dispatcher/EventSubscriberInterface.php index 8af778919b..6e1976b86a 100644 --- a/vendor/symfony/event-dispatcher/EventSubscriberInterface.php +++ b/vendor/symfony/event-dispatcher/EventSubscriberInterface.php @@ -12,7 +12,7 @@ namespace Symfony\Component\EventDispatcher; /** - * An EventSubscriber knows himself what events he is interested in. + * An EventSubscriber knows itself what events it is interested in. * If an EventSubscriber is added to an EventDispatcherInterface, the manager invokes * {@link getSubscribedEvents} and registers the subscriber as a listener for all * returned events. diff --git a/vendor/symfony/event-dispatcher/LICENSE b/vendor/symfony/event-dispatcher/LICENSE index 21d7fb9e2f..a677f43763 100644 --- a/vendor/symfony/event-dispatcher/LICENSE +++ b/vendor/symfony/event-dispatcher/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2004-2018 Fabien Potencier +Copyright (c) 2004-2019 Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/vendor/symfony/event-dispatcher/Tests/Debug/TraceableEventDispatcherTest.php b/vendor/symfony/event-dispatcher/Tests/Debug/TraceableEventDispatcherTest.php index b5c53528a7..0a2b32794d 100644 --- a/vendor/symfony/event-dispatcher/Tests/Debug/TraceableEventDispatcherTest.php +++ b/vendor/symfony/event-dispatcher/Tests/Debug/TraceableEventDispatcherTest.php @@ -110,17 +110,17 @@ class TraceableEventDispatcherTest extends TestCase $tdispatcher->addListener('foo', function () {}, 5); $listeners = $tdispatcher->getNotCalledListeners(); - $this->assertArrayHasKey('stub', $listeners['foo.closure']); - unset($listeners['foo.closure']['stub']); + $this->assertArrayHasKey('stub', $listeners[0]); + unset($listeners[0]['stub']); $this->assertEquals(array(), $tdispatcher->getCalledListeners()); - $this->assertEquals(array('foo.closure' => array('event' => 'foo', 'pretty' => 'closure', 'priority' => 5)), $listeners); + $this->assertEquals(array(array('event' => 'foo', 'pretty' => 'closure', 'priority' => 5)), $listeners); $tdispatcher->dispatch('foo'); $listeners = $tdispatcher->getCalledListeners(); - $this->assertArrayHasKey('stub', $listeners['foo.closure']); - unset($listeners['foo.closure']['stub']); - $this->assertEquals(array('foo.closure' => array('event' => 'foo', 'pretty' => 'closure', 'priority' => 5)), $listeners); + $this->assertArrayHasKey('stub', $listeners[0]); + unset($listeners[0]['stub']); + $this->assertEquals(array(array('event' => 'foo', 'pretty' => 'closure', 'priority' => 5)), $listeners); $this->assertEquals(array(), $tdispatcher->getNotCalledListeners()); } @@ -133,10 +133,22 @@ class TraceableEventDispatcherTest extends TestCase $tdispatcher->reset(); $listeners = $tdispatcher->getNotCalledListeners(); - $this->assertArrayHasKey('stub', $listeners['foo.closure']); - unset($listeners['foo.closure']['stub']); + $this->assertArrayHasKey('stub', $listeners[0]); + unset($listeners[0]['stub']); $this->assertEquals(array(), $tdispatcher->getCalledListeners()); - $this->assertEquals(array('foo.closure' => array('event' => 'foo', 'pretty' => 'closure', 'priority' => 5)), $listeners); + $this->assertEquals(array(array('event' => 'foo', 'pretty' => 'closure', 'priority' => 5)), $listeners); + } + + public function testDispatchAfterReset() + { + $tdispatcher = new TraceableEventDispatcher(new EventDispatcher(), new Stopwatch()); + $tdispatcher->addListener('foo', function () {}, 5); + + $tdispatcher->reset(); + $tdispatcher->dispatch('foo'); + + $listeners = $tdispatcher->getCalledListeners(); + $this->assertArrayHasKey('stub', $listeners[0]); } public function testGetCalledListenersNested() diff --git a/vendor/symfony/event-dispatcher/Tests/Debug/WrappedListenerTest.php b/vendor/symfony/event-dispatcher/Tests/Debug/WrappedListenerTest.php index f743f148d2..3847a1553c 100644 --- a/vendor/symfony/event-dispatcher/Tests/Debug/WrappedListenerTest.php +++ b/vendor/symfony/event-dispatcher/Tests/Debug/WrappedListenerTest.php @@ -30,21 +30,16 @@ class WrappedListenerTest extends TestCase public function provideListenersToDescribe() { - $listeners = array( + return array( array(new FooListener(), 'Symfony\Component\EventDispatcher\Tests\Debug\FooListener::__invoke'), array(array(new FooListener(), 'listen'), 'Symfony\Component\EventDispatcher\Tests\Debug\FooListener::listen'), array(array('Symfony\Component\EventDispatcher\Tests\Debug\FooListener', 'listenStatic'), 'Symfony\Component\EventDispatcher\Tests\Debug\FooListener::listenStatic'), array('var_dump', 'var_dump'), array(function () {}, 'closure'), + array(\Closure::fromCallable(array(new FooListener(), 'listen')), 'Symfony\Component\EventDispatcher\Tests\Debug\FooListener::listen'), + array(\Closure::fromCallable(array('Symfony\Component\EventDispatcher\Tests\Debug\FooListener', 'listenStatic')), 'Symfony\Component\EventDispatcher\Tests\Debug\FooListener::listenStatic'), + array(\Closure::fromCallable(function () {}), 'closure'), ); - - if (\PHP_VERSION_ID >= 70100) { - $listeners[] = array(\Closure::fromCallable(array(new FooListener(), 'listen')), 'Symfony\Component\EventDispatcher\Tests\Debug\FooListener::listen'); - $listeners[] = array(\Closure::fromCallable(array('Symfony\Component\EventDispatcher\Tests\Debug\FooListener', 'listenStatic')), 'Symfony\Component\EventDispatcher\Tests\Debug\FooListener::listenStatic'); - $listeners[] = array(\Closure::fromCallable(function () {}), 'closure'); - } - - return $listeners; } } diff --git a/vendor/symfony/expression-language/LICENSE b/vendor/symfony/expression-language/LICENSE index 21d7fb9e2f..a677f43763 100644 --- a/vendor/symfony/expression-language/LICENSE +++ b/vendor/symfony/expression-language/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2004-2018 Fabien Potencier +Copyright (c) 2004-2019 Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/vendor/symfony/http-foundation/HeaderBag.php b/vendor/symfony/http-foundation/HeaderBag.php index e1a6ae297a..8f51ef9dba 100644 --- a/vendor/symfony/http-foundation/HeaderBag.php +++ b/vendor/symfony/http-foundation/HeaderBag.php @@ -101,9 +101,9 @@ class HeaderBag implements \IteratorAggregate, \Countable /** * Returns a header value by name. * - * @param string $key The header name - * @param string|string[]|null $default The default value - * @param bool $first Whether to return the first value or all header values + * @param string $key The header name + * @param string|null $default The default value + * @param bool $first Whether to return the first value or all header values * * @return string|string[]|null The first header value or default value if $first is true, an array of values otherwise */ diff --git a/vendor/symfony/http-foundation/LICENSE b/vendor/symfony/http-foundation/LICENSE index 21d7fb9e2f..a677f43763 100644 --- a/vendor/symfony/http-foundation/LICENSE +++ b/vendor/symfony/http-foundation/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2004-2018 Fabien Potencier +Copyright (c) 2004-2019 Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/vendor/symfony/http-foundation/Request.php b/vendor/symfony/http-foundation/Request.php index 51940b8de7..c13016e522 100644 --- a/vendor/symfony/http-foundation/Request.php +++ b/vendor/symfony/http-foundation/Request.php @@ -1699,15 +1699,23 @@ class Request } elseif ($this->server->has('REQUEST_URI')) { $requestUri = $this->server->get('REQUEST_URI'); - // HTTP proxy reqs setup request URI with scheme and host [and port] + the URL path, only use URL path - $uriComponents = parse_url($requestUri); + if ('' !== $requestUri && '/' === $requestUri[0]) { + // To only use path and query remove the fragment. + if (false !== $pos = strpos($requestUri, '#')) { + $requestUri = substr($requestUri, 0, $pos); + } + } else { + // HTTP proxy reqs setup request URI with scheme and host [and port] + the URL path, + // only use URL path. + $uriComponents = parse_url($requestUri); - if (isset($uriComponents['path'])) { - $requestUri = $uriComponents['path']; - } + if (isset($uriComponents['path'])) { + $requestUri = $uriComponents['path']; + } - if (isset($uriComponents['query'])) { - $requestUri .= '?'.$uriComponents['query']; + if (isset($uriComponents['query'])) { + $requestUri .= '?'.$uriComponents['query']; + } } } elseif ($this->server->has('ORIG_PATH_INFO')) { // IIS 5.0, PHP as CGI @@ -1908,7 +1916,7 @@ class Request private static function createRequestFromFactory(array $query = array(), array $request = array(), array $attributes = array(), array $cookies = array(), array $files = array(), array $server = array(), $content = null) { if (self::$requestFactory) { - $request = \call_user_func(self::$requestFactory, $query, $request, $attributes, $cookies, $files, $server, $content); + $request = (self::$requestFactory)($query, $request, $attributes, $cookies, $files, $server, $content); if (!$request instanceof self) { throw new \LogicException('The Request factory must return an instance of Symfony\Component\HttpFoundation\Request.'); diff --git a/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php b/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php index 156a0d4555..232eb64cfd 100644 --- a/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php +++ b/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php @@ -153,7 +153,7 @@ class NativeSessionStorage implements SessionStorageInterface if (null !== $this->emulateSameSite) { $originalCookie = SessionUtils::popSessionCookie(session_name(), session_id()); if (null !== $originalCookie) { - header(sprintf('%s; SameSite=%s', $originalCookie, $this->emulateSameSite)); + header(sprintf('%s; SameSite=%s', $originalCookie, $this->emulateSameSite), false); } } @@ -225,7 +225,7 @@ class NativeSessionStorage implements SessionStorageInterface if (null !== $this->emulateSameSite) { $originalCookie = SessionUtils::popSessionCookie(session_name(), session_id()); if (null !== $originalCookie) { - header(sprintf('%s; SameSite=%s', $originalCookie, $this->emulateSameSite)); + header(sprintf('%s; SameSite=%s', $originalCookie, $this->emulateSameSite), false); } } diff --git a/vendor/symfony/http-foundation/StreamedResponse.php b/vendor/symfony/http-foundation/StreamedResponse.php index 06d053eadd..d3bcbb79d3 100644 --- a/vendor/symfony/http-foundation/StreamedResponse.php +++ b/vendor/symfony/http-foundation/StreamedResponse.php @@ -111,7 +111,7 @@ class StreamedResponse extends Response throw new \LogicException('The Response callback must not be null.'); } - \call_user_func($this->callback); + ($this->callback)(); return $this; } diff --git a/vendor/symfony/http-foundation/Tests/RequestTest.php b/vendor/symfony/http-foundation/Tests/RequestTest.php index 0711c515f2..36a9491348 100644 --- a/vendor/symfony/http-foundation/Tests/RequestTest.php +++ b/vendor/symfony/http-foundation/Tests/RequestTest.php @@ -283,6 +283,55 @@ class RequestTest extends TestCase $this->assertEquals('http://test.com/foo', $request->getUri()); } + /** + * @dataProvider getRequestUriData + */ + public function testGetRequestUri($serverRequestUri, $expected, $message) + { + $request = new Request(); + $request->server->add(array( + 'REQUEST_URI' => $serverRequestUri, + + // For having http://test.com + 'SERVER_NAME' => 'test.com', + 'SERVER_PORT' => 80, + )); + + $this->assertSame($expected, $request->getRequestUri(), $message); + $this->assertSame($expected, $request->server->get('REQUEST_URI'), 'Normalize the request URI.'); + } + + public function getRequestUriData() + { + $message = 'Do not modify the path.'; + yield array('/foo', '/foo', $message); + yield array('//bar/foo', '//bar/foo', $message); + yield array('///bar/foo', '///bar/foo', $message); + + $message = 'Handle when the scheme, host are on REQUEST_URI.'; + yield array('http://test.com/foo?bar=baz', '/foo?bar=baz', $message); + + $message = 'Handle when the scheme, host and port are on REQUEST_URI.'; + yield array('http://test.com:80/foo', '/foo', $message); + yield array('https://test.com:8080/foo', '/foo', $message); + yield array('https://test.com:443/foo', '/foo', $message); + + $message = 'Fragment should not be included in the URI'; + yield array('http://test.com/foo#bar', '/foo', $message); + yield array('/foo#bar', '/foo', $message); + } + + public function testGetRequestUriWithoutRequiredHeader() + { + $expected = ''; + + $request = new Request(); + + $message = 'Fallback to empty URI when headers are missing.'; + $this->assertSame($expected, $request->getRequestUri(), $message); + $this->assertSame($expected, $request->server->get('REQUEST_URI'), 'Normalize the request URI.'); + } + public function testCreateCheckPrecedence() { // server is used by default diff --git a/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/PdoSessionHandlerTest.php b/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/PdoSessionHandlerTest.php index 0a65eaa8e4..0edda00aa9 100644 --- a/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/PdoSessionHandlerTest.php +++ b/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/PdoSessionHandlerTest.php @@ -390,7 +390,7 @@ class MockPdo extends \PDO public function prepare($statement, $driverOptions = array()) { return \is_callable($this->prepareResult) - ? \call_user_func($this->prepareResult, $statement, $driverOptions) + ? ($this->prepareResult)($statement, $driverOptions) : $this->prepareResult; } diff --git a/vendor/symfony/http-kernel/Debug/FileLinkFormatter.php b/vendor/symfony/http-kernel/Debug/FileLinkFormatter.php index e187022b54..221d33473e 100644 --- a/vendor/symfony/http-kernel/Debug/FileLinkFormatter.php +++ b/vendor/symfony/http-kernel/Debug/FileLinkFormatter.php @@ -91,7 +91,7 @@ class FileLinkFormatter implements \Serializable if ($this->requestStack && $this->baseDir && $this->urlFormat) { $request = $this->requestStack->getMasterRequest(); if ($request instanceof Request) { - if ($this->urlFormat instanceof \Closure && !$this->urlFormat = \call_user_func($this->urlFormat)) { + if ($this->urlFormat instanceof \Closure && !$this->urlFormat = ($this->urlFormat)()) { return; } diff --git a/vendor/symfony/http-kernel/DependencyInjection/AddAnnotatedClassesToCachePass.php b/vendor/symfony/http-kernel/DependencyInjection/AddAnnotatedClassesToCachePass.php index 54f87edd99..783e6fbbe6 100644 --- a/vendor/symfony/http-kernel/DependencyInjection/AddAnnotatedClassesToCachePass.php +++ b/vendor/symfony/http-kernel/DependencyInjection/AddAnnotatedClassesToCachePass.php @@ -55,7 +55,7 @@ class AddAnnotatedClassesToCachePass implements CompilerPassInterface * @param array $patterns The class patterns to expand * @param array $classes The existing classes to match against the patterns * - * @return array A list of classes derivated from the patterns + * @return array A list of classes derived from the patterns */ private function expandClasses(array $patterns, array $classes) { diff --git a/vendor/symfony/http-kernel/Kernel.php b/vendor/symfony/http-kernel/Kernel.php index d34beba419..d09be5a0ba 100644 --- a/vendor/symfony/http-kernel/Kernel.php +++ b/vendor/symfony/http-kernel/Kernel.php @@ -73,11 +73,11 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl private $requestStackSize = 0; private $resetServices = false; - const VERSION = '4.2.1'; - const VERSION_ID = 40201; + const VERSION = '4.2.2'; + const VERSION_ID = 40202; const MAJOR_VERSION = 4; const MINOR_VERSION = 2; - const RELEASE_VERSION = 1; + const RELEASE_VERSION = 2; const EXTRA_VERSION = ''; const END_OF_MAINTENANCE = '07/2019'; @@ -743,7 +743,10 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl $fs->dumpFile($dir.$file, $code); @chmod($dir.$file, 0666 & ~umask()); } - @unlink(\dirname($dir.$file).'.legacy'); + $legacyFile = \dirname($dir.$file).'.legacy'; + if (file_exists($legacyFile)) { + @unlink($legacyFile); + } $cache->write($rootCode, $container->getResources()); } diff --git a/vendor/symfony/http-kernel/LICENSE b/vendor/symfony/http-kernel/LICENSE index 21d7fb9e2f..a677f43763 100644 --- a/vendor/symfony/http-kernel/LICENSE +++ b/vendor/symfony/http-kernel/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2004-2018 Fabien Potencier +Copyright (c) 2004-2019 Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/vendor/symfony/http-kernel/Tests/DataCollector/DumpDataCollectorTest.php b/vendor/symfony/http-kernel/Tests/DataCollector/DumpDataCollectorTest.php index 57384a79ff..0f46709049 100644 --- a/vendor/symfony/http-kernel/Tests/DataCollector/DumpDataCollectorTest.php +++ b/vendor/symfony/http-kernel/Tests/DataCollector/DumpDataCollectorTest.php @@ -144,11 +144,8 @@ EOTXT; $collector->dump($data); $line = __LINE__ - 1; $output = preg_replace("/\033\[[^m]*m/", '', ob_get_clean()); - if (\PHP_VERSION_ID >= 50400) { - $this->assertSame("DumpDataCollectorTest.php on line {$line}:\n456\n", $output); - } else { - $this->assertSame("\"DumpDataCollectorTest.php on line {$line}:\"\n456\n", $output); - } + + $this->assertSame("DumpDataCollectorTest.php on line {$line}:\n456\n", $output); ob_start(); $collector->__destruct(); diff --git a/vendor/symfony/http-kernel/Tests/EventListener/TranslatorListenerTest.php b/vendor/symfony/http-kernel/Tests/EventListener/TranslatorListenerTest.php index b448f3bfd1..c75e7b980f 100644 --- a/vendor/symfony/http-kernel/Tests/EventListener/TranslatorListenerTest.php +++ b/vendor/symfony/http-kernel/Tests/EventListener/TranslatorListenerTest.php @@ -48,7 +48,7 @@ class TranslatorListenerTest extends TestCase $this->translator ->expects($this->at(0)) ->method('setLocale') - ->will($this->throwException(new \InvalidArgumentException())); + ->willThrowException(new \InvalidArgumentException()); $this->translator ->expects($this->at(1)) ->method('setLocale') @@ -85,7 +85,7 @@ class TranslatorListenerTest extends TestCase $this->translator ->expects($this->at(0)) ->method('setLocale') - ->will($this->throwException(new \InvalidArgumentException())); + ->willThrowException(new \InvalidArgumentException()); $this->translator ->expects($this->at(1)) ->method('setLocale') diff --git a/vendor/symfony/http-kernel/Tests/Fragment/EsiFragmentRendererTest.php b/vendor/symfony/http-kernel/Tests/Fragment/EsiFragmentRendererTest.php index 7ac1f4faa5..79a9f74da4 100644 --- a/vendor/symfony/http-kernel/Tests/Fragment/EsiFragmentRendererTest.php +++ b/vendor/symfony/http-kernel/Tests/Fragment/EsiFragmentRendererTest.php @@ -60,7 +60,7 @@ class EsiFragmentRendererTest extends TestCase $altReference = new ControllerReference('alt_controller', array(), array()); $this->assertEquals( - '<esi:include src="/_fragment?_path=_format%3Dhtml%26_locale%3Dfr%26_controller%3Dmain_controller&_hash=Jz1P8NErmhKTeI6onI1EdAXTB85359MY3RIk5mSJ60w%3D" alt="/_fragment?_path=_format%3Dhtml%26_locale%3Dfr%26_controller%3Dalt_controller&_hash=iPJEdRoUpGrM1ztqByiorpfMPtiW%2FOWwdH1DBUXHhEc%3D" />', + '<esi:include src="/_fragment?_hash=Jz1P8NErmhKTeI6onI1EdAXTB85359MY3RIk5mSJ60w%3D&_path=_format%3Dhtml%26_locale%3Dfr%26_controller%3Dmain_controller" alt="/_fragment?_hash=iPJEdRoUpGrM1ztqByiorpfMPtiW%2FOWwdH1DBUXHhEc%3D&_path=_format%3Dhtml%26_locale%3Dfr%26_controller%3Dalt_controller" />', $strategy->render($reference, $request, array('alt' => $altReference))->getContent() ); } diff --git a/vendor/symfony/http-kernel/Tests/Fragment/HIncludeFragmentRendererTest.php b/vendor/symfony/http-kernel/Tests/Fragment/HIncludeFragmentRendererTest.php index 10fbccf0fa..68f8ded4e9 100644 --- a/vendor/symfony/http-kernel/Tests/Fragment/HIncludeFragmentRendererTest.php +++ b/vendor/symfony/http-kernel/Tests/Fragment/HIncludeFragmentRendererTest.php @@ -32,7 +32,7 @@ class HIncludeFragmentRendererTest extends TestCase { $strategy = new HIncludeFragmentRenderer(null, new UriSigner('foo')); - $this->assertEquals('<hx:include src="/_fragment?_path=_format%3Dhtml%26_locale%3Den%26_controller%3Dmain_controller&_hash=BP%2BOzCD5MRUI%2BHJpgPDOmoju00FnzLhP3TGcSHbbBLs%3D"></hx:include>', $strategy->render(new ControllerReference('main_controller', array(), array()), Request::create('/'))->getContent()); + $this->assertEquals('<hx:include src="/_fragment?_hash=BP%2BOzCD5MRUI%2BHJpgPDOmoju00FnzLhP3TGcSHbbBLs%3D&_path=_format%3Dhtml%26_locale%3Den%26_controller%3Dmain_controller"></hx:include>', $strategy->render(new ControllerReference('main_controller', array(), array()), Request::create('/'))->getContent()); } public function testRenderWithUri() @@ -80,7 +80,7 @@ class HIncludeFragmentRendererTest extends TestCase $engine->expects($this->once()) ->method('exists') ->with('default') - ->will($this->throwException(new \InvalidArgumentException())); + ->willThrowException(new \InvalidArgumentException()); // only default $strategy = new HIncludeFragmentRenderer($engine); @@ -93,7 +93,7 @@ class HIncludeFragmentRendererTest extends TestCase $engine->expects($this->once()) ->method('exists') ->with('loading...') - ->will($this->throwException(new \RuntimeException())); + ->willThrowException(new \RuntimeException()); // only default $strategy = new HIncludeFragmentRenderer($engine); diff --git a/vendor/symfony/http-kernel/Tests/Fragment/SsiFragmentRendererTest.php b/vendor/symfony/http-kernel/Tests/Fragment/SsiFragmentRendererTest.php index f725803118..ff98fd2616 100644 --- a/vendor/symfony/http-kernel/Tests/Fragment/SsiFragmentRendererTest.php +++ b/vendor/symfony/http-kernel/Tests/Fragment/SsiFragmentRendererTest.php @@ -51,7 +51,7 @@ class SsiFragmentRendererTest extends TestCase $altReference = new ControllerReference('alt_controller', array(), array()); $this->assertEquals( - '<!--#include virtual="/_fragment?_path=_format%3Dhtml%26_locale%3Dfr%26_controller%3Dmain_controller&_hash=Jz1P8NErmhKTeI6onI1EdAXTB85359MY3RIk5mSJ60w%3D" -->', + '<!--#include virtual="/_fragment?_hash=Jz1P8NErmhKTeI6onI1EdAXTB85359MY3RIk5mSJ60w%3D&_path=_format%3Dhtml%26_locale%3Dfr%26_controller%3Dmain_controller" -->', $strategy->render($reference, $request, array('alt' => $altReference))->getContent() ); } diff --git a/vendor/symfony/http-kernel/Tests/HttpKernelTest.php b/vendor/symfony/http-kernel/Tests/HttpKernelTest.php index 129fa704be..63a276a15e 100644 --- a/vendor/symfony/http-kernel/Tests/HttpKernelTest.php +++ b/vendor/symfony/http-kernel/Tests/HttpKernelTest.php @@ -183,7 +183,7 @@ class HttpKernelTest extends TestCase public function testHandleWhenTheControllerIsAnObjectWithInvoke() { $dispatcher = new EventDispatcher(); - $kernel = $this->getHttpKernel($dispatcher, new Controller()); + $kernel = $this->getHttpKernel($dispatcher, new TestController()); $this->assertResponseEquals(new Response('foo'), $kernel->handle(new Request())); } @@ -199,7 +199,7 @@ class HttpKernelTest extends TestCase public function testHandleWhenTheControllerIsAnArray() { $dispatcher = new EventDispatcher(); - $kernel = $this->getHttpKernel($dispatcher, array(new Controller(), 'controller')); + $kernel = $this->getHttpKernel($dispatcher, array(new TestController(), 'controller')); $this->assertResponseEquals(new Response('foo'), $kernel->handle(new Request())); } @@ -207,7 +207,7 @@ class HttpKernelTest extends TestCase public function testHandleWhenTheControllerIsAStaticArray() { $dispatcher = new EventDispatcher(); - $kernel = $this->getHttpKernel($dispatcher, array('Symfony\Component\HttpKernel\Tests\Controller', 'staticcontroller')); + $kernel = $this->getHttpKernel($dispatcher, array('Symfony\Component\HttpKernel\Tests\TestController', 'staticcontroller')); $this->assertResponseEquals(new Response('foo'), $kernel->handle(new Request())); } @@ -372,7 +372,7 @@ class HttpKernelTest extends TestCase } } -class Controller +class TestController { public function __invoke() { diff --git a/vendor/symfony/http-kernel/Tests/UriSignerTest.php b/vendor/symfony/http-kernel/Tests/UriSignerTest.php index 84ec19f70d..9b7fe08a99 100644 --- a/vendor/symfony/http-kernel/Tests/UriSignerTest.php +++ b/vendor/symfony/http-kernel/Tests/UriSignerTest.php @@ -21,7 +21,8 @@ class UriSignerTest extends TestCase $signer = new UriSigner('foobar'); $this->assertContains('?_hash=', $signer->sign('http://example.com/foo')); - $this->assertContains('&_hash=', $signer->sign('http://example.com/foo?foo=bar')); + $this->assertContains('?_hash=', $signer->sign('http://example.com/foo?foo=bar')); + $this->assertContains('&foo=', $signer->sign('http://example.com/foo?foo=bar')); } public function testCheck() @@ -45,7 +46,7 @@ class UriSignerTest extends TestCase $signer = new UriSigner('foobar'); $this->assertSame( - 'http://example.com/foo?baz=bay&foo=bar&_hash=rIOcC%2FF3DoEGo%2FvnESjSp7uU9zA9S%2F%2BOLhxgMexoPUM%3D', + 'http://example.com/foo?_hash=rIOcC%2FF3DoEGo%2FvnESjSp7uU9zA9S%2F%2BOLhxgMexoPUM%3D&baz=bay&foo=bar', $signer->sign('http://example.com/foo?foo=bar&baz=bay') ); $this->assertTrue($signer->check($signer->sign('http://example.com/foo?foo=bar&baz=bay'))); @@ -61,4 +62,15 @@ class UriSignerTest extends TestCase ); $this->assertTrue($signer->check($signer->sign('http://example.com/foo?foo=bar&baz=bay'))); } + + public function testSignerWorksWithFragments() + { + $signer = new UriSigner('foobar'); + + $this->assertSame( + 'http://example.com/foo?_hash=EhpAUyEobiM3QTrKxoLOtQq5IsWyWedoXDPqIjzNj5o%3D&bar=foo&foo=bar#foobar', + $signer->sign('http://example.com/foo?bar=foo&foo=bar#foobar') + ); + $this->assertTrue($signer->check($signer->sign('http://example.com/foo?bar=foo&foo=bar#foobar'))); + } } diff --git a/vendor/symfony/http-kernel/UriSigner.php b/vendor/symfony/http-kernel/UriSigner.php index de73039b34..210f731735 100644 --- a/vendor/symfony/http-kernel/UriSigner.php +++ b/vendor/symfony/http-kernel/UriSigner.php @@ -51,8 +51,9 @@ class UriSigner } $uri = $this->buildUrl($url, $params); + $params[$this->parameter] = $this->computeHash($uri); - return $uri.(false === strpos($uri, '?') ? '?' : '&').$this->parameter.'='.$this->computeHash($uri); + return $this->buildUrl($url, $params); } /** @@ -75,7 +76,7 @@ class UriSigner return false; } - $hash = urlencode($params[$this->parameter]); + $hash = $params[$this->parameter]; unset($params[$this->parameter]); return $this->computeHash($this->buildUrl($url, $params)) === $hash; @@ -83,7 +84,7 @@ class UriSigner private function computeHash($uri) { - return urlencode(base64_encode(hash_hmac('sha256', $uri, $this->secret, true))); + return base64_encode(hash_hmac('sha256', $uri, $this->secret, true)); } private function buildUrl(array $url, array $params = array()) diff --git a/vendor/symfony/translation/Catalogue/TargetOperation.php b/vendor/symfony/translation/Catalogue/TargetOperation.php index 6264525c97..523022550a 100644 --- a/vendor/symfony/translation/Catalogue/TargetOperation.php +++ b/vendor/symfony/translation/Catalogue/TargetOperation.php @@ -40,10 +40,10 @@ class TargetOperation extends AbstractOperation // For 'all' messages, the code can't be simplified as ``$this->messages[$domain]['all'] = $target->all($domain);``, // because doing so will drop messages like {x: x ∈ source ∧ x ∉ target.all ∧ x ∈ target.fallback} // - // For 'new' messages, the code can't be simplied as ``array_diff_assoc($this->target->all($domain), $this->source->all($domain));`` + // For 'new' messages, the code can't be simplified as ``array_diff_assoc($this->target->all($domain), $this->source->all($domain));`` // because doing so will not exclude messages like {x: x ∈ target ∧ x ∉ source.all ∧ x ∈ source.fallback} // - // For 'obsolete' messages, the code can't be simplifed as ``array_diff_assoc($this->source->all($domain), $this->target->all($domain))`` + // For 'obsolete' messages, the code can't be simplified as ``array_diff_assoc($this->source->all($domain), $this->target->all($domain))`` // because doing so will not exclude messages like {x: x ∈ source ∧ x ∉ target.all ∧ x ∈ target.fallback} foreach ($this->source->all($domain) as $id => $message) { diff --git a/vendor/symfony/translation/Command/XliffLintCommand.php b/vendor/symfony/translation/Command/XliffLintCommand.php index 67bb7764b5..17e1a72bb4 100644 --- a/vendor/symfony/translation/Command/XliffLintCommand.php +++ b/vendor/symfony/translation/Command/XliffLintCommand.php @@ -242,7 +242,7 @@ EOF }; if (null !== $this->directoryIteratorProvider) { - return \call_user_func($this->directoryIteratorProvider, $directory, $default); + return ($this->directoryIteratorProvider)($directory, $default); } return $default($directory); @@ -255,7 +255,7 @@ EOF }; if (null !== $this->isReadableProvider) { - return \call_user_func($this->isReadableProvider, $fileOrDirectory, $default); + return ($this->isReadableProvider)($fileOrDirectory, $default); } return $default($fileOrDirectory); diff --git a/vendor/symfony/translation/LICENSE b/vendor/symfony/translation/LICENSE index 21d7fb9e2f..a677f43763 100644 --- a/vendor/symfony/translation/LICENSE +++ b/vendor/symfony/translation/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2004-2018 Fabien Potencier +Copyright (c) 2004-2019 Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/vendor/symfony/translation/PluralizationRules.php b/vendor/symfony/translation/PluralizationRules.php index 362f6a1f1f..efbfd7f225 100644 --- a/vendor/symfony/translation/PluralizationRules.php +++ b/vendor/symfony/translation/PluralizationRules.php @@ -46,7 +46,7 @@ class PluralizationRules } if (isset(self::$rules[$locale])) { - $return = \call_user_func(self::$rules[$locale], $number); + $return = self::$rules[$locale]($number); if (!\is_int($return) || $return < 0) { return 0; diff --git a/vendor/symfony/translation/Tests/TranslatorCacheTest.php b/vendor/symfony/translation/Tests/TranslatorCacheTest.php index 13ae9cb10a..77c264b491 100644 --- a/vendor/symfony/translation/Tests/TranslatorCacheTest.php +++ b/vendor/symfony/translation/Tests/TranslatorCacheTest.php @@ -127,7 +127,7 @@ class TranslatorCacheTest extends TestCase { /* * Similar to the previous test. After we used the second translator, make - * sure there's still a useable cache for the first one. + * sure there's still a usable cache for the first one. */ $locale = 'any_locale'; @@ -146,7 +146,7 @@ class TranslatorCacheTest extends TestCase $translator->addResource($format, array($msgid => 'FAIL'), $locale); $translator->trans($msgid); - // Now the first translator must still have a useable cache. + // Now the first translator must still have a usable cache. $translator = new Translator($locale, null, $this->tmpDir, $debug); $translator->addLoader($format, $this->createFailingLoader()); $translator->addResource($format, array($msgid => 'OK'), $locale); diff --git a/vendor/symfony/translation/TranslatorInterface.php b/vendor/symfony/translation/TranslatorInterface.php index 3ecef054b1..77f14868e6 100644 --- a/vendor/symfony/translation/TranslatorInterface.php +++ b/vendor/symfony/translation/TranslatorInterface.php @@ -41,7 +41,7 @@ interface TranslatorInterface extends LocaleAwareInterface * Translates the given choice message by choosing a translation according to a number. * * @param string $id The message id (may also be an object that can be cast to string) - * @param int $number The number to use to find the indice of the message + * @param int $number The number to use to find the index of the message * @param array $parameters An array of parameters for the message * @param string|null $domain The domain for the message or null to use the default * @param string|null $locale The locale or null to use the default diff --git a/vendor/symfony/var-exporter/Internal/Exporter.php b/vendor/symfony/var-exporter/Internal/Exporter.php index bbb409e194..38a8e25088 100644 --- a/vendor/symfony/var-exporter/Internal/Exporter.php +++ b/vendor/symfony/var-exporter/Internal/Exporter.php @@ -232,7 +232,7 @@ class Exporter if (!\is_int($k) || 1 !== $k - $j) { $code .= self::export($k, $subIndent).' => '; } - if (\is_int($k)) { + if (\is_int($k) && $k > $j) { $j = $k; } $code .= self::export($v, $subIndent).",\n"; diff --git a/vendor/symfony/var-exporter/Internal/Registry.php b/vendor/symfony/var-exporter/Internal/Registry.php index 487a8566e2..705722650a 100644 --- a/vendor/symfony/var-exporter/Internal/Registry.php +++ b/vendor/symfony/var-exporter/Internal/Registry.php @@ -93,15 +93,9 @@ class Registry throw new NotInstantiableTypeException($class); } } - if (null !== $proto && !$proto instanceof \Throwable) { + if (null !== $proto && !$proto instanceof \Throwable && !$proto instanceof \Serializable && !\method_exists($class, '__sleep')) { try { - if (!$proto instanceof \Serializable && !\method_exists($class, '__sleep')) { - serialize($proto); - } elseif ($instantiableWithoutConstructor) { - serialize($reflector->newInstanceWithoutConstructor()); - } else { - serialize(unserialize(($proto instanceof \Serializable ? 'C:' : 'O:').\strlen($class).':"'.$class.'":0:{}')); - } + serialize($proto); } catch (\Exception $e) { throw new NotInstantiableTypeException($class, $e); } diff --git a/vendor/symfony/var-exporter/LICENSE b/vendor/symfony/var-exporter/LICENSE index ad399a798d..3f853aaf35 100644 --- a/vendor/symfony/var-exporter/LICENSE +++ b/vendor/symfony/var-exporter/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2018 Fabien Potencier +Copyright (c) 2018-2019 Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/vendor/symfony/var-exporter/Tests/Fixtures/foo-serializable.php b/vendor/symfony/var-exporter/Tests/Fixtures/foo-serializable.php new file mode 100644 index 0000000000..fd4e267101 --- /dev/null +++ b/vendor/symfony/var-exporter/Tests/Fixtures/foo-serializable.php @@ -0,0 +1,11 @@ +<?php + +return \Symfony\Component\VarExporter\Internal\Hydrator::hydrate( + $o = \Symfony\Component\VarExporter\Internal\Registry::unserialize([], [ + 'C:51:"Symfony\\Component\\VarExporter\\Tests\\FooSerializable":20:{a:1:{i:0;s:3:"bar";}}', + ]), + null, + [], + $o[0], + [] +); diff --git a/vendor/symfony/var-exporter/Tests/Fixtures/partially-indexed-array.php b/vendor/symfony/var-exporter/Tests/Fixtures/partially-indexed-array.php new file mode 100644 index 0000000000..647aa7e80f --- /dev/null +++ b/vendor/symfony/var-exporter/Tests/Fixtures/partially-indexed-array.php @@ -0,0 +1,8 @@ +<?php + +return [ + 5 => true, + 1 => true, + 2 => true, + true, +]; diff --git a/vendor/symfony/var-exporter/Tests/VarExporterTest.php b/vendor/symfony/var-exporter/Tests/VarExporterTest.php index ea0b6a4585..c34a7e4fb7 100644 --- a/vendor/symfony/var-exporter/Tests/VarExporterTest.php +++ b/vendor/symfony/var-exporter/Tests/VarExporterTest.php @@ -112,6 +112,7 @@ class VarExporterTest extends TestCase yield array('bool', true, true); yield array('simple-array', array(123, array('abc')), true); + yield array('partially-indexed-array', array(5 => true, 1 => true, 2 => true, 6 => true), true); yield array('datetime', \DateTime::createFromFormat('U', 0)); $value = new \ArrayObject(); @@ -194,6 +195,8 @@ class VarExporterTest extends TestCase yield array('wakeup-refl', $value); yield array('abstract-parent', new ConcreteClass()); + + yield array('foo-serializable', new FooSerializable('bar')); } } @@ -342,3 +345,28 @@ class ConcreteClass extends AbstractClass $this->setBar(234); } } + +class FooSerializable implements \Serializable +{ + private $foo; + + public function __construct(string $foo) + { + $this->foo = $foo; + } + + public function getFoo(): string + { + return $this->foo; + } + + public function serialize(): string + { + return serialize(array($this->getFoo())); + } + + public function unserialize($str) + { + list($this->foo) = unserialize($str); + } +} |
