+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Contracts\Cache;
+
+use Psr\Cache\CacheItemInterface;
+use Psr\Cache\InvalidArgumentException;
+
+/**
+ * Covers most simple to advanced caching needs.
+ *
+ * @author Nicolas Grekas
+ */
+interface CacheInterface
+{
+ /**
+ * Fetches a value from the pool or computes it if not found.
+ *
+ * On cache misses, a callback is called that should return the missing value.
+ * This callback is given a PSR-6 CacheItemInterface instance corresponding to the
+ * requested key, that could be used e.g. for expiration control. It could also
+ * be an ItemInterface instance when its additional features are needed.
+ *
+ * @param string $key The key of the item to retrieve from the cache
+ * @param callable|CallbackInterface $callback Should return the computed value for the given key/item
+ * @param float|null $beta A float that, as it grows, controls the likeliness of triggering
+ * early expiration. 0 disables it, INF forces immediate expiration.
+ * The default (or providing null) is implementation dependent but should
+ * typically be 1.0, which should provide optimal stampede protection.
+ * See https://en.wikipedia.org/wiki/Cache_stampede#Probabilistic_early_expiration
+ * @param array &$metadata The metadata of the cached item {@see ItemInterface::getMetadata()}
+ *
+ * @return mixed The value corresponding to the provided key
+ *
+ * @throws InvalidArgumentException When $key is not valid or when $beta is negative
+ */
+ public function get(string $key, callable $callback, float $beta = null, array &$metadata = null);
+
+ /**
+ * Removes an item from the pool.
+ *
+ * @param string $key The key to delete
+ *
+ * @throws InvalidArgumentException When $key is not valid
+ *
+ * @return bool True if the item was successfully removed, false if there was any error
+ */
+ public function delete(string $key): bool;
+}
diff --git a/vendor/symfony/contracts/Cache/CacheTrait.php b/vendor/symfony/contracts/Cache/CacheTrait.php
new file mode 100644
index 000000000..355ea2962
--- /dev/null
+++ b/vendor/symfony/contracts/Cache/CacheTrait.php
@@ -0,0 +1,76 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Contracts\Cache;
+
+use Psr\Cache\CacheItemPoolInterface;
+use Psr\Cache\InvalidArgumentException;
+use Psr\Log\LoggerInterface;
+
+/**
+ * An implementation of CacheInterface for PSR-6 CacheItemPoolInterface classes.
+ *
+ * @author Nicolas Grekas
+ */
+trait CacheTrait
+{
+ /**
+ * {@inheritdoc}
+ */
+ public function get(string $key, callable $callback, float $beta = null, array &$metadata = null)
+ {
+ return $this->doGet($this, $key, $callback, $beta, $metadata);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function delete(string $key): bool
+ {
+ return $this->deleteItem($key);
+ }
+
+ private function doGet(CacheItemPoolInterface $pool, string $key, callable $callback, ?float $beta, array &$metadata = null, LoggerInterface $logger = null)
+ {
+ if (0 > $beta = $beta ?? 1.0) {
+ throw new class(sprintf('Argument "$beta" provided to "%s::get()" must be a positive number, %f given.', \get_class($this), $beta)) extends \InvalidArgumentException implements InvalidArgumentException {
+ };
+ }
+
+ $item = $pool->getItem($key);
+ $recompute = !$item->isHit() || INF === $beta;
+ $metadata = $item instanceof ItemInterface ? $item->getMetadata() : [];
+
+ if (!$recompute && $metadata) {
+ $expiry = $metadata[ItemInterface::METADATA_EXPIRY] ?? false;
+ $ctime = $metadata[ItemInterface::METADATA_CTIME] ?? false;
+
+ if ($recompute = $ctime && $expiry && $expiry <= ($now = microtime(true)) - $ctime / 1000 * $beta * log(random_int(1, PHP_INT_MAX) / PHP_INT_MAX)) {
+ // force applying defaultLifetime to expiry
+ $item->expiresAt(null);
+ $logger && $logger->info('Item "{key}" elected for early recomputation {delta}s before its expiration', [
+ 'key' => $key,
+ 'delta' => sprintf('%.1f', $expiry - $now),
+ ]);
+ }
+ }
+
+ if ($recompute) {
+ $save = true;
+ $item->set($callback($item, $save));
+ if ($save) {
+ $pool->save($item);
+ }
+ }
+
+ return $item->get();
+ }
+}
diff --git a/vendor/symfony/contracts/Cache/CallbackInterface.php b/vendor/symfony/contracts/Cache/CallbackInterface.php
new file mode 100644
index 000000000..7dae2aac3
--- /dev/null
+++ b/vendor/symfony/contracts/Cache/CallbackInterface.php
@@ -0,0 +1,30 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Contracts\Cache;
+
+use Psr\Cache\CacheItemInterface;
+
+/**
+ * Computes and returns the cached value of an item.
+ *
+ * @author Nicolas Grekas
+ */
+interface CallbackInterface
+{
+ /**
+ * @param CacheItemInterface|ItemInterface $item The item to compute the value for
+ * @param bool &$save Should be set to false when the value should not be saved in the pool
+ *
+ * @return mixed The computed value for the passed item
+ */
+ public function __invoke(CacheItemInterface $item, bool &$save);
+}
diff --git a/vendor/symfony/contracts/Cache/ItemInterface.php b/vendor/symfony/contracts/Cache/ItemInterface.php
new file mode 100644
index 000000000..cbd72260b
--- /dev/null
+++ b/vendor/symfony/contracts/Cache/ItemInterface.php
@@ -0,0 +1,65 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Contracts\Cache;
+
+use Psr\Cache\CacheException;
+use Psr\Cache\CacheItemInterface;
+use Psr\Cache\InvalidArgumentException;
+
+/**
+ * Augments PSR-6's CacheItemInterface with support for tags and metadata.
+ *
+ * @author Nicolas Grekas
+ */
+interface ItemInterface extends CacheItemInterface
+{
+ /**
+ * References the Unix timestamp stating when the item will expire.
+ */
+ const METADATA_EXPIRY = 'expiry';
+
+ /**
+ * References the time the item took to be created, in milliseconds.
+ */
+ const METADATA_CTIME = 'ctime';
+
+ /**
+ * References the list of tags that were assigned to the item, as string[].
+ */
+ const METADATA_TAGS = 'tags';
+
+ /**
+ * Reserved characters that cannot be used in a key or tag.
+ */
+ const RESERVED_CHARACTERS = '{}()/\@:';
+
+ /**
+ * Adds a tag to a cache item.
+ *
+ * Tags are strings that follow the same validation rules as keys.
+ *
+ * @param string|string[] $tags A tag or array of tags
+ *
+ * @return $this
+ *
+ * @throws InvalidArgumentException When $tag is not valid
+ * @throws CacheException When the item comes from a pool that is not tag-aware
+ */
+ public function tag($tags): self;
+
+ /**
+ * Returns a list of metadata info that were saved alongside with the cached value.
+ *
+ * See ItemInterface::METADATA_* consts for keys potentially found in the returned array.
+ */
+ public function getMetadata(): array;
+}
diff --git a/vendor/symfony/debug/LICENSE b/vendor/symfony/contracts/Cache/LICENSE
similarity index 96%
rename from vendor/symfony/debug/LICENSE
rename to vendor/symfony/contracts/Cache/LICENSE
index 17d16a133..3f853aaf3 100644
--- a/vendor/symfony/debug/LICENSE
+++ b/vendor/symfony/contracts/Cache/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2004-2017 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/contracts/Cache/README.md b/vendor/symfony/contracts/Cache/README.md
new file mode 100644
index 000000000..58c589e9e
--- /dev/null
+++ b/vendor/symfony/contracts/Cache/README.md
@@ -0,0 +1,9 @@
+Symfony Cache Contracts
+=======================
+
+A set of abstractions extracted out of the Symfony components.
+
+Can be used to build on semantics that the Symfony components proved useful - and
+that already have battle tested implementations.
+
+See https://github.com/symfony/contracts/blob/master/README.md for more information.
diff --git a/vendor/symfony/contracts/Cache/TagAwareCacheInterface.php b/vendor/symfony/contracts/Cache/TagAwareCacheInterface.php
new file mode 100644
index 000000000..7c4cf1111
--- /dev/null
+++ b/vendor/symfony/contracts/Cache/TagAwareCacheInterface.php
@@ -0,0 +1,38 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Contracts\Cache;
+
+use Psr\Cache\InvalidArgumentException;
+
+/**
+ * Allows invalidating cached items using tags.
+ *
+ * @author Nicolas Grekas
+ */
+interface TagAwareCacheInterface extends CacheInterface
+{
+ /**
+ * Invalidates cached items using tags.
+ *
+ * When implemented on a PSR-6 pool, invalidation should not apply
+ * to deferred items. Instead, they should be committed as usual.
+ * This allows replacing old tagged values by new ones without
+ * race conditions.
+ *
+ * @param string[] $tags An array of tags to invalidate
+ *
+ * @return bool True on success
+ *
+ * @throws InvalidArgumentException When $tags is not valid
+ */
+ public function invalidateTags(array $tags);
+}
diff --git a/vendor/symfony/contracts/Cache/composer.json b/vendor/symfony/contracts/Cache/composer.json
new file mode 100644
index 000000000..4e0bd1a42
--- /dev/null
+++ b/vendor/symfony/contracts/Cache/composer.json
@@ -0,0 +1,34 @@
+{
+ "name": "symfony/cache-contracts",
+ "type": "library",
+ "description": "Generic abstractions related to caching",
+ "keywords": ["abstractions", "contracts", "decoupling", "interfaces", "interoperability", "standards"],
+ "homepage": "https://symfony.com",
+ "license": "MIT",
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "require": {
+ "php": "^7.1.3",
+ "psr/cache": "^1.0"
+ },
+ "suggest": {
+ "symfony/cache-implementation": ""
+ },
+ "autoload": {
+ "psr-4": { "Symfony\\Contracts\\Cache\\": "" }
+ },
+ "minimum-stability": "dev",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.1-dev"
+ }
+ }
+}
diff --git a/vendor/symfony/contracts/EventDispatcher/.gitignore b/vendor/symfony/contracts/EventDispatcher/.gitignore
new file mode 100644
index 000000000..c49a5d8df
--- /dev/null
+++ b/vendor/symfony/contracts/EventDispatcher/.gitignore
@@ -0,0 +1,3 @@
+vendor/
+composer.lock
+phpunit.xml
diff --git a/vendor/symfony/contracts/EventDispatcher/Event.php b/vendor/symfony/contracts/EventDispatcher/Event.php
new file mode 100644
index 000000000..84f60f3ed
--- /dev/null
+++ b/vendor/symfony/contracts/EventDispatcher/Event.php
@@ -0,0 +1,96 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Contracts\EventDispatcher;
+
+use Psr\EventDispatcher\StoppableEventInterface;
+
+if (interface_exists(StoppableEventInterface::class)) {
+ /**
+ * Event is the base class for classes containing event data.
+ *
+ * This class contains no event data. It is used by events that do not pass
+ * state information to an event handler when an event is raised.
+ *
+ * You can call the method stopPropagation() to abort the execution of
+ * further listeners in your event listener.
+ *
+ * @author Guilherme Blanco
+ * @author Jonathan Wage
+ * @author Roman Borschel
+ * @author Bernhard Schussek
+ * @author Nicolas Grekas
+ */
+ class Event implements StoppableEventInterface
+ {
+ private $propagationStopped = false;
+
+ /**
+ * Returns whether further event listeners should be triggered.
+ */
+ public function isPropagationStopped(): bool
+ {
+ return $this->propagationStopped;
+ }
+
+ /**
+ * Stops the propagation of the event to further event listeners.
+ *
+ * If multiple event listeners are connected to the same event, no
+ * further event listener will be triggered once any trigger calls
+ * stopPropagation().
+ */
+ public function stopPropagation(): void
+ {
+ $this->propagationStopped = true;
+ }
+ }
+} else {
+ /**
+ * Event is the base class for classes containing event data.
+ *
+ * This class contains no event data. It is used by events that do not pass
+ * state information to an event handler when an event is raised.
+ *
+ * You can call the method stopPropagation() to abort the execution of
+ * further listeners in your event listener.
+ *
+ * @author Guilherme Blanco
+ * @author Jonathan Wage
+ * @author Roman Borschel
+ * @author Bernhard Schussek
+ * @author Nicolas Grekas
+ */
+ class Event
+ {
+ private $propagationStopped = false;
+
+ /**
+ * Returns whether further event listeners should be triggered.
+ */
+ public function isPropagationStopped(): bool
+ {
+ return $this->propagationStopped;
+ }
+
+ /**
+ * Stops the propagation of the event to further event listeners.
+ *
+ * If multiple event listeners are connected to the same event, no
+ * further event listener will be triggered once any trigger calls
+ * stopPropagation().
+ */
+ public function stopPropagation(): void
+ {
+ $this->propagationStopped = true;
+ }
+ }
+}
diff --git a/vendor/symfony/contracts/EventDispatcher/EventDispatcherInterface.php b/vendor/symfony/contracts/EventDispatcher/EventDispatcherInterface.php
new file mode 100644
index 000000000..2d470af92
--- /dev/null
+++ b/vendor/symfony/contracts/EventDispatcher/EventDispatcherInterface.php
@@ -0,0 +1,58 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Contracts\EventDispatcher;
+
+use Psr\EventDispatcher\EventDispatcherInterface as PsrEventDispatcherInterface;
+
+if (interface_exists(PsrEventDispatcherInterface::class)) {
+ /**
+ * Allows providing hooks on domain-specific lifecycles by dispatching events.
+ */
+ interface EventDispatcherInterface extends PsrEventDispatcherInterface
+ {
+ /**
+ * Dispatches an event to all registered listeners.
+ *
+ * For BC with Symfony 4, the $eventName argument is not declared explicitly on the
+ * signature of the method. Implementations that are not bound by this BC constraint
+ * MUST declare it explicitly, as allowed by PHP.
+ *
+ * @param object $event The event to pass to the event handlers/listeners
+ * @param string|null $eventName The name of the event to dispatch. If not supplied,
+ * the class of $event should be used instead.
+ *
+ * @return object The passed $event MUST be returned
+ */
+ public function dispatch($event/*, string $eventName = null*/);
+ }
+} else {
+ /**
+ * Allows providing hooks on domain-specific lifecycles by dispatching events.
+ */
+ interface EventDispatcherInterface
+ {
+ /**
+ * Dispatches an event to all registered listeners.
+ *
+ * For BC with Symfony 4, the $eventName argument is not declared explicitly on the
+ * signature of the method. Implementations that are not bound by this BC constraint
+ * MUST declare it explicitly, as allowed by PHP.
+ *
+ * @param object $event The event to pass to the event handlers/listeners
+ * @param string|null $eventName The name of the event to dispatch. If not supplied,
+ * the class of $event should be used instead.
+ *
+ * @return object The passed $event MUST be returned
+ */
+ public function dispatch($event/*, string $eventName = null*/);
+ }
+}
diff --git a/vendor/symfony/contracts/EventDispatcher/LICENSE b/vendor/symfony/contracts/EventDispatcher/LICENSE
new file mode 100644
index 000000000..3f853aaf3
--- /dev/null
+++ b/vendor/symfony/contracts/EventDispatcher/LICENSE
@@ -0,0 +1,19 @@
+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
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is furnished
+to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/vendor/symfony/contracts/EventDispatcher/README.md b/vendor/symfony/contracts/EventDispatcher/README.md
new file mode 100644
index 000000000..fb051c73f
--- /dev/null
+++ b/vendor/symfony/contracts/EventDispatcher/README.md
@@ -0,0 +1,9 @@
+Symfony EventDispatcher Contracts
+=================================
+
+A set of abstractions extracted out of the Symfony components.
+
+Can be used to build on semantics that the Symfony components proved useful - and
+that already have battle tested implementations.
+
+See https://github.com/symfony/contracts/blob/master/README.md for more information.
diff --git a/vendor/symfony/contracts/EventDispatcher/composer.json b/vendor/symfony/contracts/EventDispatcher/composer.json
new file mode 100644
index 000000000..55802a491
--- /dev/null
+++ b/vendor/symfony/contracts/EventDispatcher/composer.json
@@ -0,0 +1,34 @@
+{
+ "name": "symfony/event-dispatcher-contracts",
+ "type": "library",
+ "description": "Generic abstractions related to dispatching event",
+ "keywords": ["abstractions", "contracts", "decoupling", "interfaces", "interoperability", "standards"],
+ "homepage": "https://symfony.com",
+ "license": "MIT",
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "require": {
+ "php": "^7.1.3"
+ },
+ "suggest": {
+ "psr/event-dispatcher": "",
+ "symfony/event-dispatcher-implementation": ""
+ },
+ "autoload": {
+ "psr-4": { "Symfony\\Contracts\\EventDispatcher\\": "" }
+ },
+ "minimum-stability": "dev",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.1-dev"
+ }
+ }
+}
diff --git a/vendor/symfony/contracts/HttpClient/.gitignore b/vendor/symfony/contracts/HttpClient/.gitignore
new file mode 100644
index 000000000..c49a5d8df
--- /dev/null
+++ b/vendor/symfony/contracts/HttpClient/.gitignore
@@ -0,0 +1,3 @@
+vendor/
+composer.lock
+phpunit.xml
diff --git a/vendor/symfony/contracts/HttpClient/ChunkInterface.php b/vendor/symfony/contracts/HttpClient/ChunkInterface.php
new file mode 100644
index 000000000..ad5efca9e
--- /dev/null
+++ b/vendor/symfony/contracts/HttpClient/ChunkInterface.php
@@ -0,0 +1,73 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Contracts\HttpClient;
+
+use Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface;
+
+/**
+ * The interface of chunks returned by ResponseStreamInterface::current().
+ *
+ * When the chunk is first, last or timeout, the content MUST be empty.
+ * When an unchecked timeout or a network error occurs, a TransportExceptionInterface
+ * MUST be thrown by the destructor unless one was already thrown by another method.
+ *
+ * @author Nicolas Grekas
+ *
+ * @experimental in 1.1
+ */
+interface ChunkInterface
+{
+ /**
+ * Tells when the idle timeout has been reached.
+ *
+ * @throws TransportExceptionInterface on a network error
+ */
+ public function isTimeout(): bool;
+
+ /**
+ * Tells when headers just arrived.
+ *
+ * @throws TransportExceptionInterface on a network error or when the idle timeout is reached
+ */
+ public function isFirst(): bool;
+
+ /**
+ * Tells when the body just completed.
+ *
+ * @throws TransportExceptionInterface on a network error or when the idle timeout is reached
+ */
+ public function isLast(): bool;
+
+ /**
+ * Returns a [status code, headers] tuple when a 1xx status code was just received.
+ *
+ * @throws TransportExceptionInterface on a network error or when the idle timeout is reached
+ */
+ public function getInformationalStatus(): ?array;
+
+ /**
+ * Returns the content of the response chunk.
+ *
+ * @throws TransportExceptionInterface on a network error or when the idle timeout is reached
+ */
+ public function getContent(): string;
+
+ /**
+ * Returns the offset of the chunk in the response body.
+ */
+ public function getOffset(): int;
+
+ /**
+ * In case of error, returns the message that describes it.
+ */
+ public function getError(): ?string;
+}
diff --git a/vendor/symfony/debug/Exception/OutOfMemoryException.php b/vendor/symfony/contracts/HttpClient/Exception/ClientExceptionInterface.php
similarity index 62%
rename from vendor/symfony/debug/Exception/OutOfMemoryException.php
rename to vendor/symfony/contracts/HttpClient/Exception/ClientExceptionInterface.php
index fec197983..5b5fa5084 100644
--- a/vendor/symfony/debug/Exception/OutOfMemoryException.php
+++ b/vendor/symfony/contracts/HttpClient/Exception/ClientExceptionInterface.php
@@ -9,13 +9,15 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Component\Debug\Exception;
+namespace Symfony\Contracts\HttpClient\Exception;
/**
- * Out of memory exception.
+ * When a 4xx response is returned.
*
* @author Nicolas Grekas
+ *
+ * @experimental in 1.1
*/
-class OutOfMemoryException extends FatalErrorException
+interface ClientExceptionInterface extends HttpExceptionInterface
{
}
diff --git a/vendor/symfony/contracts/HttpClient/Exception/DecodingExceptionInterface.php b/vendor/symfony/contracts/HttpClient/Exception/DecodingExceptionInterface.php
new file mode 100644
index 000000000..709db2189
--- /dev/null
+++ b/vendor/symfony/contracts/HttpClient/Exception/DecodingExceptionInterface.php
@@ -0,0 +1,23 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Contracts\HttpClient\Exception;
+
+/**
+ * When a content-type cannot be decoded to the expected representation.
+ *
+ * @author Nicolas Grekas
+ *
+ * @experimental in 1.1
+ */
+interface DecodingExceptionInterface extends ExceptionInterface
+{
+}
diff --git a/vendor/symfony/contracts/HttpClient/Exception/ExceptionInterface.php b/vendor/symfony/contracts/HttpClient/Exception/ExceptionInterface.php
new file mode 100644
index 000000000..6d59715f7
--- /dev/null
+++ b/vendor/symfony/contracts/HttpClient/Exception/ExceptionInterface.php
@@ -0,0 +1,23 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Contracts\HttpClient\Exception;
+
+/**
+ * The base interface for all exceptions in the contract.
+ *
+ * @author Nicolas Grekas
+ *
+ * @experimental in 1.1
+ */
+interface ExceptionInterface extends \Throwable
+{
+}
diff --git a/vendor/symfony/contracts/HttpClient/Exception/HttpExceptionInterface.php b/vendor/symfony/contracts/HttpClient/Exception/HttpExceptionInterface.php
new file mode 100644
index 000000000..0e9f39f6e
--- /dev/null
+++ b/vendor/symfony/contracts/HttpClient/Exception/HttpExceptionInterface.php
@@ -0,0 +1,26 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Contracts\HttpClient\Exception;
+
+use Symfony\Contracts\HttpClient\ResponseInterface;
+
+/**
+ * Base interface for HTTP-related exceptions.
+ *
+ * @author Anton Chernikov
+ *
+ * @experimental in 1.1
+ */
+interface HttpExceptionInterface extends ExceptionInterface
+{
+ public function getResponse(): ResponseInterface;
+}
diff --git a/vendor/symfony/contracts/HttpClient/Exception/RedirectionExceptionInterface.php b/vendor/symfony/contracts/HttpClient/Exception/RedirectionExceptionInterface.php
new file mode 100644
index 000000000..8cdd3e70d
--- /dev/null
+++ b/vendor/symfony/contracts/HttpClient/Exception/RedirectionExceptionInterface.php
@@ -0,0 +1,23 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Contracts\HttpClient\Exception;
+
+/**
+ * When a 3xx response is returned and the "max_redirects" option has been reached.
+ *
+ * @author Nicolas Grekas
+ *
+ * @experimental in 1.1
+ */
+interface RedirectionExceptionInterface extends HttpExceptionInterface
+{
+}
diff --git a/vendor/symfony/contracts/HttpClient/Exception/ServerExceptionInterface.php b/vendor/symfony/contracts/HttpClient/Exception/ServerExceptionInterface.php
new file mode 100644
index 000000000..f994ba2dd
--- /dev/null
+++ b/vendor/symfony/contracts/HttpClient/Exception/ServerExceptionInterface.php
@@ -0,0 +1,23 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Contracts\HttpClient\Exception;
+
+/**
+ * When a 5xx response is returned.
+ *
+ * @author Nicolas Grekas
+ *
+ * @experimental in 1.1
+ */
+interface ServerExceptionInterface extends HttpExceptionInterface
+{
+}
diff --git a/vendor/symfony/contracts/HttpClient/Exception/TransportExceptionInterface.php b/vendor/symfony/contracts/HttpClient/Exception/TransportExceptionInterface.php
new file mode 100644
index 000000000..1cdc30a2f
--- /dev/null
+++ b/vendor/symfony/contracts/HttpClient/Exception/TransportExceptionInterface.php
@@ -0,0 +1,23 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Contracts\HttpClient\Exception;
+
+/**
+ * When any error happens at the transport level.
+ *
+ * @author Nicolas Grekas
+ *
+ * @experimental in 1.1
+ */
+interface TransportExceptionInterface extends ExceptionInterface
+{
+}
diff --git a/vendor/symfony/contracts/HttpClient/HttpClientInterface.php b/vendor/symfony/contracts/HttpClient/HttpClientInterface.php
new file mode 100644
index 000000000..68afa7811
--- /dev/null
+++ b/vendor/symfony/contracts/HttpClient/HttpClientInterface.php
@@ -0,0 +1,95 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Contracts\HttpClient;
+
+use Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface;
+use Symfony\Contracts\HttpClient\Test\HttpClientTestCase;
+
+/**
+ * Provides flexible methods for requesting HTTP resources synchronously or asynchronously.
+ *
+ * @see HttpClientTestCase for a reference test suite
+ *
+ * @author Nicolas Grekas
+ *
+ * @experimental in 1.1
+ */
+interface HttpClientInterface
+{
+ public const OPTIONS_DEFAULTS = [
+ 'auth_basic' => null, // array|string - an array containing the username as first value, and optionally the
+ // password as the second one; or string like username:password - enabling HTTP Basic
+ // authentication (RFC 7617)
+ 'auth_bearer' => null, // string - a token enabling HTTP Bearer authorization (RFC 6750)
+ 'query' => [], // string[] - associative array of query string values to merge with the request's URL
+ 'headers' => [], // iterable|string[]|string[][] - headers names provided as keys or as part of values
+ 'body' => '', // array|string|resource|\Traversable|\Closure - the callback SHOULD yield a string
+ // smaller than the amount requested as argument; the empty string signals EOF; if
+ // an array is passed, it is meant as a form payload of field names and values
+ 'json' => null, // mixed - if set, implementations MUST set the "body" option to the JSON-encoded
+ // value and set the "content-type" header to a JSON-compatible value if it is not
+ // explicitly defined in the headers option - typically "application/json"
+ 'user_data' => null, // mixed - any extra data to attach to the request (scalar, callable, object...) that
+ // MUST be available via $response->getInfo('user_data') - not used internally
+ 'max_redirects' => 20, // int - the maximum number of redirects to follow; a value lower than or equal to 0
+ // means redirects should not be followed; "Authorization" and "Cookie" headers MUST
+ // NOT follow except for the initial host name
+ 'http_version' => null, // string - defaults to the best supported version, typically 1.1 or 2.0
+ 'base_uri' => null, // string - the URI to resolve relative URLs, following rules in RFC 3986, section 2
+ 'buffer' => true, // bool|resource|\Closure - whether the content of the response should be buffered or not,
+ // or a stream resource where the response body should be written,
+ // or a closure telling if/where the response should be buffered based on its headers
+ 'on_progress' => null, // callable(int $dlNow, int $dlSize, array $info) - throwing any exceptions MUST abort
+ // the request; it MUST be called on DNS resolution, on arrival of headers and on
+ // completion; it SHOULD be called on upload/download of data and at least 1/s
+ 'resolve' => [], // string[] - a map of host to IP address that SHOULD replace DNS resolution
+ 'proxy' => null, // string - by default, the proxy-related env vars handled by curl SHOULD be honored
+ 'no_proxy' => null, // string - a comma separated list of hosts that do not require a proxy to be reached
+ 'timeout' => null, // float - the idle timeout - defaults to ini_get('default_socket_timeout')
+ 'max_duration' => 0, // float - the maximum execution time for the request+response as a whole;
+ // a value lower than or equal to 0 means it is unlimited
+ 'bindto' => '0', // string - the interface or the local socket to bind to
+ 'verify_peer' => true, // see https://php.net/context.ssl for the following options
+ 'verify_host' => true,
+ 'cafile' => null,
+ 'capath' => null,
+ 'local_cert' => null,
+ 'local_pk' => null,
+ 'passphrase' => null,
+ 'ciphers' => null,
+ 'peer_fingerprint' => null,
+ 'capture_peer_cert_chain' => false,
+ 'extra' => [], // array - additional options that can be ignored if unsupported, unlike regular options
+ ];
+
+ /**
+ * Requests an HTTP resource.
+ *
+ * Responses MUST be lazy, but their status code MUST be
+ * checked even if none of their public methods are called.
+ *
+ * Implementations are not required to support all options described above; they can also
+ * support more custom options; but in any case, they MUST throw a TransportExceptionInterface
+ * when an unsupported option is passed.
+ *
+ * @throws TransportExceptionInterface When an unsupported option is passed
+ */
+ public function request(string $method, string $url, array $options = []): ResponseInterface;
+
+ /**
+ * Yields responses chunk by chunk as they complete.
+ *
+ * @param ResponseInterface|ResponseInterface[]|iterable $responses One or more responses created by the current HTTP client
+ * @param float|null $timeout The idle timeout before yielding timeout chunks
+ */
+ public function stream($responses, float $timeout = null): ResponseStreamInterface;
+}
diff --git a/vendor/symfony/contracts/HttpClient/LICENSE b/vendor/symfony/contracts/HttpClient/LICENSE
new file mode 100644
index 000000000..3f853aaf3
--- /dev/null
+++ b/vendor/symfony/contracts/HttpClient/LICENSE
@@ -0,0 +1,19 @@
+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
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is furnished
+to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/vendor/symfony/contracts/HttpClient/README.md b/vendor/symfony/contracts/HttpClient/README.md
new file mode 100644
index 000000000..01f811894
--- /dev/null
+++ b/vendor/symfony/contracts/HttpClient/README.md
@@ -0,0 +1,9 @@
+Symfony HttpClient Contracts
+============================
+
+A set of abstractions extracted out of the Symfony components.
+
+Can be used to build on semantics that the Symfony components proved useful - and
+that already have battle tested implementations.
+
+See https://github.com/symfony/contracts/blob/master/README.md for more information.
diff --git a/vendor/symfony/contracts/HttpClient/ResponseInterface.php b/vendor/symfony/contracts/HttpClient/ResponseInterface.php
new file mode 100644
index 000000000..b9917ac5f
--- /dev/null
+++ b/vendor/symfony/contracts/HttpClient/ResponseInterface.php
@@ -0,0 +1,111 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Contracts\HttpClient;
+
+use Symfony\Contracts\HttpClient\Exception\ClientExceptionInterface;
+use Symfony\Contracts\HttpClient\Exception\DecodingExceptionInterface;
+use Symfony\Contracts\HttpClient\Exception\ExceptionInterface;
+use Symfony\Contracts\HttpClient\Exception\RedirectionExceptionInterface;
+use Symfony\Contracts\HttpClient\Exception\ServerExceptionInterface;
+use Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface;
+
+/**
+ * A (lazily retrieved) HTTP response.
+ *
+ * @author Nicolas Grekas
+ *
+ * @experimental in 1.1
+ */
+interface ResponseInterface
+{
+ /**
+ * Gets the HTTP status code of the response.
+ *
+ * @throws TransportExceptionInterface when a network error occurs
+ */
+ public function getStatusCode(): int;
+
+ /**
+ * Gets the HTTP headers of the response.
+ *
+ * @param bool $throw Whether an exception should be thrown on 3/4/5xx status codes
+ *
+ * @return string[][] The headers of the response keyed by header names in lowercase
+ *
+ * @throws TransportExceptionInterface When a network error occurs
+ * @throws RedirectionExceptionInterface On a 3xx when $throw is true and the "max_redirects" option has been reached
+ * @throws ClientExceptionInterface On a 4xx when $throw is true
+ * @throws ServerExceptionInterface On a 5xx when $throw is true
+ */
+ public function getHeaders(bool $throw = true): array;
+
+ /**
+ * Gets the response body as a string.
+ *
+ * @param bool $throw Whether an exception should be thrown on 3/4/5xx status codes
+ *
+ * @throws TransportExceptionInterface When a network error occurs
+ * @throws RedirectionExceptionInterface On a 3xx when $throw is true and the "max_redirects" option has been reached
+ * @throws ClientExceptionInterface On a 4xx when $throw is true
+ * @throws ServerExceptionInterface On a 5xx when $throw is true
+ */
+ public function getContent(bool $throw = true): string;
+
+ /**
+ * Gets the response body decoded as array, typically from a JSON payload.
+ *
+ * @param bool $throw Whether an exception should be thrown on 3/4/5xx status codes
+ *
+ * @throws DecodingExceptionInterface When the body cannot be decoded to an array
+ * @throws TransportExceptionInterface When a network error occurs
+ * @throws RedirectionExceptionInterface On a 3xx when $throw is true and the "max_redirects" option has been reached
+ * @throws ClientExceptionInterface On a 4xx when $throw is true
+ * @throws ServerExceptionInterface On a 5xx when $throw is true
+ */
+ public function toArray(bool $throw = true): array;
+
+ /**
+ * Closes the response stream and all related buffers.
+ *
+ * No further chunk will be yielded after this method has been called.
+ */
+ public function cancel(): void;
+
+ /**
+ * Returns info coming from the transport layer.
+ *
+ * This method SHOULD NOT throw any ExceptionInterface and SHOULD be non-blocking.
+ * The returned info is "live": it can be empty and can change from one call to
+ * another, as the request/response progresses.
+ *
+ * The following info MUST be returned:
+ * - canceled (bool) - true if the response was canceled using ResponseInterface::cancel(), false otherwise
+ * - error (string|null) - the error message when the transfer was aborted, null otherwise
+ * - http_code (int) - the last response code or 0 when it is not known yet
+ * - http_method (string) - the HTTP verb of the last request
+ * - redirect_count (int) - the number of redirects followed while executing the request
+ * - redirect_url (string|null) - the resolved location of redirect responses, null otherwise
+ * - response_headers (array) - an array modelled after the special $http_response_header variable
+ * - start_time (float) - the time when the request was sent or 0.0 when it's pending
+ * - url (string) - the last effective URL of the request
+ * - user_data (mixed|null) - the value of the "user_data" request option, null if not set
+ *
+ * When the "capture_peer_cert_chain" option is true, the "peer_certificate_chain"
+ * attribute SHOULD list the peer certificates as an array of OpenSSL X.509 resources.
+ *
+ * Other info SHOULD be named after curl_getinfo()'s associative return value.
+ *
+ * @return array|mixed|null An array of all available info, or one of them when $type is
+ * provided, or null when an unsupported type is requested
+ */
+ public function getInfo(string $type = null);
+}
diff --git a/vendor/symfony/contracts/HttpClient/ResponseStreamInterface.php b/vendor/symfony/contracts/HttpClient/ResponseStreamInterface.php
new file mode 100644
index 000000000..dfff554df
--- /dev/null
+++ b/vendor/symfony/contracts/HttpClient/ResponseStreamInterface.php
@@ -0,0 +1,26 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Contracts\HttpClient;
+
+/**
+ * Yields response chunks, returned by HttpClientInterface::stream().
+ *
+ * @author Nicolas Grekas
+ *
+ * @experimental in 1.1
+ */
+interface ResponseStreamInterface extends \Iterator
+{
+ public function key(): ResponseInterface;
+
+ public function current(): ChunkInterface;
+}
diff --git a/vendor/symfony/contracts/HttpClient/Test/Fixtures/web/index.php b/vendor/symfony/contracts/HttpClient/Test/Fixtures/web/index.php
new file mode 100644
index 000000000..d3c4f0f1d
--- /dev/null
+++ b/vendor/symfony/contracts/HttpClient/Test/Fixtures/web/index.php
@@ -0,0 +1,162 @@
+ $v) {
+ switch ($k) {
+ default:
+ if (0 !== strpos($k, 'HTTP_')) {
+ continue 2;
+ }
+ // no break
+ case 'SERVER_NAME':
+ case 'SERVER_PROTOCOL':
+ case 'REQUEST_URI':
+ case 'REQUEST_METHOD':
+ case 'PHP_AUTH_USER':
+ case 'PHP_AUTH_PW':
+ $vars[$k] = $v;
+ }
+}
+
+$json = json_encode($vars, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
+
+switch ($vars['REQUEST_URI']) {
+ default:
+ exit;
+
+ case '/head':
+ header('Content-Length: '.strlen($json), true);
+ break;
+
+ case '/':
+ case '/?a=a&b=b':
+ case 'http://127.0.0.1:8057/':
+ case 'http://localhost:8057/':
+ ob_start('ob_gzhandler');
+ break;
+
+ case '/103':
+ header('HTTP/1.1 103 Early Hints');
+ header('Link: ; rel=preload; as=style', false);
+ header('Link: ; rel=preload; as=script', false);
+ flush();
+ usleep(1000);
+ echo "HTTP/1.1 200 OK\r\n";
+ echo "Date: Fri, 26 May 2017 10:02:11 GMT\r\n";
+ echo "Content-Length: 13\r\n";
+ echo "\r\n";
+ echo 'Here the body';
+ exit;
+
+ case '/404':
+ header('Content-Type: application/json', true, 404);
+ break;
+
+ case '/301':
+ if ('Basic Zm9vOmJhcg==' === $vars['HTTP_AUTHORIZATION']) {
+ header('Location: http://127.0.0.1:8057/302', true, 301);
+ }
+ break;
+
+ case '/301/bad-tld':
+ header('Location: http://foo.example.', true, 301);
+ break;
+
+ case '/301/invalid':
+ header('Location: //?foo=bar', true, 301);
+ break;
+
+ case '/302':
+ if (!isset($vars['HTTP_AUTHORIZATION'])) {
+ header('Location: http://localhost:8057/', true, 302);
+ }
+ break;
+
+ case '/302/relative':
+ header('Location: ..', true, 302);
+ break;
+
+ case '/304':
+ header('Content-Length: 10', true, 304);
+ echo '12345';
+
+ return;
+
+ case '/307':
+ header('Location: http://localhost:8057/post', true, 307);
+ break;
+
+ case '/length-broken':
+ header('Content-Length: 1000');
+ break;
+
+ case '/post':
+ $output = json_encode($_POST + ['REQUEST_METHOD' => $vars['REQUEST_METHOD']], JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
+ header('Content-Type: application/json', true);
+ header('Content-Length: '.strlen($output));
+ echo $output;
+ exit;
+
+ case '/timeout-header':
+ usleep(300000);
+ break;
+
+ case '/timeout-body':
+ echo '<1>';
+ @ob_flush();
+ flush();
+ usleep(500000);
+ echo '<2>';
+ exit;
+
+ case '/timeout-long':
+ ignore_user_abort(false);
+ sleep(1);
+ while (true) {
+ echo '<1>';
+ @ob_flush();
+ flush();
+ usleep(500);
+ }
+ exit;
+
+ case '/chunked':
+ header('Transfer-Encoding: chunked');
+ echo "8\r\nSymfony \r\n5\r\nis aw\r\n6\r\nesome!\r\n0\r\n\r\n";
+ exit;
+
+ case '/chunked-broken':
+ header('Transfer-Encoding: chunked');
+ echo "8\r\nSymfony \r\n5\r\nis aw\r\n6\r\ne";
+ exit;
+
+ case '/gzip-broken':
+ header('Content-Encoding: gzip');
+ echo str_repeat('-', 1000);
+ exit;
+
+ case '/max-duration':
+ ignore_user_abort(false);
+ while (true) {
+ echo '<1>';
+ @ob_flush();
+ flush();
+ usleep(500);
+ }
+ exit;
+}
+
+header('Content-Type: application/json', true);
+
+echo $json;
diff --git a/vendor/symfony/contracts/HttpClient/Test/HttpClientTestCase.php b/vendor/symfony/contracts/HttpClient/Test/HttpClientTestCase.php
new file mode 100644
index 000000000..4badb4c35
--- /dev/null
+++ b/vendor/symfony/contracts/HttpClient/Test/HttpClientTestCase.php
@@ -0,0 +1,953 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Contracts\HttpClient\Test;
+
+use PHPUnit\Framework\TestCase;
+use Symfony\Contracts\HttpClient\Exception\ClientExceptionInterface;
+use Symfony\Contracts\HttpClient\Exception\RedirectionExceptionInterface;
+use Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface;
+use Symfony\Contracts\HttpClient\HttpClientInterface;
+
+/**
+ * A reference test suite for HttpClientInterface implementations.
+ *
+ * @experimental in 1.1
+ */
+abstract class HttpClientTestCase extends TestCase
+{
+ private static $server;
+
+ public static function setUpBeforeClass(): void
+ {
+ TestHttpServer::start();
+ }
+
+ abstract protected function getHttpClient(string $testCase): HttpClientInterface;
+
+ public function testGetRequest()
+ {
+ $client = $this->getHttpClient(__FUNCTION__);
+ $response = $client->request('GET', 'http://localhost:8057', [
+ 'headers' => ['Foo' => 'baR'],
+ 'user_data' => $data = new \stdClass(),
+ ]);
+
+ $this->assertSame([], $response->getInfo('response_headers'));
+ $this->assertSame($data, $response->getInfo()['user_data']);
+ $this->assertSame(200, $response->getStatusCode());
+
+ $info = $response->getInfo();
+ $this->assertNull($info['error']);
+ $this->assertSame(0, $info['redirect_count']);
+ $this->assertSame('HTTP/1.1 200 OK', $info['response_headers'][0]);
+ $this->assertSame('Host: localhost:8057', $info['response_headers'][1]);
+ $this->assertSame('http://localhost:8057/', $info['url']);
+
+ $headers = $response->getHeaders();
+
+ $this->assertSame('localhost:8057', $headers['host'][0]);
+ $this->assertSame(['application/json'], $headers['content-type']);
+
+ $body = json_decode($response->getContent(), true);
+ $this->assertSame($body, $response->toArray());
+
+ $this->assertSame('HTTP/1.1', $body['SERVER_PROTOCOL']);
+ $this->assertSame('/', $body['REQUEST_URI']);
+ $this->assertSame('GET', $body['REQUEST_METHOD']);
+ $this->assertSame('localhost:8057', $body['HTTP_HOST']);
+ $this->assertSame('baR', $body['HTTP_FOO']);
+
+ $response = $client->request('GET', 'http://localhost:8057/length-broken');
+
+ $this->expectException(TransportExceptionInterface::class);
+ $response->getContent();
+ }
+
+ public function testHeadRequest()
+ {
+ $client = $this->getHttpClient(__FUNCTION__);
+ $response = $client->request('HEAD', 'http://localhost:8057/head', [
+ 'headers' => ['Foo' => 'baR'],
+ 'user_data' => $data = new \stdClass(),
+ 'buffer' => false,
+ ]);
+
+ $this->assertSame([], $response->getInfo('response_headers'));
+ $this->assertSame(200, $response->getStatusCode());
+
+ $info = $response->getInfo();
+ $this->assertSame('HTTP/1.1 200 OK', $info['response_headers'][0]);
+ $this->assertSame('Host: localhost:8057', $info['response_headers'][1]);
+
+ $headers = $response->getHeaders();
+
+ $this->assertSame('localhost:8057', $headers['host'][0]);
+ $this->assertSame(['application/json'], $headers['content-type']);
+ $this->assertTrue(0 < $headers['content-length'][0]);
+
+ $this->assertSame('', $response->getContent());
+ }
+
+ public function testNonBufferedGetRequest()
+ {
+ $client = $this->getHttpClient(__FUNCTION__);
+ $response = $client->request('GET', 'http://localhost:8057', [
+ 'buffer' => false,
+ 'headers' => ['Foo' => 'baR'],
+ ]);
+
+ $body = $response->toArray();
+ $this->assertSame('baR', $body['HTTP_FOO']);
+
+ $this->expectException(TransportExceptionInterface::class);
+ $response->getContent();
+ }
+
+ public function testBufferSink()
+ {
+ $sink = fopen('php://temp', 'w+');
+ $client = $this->getHttpClient(__FUNCTION__);
+ $response = $client->request('GET', 'http://localhost:8057', [
+ 'buffer' => $sink,
+ 'headers' => ['Foo' => 'baR'],
+ ]);
+
+ $body = $response->toArray();
+ $this->assertSame('baR', $body['HTTP_FOO']);
+
+ rewind($sink);
+ $sink = stream_get_contents($sink);
+ $this->assertSame($sink, $response->getContent());
+ }
+
+ public function testConditionalBuffering()
+ {
+ $client = $this->getHttpClient(__FUNCTION__);
+ $response = $client->request('GET', 'http://localhost:8057');
+ $firstContent = $response->getContent();
+ $secondContent = $response->getContent();
+
+ $this->assertSame($firstContent, $secondContent);
+
+ $response = $client->request('GET', 'http://localhost:8057', ['buffer' => function () { return false; }]);
+ $response->getContent();
+
+ $this->expectException(TransportExceptionInterface::class);
+ $response->getContent();
+ }
+
+ public function testReentrantBufferCallback()
+ {
+ $client = $this->getHttpClient(__FUNCTION__);
+
+ $response = $client->request('GET', 'http://localhost:8057', ['buffer' => function () use (&$response) {
+ $response->cancel();
+
+ return true;
+ }]);
+
+ $this->assertSame(200, $response->getStatusCode());
+
+ $this->expectException(TransportExceptionInterface::class);
+ $response->getContent();
+ }
+
+ public function testThrowingBufferCallback()
+ {
+ $client = $this->getHttpClient(__FUNCTION__);
+
+ $response = $client->request('GET', 'http://localhost:8057', ['buffer' => function () {
+ throw new \Exception('Boo');
+ }]);
+
+ $this->assertSame(200, $response->getStatusCode());
+
+ $this->expectException(TransportExceptionInterface::class);
+ $this->expectExceptionMessage('Boo');
+ $response->getContent();
+ }
+
+ public function testUnsupportedOption()
+ {
+ $client = $this->getHttpClient(__FUNCTION__);
+
+ $this->expectException(\InvalidArgumentException::class);
+ $client->request('GET', 'http://localhost:8057', [
+ 'capture_peer_cert' => 1.0,
+ ]);
+ }
+
+ public function testHttpVersion()
+ {
+ $client = $this->getHttpClient(__FUNCTION__);
+ $response = $client->request('GET', 'http://localhost:8057', [
+ 'http_version' => 1.0,
+ ]);
+
+ $this->assertSame(200, $response->getStatusCode());
+ $this->assertSame('HTTP/1.0 200 OK', $response->getInfo('response_headers')[0]);
+
+ $body = $response->toArray();
+
+ $this->assertSame('HTTP/1.0', $body['SERVER_PROTOCOL']);
+ $this->assertSame('GET', $body['REQUEST_METHOD']);
+ $this->assertSame('/', $body['REQUEST_URI']);
+ }
+
+ public function testChunkedEncoding()
+ {
+ $client = $this->getHttpClient(__FUNCTION__);
+ $response = $client->request('GET', 'http://localhost:8057/chunked');
+
+ $this->assertSame(['chunked'], $response->getHeaders()['transfer-encoding']);
+ $this->assertSame('Symfony is awesome!', $response->getContent());
+
+ $response = $client->request('GET', 'http://localhost:8057/chunked-broken');
+
+ $this->expectException(TransportExceptionInterface::class);
+ $response->getContent();
+ }
+
+ public function testClientError()
+ {
+ $client = $this->getHttpClient(__FUNCTION__);
+ $response = $client->request('GET', 'http://localhost:8057/404');
+
+ $client->stream($response)->valid();
+
+ $this->assertSame(404, $response->getInfo('http_code'));
+
+ try {
+ $response->getHeaders();
+ $this->fail(ClientExceptionInterface::class.' expected');
+ } catch (ClientExceptionInterface $e) {
+ }
+
+ try {
+ $response->getContent();
+ $this->fail(ClientExceptionInterface::class.' expected');
+ } catch (ClientExceptionInterface $e) {
+ }
+
+ $this->assertSame(404, $response->getStatusCode());
+ $this->assertSame(['application/json'], $response->getHeaders(false)['content-type']);
+ $this->assertNotEmpty($response->getContent(false));
+
+ $response = $client->request('GET', 'http://localhost:8057/404');
+
+ try {
+ foreach ($client->stream($response) as $chunk) {
+ $this->assertTrue($chunk->isFirst());
+ }
+ $this->fail(ClientExceptionInterface::class.' expected');
+ } catch (ClientExceptionInterface $e) {
+ }
+ }
+
+ public function testIgnoreErrors()
+ {
+ $client = $this->getHttpClient(__FUNCTION__);
+ $response = $client->request('GET', 'http://localhost:8057/404');
+
+ $this->assertSame(404, $response->getStatusCode());
+ }
+
+ public function testDnsError()
+ {
+ $client = $this->getHttpClient(__FUNCTION__);
+ $response = $client->request('GET', 'http://localhost:8057/301/bad-tld');
+
+ try {
+ $response->getStatusCode();
+ $this->fail(TransportExceptionInterface::class.' expected');
+ } catch (TransportExceptionInterface $e) {
+ $this->addToAssertionCount(1);
+ }
+
+ try {
+ $response->getStatusCode();
+ $this->fail(TransportExceptionInterface::class.' still expected');
+ } catch (TransportExceptionInterface $e) {
+ $this->addToAssertionCount(1);
+ }
+
+ $response = $client->request('GET', 'http://localhost:8057/301/bad-tld');
+
+ try {
+ foreach ($client->stream($response) as $r => $chunk) {
+ }
+ $this->fail(TransportExceptionInterface::class.' expected');
+ } catch (TransportExceptionInterface $e) {
+ $this->addToAssertionCount(1);
+ }
+
+ $this->assertSame($response, $r);
+ $this->assertNotNull($chunk->getError());
+
+ $this->expectException(TransportExceptionInterface::class);
+ foreach ($client->stream($response) as $chunk) {
+ }
+ }
+
+ public function testInlineAuth()
+ {
+ $client = $this->getHttpClient(__FUNCTION__);
+ $response = $client->request('GET', 'http://foo:bar%3Dbar@localhost:8057');
+
+ $body = $response->toArray();
+
+ $this->assertSame('foo', $body['PHP_AUTH_USER']);
+ $this->assertSame('bar=bar', $body['PHP_AUTH_PW']);
+ }
+
+ public function testBadRequestBody()
+ {
+ $client = $this->getHttpClient(__FUNCTION__);
+
+ $this->expectException(TransportExceptionInterface::class);
+
+ $response = $client->request('POST', 'http://localhost:8057/', [
+ 'body' => function () { yield []; },
+ ]);
+
+ $response->getStatusCode();
+ }
+
+ public function test304()
+ {
+ $client = $this->getHttpClient(__FUNCTION__);
+ $response = $client->request('GET', 'http://localhost:8057/304', [
+ 'headers' => ['If-Match' => '"abc"'],
+ 'buffer' => false,
+ ]);
+
+ $this->assertSame(304, $response->getStatusCode());
+ $this->assertSame('', $response->getContent(false));
+ }
+
+ public function testRedirects()
+ {
+ $client = $this->getHttpClient(__FUNCTION__);
+ $response = $client->request('POST', 'http://localhost:8057/301', [
+ 'auth_basic' => 'foo:bar',
+ 'body' => function () {
+ yield 'foo=bar';
+ },
+ ]);
+
+ $body = $response->toArray();
+ $this->assertSame('GET', $body['REQUEST_METHOD']);
+ $this->assertSame('Basic Zm9vOmJhcg==', $body['HTTP_AUTHORIZATION']);
+ $this->assertSame('http://localhost:8057/', $response->getInfo('url'));
+
+ $this->assertSame(2, $response->getInfo('redirect_count'));
+ $this->assertNull($response->getInfo('redirect_url'));
+
+ $expected = [
+ 'HTTP/1.1 301 Moved Permanently',
+ 'Location: http://127.0.0.1:8057/302',
+ 'Content-Type: application/json',
+ 'HTTP/1.1 302 Found',
+ 'Location: http://localhost:8057/',
+ 'Content-Type: application/json',
+ 'HTTP/1.1 200 OK',
+ 'Content-Type: application/json',
+ ];
+
+ $filteredHeaders = array_values(array_filter($response->getInfo('response_headers'), function ($h) {
+ return \in_array(substr($h, 0, 4), ['HTTP', 'Loca', 'Cont'], true) && 'Content-Encoding: gzip' !== $h;
+ }));
+
+ $this->assertSame($expected, $filteredHeaders);
+ }
+
+ public function testInvalidRedirect()
+ {
+ $client = $this->getHttpClient(__FUNCTION__);
+ $response = $client->request('GET', 'http://localhost:8057/301/invalid');
+
+ $this->assertSame(301, $response->getStatusCode());
+ $this->assertSame(['//?foo=bar'], $response->getHeaders(false)['location']);
+ $this->assertSame(0, $response->getInfo('redirect_count'));
+ $this->assertNull($response->getInfo('redirect_url'));
+
+ $this->expectException(RedirectionExceptionInterface::class);
+ $response->getHeaders();
+ }
+
+ public function testRelativeRedirects()
+ {
+ $client = $this->getHttpClient(__FUNCTION__);
+ $response = $client->request('GET', 'http://localhost:8057/302/relative');
+
+ $body = $response->toArray();
+
+ $this->assertSame('/', $body['REQUEST_URI']);
+ $this->assertNull($response->getInfo('redirect_url'));
+
+ $response = $client->request('GET', 'http://localhost:8057/302/relative', [
+ 'max_redirects' => 0,
+ ]);
+
+ $this->assertSame(302, $response->getStatusCode());
+ $this->assertSame('http://localhost:8057/', $response->getInfo('redirect_url'));
+ }
+
+ public function testRedirect307()
+ {
+ $client = $this->getHttpClient(__FUNCTION__);
+
+ $response = $client->request('POST', 'http://localhost:8057/307', [
+ 'body' => function () {
+ yield 'foo=bar';
+ },
+ 'max_redirects' => 0,
+ ]);
+
+ $this->assertSame(307, $response->getStatusCode());
+
+ $response = $client->request('POST', 'http://localhost:8057/307', [
+ 'body' => 'foo=bar',
+ ]);
+
+ $body = $response->toArray();
+
+ $this->assertSame(['foo' => 'bar', 'REQUEST_METHOD' => 'POST'], $body);
+ }
+
+ public function testMaxRedirects()
+ {
+ $client = $this->getHttpClient(__FUNCTION__);
+ $response = $client->request('GET', 'http://localhost:8057/301', [
+ 'max_redirects' => 1,
+ 'auth_basic' => 'foo:bar',
+ ]);
+
+ try {
+ $response->getHeaders();
+ $this->fail(RedirectionExceptionInterface::class.' expected');
+ } catch (RedirectionExceptionInterface $e) {
+ }
+
+ $this->assertSame(302, $response->getStatusCode());
+ $this->assertSame(1, $response->getInfo('redirect_count'));
+ $this->assertSame('http://localhost:8057/', $response->getInfo('redirect_url'));
+
+ $expected = [
+ 'HTTP/1.1 301 Moved Permanently',
+ 'Location: http://127.0.0.1:8057/302',
+ 'Content-Type: application/json',
+ 'HTTP/1.1 302 Found',
+ 'Location: http://localhost:8057/',
+ 'Content-Type: application/json',
+ ];
+
+ $filteredHeaders = array_values(array_filter($response->getInfo('response_headers'), function ($h) {
+ return \in_array(substr($h, 0, 4), ['HTTP', 'Loca', 'Cont'], true);
+ }));
+
+ $this->assertSame($expected, $filteredHeaders);
+ }
+
+ public function testStream()
+ {
+ $client = $this->getHttpClient(__FUNCTION__);
+
+ $response = $client->request('GET', 'http://localhost:8057');
+ $chunks = $client->stream($response);
+ $result = [];
+
+ foreach ($chunks as $r => $chunk) {
+ if ($chunk->isTimeout()) {
+ $result[] = 't';
+ } elseif ($chunk->isLast()) {
+ $result[] = 'l';
+ } elseif ($chunk->isFirst()) {
+ $result[] = 'f';
+ }
+ }
+
+ $this->assertSame($response, $r);
+ $this->assertSame(['f', 'l'], $result);
+
+ $chunk = null;
+ $i = 0;
+
+ foreach ($client->stream($response) as $chunk) {
+ ++$i;
+ }
+
+ $this->assertSame(1, $i);
+ $this->assertTrue($chunk->isLast());
+ }
+
+ public function testAddToStream()
+ {
+ $client = $this->getHttpClient(__FUNCTION__);
+
+ $r1 = $client->request('GET', 'http://localhost:8057');
+
+ $completed = [];
+
+ $pool = [$r1];
+
+ while ($pool) {
+ $chunks = $client->stream($pool);
+ $pool = [];
+
+ foreach ($chunks as $r => $chunk) {
+ if (!$chunk->isLast()) {
+ continue;
+ }
+
+ if ($r1 === $r) {
+ $r2 = $client->request('GET', 'http://localhost:8057');
+ $pool[] = $r2;
+ }
+
+ $completed[] = $r;
+ }
+ }
+
+ $this->assertSame([$r1, $r2], $completed);
+ }
+
+ public function testCompleteTypeError()
+ {
+ $client = $this->getHttpClient(__FUNCTION__);
+
+ $this->expectException(\TypeError::class);
+ $client->stream(123);
+ }
+
+ public function testOnProgress()
+ {
+ $client = $this->getHttpClient(__FUNCTION__);
+ $response = $client->request('POST', 'http://localhost:8057/post', [
+ 'headers' => ['Content-Length' => 14],
+ 'body' => 'foo=0123456789',
+ 'on_progress' => function (...$state) use (&$steps) { $steps[] = $state; },
+ ]);
+
+ $body = $response->toArray();
+
+ $this->assertSame(['foo' => '0123456789', 'REQUEST_METHOD' => 'POST'], $body);
+ $this->assertSame([0, 0], \array_slice($steps[0], 0, 2));
+ $lastStep = \array_slice($steps, -1)[0];
+ $this->assertSame([57, 57], \array_slice($lastStep, 0, 2));
+ $this->assertSame('http://localhost:8057/post', $steps[0][2]['url']);
+ }
+
+ public function testPostJson()
+ {
+ $client = $this->getHttpClient(__FUNCTION__);
+
+ $response = $client->request('POST', 'http://localhost:8057/post', [
+ 'json' => ['foo' => 'bar'],
+ ]);
+
+ $body = $response->toArray();
+
+ $this->assertStringContainsString('json', $body['content-type']);
+ unset($body['content-type']);
+ $this->assertSame(['foo' => 'bar', 'REQUEST_METHOD' => 'POST'], $body);
+ }
+
+ public function testPostArray()
+ {
+ $client = $this->getHttpClient(__FUNCTION__);
+
+ $response = $client->request('POST', 'http://localhost:8057/post', [
+ 'body' => ['foo' => 'bar'],
+ ]);
+
+ $this->assertSame(['foo' => 'bar', 'REQUEST_METHOD' => 'POST'], $response->toArray());
+ }
+
+ public function testPostResource()
+ {
+ $client = $this->getHttpClient(__FUNCTION__);
+
+ $h = fopen('php://temp', 'w+');
+ fwrite($h, 'foo=0123456789');
+ rewind($h);
+
+ $response = $client->request('POST', 'http://localhost:8057/post', [
+ 'body' => $h,
+ ]);
+
+ $body = $response->toArray();
+
+ $this->assertSame(['foo' => '0123456789', 'REQUEST_METHOD' => 'POST'], $body);
+ }
+
+ public function testPostCallback()
+ {
+ $client = $this->getHttpClient(__FUNCTION__);
+
+ $response = $client->request('POST', 'http://localhost:8057/post', [
+ 'body' => function () {
+ yield 'foo';
+ yield '';
+ yield '=';
+ yield '0123456789';
+ },
+ ]);
+
+ $this->assertSame(['foo' => '0123456789', 'REQUEST_METHOD' => 'POST'], $response->toArray());
+ }
+
+ public function testCancel()
+ {
+ $client = $this->getHttpClient(__FUNCTION__);
+ $response = $client->request('GET', 'http://localhost:8057/timeout-header');
+
+ $response->cancel();
+ $this->expectException(TransportExceptionInterface::class);
+ $response->getHeaders();
+ }
+
+ public function testInfoOnCanceledResponse()
+ {
+ $client = $this->getHttpClient(__FUNCTION__);
+
+ $response = $client->request('GET', 'http://localhost:8057/timeout-header');
+
+ $this->assertFalse($response->getInfo('canceled'));
+ $response->cancel();
+ $this->assertTrue($response->getInfo('canceled'));
+ }
+
+ public function testCancelInStream()
+ {
+ $client = $this->getHttpClient(__FUNCTION__);
+ $response = $client->request('GET', 'http://localhost:8057/404');
+
+ foreach ($client->stream($response) as $chunk) {
+ $response->cancel();
+ }
+
+ $this->expectException(TransportExceptionInterface::class);
+
+ foreach ($client->stream($response) as $chunk) {
+ }
+ }
+
+ public function testOnProgressCancel()
+ {
+ $client = $this->getHttpClient(__FUNCTION__);
+ $response = $client->request('GET', 'http://localhost:8057/timeout-body', [
+ 'on_progress' => function ($dlNow) {
+ if (0 < $dlNow) {
+ throw new \Exception('Aborting the request');
+ }
+ },
+ ]);
+
+ try {
+ foreach ($client->stream([$response]) as $chunk) {
+ }
+ $this->fail(ClientExceptionInterface::class.' expected');
+ } catch (TransportExceptionInterface $e) {
+ $this->assertSame('Aborting the request', $e->getPrevious()->getMessage());
+ }
+
+ $this->assertNotNull($response->getInfo('error'));
+ $this->expectException(TransportExceptionInterface::class);
+ $response->getContent();
+ }
+
+ public function testOnProgressError()
+ {
+ $client = $this->getHttpClient(__FUNCTION__);
+ $response = $client->request('GET', 'http://localhost:8057/timeout-body', [
+ 'on_progress' => function ($dlNow) {
+ if (0 < $dlNow) {
+ throw new \Error('BUG');
+ }
+ },
+ ]);
+
+ try {
+ foreach ($client->stream([$response]) as $chunk) {
+ }
+ $this->fail('Error expected');
+ } catch (\Error $e) {
+ $this->assertSame('BUG', $e->getMessage());
+ }
+
+ $this->assertNotNull($response->getInfo('error'));
+ $this->expectException(TransportExceptionInterface::class);
+ $response->getContent();
+ }
+
+ public function testResolve()
+ {
+ $client = $this->getHttpClient(__FUNCTION__);
+ $response = $client->request('GET', 'http://symfony.com:8057/', [
+ 'resolve' => ['symfony.com' => '127.0.0.1'],
+ ]);
+
+ $this->assertSame(200, $response->getStatusCode());
+ $this->assertSame(200, $client->request('GET', 'http://symfony.com:8057/')->getStatusCode());
+
+ $response = null;
+ $this->expectException(TransportExceptionInterface::class);
+ $client->request('GET', 'http://symfony.com:8057/', ['timeout' => 1]);
+ }
+
+ public function testNotATimeout()
+ {
+ $client = $this->getHttpClient(__FUNCTION__);
+ $response = $client->request('GET', 'http://localhost:8057/timeout-header', [
+ 'timeout' => 0.9,
+ ]);
+ sleep(1);
+ $this->assertSame(200, $response->getStatusCode());
+ }
+
+ public function testTimeoutOnAccess()
+ {
+ $client = $this->getHttpClient(__FUNCTION__);
+ $response = $client->request('GET', 'http://localhost:8057/timeout-header', [
+ 'timeout' => 0.1,
+ ]);
+
+ $this->expectException(TransportExceptionInterface::class);
+ $response->getHeaders();
+ }
+
+ public function testTimeoutOnStream()
+ {
+ usleep(300000); // wait for the previous test to release the server
+ $client = $this->getHttpClient(__FUNCTION__);
+ $response = $client->request('GET', 'http://localhost:8057/timeout-body');
+
+ $this->assertSame(200, $response->getStatusCode());
+ $chunks = $client->stream([$response], 0.2);
+
+ $result = [];
+
+ foreach ($chunks as $r => $chunk) {
+ if ($chunk->isTimeout()) {
+ $result[] = 't';
+ } else {
+ $result[] = $chunk->getContent();
+ }
+ }
+
+ $this->assertSame(['<1>', 't'], $result);
+
+ $chunks = $client->stream([$response]);
+
+ foreach ($chunks as $r => $chunk) {
+ $this->assertSame('<2>', $chunk->getContent());
+ $this->assertSame('<1><2>', $r->getContent());
+
+ return;
+ }
+
+ $this->fail('The response should have completed');
+ }
+
+ public function testUncheckedTimeoutThrows()
+ {
+ $client = $this->getHttpClient(__FUNCTION__);
+ $response = $client->request('GET', 'http://localhost:8057/timeout-body');
+ $chunks = $client->stream([$response], 0.1);
+
+ $this->expectException(TransportExceptionInterface::class);
+
+ foreach ($chunks as $r => $chunk) {
+ }
+ }
+
+ public function testDestruct()
+ {
+ $client = $this->getHttpClient(__FUNCTION__);
+
+ $start = microtime(true);
+ $client->request('GET', 'http://localhost:8057/timeout-long');
+ $client = null;
+ $duration = microtime(true) - $start;
+
+ $this->assertGreaterThan(1, $duration);
+ $this->assertLessThan(4, $duration);
+ }
+
+ public function testProxy()
+ {
+ $client = $this->getHttpClient(__FUNCTION__);
+ $response = $client->request('GET', 'http://localhost:8057/', [
+ 'proxy' => 'http://localhost:8057',
+ ]);
+
+ $body = $response->toArray();
+ $this->assertSame('localhost:8057', $body['HTTP_HOST']);
+ $this->assertRegexp('#^http://(localhost|127\.0\.0\.1):8057/$#', $body['REQUEST_URI']);
+
+ $response = $client->request('GET', 'http://localhost:8057/', [
+ 'proxy' => 'http://foo:b%3Dar@localhost:8057',
+ ]);
+
+ $body = $response->toArray();
+ $this->assertSame('Basic Zm9vOmI9YXI=', $body['HTTP_PROXY_AUTHORIZATION']);
+ }
+
+ public function testNoProxy()
+ {
+ putenv('no_proxy='.$_SERVER['no_proxy'] = 'example.com, localhost');
+
+ try {
+ $client = $this->getHttpClient(__FUNCTION__);
+ $response = $client->request('GET', 'http://localhost:8057/', [
+ 'proxy' => 'http://localhost:8057',
+ ]);
+
+ $body = $response->toArray();
+
+ $this->assertSame('HTTP/1.1', $body['SERVER_PROTOCOL']);
+ $this->assertSame('/', $body['REQUEST_URI']);
+ $this->assertSame('GET', $body['REQUEST_METHOD']);
+ } finally {
+ putenv('no_proxy');
+ unset($_SERVER['no_proxy']);
+ }
+ }
+
+ /**
+ * @requires extension zlib
+ */
+ public function testAutoEncodingRequest()
+ {
+ $client = $this->getHttpClient(__FUNCTION__);
+ $response = $client->request('GET', 'http://localhost:8057');
+
+ $this->assertSame(200, $response->getStatusCode());
+
+ $headers = $response->getHeaders();
+
+ $this->assertSame(['Accept-Encoding'], $headers['vary']);
+ $this->assertStringContainsString('gzip', $headers['content-encoding'][0]);
+
+ $body = $response->toArray();
+
+ $this->assertStringContainsString('gzip', $body['HTTP_ACCEPT_ENCODING']);
+ }
+
+ public function testBaseUri()
+ {
+ $client = $this->getHttpClient(__FUNCTION__);
+ $response = $client->request('GET', '../404', [
+ 'base_uri' => 'http://localhost:8057/abc/',
+ ]);
+
+ $this->assertSame(404, $response->getStatusCode());
+ $this->assertSame(['application/json'], $response->getHeaders(false)['content-type']);
+ }
+
+ public function testQuery()
+ {
+ $client = $this->getHttpClient(__FUNCTION__);
+ $response = $client->request('GET', 'http://localhost:8057/?a=a', [
+ 'query' => ['b' => 'b'],
+ ]);
+
+ $body = $response->toArray();
+ $this->assertSame('GET', $body['REQUEST_METHOD']);
+ $this->assertSame('/?a=a&b=b', $body['REQUEST_URI']);
+ }
+
+ public function testInformationalResponse()
+ {
+ $client = $this->getHttpClient(__FUNCTION__);
+ $response = $client->request('GET', 'http://localhost:8057/103');
+
+ $this->assertSame('Here the body', $response->getContent());
+ $this->assertSame(200, $response->getStatusCode());
+ }
+
+ public function testInformationalResponseStream()
+ {
+ $client = $this->getHttpClient(__FUNCTION__);
+ $response = $client->request('GET', 'http://localhost:8057/103');
+
+ $chunks = [];
+ foreach ($client->stream($response) as $chunk) {
+ $chunks[] = $chunk;
+ }
+
+ $this->assertSame(103, $chunks[0]->getInformationalStatus()[0]);
+ $this->assertSame(['; rel=preload; as=style', '; rel=preload; as=script'], $chunks[0]->getInformationalStatus()[1]['link']);
+ $this->assertTrue($chunks[1]->isFirst());
+ $this->assertSame('Here the body', $chunks[2]->getContent());
+ $this->assertTrue($chunks[3]->isLast());
+ $this->assertNull($chunks[3]->getInformationalStatus());
+
+ $this->assertSame(['date', 'content-length'], array_keys($response->getHeaders()));
+ $this->assertContains('Link: ; rel=preload; as=style', $response->getInfo('response_headers'));
+ }
+
+ /**
+ * @requires extension zlib
+ */
+ public function testUserlandEncodingRequest()
+ {
+ $client = $this->getHttpClient(__FUNCTION__);
+ $response = $client->request('GET', 'http://localhost:8057', [
+ 'headers' => ['Accept-Encoding' => 'gzip'],
+ ]);
+
+ $headers = $response->getHeaders();
+
+ $this->assertSame(['Accept-Encoding'], $headers['vary']);
+ $this->assertStringContainsString('gzip', $headers['content-encoding'][0]);
+
+ $body = $response->getContent();
+ $this->assertSame("\x1F", $body[0]);
+
+ $body = json_decode(gzdecode($body), true);
+ $this->assertSame('gzip', $body['HTTP_ACCEPT_ENCODING']);
+ }
+
+ /**
+ * @requires extension zlib
+ */
+ public function testGzipBroken()
+ {
+ $client = $this->getHttpClient(__FUNCTION__);
+ $response = $client->request('GET', 'http://localhost:8057/gzip-broken');
+
+ $this->expectException(TransportExceptionInterface::class);
+ $response->getContent();
+ }
+
+ public function testMaxDuration()
+ {
+ $client = $this->getHttpClient(__FUNCTION__);
+ $response = $client->request('GET', 'http://localhost:8057/max-duration', [
+ 'max_duration' => 0.1,
+ ]);
+
+ $start = microtime(true);
+
+ try {
+ $response->getContent();
+ } catch (TransportExceptionInterface $e) {
+ $this->addToAssertionCount(1);
+ }
+
+ $duration = microtime(true) - $start;
+
+ $this->assertLessThan(10, $duration);
+ }
+}
diff --git a/vendor/symfony/contracts/HttpClient/Test/TestHttpServer.php b/vendor/symfony/contracts/HttpClient/Test/TestHttpServer.php
new file mode 100644
index 000000000..8e7a469c4
--- /dev/null
+++ b/vendor/symfony/contracts/HttpClient/Test/TestHttpServer.php
@@ -0,0 +1,49 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Contracts\HttpClient\Test;
+
+use Symfony\Component\Process\PhpExecutableFinder;
+use Symfony\Component\Process\Process;
+
+/**
+ * @experimental in 1.1
+ */
+class TestHttpServer
+{
+ private static $server;
+
+ public static function start()
+ {
+ if (null !== self::$server) {
+ return;
+ }
+
+ $finder = new PhpExecutableFinder();
+ $process = new Process(array_merge([$finder->find(false)], $finder->findArguments(), ['-dopcache.enable=0', '-dvariables_order=EGPCS', '-S', '127.0.0.1:8057']));
+ $process->setWorkingDirectory(__DIR__.'/Fixtures/web');
+ $process->setTimeout(300);
+ $process->start();
+
+ self::$server = new class() {
+ public $process;
+
+ public function __destruct()
+ {
+ $this->process->stop();
+ }
+ };
+
+ self::$server->process = $process;
+
+ sleep('\\' === \DIRECTORY_SEPARATOR ? 10 : 1);
+ }
+}
diff --git a/vendor/symfony/contracts/HttpClient/composer.json b/vendor/symfony/contracts/HttpClient/composer.json
new file mode 100644
index 000000000..4dc9b2d38
--- /dev/null
+++ b/vendor/symfony/contracts/HttpClient/composer.json
@@ -0,0 +1,33 @@
+{
+ "name": "symfony/http-client-contracts",
+ "type": "library",
+ "description": "Generic abstractions related to HTTP clients",
+ "keywords": ["abstractions", "contracts", "decoupling", "interfaces", "interoperability", "standards"],
+ "homepage": "https://symfony.com",
+ "license": "MIT",
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "require": {
+ "php": "^7.1.3"
+ },
+ "suggest": {
+ "symfony/http-client-implementation": ""
+ },
+ "autoload": {
+ "psr-4": { "Symfony\\Contracts\\HttpClient\\": "" }
+ },
+ "minimum-stability": "dev",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.1-dev"
+ }
+ }
+}
diff --git a/vendor/symfony/contracts/LICENSE b/vendor/symfony/contracts/LICENSE
new file mode 100644
index 000000000..3f853aaf3
--- /dev/null
+++ b/vendor/symfony/contracts/LICENSE
@@ -0,0 +1,19 @@
+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
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is furnished
+to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/vendor/symfony/contracts/README.md b/vendor/symfony/contracts/README.md
new file mode 100644
index 000000000..480c2a90e
--- /dev/null
+++ b/vendor/symfony/contracts/README.md
@@ -0,0 +1,54 @@
+Symfony Contracts
+=================
+
+A set of abstractions extracted out of the Symfony components.
+
+Can be used to build on semantics that the Symfony components proved useful - and
+that already have battle tested implementations.
+
+Design Principles
+-----------------
+
+ * contracts are split by domain, each into their own sub-namespaces;
+ * contracts are small and consistent sets of PHP interfaces, traits, normative
+ docblocks and reference test suites when applicable, ...;
+ * all contracts must have a proven implementation to enter this repository;
+ * they must be backward compatible with existing Symfony components.
+
+Packages that implement specific contracts should list them in the "provide"
+section of their "composer.json" file, using the `symfony/*-implementation`
+convention (e.g. `"provide": { "symfony/cache-implementation": "1.0" }`).
+
+FAQ
+---
+
+### How to use this package?
+
+The abstractions in this package are useful to achieve loose coupling and
+interoperability. By using the provided interfaces as type hints, you are able
+to reuse any implementations that match their contracts. It could be a Symfony
+component, or another one provided by the PHP community at large.
+
+Depending on their semantics, some interfaces can be combined with autowiring to
+seamlessly inject a service in your classes.
+
+Others might be useful as labeling interfaces, to hint about a specific behavior
+that could be enabled when using autoconfiguration or manual service tagging (or
+any other means provided by your framework.)
+
+### How is this different from PHP-FIG's PSRs?
+
+When applicable, the provided contracts are built on top of PHP-FIG's PSRs. But
+the group has different goals and different processes. Here, we're focusing on
+providing abstractions that are useful on their own while still compatible with
+implementations provided by Symfony. Although not the main target, we hope that
+the declared contracts will directly or indirectly contribute to the PHP-FIG.
+
+Resources
+---------
+
+ * [Documentation](https://symfony.com/doc/current/components/contracts.html)
+ * [Contributing](https://symfony.com/doc/current/contributing/index.html)
+ * [Report issues](https://github.com/symfony/symfony/issues) and
+ [send Pull Requests](https://github.com/symfony/symfony/pulls)
+ in the [main Symfony repository](https://github.com/symfony/symfony)
diff --git a/vendor/symfony/contracts/Service/.gitignore b/vendor/symfony/contracts/Service/.gitignore
new file mode 100644
index 000000000..c49a5d8df
--- /dev/null
+++ b/vendor/symfony/contracts/Service/.gitignore
@@ -0,0 +1,3 @@
+vendor/
+composer.lock
+phpunit.xml
diff --git a/vendor/symfony/contracts/Service/LICENSE b/vendor/symfony/contracts/Service/LICENSE
new file mode 100644
index 000000000..3f853aaf3
--- /dev/null
+++ b/vendor/symfony/contracts/Service/LICENSE
@@ -0,0 +1,19 @@
+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
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is furnished
+to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/vendor/symfony/contracts/Service/README.md b/vendor/symfony/contracts/Service/README.md
new file mode 100644
index 000000000..d033a439b
--- /dev/null
+++ b/vendor/symfony/contracts/Service/README.md
@@ -0,0 +1,9 @@
+Symfony Service Contracts
+=========================
+
+A set of abstractions extracted out of the Symfony components.
+
+Can be used to build on semantics that the Symfony components proved useful - and
+that already have battle tested implementations.
+
+See https://github.com/symfony/contracts/blob/master/README.md for more information.
diff --git a/vendor/symfony/contracts/Service/ResetInterface.php b/vendor/symfony/contracts/Service/ResetInterface.php
new file mode 100644
index 000000000..1af1075ee
--- /dev/null
+++ b/vendor/symfony/contracts/Service/ResetInterface.php
@@ -0,0 +1,30 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Contracts\Service;
+
+/**
+ * Provides a way to reset an object to its initial state.
+ *
+ * When calling the "reset()" method on an object, it should be put back to its
+ * initial state. This usually means clearing any internal buffers and forwarding
+ * the call to internal dependencies. All properties of the object should be put
+ * back to the same state it had when it was first ready to use.
+ *
+ * This method could be called, for example, to recycle objects that are used as
+ * services, so that they can be used to handle several requests in the same
+ * process loop (note that we advise making your services stateless instead of
+ * implementing this interface when possible.)
+ */
+interface ResetInterface
+{
+ public function reset();
+}
diff --git a/vendor/symfony/contracts/Service/ServiceLocatorTrait.php b/vendor/symfony/contracts/Service/ServiceLocatorTrait.php
new file mode 100644
index 000000000..4ec6eb427
--- /dev/null
+++ b/vendor/symfony/contracts/Service/ServiceLocatorTrait.php
@@ -0,0 +1,122 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Contracts\Service;
+
+use Psr\Container\ContainerExceptionInterface;
+use Psr\Container\NotFoundExceptionInterface;
+
+/**
+ * A trait to help implement ServiceProviderInterface.
+ *
+ * @author Robin Chalas
+ * @author Nicolas Grekas
+ */
+trait ServiceLocatorTrait
+{
+ private $factories;
+ private $loading = [];
+ private $providedTypes;
+
+ /**
+ * @param callable[] $factories
+ */
+ public function __construct(array $factories)
+ {
+ $this->factories = $factories;
+ }
+
+ /**
+ * {@inheritdoc}
+ *
+ * @return bool
+ */
+ public function has($id)
+ {
+ return isset($this->factories[$id]);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get($id)
+ {
+ if (!isset($this->factories[$id])) {
+ throw $this->createNotFoundException($id);
+ }
+
+ if (isset($this->loading[$id])) {
+ $ids = array_values($this->loading);
+ $ids = \array_slice($this->loading, array_search($id, $ids));
+ $ids[] = $id;
+
+ throw $this->createCircularReferenceException($id, $ids);
+ }
+
+ $this->loading[$id] = $id;
+ try {
+ return $this->factories[$id]($this);
+ } finally {
+ unset($this->loading[$id]);
+ }
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getProvidedServices(): array
+ {
+ if (null === $this->providedTypes) {
+ $this->providedTypes = [];
+
+ foreach ($this->factories as $name => $factory) {
+ if (!\is_callable($factory)) {
+ $this->providedTypes[$name] = '?';
+ } else {
+ $type = (new \ReflectionFunction($factory))->getReturnType();
+
+ $this->providedTypes[$name] = $type ? ($type->allowsNull() ? '?' : '').$type->getName() : '?';
+ }
+ }
+ }
+
+ return $this->providedTypes;
+ }
+
+ private function createNotFoundException(string $id): NotFoundExceptionInterface
+ {
+ if (!$alternatives = array_keys($this->factories)) {
+ $message = 'is empty...';
+ } else {
+ $last = array_pop($alternatives);
+ if ($alternatives) {
+ $message = sprintf('only knows about the "%s" and "%s" services.', implode('", "', $alternatives), $last);
+ } else {
+ $message = sprintf('only knows about the "%s" service.', $last);
+ }
+ }
+
+ if ($this->loading) {
+ $message = sprintf('The service "%s" has a dependency on a non-existent service "%s". This locator %s', end($this->loading), $id, $message);
+ } else {
+ $message = sprintf('Service "%s" not found: the current service locator %s', $id, $message);
+ }
+
+ return new class($message) extends \InvalidArgumentException implements NotFoundExceptionInterface {
+ };
+ }
+
+ private function createCircularReferenceException(string $id, array $path): ContainerExceptionInterface
+ {
+ return new class(sprintf('Circular reference detected for service "%s", path: "%s".', $id, implode(' -> ', $path))) extends \RuntimeException implements ContainerExceptionInterface {
+ };
+ }
+}
diff --git a/vendor/symfony/contracts/Service/ServiceProviderInterface.php b/vendor/symfony/contracts/Service/ServiceProviderInterface.php
new file mode 100644
index 000000000..c60ad0bd4
--- /dev/null
+++ b/vendor/symfony/contracts/Service/ServiceProviderInterface.php
@@ -0,0 +1,36 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Contracts\Service;
+
+use Psr\Container\ContainerInterface;
+
+/**
+ * A ServiceProviderInterface exposes the identifiers and the types of services provided by a container.
+ *
+ * @author Nicolas Grekas
+ * @author Mateusz Sip
+ */
+interface ServiceProviderInterface extends ContainerInterface
+{
+ /**
+ * Returns an associative array of service types keyed by the identifiers provided by the current container.
+ *
+ * Examples:
+ *
+ * * ['logger' => 'Psr\Log\LoggerInterface'] means the object provides a service named "logger" that implements Psr\Log\LoggerInterface
+ * * ['foo' => '?'] means the container provides service name "foo" of unspecified type
+ * * ['bar' => '?Bar\Baz'] means the container provides a service "bar" of type Bar\Baz|null
+ *
+ * @return string[] The provided service types, keyed by service names
+ */
+ public function getProvidedServices(): array;
+}
diff --git a/vendor/symfony/contracts/Service/ServiceSubscriberInterface.php b/vendor/symfony/contracts/Service/ServiceSubscriberInterface.php
new file mode 100644
index 000000000..8bb320f5b
--- /dev/null
+++ b/vendor/symfony/contracts/Service/ServiceSubscriberInterface.php
@@ -0,0 +1,53 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Contracts\Service;
+
+/**
+ * A ServiceSubscriber exposes its dependencies via the static {@link getSubscribedServices} method.
+ *
+ * The getSubscribedServices method returns an array of service types required by such instances,
+ * optionally keyed by the service names used internally. Service types that start with an interrogation
+ * mark "?" are optional, while the other ones are mandatory service dependencies.
+ *
+ * The injected service locators SHOULD NOT allow access to any other services not specified by the method.
+ *
+ * It is expected that ServiceSubscriber instances consume PSR-11-based service locators internally.
+ * This interface does not dictate any injection method for these service locators, although constructor
+ * injection is recommended.
+ *
+ * @author Nicolas Grekas
+ */
+interface ServiceSubscriberInterface
+{
+ /**
+ * Returns an array of service types required by such instances, optionally keyed by the service names used internally.
+ *
+ * For mandatory dependencies:
+ *
+ * * ['logger' => 'Psr\Log\LoggerInterface'] means the objects use the "logger" name
+ * internally to fetch a service which must implement Psr\Log\LoggerInterface.
+ * * ['loggers' => 'Psr\Log\LoggerInterface[]'] means the objects use the "loggers" name
+ * internally to fetch an iterable of Psr\Log\LoggerInterface instances.
+ * * ['Psr\Log\LoggerInterface'] is a shortcut for
+ * * ['Psr\Log\LoggerInterface' => 'Psr\Log\LoggerInterface']
+ *
+ * otherwise:
+ *
+ * * ['logger' => '?Psr\Log\LoggerInterface'] denotes an optional dependency
+ * * ['loggers' => '?Psr\Log\LoggerInterface[]'] denotes an optional iterable dependency
+ * * ['?Psr\Log\LoggerInterface'] is a shortcut for
+ * * ['Psr\Log\LoggerInterface' => '?Psr\Log\LoggerInterface']
+ *
+ * @return array The required service types, optionally keyed by service names
+ */
+ public static function getSubscribedServices();
+}
diff --git a/vendor/symfony/contracts/Service/ServiceSubscriberTrait.php b/vendor/symfony/contracts/Service/ServiceSubscriberTrait.php
new file mode 100644
index 000000000..5d9d456d0
--- /dev/null
+++ b/vendor/symfony/contracts/Service/ServiceSubscriberTrait.php
@@ -0,0 +1,63 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Contracts\Service;
+
+use Psr\Container\ContainerInterface;
+
+/**
+ * Implementation of ServiceSubscriberInterface that determines subscribed services from
+ * private method return types. Service ids are available as "ClassName::methodName".
+ *
+ * @author Kevin Bond
+ */
+trait ServiceSubscriberTrait
+{
+ /** @var ContainerInterface */
+ protected $container;
+
+ public static function getSubscribedServices(): array
+ {
+ static $services;
+
+ if (null !== $services) {
+ return $services;
+ }
+
+ $services = \is_callable(['parent', __FUNCTION__]) ? parent::getSubscribedServices() : [];
+
+ foreach ((new \ReflectionClass(self::class))->getMethods() as $method) {
+ if ($method->isStatic() || $method->isAbstract() || $method->isGenerator() || $method->isInternal() || $method->getNumberOfRequiredParameters()) {
+ continue;
+ }
+
+ if (self::class === $method->getDeclaringClass()->name && ($returnType = $method->getReturnType()) && !$returnType->isBuiltin()) {
+ $services[self::class.'::'.$method->name] = '?'.$returnType->getName();
+ }
+ }
+
+ return $services;
+ }
+
+ /**
+ * @required
+ */
+ public function setContainer(ContainerInterface $container)
+ {
+ $this->container = $container;
+
+ if (\is_callable(['parent', __FUNCTION__])) {
+ return parent::setContainer($container);
+ }
+
+ return null;
+ }
+}
diff --git a/vendor/symfony/contracts/Service/Test/ServiceLocatorTest.php b/vendor/symfony/contracts/Service/Test/ServiceLocatorTest.php
new file mode 100644
index 000000000..5ed914952
--- /dev/null
+++ b/vendor/symfony/contracts/Service/Test/ServiceLocatorTest.php
@@ -0,0 +1,92 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Contracts\Service\Test;
+
+use PHPUnit\Framework\TestCase;
+use Psr\Container\ContainerInterface;
+use Symfony\Contracts\Service\ServiceLocatorTrait;
+
+abstract class ServiceLocatorTest extends TestCase
+{
+ protected function getServiceLocator(array $factories)
+ {
+ return new class($factories) implements ContainerInterface {
+ use ServiceLocatorTrait;
+ };
+ }
+
+ public function testHas()
+ {
+ $locator = $this->getServiceLocator([
+ 'foo' => function () { return 'bar'; },
+ 'bar' => function () { return 'baz'; },
+ function () { return 'dummy'; },
+ ]);
+
+ $this->assertTrue($locator->has('foo'));
+ $this->assertTrue($locator->has('bar'));
+ $this->assertFalse($locator->has('dummy'));
+ }
+
+ public function testGet()
+ {
+ $locator = $this->getServiceLocator([
+ 'foo' => function () { return 'bar'; },
+ 'bar' => function () { return 'baz'; },
+ ]);
+
+ $this->assertSame('bar', $locator->get('foo'));
+ $this->assertSame('baz', $locator->get('bar'));
+ }
+
+ public function testGetDoesNotMemoize()
+ {
+ $i = 0;
+ $locator = $this->getServiceLocator([
+ 'foo' => function () use (&$i) {
+ ++$i;
+
+ return 'bar';
+ },
+ ]);
+
+ $this->assertSame('bar', $locator->get('foo'));
+ $this->assertSame('bar', $locator->get('foo'));
+ $this->assertSame(2, $i);
+ }
+
+ public function testThrowsOnUndefinedInternalService()
+ {
+ if (!$this->getExpectedException()) {
+ $this->expectException('Psr\Container\NotFoundExceptionInterface');
+ $this->expectExceptionMessage('The service "foo" has a dependency on a non-existent service "bar". This locator only knows about the "foo" service.');
+ }
+ $locator = $this->getServiceLocator([
+ 'foo' => function () use (&$locator) { return $locator->get('bar'); },
+ ]);
+
+ $locator->get('foo');
+ }
+
+ public function testThrowsOnCircularReference()
+ {
+ $this->expectException('Psr\Container\ContainerExceptionInterface');
+ $this->expectExceptionMessage('Circular reference detected for service "bar", path: "bar -> baz -> bar".');
+ $locator = $this->getServiceLocator([
+ 'foo' => function () use (&$locator) { return $locator->get('bar'); },
+ 'bar' => function () use (&$locator) { return $locator->get('baz'); },
+ 'baz' => function () use (&$locator) { return $locator->get('bar'); },
+ ]);
+
+ $locator->get('foo');
+ }
+}
diff --git a/vendor/symfony/contracts/Service/composer.json b/vendor/symfony/contracts/Service/composer.json
new file mode 100644
index 000000000..f4209cc41
--- /dev/null
+++ b/vendor/symfony/contracts/Service/composer.json
@@ -0,0 +1,34 @@
+{
+ "name": "symfony/service-contracts",
+ "type": "library",
+ "description": "Generic abstractions related to writing services",
+ "keywords": ["abstractions", "contracts", "decoupling", "interfaces", "interoperability", "standards"],
+ "homepage": "https://symfony.com",
+ "license": "MIT",
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "require": {
+ "php": "^7.1.3",
+ "psr/container": "^1.0"
+ },
+ "suggest": {
+ "symfony/service-implementation": ""
+ },
+ "autoload": {
+ "psr-4": { "Symfony\\Contracts\\Service\\": "" }
+ },
+ "minimum-stability": "dev",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.1-dev"
+ }
+ }
+}
diff --git a/vendor/symfony/contracts/Tests/Cache/CacheTraitTest.php b/vendor/symfony/contracts/Tests/Cache/CacheTraitTest.php
new file mode 100644
index 000000000..9d803c34d
--- /dev/null
+++ b/vendor/symfony/contracts/Tests/Cache/CacheTraitTest.php
@@ -0,0 +1,165 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Contracts\Tests\Cache;
+
+use PHPUnit\Framework\TestCase;
+use Psr\Cache\CacheItemInterface;
+use Psr\Cache\CacheItemPoolInterface;
+use Symfony\Contracts\Cache\CacheTrait;
+
+/**
+ * @author Tobias Nyholm
+ */
+class CacheTraitTest extends TestCase
+{
+ public function testSave()
+ {
+ $item = $this->getMockBuilder(CacheItemInterface::class)->getMock();
+ $item->method('set')
+ ->willReturn($item);
+ $item->method('isHit')
+ ->willReturn(false);
+
+ $item->expects($this->once())
+ ->method('set')
+ ->with('computed data');
+
+ $cache = $this->getMockBuilder(TestPool::class)
+ ->setMethods(['getItem', 'save'])
+ ->getMock();
+ $cache->expects($this->once())
+ ->method('getItem')
+ ->with('key')
+ ->willReturn($item);
+ $cache->expects($this->once())
+ ->method('save');
+
+ $callback = function (CacheItemInterface $item) {
+ return 'computed data';
+ };
+
+ $cache->get('key', $callback);
+ }
+
+ public function testNoCallbackCallOnHit()
+ {
+ $item = $this->getMockBuilder(CacheItemInterface::class)->getMock();
+ $item->method('isHit')
+ ->willReturn(true);
+
+ $item->expects($this->never())
+ ->method('set');
+
+ $cache = $this->getMockBuilder(TestPool::class)
+ ->setMethods(['getItem', 'save'])
+ ->getMock();
+
+ $cache->expects($this->once())
+ ->method('getItem')
+ ->with('key')
+ ->willReturn($item);
+ $cache->expects($this->never())
+ ->method('save');
+
+ $callback = function (CacheItemInterface $item) {
+ $this->assertTrue(false, 'This code should never be reached');
+ };
+
+ $cache->get('key', $callback);
+ }
+
+ public function testRecomputeOnBetaInf()
+ {
+ $item = $this->getMockBuilder(CacheItemInterface::class)->getMock();
+ $item->method('set')
+ ->willReturn($item);
+ $item->method('isHit')
+ // We want to recompute even if it is a hit
+ ->willReturn(true);
+
+ $item->expects($this->once())
+ ->method('set')
+ ->with('computed data');
+
+ $cache = $this->getMockBuilder(TestPool::class)
+ ->setMethods(['getItem', 'save'])
+ ->getMock();
+
+ $cache->expects($this->once())
+ ->method('getItem')
+ ->with('key')
+ ->willReturn($item);
+ $cache->expects($this->once())
+ ->method('save');
+
+ $callback = function (CacheItemInterface $item) {
+ return 'computed data';
+ };
+
+ $cache->get('key', $callback, INF);
+ }
+
+ public function testExceptionOnNegativeBeta()
+ {
+ $cache = $this->getMockBuilder(TestPool::class)
+ ->setMethods(['getItem', 'save'])
+ ->getMock();
+
+ $callback = function (CacheItemInterface $item) {
+ return 'computed data';
+ };
+
+ $this->expectException(\InvalidArgumentException::class);
+ $cache->get('key', $callback, -2);
+ }
+}
+
+class TestPool implements CacheItemPoolInterface
+{
+ use CacheTrait;
+
+ public function hasItem($key): bool
+ {
+ }
+
+ public function deleteItem($key): bool
+ {
+ }
+
+ public function deleteItems(array $keys = []): bool
+ {
+ }
+
+ public function getItem($key): CacheItemInterface
+ {
+ }
+
+ public function getItems(array $key = []): iterable
+ {
+ }
+
+ public function saveDeferred(CacheItemInterface $item): bool
+ {
+ }
+
+ public function save(CacheItemInterface $item): bool
+ {
+ }
+
+ public function commit(): bool
+ {
+ }
+
+ public function clear(): bool
+ {
+ }
+}
diff --git a/vendor/symfony/contracts/Tests/Service/ServiceSubscriberTraitTest.php b/vendor/symfony/contracts/Tests/Service/ServiceSubscriberTraitTest.php
new file mode 100644
index 000000000..344bba877
--- /dev/null
+++ b/vendor/symfony/contracts/Tests/Service/ServiceSubscriberTraitTest.php
@@ -0,0 +1,65 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Contracts\Tests\Service;
+
+use PHPUnit\Framework\TestCase;
+use Psr\Container\ContainerInterface;
+use Symfony\Contracts\Service\ServiceLocatorTrait;
+use Symfony\Contracts\Service\ServiceSubscriberInterface;
+use Symfony\Contracts\Service\ServiceSubscriberTrait;
+
+class ServiceSubscriberTraitTest extends TestCase
+{
+ public function testMethodsOnParentsAndChildrenAreIgnoredInGetSubscribedServices()
+ {
+ $expected = [TestService::class.'::aService' => '?Symfony\Contracts\Tests\Service\Service2'];
+
+ $this->assertEquals($expected, ChildTestService::getSubscribedServices());
+ }
+
+ public function testSetContainerIsCalledOnParent()
+ {
+ $container = new class([]) implements ContainerInterface {
+ use ServiceLocatorTrait;
+ };
+
+ $this->assertSame($container, (new TestService())->setContainer($container));
+ }
+}
+
+class ParentTestService
+{
+ public function aParentService(): Service1
+ {
+ }
+
+ public function setContainer(ContainerInterface $container)
+ {
+ return $container;
+ }
+}
+
+class TestService extends ParentTestService implements ServiceSubscriberInterface
+{
+ use ServiceSubscriberTrait;
+
+ public function aService(): Service2
+ {
+ }
+}
+
+class ChildTestService extends TestService
+{
+ public function aChildService(): Service3
+ {
+ }
+}
diff --git a/vendor/symfony/contracts/Translation/.gitignore b/vendor/symfony/contracts/Translation/.gitignore
new file mode 100644
index 000000000..c49a5d8df
--- /dev/null
+++ b/vendor/symfony/contracts/Translation/.gitignore
@@ -0,0 +1,3 @@
+vendor/
+composer.lock
+phpunit.xml
diff --git a/vendor/symfony/contracts/Translation/LICENSE b/vendor/symfony/contracts/Translation/LICENSE
new file mode 100644
index 000000000..3f853aaf3
--- /dev/null
+++ b/vendor/symfony/contracts/Translation/LICENSE
@@ -0,0 +1,19 @@
+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
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is furnished
+to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/vendor/symfony/contracts/Translation/LocaleAwareInterface.php b/vendor/symfony/contracts/Translation/LocaleAwareInterface.php
new file mode 100644
index 000000000..dbd8894fe
--- /dev/null
+++ b/vendor/symfony/contracts/Translation/LocaleAwareInterface.php
@@ -0,0 +1,31 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Contracts\Translation;
+
+interface LocaleAwareInterface
+{
+ /**
+ * Sets the current locale.
+ *
+ * @param string $locale The locale
+ *
+ * @throws \InvalidArgumentException If the locale contains invalid characters
+ */
+ public function setLocale($locale);
+
+ /**
+ * Returns the current locale.
+ *
+ * @return string The locale
+ */
+ public function getLocale();
+}
diff --git a/vendor/symfony/contracts/Translation/README.md b/vendor/symfony/contracts/Translation/README.md
new file mode 100644
index 000000000..6c693ce0b
--- /dev/null
+++ b/vendor/symfony/contracts/Translation/README.md
@@ -0,0 +1,9 @@
+Symfony Translation Contracts
+=============================
+
+A set of abstractions extracted out of the Symfony components.
+
+Can be used to build on semantics that the Symfony components proved useful - and
+that already have battle tested implementations.
+
+See https://github.com/symfony/contracts/blob/master/README.md for more information.
diff --git a/vendor/symfony/contracts/Translation/Test/TranslatorTest.php b/vendor/symfony/contracts/Translation/Test/TranslatorTest.php
new file mode 100644
index 000000000..5bfb0f8df
--- /dev/null
+++ b/vendor/symfony/contracts/Translation/Test/TranslatorTest.php
@@ -0,0 +1,353 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Contracts\Translation\Test;
+
+use PHPUnit\Framework\TestCase;
+use Symfony\Contracts\Translation\TranslatorInterface;
+use Symfony\Contracts\Translation\TranslatorTrait;
+
+/**
+ * Test should cover all languages mentioned on http://translate.sourceforge.net/wiki/l10n/pluralforms
+ * and Plural forms mentioned on http://www.gnu.org/software/gettext/manual/gettext.html#Plural-forms.
+ *
+ * See also https://developer.mozilla.org/en/Localization_and_Plurals which mentions 15 rules having a maximum of 6 forms.
+ * The mozilla code is also interesting to check for.
+ *
+ * As mentioned by chx http://drupal.org/node/1273968 we can cover all by testing number from 0 to 199
+ *
+ * The goal to cover all languages is to far fetched so this test case is smaller.
+ *
+ * @author Clemens Tolboom clemens@build2be.nl
+ */
+class TranslatorTest extends TestCase
+{
+ public function getTranslator()
+ {
+ return new class() implements TranslatorInterface {
+ use TranslatorTrait;
+ };
+ }
+
+ /**
+ * @dataProvider getTransTests
+ */
+ public function testTrans($expected, $id, $parameters)
+ {
+ $translator = $this->getTranslator();
+
+ $this->assertEquals($expected, $translator->trans($id, $parameters));
+ }
+
+ /**
+ * @dataProvider getTransChoiceTests
+ */
+ public function testTransChoiceWithExplicitLocale($expected, $id, $number)
+ {
+ $translator = $this->getTranslator();
+ $translator->setLocale('en');
+
+ $this->assertEquals($expected, $translator->trans($id, ['%count%' => $number]));
+ }
+
+ /**
+ * @dataProvider getTransChoiceTests
+ */
+ public function testTransChoiceWithDefaultLocale($expected, $id, $number)
+ {
+ \Locale::setDefault('en');
+
+ $translator = $this->getTranslator();
+
+ $this->assertEquals($expected, $translator->trans($id, ['%count%' => $number]));
+ }
+
+ public function testGetSetLocale()
+ {
+ $translator = $this->getTranslator();
+ $translator->setLocale('en');
+
+ $this->assertEquals('en', $translator->getLocale());
+ }
+
+ /**
+ * @requires extension intl
+ */
+ public function testGetLocaleReturnsDefaultLocaleIfNotSet()
+ {
+ $translator = $this->getTranslator();
+
+ \Locale::setDefault('pt_BR');
+ $this->assertEquals('pt_BR', $translator->getLocale());
+
+ \Locale::setDefault('en');
+ $this->assertEquals('en', $translator->getLocale());
+ }
+
+ public function getTransTests()
+ {
+ return [
+ ['Symfony is great!', 'Symfony is great!', []],
+ ['Symfony is awesome!', 'Symfony is %what%!', ['%what%' => 'awesome']],
+ ];
+ }
+
+ public function getTransChoiceTests()
+ {
+ return [
+ ['There are no apples', '{0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples', 0],
+ ['There is one apple', '{0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples', 1],
+ ['There are 10 apples', '{0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples', 10],
+ ['There are 0 apples', 'There is 1 apple|There are %count% apples', 0],
+ ['There is 1 apple', 'There is 1 apple|There are %count% apples', 1],
+ ['There are 10 apples', 'There is 1 apple|There are %count% apples', 10],
+ // custom validation messages may be coded with a fixed value
+ ['There are 2 apples', 'There are 2 apples', 2],
+ ];
+ }
+
+ /**
+ * @dataProvider getInternal
+ */
+ public function testInterval($expected, $number, $interval)
+ {
+ $translator = $this->getTranslator();
+
+ $this->assertEquals($expected, $translator->trans($interval.' foo|[1,Inf[ bar', ['%count%' => $number]));
+ }
+
+ public function getInternal()
+ {
+ return [
+ ['foo', 3, '{1,2, 3 ,4}'],
+ ['bar', 10, '{1,2, 3 ,4}'],
+ ['bar', 3, '[1,2]'],
+ ['foo', 1, '[1,2]'],
+ ['foo', 2, '[1,2]'],
+ ['bar', 1, ']1,2['],
+ ['bar', 2, ']1,2['],
+ ['foo', log(0), '[-Inf,2['],
+ ['foo', -log(0), '[-2,+Inf]'],
+ ];
+ }
+
+ /**
+ * @dataProvider getChooseTests
+ */
+ public function testChoose($expected, $id, $number)
+ {
+ $translator = $this->getTranslator();
+
+ $this->assertEquals($expected, $translator->trans($id, ['%count%' => $number]));
+ }
+
+ public function testReturnMessageIfExactlyOneStandardRuleIsGiven()
+ {
+ $translator = $this->getTranslator();
+
+ $this->assertEquals('There are two apples', $translator->trans('There are two apples', ['%count%' => 2]));
+ }
+
+ /**
+ * @dataProvider getNonMatchingMessages
+ */
+ public function testThrowExceptionIfMatchingMessageCannotBeFound($id, $number)
+ {
+ $this->expectException('InvalidArgumentException');
+ $translator = $this->getTranslator();
+
+ $translator->trans($id, ['%count%' => $number]);
+ }
+
+ public function getNonMatchingMessages()
+ {
+ return [
+ ['{0} There are no apples|{1} There is one apple', 2],
+ ['{1} There is one apple|]1,Inf] There are %count% apples', 0],
+ ['{1} There is one apple|]2,Inf] There are %count% apples', 2],
+ ['{0} There are no apples|There is one apple', 2],
+ ];
+ }
+
+ public function getChooseTests()
+ {
+ return [
+ ['There are no apples', '{0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples', 0],
+ ['There are no apples', '{0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples', 0],
+ ['There are no apples', '{0}There are no apples|{1} There is one apple|]1,Inf] There are %count% apples', 0],
+
+ ['There is one apple', '{0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples', 1],
+
+ ['There are 10 apples', '{0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples', 10],
+ ['There are 10 apples', '{0} There are no apples|{1} There is one apple|]1,Inf]There are %count% apples', 10],
+ ['There are 10 apples', '{0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples', 10],
+
+ ['There are 0 apples', 'There is one apple|There are %count% apples', 0],
+ ['There is one apple', 'There is one apple|There are %count% apples', 1],
+ ['There are 10 apples', 'There is one apple|There are %count% apples', 10],
+
+ ['There are 0 apples', 'one: There is one apple|more: There are %count% apples', 0],
+ ['There is one apple', 'one: There is one apple|more: There are %count% apples', 1],
+ ['There are 10 apples', 'one: There is one apple|more: There are %count% apples', 10],
+
+ ['There are no apples', '{0} There are no apples|one: There is one apple|more: There are %count% apples', 0],
+ ['There is one apple', '{0} There are no apples|one: There is one apple|more: There are %count% apples', 1],
+ ['There are 10 apples', '{0} There are no apples|one: There is one apple|more: There are %count% apples', 10],
+
+ ['', '{0}|{1} There is one apple|]1,Inf] There are %count% apples', 0],
+ ['', '{0} There are no apples|{1}|]1,Inf] There are %count% apples', 1],
+
+ // Indexed only tests which are Gettext PoFile* compatible strings.
+ ['There are 0 apples', 'There is one apple|There are %count% apples', 0],
+ ['There is one apple', 'There is one apple|There are %count% apples', 1],
+ ['There are 2 apples', 'There is one apple|There are %count% apples', 2],
+
+ // Tests for float numbers
+ ['There is almost one apple', '{0} There are no apples|]0,1[ There is almost one apple|{1} There is one apple|[1,Inf] There is more than one apple', 0.7],
+ ['There is one apple', '{0} There are no apples|]0,1[There are %count% apples|{1} There is one apple|[1,Inf] There is more than one apple', 1],
+ ['There is more than one apple', '{0} There are no apples|]0,1[There are %count% apples|{1} There is one apple|[1,Inf] There is more than one apple', 1.7],
+ ['There are no apples', '{0} There are no apples|]0,1[There are %count% apples|{1} There is one apple|[1,Inf] There is more than one apple', 0],
+ ['There are no apples', '{0} There are no apples|]0,1[There are %count% apples|{1} There is one apple|[1,Inf] There is more than one apple', 0.0],
+ ['There are no apples', '{0.0} There are no apples|]0,1[There are %count% apples|{1} There is one apple|[1,Inf] There is more than one apple', 0],
+
+ // Test texts with new-lines
+ // with double-quotes and \n in id & double-quotes and actual newlines in text
+ ["This is a text with a\n new-line in it. Selector = 0.", '{0}This is a text with a
+ new-line in it. Selector = 0.|{1}This is a text with a
+ new-line in it. Selector = 1.|[1,Inf]This is a text with a
+ new-line in it. Selector > 1.', 0],
+ // with double-quotes and \n in id and single-quotes and actual newlines in text
+ ["This is a text with a\n new-line in it. Selector = 1.", '{0}This is a text with a
+ new-line in it. Selector = 0.|{1}This is a text with a
+ new-line in it. Selector = 1.|[1,Inf]This is a text with a
+ new-line in it. Selector > 1.', 1],
+ ["This is a text with a\n new-line in it. Selector > 1.", '{0}This is a text with a
+ new-line in it. Selector = 0.|{1}This is a text with a
+ new-line in it. Selector = 1.|[1,Inf]This is a text with a
+ new-line in it. Selector > 1.', 5],
+ // with double-quotes and id split accros lines
+ ['This is a text with a
+ new-line in it. Selector = 1.', '{0}This is a text with a
+ new-line in it. Selector = 0.|{1}This is a text with a
+ new-line in it. Selector = 1.|[1,Inf]This is a text with a
+ new-line in it. Selector > 1.', 1],
+ // with single-quotes and id split accros lines
+ ['This is a text with a
+ new-line in it. Selector > 1.', '{0}This is a text with a
+ new-line in it. Selector = 0.|{1}This is a text with a
+ new-line in it. Selector = 1.|[1,Inf]This is a text with a
+ new-line in it. Selector > 1.', 5],
+ // with single-quotes and \n in text
+ ['This is a text with a\nnew-line in it. Selector = 0.', '{0}This is a text with a\nnew-line in it. Selector = 0.|{1}This is a text with a\nnew-line in it. Selector = 1.|[1,Inf]This is a text with a\nnew-line in it. Selector > 1.', 0],
+ // with double-quotes and id split accros lines
+ ["This is a text with a\nnew-line in it. Selector = 1.", "{0}This is a text with a\nnew-line in it. Selector = 0.|{1}This is a text with a\nnew-line in it. Selector = 1.|[1,Inf]This is a text with a\nnew-line in it. Selector > 1.", 1],
+ // esacape pipe
+ ['This is a text with | in it. Selector = 0.', '{0}This is a text with || in it. Selector = 0.|{1}This is a text with || in it. Selector = 1.', 0],
+ // Empty plural set (2 plural forms) from a .PO file
+ ['', '|', 1],
+ // Empty plural set (3 plural forms) from a .PO file
+ ['', '||', 1],
+ ];
+ }
+
+ /**
+ * @dataProvider failingLangcodes
+ */
+ public function testFailedLangcodes($nplural, $langCodes)
+ {
+ $matrix = $this->generateTestData($langCodes);
+ $this->validateMatrix($nplural, $matrix, false);
+ }
+
+ /**
+ * @dataProvider successLangcodes
+ */
+ public function testLangcodes($nplural, $langCodes)
+ {
+ $matrix = $this->generateTestData($langCodes);
+ $this->validateMatrix($nplural, $matrix);
+ }
+
+ /**
+ * This array should contain all currently known langcodes.
+ *
+ * As it is impossible to have this ever complete we should try as hard as possible to have it almost complete.
+ *
+ * @return array
+ */
+ public function successLangcodes()
+ {
+ return [
+ ['1', ['ay', 'bo', 'cgg', 'dz', 'id', 'ja', 'jbo', 'ka', 'kk', 'km', 'ko', 'ky']],
+ ['2', ['nl', 'fr', 'en', 'de', 'de_GE', 'hy', 'hy_AM']],
+ ['3', ['be', 'bs', 'cs', 'hr']],
+ ['4', ['cy', 'mt', 'sl']],
+ ['6', ['ar']],
+ ];
+ }
+
+ /**
+ * This array should be at least empty within the near future.
+ *
+ * This both depends on a complete list trying to add above as understanding
+ * the plural rules of the current failing languages.
+ *
+ * @return array with nplural together with langcodes
+ */
+ public function failingLangcodes()
+ {
+ return [
+ ['1', ['fa']],
+ ['2', ['jbo']],
+ ['3', ['cbs']],
+ ['4', ['gd', 'kw']],
+ ['5', ['ga']],
+ ];
+ }
+
+ /**
+ * We validate only on the plural coverage. Thus the real rules is not tested.
+ *
+ * @param string $nplural Plural expected
+ * @param array $matrix Containing langcodes and their plural index values
+ * @param bool $expectSuccess
+ */
+ protected function validateMatrix($nplural, $matrix, $expectSuccess = true)
+ {
+ foreach ($matrix as $langCode => $data) {
+ $indexes = array_flip($data);
+ if ($expectSuccess) {
+ $this->assertEquals($nplural, \count($indexes), "Langcode '$langCode' has '$nplural' plural forms.");
+ } else {
+ $this->assertNotEquals((int) $nplural, \count($indexes), "Langcode '$langCode' has '$nplural' plural forms.");
+ }
+ }
+ }
+
+ protected function generateTestData($langCodes)
+ {
+ $translator = new class() {
+ use TranslatorTrait {
+ getPluralizationRule as public;
+ }
+ };
+
+ $matrix = [];
+ foreach ($langCodes as $langCode) {
+ for ($count = 0; $count < 200; ++$count) {
+ $plural = $translator->getPluralizationRule($count, $langCode);
+ $matrix[$langCode][$count] = $plural;
+ }
+ }
+
+ return $matrix;
+ }
+}
diff --git a/vendor/symfony/contracts/Translation/TranslatorInterface.php b/vendor/symfony/contracts/Translation/TranslatorInterface.php
new file mode 100644
index 000000000..d86763737
--- /dev/null
+++ b/vendor/symfony/contracts/Translation/TranslatorInterface.php
@@ -0,0 +1,65 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Contracts\Translation;
+
+/**
+ * @author Fabien Potencier
+ */
+interface TranslatorInterface
+{
+ /**
+ * Translates the given message.
+ *
+ * When a number is provided as a parameter named "%count%", the message is parsed for plural
+ * forms and a translation is chosen according to this number using the following rules:
+ *
+ * Given a message with different plural translations separated by a
+ * pipe (|), this method returns the correct portion of the message based
+ * on the given number, locale and the pluralization rules in the message
+ * itself.
+ *
+ * The message supports two different types of pluralization rules:
+ *
+ * interval: {0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples
+ * indexed: There is one apple|There are %count% apples
+ *
+ * The indexed solution can also contain labels (e.g. one: There is one apple).
+ * This is purely for making the translations more clear - it does not
+ * affect the functionality.
+ *
+ * The two methods can also be mixed:
+ * {0} There are no apples|one: There is one apple|more: There are %count% apples
+ *
+ * An interval can represent a finite set of numbers:
+ * {1,2,3,4}
+ *
+ * An interval can represent numbers between two numbers:
+ * [1, +Inf]
+ * ]-1,2[
+ *
+ * The left delimiter can be [ (inclusive) or ] (exclusive).
+ * The right delimiter can be [ (exclusive) or ] (inclusive).
+ * Beside numbers, you can use -Inf and +Inf for the infinite.
+ *
+ * @see https://en.wikipedia.org/wiki/ISO_31-11
+ *
+ * @param string $id The message id (may also be an object that can be cast to string)
+ * @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
+ *
+ * @return string The translated string
+ *
+ * @throws \InvalidArgumentException If the locale contains invalid characters
+ */
+ public function trans($id, array $parameters = [], $domain = null, $locale = null);
+}
diff --git a/vendor/symfony/contracts/Translation/TranslatorTrait.php b/vendor/symfony/contracts/Translation/TranslatorTrait.php
new file mode 100644
index 000000000..a8267342a
--- /dev/null
+++ b/vendor/symfony/contracts/Translation/TranslatorTrait.php
@@ -0,0 +1,257 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Contracts\Translation;
+
+use Symfony\Component\Translation\Exception\InvalidArgumentException;
+
+/**
+ * A trait to help implement TranslatorInterface and LocaleAwareInterface.
+ *
+ * @author Fabien Potencier
+ */
+trait TranslatorTrait
+{
+ private $locale;
+
+ /**
+ * {@inheritdoc}
+ */
+ public function setLocale($locale)
+ {
+ $this->locale = (string) $locale;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getLocale()
+ {
+ return $this->locale ?: \Locale::getDefault();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function trans($id, array $parameters = [], $domain = null, $locale = null)
+ {
+ if ('' === $id = (string) $id) {
+ return '';
+ }
+
+ if (!isset($parameters['%count%']) || !is_numeric($parameters['%count%'])) {
+ return strtr($id, $parameters);
+ }
+
+ $number = (float) $parameters['%count%'];
+ $locale = (string) $locale ?: $this->getLocale();
+
+ $parts = [];
+ if (preg_match('/^\|++$/', $id)) {
+ $parts = explode('|', $id);
+ } elseif (preg_match_all('/(?:\|\||[^\|])++/', $id, $matches)) {
+ $parts = $matches[0];
+ }
+
+ $intervalRegexp = <<<'EOF'
+/^(?P
+ ({\s*
+ (\-?\d+(\.\d+)?[\s*,\s*\-?\d+(\.\d+)?]*)
+ \s*})
+
+ |
+
+ (?P[\[\]])
+ \s*
+ (?P-Inf|\-?\d+(\.\d+)?)
+ \s*,\s*
+ (?P\+?Inf|\-?\d+(\.\d+)?)
+ \s*
+ (?P[\[\]])
+)\s*(?P.*?)$/xs
+EOF;
+
+ $standardRules = [];
+ foreach ($parts as $part) {
+ $part = trim(str_replace('||', '|', $part));
+
+ // try to match an explicit rule, then fallback to the standard ones
+ if (preg_match($intervalRegexp, $part, $matches)) {
+ if ($matches[2]) {
+ foreach (explode(',', $matches[3]) as $n) {
+ if ($number == $n) {
+ return strtr($matches['message'], $parameters);
+ }
+ }
+ } else {
+ $leftNumber = '-Inf' === $matches['left'] ? -INF : (float) $matches['left'];
+ $rightNumber = is_numeric($matches['right']) ? (float) $matches['right'] : INF;
+
+ if (('[' === $matches['left_delimiter'] ? $number >= $leftNumber : $number > $leftNumber)
+ && (']' === $matches['right_delimiter'] ? $number <= $rightNumber : $number < $rightNumber)
+ ) {
+ return strtr($matches['message'], $parameters);
+ }
+ }
+ } elseif (preg_match('/^\w+\:\s*(.*?)$/', $part, $matches)) {
+ $standardRules[] = $matches[1];
+ } else {
+ $standardRules[] = $part;
+ }
+ }
+
+ $position = $this->getPluralizationRule($number, $locale);
+
+ if (!isset($standardRules[$position])) {
+ // when there's exactly one rule given, and that rule is a standard
+ // rule, use this rule
+ if (1 === \count($parts) && isset($standardRules[0])) {
+ return strtr($standardRules[0], $parameters);
+ }
+
+ $message = sprintf('Unable to choose a translation for "%s" with locale "%s" for value "%d". Double check that this translation has the correct plural options (e.g. "There is one apple|There are %%count%% apples").', $id, $locale, $number);
+
+ if (class_exists(InvalidArgumentException::class)) {
+ throw new InvalidArgumentException($message);
+ }
+
+ throw new \InvalidArgumentException($message);
+ }
+
+ return strtr($standardRules[$position], $parameters);
+ }
+
+ /**
+ * Returns the plural position to use for the given locale and number.
+ *
+ * The plural rules are derived from code of the Zend Framework (2010-09-25),
+ * which is subject to the new BSD license (http://framework.zend.com/license/new-bsd).
+ * Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
+ */
+ private function getPluralizationRule(int $number, string $locale): int
+ {
+ switch ('pt_BR' !== $locale && \strlen($locale) > 3 ? substr($locale, 0, strrpos($locale, '_')) : $locale) {
+ case 'af':
+ case 'bn':
+ case 'bg':
+ case 'ca':
+ case 'da':
+ case 'de':
+ case 'el':
+ case 'en':
+ case 'eo':
+ case 'es':
+ case 'et':
+ case 'eu':
+ case 'fa':
+ case 'fi':
+ case 'fo':
+ case 'fur':
+ case 'fy':
+ case 'gl':
+ case 'gu':
+ case 'ha':
+ case 'he':
+ case 'hu':
+ case 'is':
+ case 'it':
+ case 'ku':
+ case 'lb':
+ case 'ml':
+ case 'mn':
+ case 'mr':
+ case 'nah':
+ case 'nb':
+ case 'ne':
+ case 'nl':
+ case 'nn':
+ case 'no':
+ case 'oc':
+ case 'om':
+ case 'or':
+ case 'pa':
+ case 'pap':
+ case 'ps':
+ case 'pt':
+ case 'so':
+ case 'sq':
+ case 'sv':
+ case 'sw':
+ case 'ta':
+ case 'te':
+ case 'tk':
+ case 'ur':
+ case 'zu':
+ return (1 == $number) ? 0 : 1;
+
+ case 'am':
+ case 'bh':
+ case 'fil':
+ case 'fr':
+ case 'gun':
+ case 'hi':
+ case 'hy':
+ case 'ln':
+ case 'mg':
+ case 'nso':
+ case 'pt_BR':
+ case 'ti':
+ case 'wa':
+ return ((0 == $number) || (1 == $number)) ? 0 : 1;
+
+ case 'be':
+ case 'bs':
+ case 'hr':
+ case 'ru':
+ case 'sh':
+ case 'sr':
+ case 'uk':
+ return ((1 == $number % 10) && (11 != $number % 100)) ? 0 : ((($number % 10 >= 2) && ($number % 10 <= 4) && (($number % 100 < 10) || ($number % 100 >= 20))) ? 1 : 2);
+
+ case 'cs':
+ case 'sk':
+ return (1 == $number) ? 0 : ((($number >= 2) && ($number <= 4)) ? 1 : 2);
+
+ case 'ga':
+ return (1 == $number) ? 0 : ((2 == $number) ? 1 : 2);
+
+ case 'lt':
+ return ((1 == $number % 10) && (11 != $number % 100)) ? 0 : ((($number % 10 >= 2) && (($number % 100 < 10) || ($number % 100 >= 20))) ? 1 : 2);
+
+ case 'sl':
+ return (1 == $number % 100) ? 0 : ((2 == $number % 100) ? 1 : (((3 == $number % 100) || (4 == $number % 100)) ? 2 : 3));
+
+ case 'mk':
+ return (1 == $number % 10) ? 0 : 1;
+
+ case 'mt':
+ return (1 == $number) ? 0 : (((0 == $number) || (($number % 100 > 1) && ($number % 100 < 11))) ? 1 : ((($number % 100 > 10) && ($number % 100 < 20)) ? 2 : 3));
+
+ case 'lv':
+ return (0 == $number) ? 0 : (((1 == $number % 10) && (11 != $number % 100)) ? 1 : 2);
+
+ case 'pl':
+ return (1 == $number) ? 0 : ((($number % 10 >= 2) && ($number % 10 <= 4) && (($number % 100 < 12) || ($number % 100 > 14))) ? 1 : 2);
+
+ case 'cy':
+ return (1 == $number) ? 0 : ((2 == $number) ? 1 : (((8 == $number) || (11 == $number)) ? 2 : 3));
+
+ case 'ro':
+ return (1 == $number) ? 0 : (((0 == $number) || (($number % 100 > 0) && ($number % 100 < 20))) ? 1 : 2);
+
+ case 'ar':
+ return (0 == $number) ? 0 : ((1 == $number) ? 1 : ((2 == $number) ? 2 : ((($number % 100 >= 3) && ($number % 100 <= 10)) ? 3 : ((($number % 100 >= 11) && ($number % 100 <= 99)) ? 4 : 5))));
+
+ default:
+ return 0;
+ }
+ }
+}
diff --git a/vendor/symfony/contracts/Translation/composer.json b/vendor/symfony/contracts/Translation/composer.json
new file mode 100644
index 000000000..09749d35f
--- /dev/null
+++ b/vendor/symfony/contracts/Translation/composer.json
@@ -0,0 +1,33 @@
+{
+ "name": "symfony/translation-contracts",
+ "type": "library",
+ "description": "Generic abstractions related to translation",
+ "keywords": ["abstractions", "contracts", "decoupling", "interfaces", "interoperability", "standards"],
+ "homepage": "https://symfony.com",
+ "license": "MIT",
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "require": {
+ "php": "^7.1.3"
+ },
+ "suggest": {
+ "symfony/translation-implementation": ""
+ },
+ "autoload": {
+ "psr-4": { "Symfony\\Contracts\\Translation\\": "" }
+ },
+ "minimum-stability": "dev",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.1-dev"
+ }
+ }
+}
diff --git a/vendor/symfony/contracts/composer.json b/vendor/symfony/contracts/composer.json
new file mode 100644
index 000000000..b9277e1dd
--- /dev/null
+++ b/vendor/symfony/contracts/composer.json
@@ -0,0 +1,53 @@
+{
+ "name": "symfony/contracts",
+ "type": "library",
+ "description": "A set of abstractions extracted out of the Symfony components",
+ "keywords": ["abstractions", "contracts", "decoupling", "interfaces", "interoperability", "standards"],
+ "homepage": "https://symfony.com",
+ "license": "MIT",
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "require": {
+ "php": "^7.1.3",
+ "psr/cache": "^1.0",
+ "psr/container": "^1.0"
+ },
+ "require-dev": {
+ "symfony/polyfill-intl-idn": "^1.10"
+ },
+ "replace": {
+ "symfony/cache-contracts": "self.version",
+ "symfony/event-dispatcher-contracts": "self.version",
+ "symfony/http-client-contracts": "self.version",
+ "symfony/service-contracts": "self.version",
+ "symfony/translation-contracts": "self.version"
+ },
+ "suggest": {
+ "psr/event-dispatcher": "When using the EventDispatcher contracts",
+ "symfony/cache-implementation": "",
+ "symfony/event-dispatcher-implementation": "",
+ "symfony/http-client-implementation": "",
+ "symfony/service-implementation": "",
+ "symfony/translation-implementation": ""
+ },
+ "autoload": {
+ "psr-4": { "Symfony\\Contracts\\": "" },
+ "exclude-from-classmap": [
+ "**/Tests/"
+ ]
+ },
+ "minimum-stability": "dev",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.1-dev"
+ }
+ }
+}
diff --git a/vendor/symfony/debug/phpunit.xml.dist b/vendor/symfony/contracts/phpunit.xml.dist
similarity index 71%
rename from vendor/symfony/debug/phpunit.xml.dist
rename to vendor/symfony/contracts/phpunit.xml.dist
index 12e58612b..fd93d020f 100644
--- a/vendor/symfony/debug/phpunit.xml.dist
+++ b/vendor/symfony/contracts/phpunit.xml.dist
@@ -1,7 +1,7 @@
-
+
./Tests/
-
-
- ./Resources/ext/tests/
+ ./Service/Test/
+ ./Translation/Test/
@@ -26,8 +25,11 @@
./
./Tests
+ ./Service/Test/
+ ./Translation/Test/
./vendor
+
diff --git a/vendor/symfony/debug/BufferingLogger.php b/vendor/symfony/debug/BufferingLogger.php
deleted file mode 100644
index a2ed75b9d..000000000
--- a/vendor/symfony/debug/BufferingLogger.php
+++ /dev/null
@@ -1,37 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Debug;
-
-use Psr\Log\AbstractLogger;
-
-/**
- * A buffering logger that stacks logs for later.
- *
- * @author Nicolas Grekas
- */
-class BufferingLogger extends AbstractLogger
-{
- private $logs = array();
-
- public function log($level, $message, array $context = array())
- {
- $this->logs[] = array($level, $message, $context);
- }
-
- public function cleanLogs()
- {
- $logs = $this->logs;
- $this->logs = array();
-
- return $logs;
- }
-}
diff --git a/vendor/symfony/debug/CHANGELOG.md b/vendor/symfony/debug/CHANGELOG.md
deleted file mode 100644
index 31c67eb60..000000000
--- a/vendor/symfony/debug/CHANGELOG.md
+++ /dev/null
@@ -1,64 +0,0 @@
-CHANGELOG
-=========
-
-3.4.0
------
-
-* deprecated `ErrorHandler::stackErrors()` and `ErrorHandler::unstackErrors()`
-
-3.3.0
------
-
-* deprecated the `ContextErrorException` class: use \ErrorException directly now
-
-3.2.0
------
-
-* `FlattenException::getTrace()` now returns additional type descriptions
- `integer` and `float`.
-
-
-3.0.0
------
-
-* removed classes, methods and interfaces deprecated in 2.x
-
-2.8.0
------
-
-* added BufferingLogger for errors that happen before a proper logger is configured
-* allow throwing from `__toString()` with `return trigger_error($e, E_USER_ERROR);`
-* deprecate ExceptionHandler::createResponse
-
-2.7.0
------
-
-* added deprecations checking for parent interfaces/classes to DebugClassLoader
-* added ZTS support to symfony_debug extension
-* added symfony_debug_backtrace() to symfony_debug extension
- to track the backtrace of fatal errors
-
-2.6.0
------
-
-* generalized ErrorHandler and ExceptionHandler,
- with some new methods and others deprecated
-* enhanced error messages for uncaught exceptions
-
-2.5.0
------
-
-* added ExceptionHandler::setHandler()
-* added UndefinedMethodFatalErrorHandler
-* deprecated DummyException
-
-2.4.0
------
-
- * added a DebugClassLoader able to wrap any autoloader providing a findFile method
- * improved error messages for not found classes and functions
-
-2.3.0
------
-
- * added the component
diff --git a/vendor/symfony/debug/Debug.php b/vendor/symfony/debug/Debug.php
deleted file mode 100644
index e3665ae5f..000000000
--- a/vendor/symfony/debug/Debug.php
+++ /dev/null
@@ -1,63 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Debug;
-
-/**
- * Registers all the debug tools.
- *
- * @author Fabien Potencier
- */
-class Debug
-{
- private static $enabled = false;
-
- /**
- * Enables the debug tools.
- *
- * This method registers an error handler and an exception handler.
- *
- * If the Symfony ClassLoader component is available, a special
- * class loader is also registered.
- *
- * @param int $errorReportingLevel The level of error reporting you want
- * @param bool $displayErrors Whether to display errors (for development) or just log them (for production)
- */
- public static function enable($errorReportingLevel = E_ALL, $displayErrors = true)
- {
- if (static::$enabled) {
- return;
- }
-
- static::$enabled = true;
-
- if (null !== $errorReportingLevel) {
- error_reporting($errorReportingLevel);
- } else {
- error_reporting(E_ALL);
- }
-
- if ('cli' !== PHP_SAPI) {
- ini_set('display_errors', 0);
- ExceptionHandler::register();
- } elseif ($displayErrors && (!ini_get('log_errors') || ini_get('error_log'))) {
- // CLI - display errors only if they're not already logged to STDERR
- ini_set('display_errors', 1);
- }
- if ($displayErrors) {
- ErrorHandler::register(new ErrorHandler(new BufferingLogger()));
- } else {
- ErrorHandler::register()->throwAt(0, true);
- }
-
- DebugClassLoader::enable();
- }
-}
diff --git a/vendor/symfony/debug/DebugClassLoader.php b/vendor/symfony/debug/DebugClassLoader.php
deleted file mode 100644
index 9ff826ed0..000000000
--- a/vendor/symfony/debug/DebugClassLoader.php
+++ /dev/null
@@ -1,384 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Debug;
-
-/**
- * Autoloader checking if the class is really defined in the file found.
- *
- * The ClassLoader will wrap all registered autoloaders
- * and will throw an exception if a file is found but does
- * not declare the class.
- *
- * @author Fabien Potencier
- * @author Christophe Coevoet
- * @author Nicolas Grekas
- */
-class DebugClassLoader
-{
- private $classLoader;
- private $isFinder;
- private $loaded = array();
- private static $caseCheck;
- private static $final = array();
- private static $finalMethods = array();
- private static $deprecated = array();
- private static $internal = array();
- private static $internalMethods = array();
- private static $php7Reserved = array('int', 'float', 'bool', 'string', 'true', 'false', 'null');
- private static $darwinCache = array('/' => array('/', array()));
-
- public function __construct(callable $classLoader)
- {
- $this->classLoader = $classLoader;
- $this->isFinder = is_array($classLoader) && method_exists($classLoader[0], 'findFile');
-
- if (!isset(self::$caseCheck)) {
- $file = file_exists(__FILE__) ? __FILE__ : rtrim(realpath('.'), DIRECTORY_SEPARATOR);
- $i = strrpos($file, DIRECTORY_SEPARATOR);
- $dir = substr($file, 0, 1 + $i);
- $file = substr($file, 1 + $i);
- $test = strtoupper($file) === $file ? strtolower($file) : strtoupper($file);
- $test = realpath($dir.$test);
-
- if (false === $test || false === $i) {
- // filesystem is case sensitive
- self::$caseCheck = 0;
- } elseif (substr($test, -strlen($file)) === $file) {
- // filesystem is case insensitive and realpath() normalizes the case of characters
- self::$caseCheck = 1;
- } elseif (false !== stripos(PHP_OS, 'darwin')) {
- // on MacOSX, HFS+ is case insensitive but realpath() doesn't normalize the case of characters
- self::$caseCheck = 2;
- } else {
- // filesystem case checks failed, fallback to disabling them
- self::$caseCheck = 0;
- }
- }
- }
-
- /**
- * Gets the wrapped class loader.
- *
- * @return callable The wrapped class loader
- */
- public function getClassLoader()
- {
- return $this->classLoader;
- }
-
- /**
- * Wraps all autoloaders.
- */
- public static function enable()
- {
- // Ensures we don't hit https://bugs.php.net/42098
- class_exists('Symfony\Component\Debug\ErrorHandler');
- class_exists('Psr\Log\LogLevel');
-
- if (!is_array($functions = spl_autoload_functions())) {
- return;
- }
-
- foreach ($functions as $function) {
- spl_autoload_unregister($function);
- }
-
- foreach ($functions as $function) {
- if (!is_array($function) || !$function[0] instanceof self) {
- $function = array(new static($function), 'loadClass');
- }
-
- spl_autoload_register($function);
- }
- }
-
- /**
- * Disables the wrapping.
- */
- public static function disable()
- {
- if (!is_array($functions = spl_autoload_functions())) {
- return;
- }
-
- foreach ($functions as $function) {
- spl_autoload_unregister($function);
- }
-
- foreach ($functions as $function) {
- if (is_array($function) && $function[0] instanceof self) {
- $function = $function[0]->getClassLoader();
- }
-
- spl_autoload_register($function);
- }
- }
-
- /**
- * Loads the given class or interface.
- *
- * @param string $class The name of the class
- *
- * @return bool|null True, if loaded
- *
- * @throws \RuntimeException
- */
- public function loadClass($class)
- {
- $e = error_reporting(error_reporting() | E_PARSE | E_ERROR | E_CORE_ERROR | E_COMPILE_ERROR);
-
- try {
- if ($this->isFinder && !isset($this->loaded[$class])) {
- $this->loaded[$class] = true;
- if ($file = $this->classLoader[0]->findFile($class)) {
- require $file;
- }
- } else {
- call_user_func($this->classLoader, $class);
- $file = false;
- }
- } finally {
- error_reporting($e);
- }
-
- $exists = class_exists($class, false) || interface_exists($class, false) || trait_exists($class, false);
-
- if ($class && '\\' === $class[0]) {
- $class = substr($class, 1);
- }
-
- if ($exists) {
- $refl = new \ReflectionClass($class);
- $name = $refl->getName();
-
- if ($name !== $class && 0 === strcasecmp($name, $class)) {
- throw new \RuntimeException(sprintf('Case mismatch between loaded and declared class names: "%s" vs "%s".', $class, $name));
- }
-
- // Don't trigger deprecations for classes in the same vendor
- if (2 > $len = 1 + (strpos($name, '\\') ?: strpos($name, '_'))) {
- $len = 0;
- $ns = '';
- } else {
- $ns = substr($name, 0, $len);
- }
-
- // Detect annotations on the class
- if (false !== $doc = $refl->getDocComment()) {
- foreach (array('final', 'deprecated', 'internal') as $annotation) {
- if (false !== strpos($doc, '@'.$annotation) && preg_match('#\n \* @'.$annotation.'(?:( .+?)\.?)?\r?\n \*(?: @|/$)#s', $doc, $notice)) {
- self::${$annotation}[$name] = isset($notice[1]) ? preg_replace('#\s*\r?\n \* +#', ' ', $notice[1]) : '';
- }
- }
- }
-
- $parentAndTraits = class_uses($name, false);
- if ($parent = get_parent_class($class)) {
- $parentAndTraits[] = $parent;
-
- if (isset(self::$final[$parent])) {
- @trigger_error(sprintf('The "%s" class is considered final%s. It may change without further notice as of its next major version. You should not extend it from "%s".', $parent, self::$final[$parent], $name), E_USER_DEPRECATED);
- }
- }
-
- // Detect if the parent is annotated
- foreach ($parentAndTraits + $this->getOwnInterfaces($name, $parent) as $use) {
- if (isset(self::$deprecated[$use]) && strncmp($ns, $use, $len)) {
- $type = class_exists($name, false) ? 'class' : (interface_exists($name, false) ? 'interface' : 'trait');
- $verb = class_exists($use, false) || interface_exists($name, false) ? 'extends' : (interface_exists($use, false) ? 'implements' : 'uses');
-
- @trigger_error(sprintf('The "%s" %s %s "%s" that is deprecated%s.', $name, $type, $verb, $use, self::$deprecated[$use]), E_USER_DEPRECATED);
- }
- if (isset(self::$internal[$use]) && strncmp($ns, $use, $len)) {
- @trigger_error(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], $name), E_USER_DEPRECATED);
- }
- }
-
- // Inherit @final and @internal annotations for methods
- self::$finalMethods[$name] = array();
- self::$internalMethods[$name] = array();
- foreach ($parentAndTraits as $use) {
- foreach (array('finalMethods', 'internalMethods') as $property) {
- if (isset(self::${$property}[$use])) {
- self::${$property}[$name] = array_merge(self::${$property}[$name], self::${$property}[$use]);
- }
- }
- }
-
- $isClass = class_exists($name, false);
- foreach ($refl->getMethods(\ReflectionMethod::IS_PUBLIC | \ReflectionMethod::IS_PROTECTED) as $method) {
- if ($method->class !== $name) {
- continue;
- }
-
- // Method from a trait
- if ($method->getFilename() !== $refl->getFileName()) {
- continue;
- }
-
- if ($isClass && $parent && isset(self::$finalMethods[$parent][$method->name])) {
- list($declaringClass, $message) = self::$finalMethods[$parent][$method->name];
- @trigger_error(sprintf('The "%s::%s()" method is considered final%s. It may change without further notice as of its next major version. You should not extend it from "%s".', $declaringClass, $method->name, $message, $name), E_USER_DEPRECATED);
- }
-
- foreach ($parentAndTraits as $use) {
- if (isset(self::$internalMethods[$use][$method->name])) {
- list($declaringClass, $message) = self::$internalMethods[$use][$method->name];
- if (strncmp($ns, $declaringClass, $len)) {
- @trigger_error(sprintf('The "%s::%s()" method is considered internal%s. It may change without further notice. You should not extend it from "%s".', $declaringClass, $method->name, $message, $name), E_USER_DEPRECATED);
- }
- }
- }
-
- // Detect method annotations
- if (false === $doc = $method->getDocComment()) {
- continue;
- }
-
- foreach (array('final', 'internal') as $annotation) {
- if (false !== strpos($doc, '@'.$annotation) && preg_match('#\n\s+\* @'.$annotation.'(?:( .+?)\.?)?\r?\n\s+\*(?: @|/$)#s', $doc, $notice)) {
- $message = isset($notice[1]) ? preg_replace('#\s*\r?\n \* +#', ' ', $notice[1]) : '';
- self::${$annotation.'Methods'}[$name][$method->name] = array($name, $message);
- }
- }
- }
-
- if (in_array(strtolower($refl->getShortName()), self::$php7Reserved)) {
- @trigger_error(sprintf('The "%s" class uses the reserved name "%s", it will break on PHP 7 and higher', $name, $refl->getShortName()), E_USER_DEPRECATED);
- }
- }
-
- if ($file) {
- if (!$exists) {
- if (false !== strpos($class, '/')) {
- throw new \RuntimeException(sprintf('Trying to autoload a class with an invalid name "%s". Be careful that the namespace separator is "\" in PHP, not "/".', $class));
- }
-
- throw new \RuntimeException(sprintf('The autoloader expected class "%s" to be defined in file "%s". The file was found but the class was not in it, the class name or namespace probably has a typo.', $class, $file));
- }
- if (self::$caseCheck) {
- $real = explode('\\', $class.strrchr($file, '.'));
- $tail = explode(DIRECTORY_SEPARATOR, str_replace('/', DIRECTORY_SEPARATOR, $file));
-
- $i = count($tail) - 1;
- $j = count($real) - 1;
-
- while (isset($tail[$i], $real[$j]) && $tail[$i] === $real[$j]) {
- --$i;
- --$j;
- }
-
- array_splice($tail, 0, $i + 1);
- }
- if (self::$caseCheck && $tail) {
- $tail = DIRECTORY_SEPARATOR.implode(DIRECTORY_SEPARATOR, $tail);
- $tailLen = strlen($tail);
- $real = $refl->getFileName();
-
- if (2 === self::$caseCheck) {
- // realpath() on MacOSX doesn't normalize the case of characters
-
- $i = 1 + strrpos($real, '/');
- $file = substr($real, $i);
- $real = substr($real, 0, $i);
-
- if (isset(self::$darwinCache[$real])) {
- $kDir = $real;
- } else {
- $kDir = strtolower($real);
-
- if (isset(self::$darwinCache[$kDir])) {
- $real = self::$darwinCache[$kDir][0];
- } else {
- $dir = getcwd();
- chdir($real);
- $real = getcwd().'/';
- chdir($dir);
-
- $dir = $real;
- $k = $kDir;
- $i = strlen($dir) - 1;
- while (!isset(self::$darwinCache[$k])) {
- self::$darwinCache[$k] = array($dir, array());
- self::$darwinCache[$dir] = &self::$darwinCache[$k];
-
- while ('/' !== $dir[--$i]) {
- }
- $k = substr($k, 0, ++$i);
- $dir = substr($dir, 0, $i--);
- }
- }
- }
-
- $dirFiles = self::$darwinCache[$kDir][1];
-
- if (isset($dirFiles[$file])) {
- $kFile = $file;
- } else {
- $kFile = strtolower($file);
-
- if (!isset($dirFiles[$kFile])) {
- foreach (scandir($real, 2) as $f) {
- if ('.' !== $f[0]) {
- $dirFiles[$f] = $f;
- if ($f === $file) {
- $kFile = $k = $file;
- } elseif ($f !== $k = strtolower($f)) {
- $dirFiles[$k] = $f;
- }
- }
- }
- self::$darwinCache[$kDir][1] = $dirFiles;
- }
- }
-
- $real .= $dirFiles[$kFile];
- }
-
- if (0 === substr_compare($real, $tail, -$tailLen, $tailLen, true)
- && 0 !== substr_compare($real, $tail, -$tailLen, $tailLen, false)
- ) {
- throw new \RuntimeException(sprintf('Case mismatch between class and real file names: "%s" vs "%s" in "%s".', substr($tail, -$tailLen + 1), substr($real, -$tailLen + 1), substr($real, 0, -$tailLen + 1)));
- }
- }
-
- return true;
- }
- }
-
- /**
- * `class_implements` includes interfaces from the parents so we have to manually exclude them.
- *
- * @param string $class
- * @param string|false $parent
- *
- * @return string[]
- */
- private function getOwnInterfaces($class, $parent)
- {
- $ownInterfaces = class_implements($class, false);
-
- if ($parent) {
- foreach (class_implements($parent, false) as $interface) {
- unset($ownInterfaces[$interface]);
- }
- }
-
- foreach ($ownInterfaces as $interface) {
- foreach (class_implements($interface) as $interface) {
- unset($ownInterfaces[$interface]);
- }
- }
-
- return $ownInterfaces;
- }
-}
diff --git a/vendor/symfony/debug/ErrorHandler.php b/vendor/symfony/debug/ErrorHandler.php
deleted file mode 100644
index aebb740ad..000000000
--- a/vendor/symfony/debug/ErrorHandler.php
+++ /dev/null
@@ -1,746 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Debug;
-
-use Psr\Log\LogLevel;
-use Psr\Log\LoggerInterface;
-use Symfony\Component\Debug\Exception\ContextErrorException;
-use Symfony\Component\Debug\Exception\FatalErrorException;
-use Symfony\Component\Debug\Exception\FatalThrowableError;
-use Symfony\Component\Debug\Exception\OutOfMemoryException;
-use Symfony\Component\Debug\Exception\SilencedErrorContext;
-use Symfony\Component\Debug\FatalErrorHandler\UndefinedFunctionFatalErrorHandler;
-use Symfony\Component\Debug\FatalErrorHandler\UndefinedMethodFatalErrorHandler;
-use Symfony\Component\Debug\FatalErrorHandler\ClassNotFoundFatalErrorHandler;
-use Symfony\Component\Debug\FatalErrorHandler\FatalErrorHandlerInterface;
-
-/**
- * A generic ErrorHandler for the PHP engine.
- *
- * Provides five bit fields that control how errors are handled:
- * - thrownErrors: errors thrown as \ErrorException
- * - loggedErrors: logged errors, when not @-silenced
- * - scopedErrors: errors thrown or logged with their local context
- * - tracedErrors: errors logged with their stack trace
- * - screamedErrors: never @-silenced errors
- *
- * Each error level can be logged by a dedicated PSR-3 logger object.
- * Screaming only applies to logging.
- * Throwing takes precedence over logging.
- * Uncaught exceptions are logged as E_ERROR.
- * E_DEPRECATED and E_USER_DEPRECATED levels never throw.
- * E_RECOVERABLE_ERROR and E_USER_ERROR levels always throw.
- * Non catchable errors that can be detected at shutdown time are logged when the scream bit field allows so.
- * As errors have a performance cost, repeated errors are all logged, so that the developer
- * can see them and weight them as more important to fix than others of the same level.
- *
- * @author Nicolas Grekas
- * @author Grégoire Pineau
- */
-class ErrorHandler
-{
- private $levels = array(
- E_DEPRECATED => 'Deprecated',
- E_USER_DEPRECATED => 'User Deprecated',
- E_NOTICE => 'Notice',
- E_USER_NOTICE => 'User Notice',
- E_STRICT => 'Runtime Notice',
- E_WARNING => 'Warning',
- E_USER_WARNING => 'User Warning',
- E_COMPILE_WARNING => 'Compile Warning',
- E_CORE_WARNING => 'Core Warning',
- E_USER_ERROR => 'User Error',
- E_RECOVERABLE_ERROR => 'Catchable Fatal Error',
- E_COMPILE_ERROR => 'Compile Error',
- E_PARSE => 'Parse Error',
- E_ERROR => 'Error',
- E_CORE_ERROR => 'Core Error',
- );
-
- private $loggers = array(
- E_DEPRECATED => array(null, LogLevel::INFO),
- E_USER_DEPRECATED => array(null, LogLevel::INFO),
- E_NOTICE => array(null, LogLevel::WARNING),
- E_USER_NOTICE => array(null, LogLevel::WARNING),
- E_STRICT => array(null, LogLevel::WARNING),
- E_WARNING => array(null, LogLevel::WARNING),
- E_USER_WARNING => array(null, LogLevel::WARNING),
- E_COMPILE_WARNING => array(null, LogLevel::WARNING),
- E_CORE_WARNING => array(null, LogLevel::WARNING),
- E_USER_ERROR => array(null, LogLevel::CRITICAL),
- E_RECOVERABLE_ERROR => array(null, LogLevel::CRITICAL),
- E_COMPILE_ERROR => array(null, LogLevel::CRITICAL),
- E_PARSE => array(null, LogLevel::CRITICAL),
- E_ERROR => array(null, LogLevel::CRITICAL),
- E_CORE_ERROR => array(null, LogLevel::CRITICAL),
- );
-
- private $thrownErrors = 0x1FFF; // E_ALL - E_DEPRECATED - E_USER_DEPRECATED
- private $scopedErrors = 0x1FFF; // E_ALL - E_DEPRECATED - E_USER_DEPRECATED
- private $tracedErrors = 0x77FB; // E_ALL - E_STRICT - E_PARSE
- private $screamedErrors = 0x55; // E_ERROR + E_CORE_ERROR + E_COMPILE_ERROR + E_PARSE
- private $loggedErrors = 0;
- private $traceReflector;
-
- private $isRecursive = 0;
- private $isRoot = false;
- private $exceptionHandler;
- private $bootstrappingLogger;
-
- private static $reservedMemory;
- private static $stackedErrors = array();
- private static $stackedErrorLevels = array();
- private static $toStringException = null;
- private static $silencedErrorCache = array();
- private static $silencedErrorCount = 0;
- private static $exitCode = 0;
-
- /**
- * Registers the error handler.
- *
- * @param self|null $handler The handler to register
- * @param bool $replace Whether to replace or not any existing handler
- *
- * @return self The registered error handler
- */
- public static function register(self $handler = null, $replace = true)
- {
- if (null === self::$reservedMemory) {
- self::$reservedMemory = str_repeat('x', 10240);
- register_shutdown_function(__CLASS__.'::handleFatalError');
- }
-
- if ($handlerIsNew = null === $handler) {
- $handler = new static();
- }
-
- if (null === $prev = set_error_handler(array($handler, 'handleError'))) {
- restore_error_handler();
- // Specifying the error types earlier would expose us to https://bugs.php.net/63206
- set_error_handler(array($handler, 'handleError'), $handler->thrownErrors | $handler->loggedErrors);
- $handler->isRoot = true;
- }
-
- if ($handlerIsNew && is_array($prev) && $prev[0] instanceof self) {
- $handler = $prev[0];
- $replace = false;
- }
- if ($replace || !$prev) {
- $handler->setExceptionHandler(set_exception_handler(array($handler, 'handleException')));
- } else {
- restore_error_handler();
- }
-
- $handler->throwAt(E_ALL & $handler->thrownErrors, true);
-
- return $handler;
- }
-
- public function __construct(BufferingLogger $bootstrappingLogger = null)
- {
- if ($bootstrappingLogger) {
- $this->bootstrappingLogger = $bootstrappingLogger;
- $this->setDefaultLogger($bootstrappingLogger);
- }
- $this->traceReflector = new \ReflectionProperty('Exception', 'trace');
- $this->traceReflector->setAccessible(true);
- }
-
- /**
- * Sets a logger to non assigned errors levels.
- *
- * @param LoggerInterface $logger A PSR-3 logger to put as default for the given levels
- * @param array|int $levels An array map of E_* to LogLevel::* or an integer bit field of E_* constants
- * @param bool $replace Whether to replace or not any existing logger
- */
- public function setDefaultLogger(LoggerInterface $logger, $levels = E_ALL, $replace = false)
- {
- $loggers = array();
-
- if (is_array($levels)) {
- foreach ($levels as $type => $logLevel) {
- if (empty($this->loggers[$type][0]) || $replace || $this->loggers[$type][0] === $this->bootstrappingLogger) {
- $loggers[$type] = array($logger, $logLevel);
- }
- }
- } else {
- if (null === $levels) {
- $levels = E_ALL;
- }
- foreach ($this->loggers as $type => $log) {
- if (($type & $levels) && (empty($log[0]) || $replace || $log[0] === $this->bootstrappingLogger)) {
- $log[0] = $logger;
- $loggers[$type] = $log;
- }
- }
- }
-
- $this->setLoggers($loggers);
- }
-
- /**
- * Sets a logger for each error level.
- *
- * @param array $loggers Error levels to [LoggerInterface|null, LogLevel::*] map
- *
- * @return array The previous map
- *
- * @throws \InvalidArgumentException
- */
- public function setLoggers(array $loggers)
- {
- $prevLogged = $this->loggedErrors;
- $prev = $this->loggers;
- $flush = array();
-
- foreach ($loggers as $type => $log) {
- if (!isset($prev[$type])) {
- throw new \InvalidArgumentException('Unknown error type: '.$type);
- }
- if (!is_array($log)) {
- $log = array($log);
- } elseif (!array_key_exists(0, $log)) {
- throw new \InvalidArgumentException('No logger provided');
- }
- if (null === $log[0]) {
- $this->loggedErrors &= ~$type;
- } elseif ($log[0] instanceof LoggerInterface) {
- $this->loggedErrors |= $type;
- } else {
- throw new \InvalidArgumentException('Invalid logger provided');
- }
- $this->loggers[$type] = $log + $prev[$type];
-
- if ($this->bootstrappingLogger && $prev[$type][0] === $this->bootstrappingLogger) {
- $flush[$type] = $type;
- }
- }
- $this->reRegister($prevLogged | $this->thrownErrors);
-
- if ($flush) {
- foreach ($this->bootstrappingLogger->cleanLogs() as $log) {
- $type = $log[2]['exception'] instanceof \ErrorException ? $log[2]['exception']->getSeverity() : E_ERROR;
- if (!isset($flush[$type])) {
- $this->bootstrappingLogger->log($log[0], $log[1], $log[2]);
- } elseif ($this->loggers[$type][0]) {
- $this->loggers[$type][0]->log($this->loggers[$type][1], $log[1], $log[2]);
- }
- }
- }
-
- return $prev;
- }
-
- /**
- * Sets a user exception handler.
- *
- * @param callable $handler A handler that will be called on Exception
- *
- * @return callable|null The previous exception handler
- */
- public function setExceptionHandler(callable $handler = null)
- {
- $prev = $this->exceptionHandler;
- $this->exceptionHandler = $handler;
-
- return $prev;
- }
-
- /**
- * Sets the PHP error levels that throw an exception when a PHP error occurs.
- *
- * @param int $levels A bit field of E_* constants for thrown errors
- * @param bool $replace Replace or amend the previous value
- *
- * @return int The previous value
- */
- public function throwAt($levels, $replace = false)
- {
- $prev = $this->thrownErrors;
- $this->thrownErrors = ($levels | E_RECOVERABLE_ERROR | E_USER_ERROR) & ~E_USER_DEPRECATED & ~E_DEPRECATED;
- if (!$replace) {
- $this->thrownErrors |= $prev;
- }
- $this->reRegister($prev | $this->loggedErrors);
-
- return $prev;
- }
-
- /**
- * Sets the PHP error levels for which local variables are preserved.
- *
- * @param int $levels A bit field of E_* constants for scoped errors
- * @param bool $replace Replace or amend the previous value
- *
- * @return int The previous value
- */
- public function scopeAt($levels, $replace = false)
- {
- $prev = $this->scopedErrors;
- $this->scopedErrors = (int) $levels;
- if (!$replace) {
- $this->scopedErrors |= $prev;
- }
-
- return $prev;
- }
-
- /**
- * Sets the PHP error levels for which the stack trace is preserved.
- *
- * @param int $levels A bit field of E_* constants for traced errors
- * @param bool $replace Replace or amend the previous value
- *
- * @return int The previous value
- */
- public function traceAt($levels, $replace = false)
- {
- $prev = $this->tracedErrors;
- $this->tracedErrors = (int) $levels;
- if (!$replace) {
- $this->tracedErrors |= $prev;
- }
-
- return $prev;
- }
-
- /**
- * Sets the error levels where the @-operator is ignored.
- *
- * @param int $levels A bit field of E_* constants for screamed errors
- * @param bool $replace Replace or amend the previous value
- *
- * @return int The previous value
- */
- public function screamAt($levels, $replace = false)
- {
- $prev = $this->screamedErrors;
- $this->screamedErrors = (int) $levels;
- if (!$replace) {
- $this->screamedErrors |= $prev;
- }
-
- return $prev;
- }
-
- /**
- * Re-registers as a PHP error handler if levels changed.
- */
- private function reRegister($prev)
- {
- if ($prev !== $this->thrownErrors | $this->loggedErrors) {
- $handler = set_error_handler('var_dump');
- $handler = is_array($handler) ? $handler[0] : null;
- restore_error_handler();
- if ($handler === $this) {
- restore_error_handler();
- if ($this->isRoot) {
- set_error_handler(array($this, 'handleError'), $this->thrownErrors | $this->loggedErrors);
- } else {
- set_error_handler(array($this, 'handleError'));
- }
- }
- }
- }
-
- /**
- * Handles errors by filtering then logging them according to the configured bit fields.
- *
- * @param int $type One of the E_* constants
- * @param string $message
- * @param string $file
- * @param int $line
- *
- * @return bool Returns false when no handling happens so that the PHP engine can handle the error itself
- *
- * @throws \ErrorException When $this->thrownErrors requests so
- *
- * @internal
- */
- public function handleError($type, $message, $file, $line)
- {
- // Level is the current error reporting level to manage silent error.
- // Strong errors are not authorized to be silenced.
- $level = error_reporting() | E_RECOVERABLE_ERROR | E_USER_ERROR | E_DEPRECATED | E_USER_DEPRECATED;
- $log = $this->loggedErrors & $type;
- $throw = $this->thrownErrors & $type & $level;
- $type &= $level | $this->screamedErrors;
-
- if (!$type || (!$log && !$throw)) {
- return $type && $log;
- }
- $scope = $this->scopedErrors & $type;
-
- if (4 < $numArgs = func_num_args()) {
- $context = $scope ? (func_get_arg(4) ?: array()) : array();
- $backtrace = 5 < $numArgs ? func_get_arg(5) : null; // defined on HHVM
- } else {
- $context = array();
- $backtrace = null;
- }
-
- if (isset($context['GLOBALS']) && $scope) {
- $e = $context; // Whatever the signature of the method,
- unset($e['GLOBALS'], $context); // $context is always a reference in 5.3
- $context = $e;
- }
-
- if (null !== $backtrace && $type & E_ERROR) {
- // E_ERROR fatal errors are triggered on HHVM when
- // hhvm.error_handling.call_user_handler_on_fatals=1
- // which is the way to get their backtrace.
- $this->handleFatalError(compact('type', 'message', 'file', 'line', 'backtrace'));
-
- return true;
- }
-
- $logMessage = $this->levels[$type].': '.$message;
-
- if (null !== self::$toStringException) {
- $errorAsException = self::$toStringException;
- self::$toStringException = null;
- } elseif (!$throw && !($type & $level)) {
- if (!isset(self::$silencedErrorCache[$id = $file.':'.$line])) {
- $lightTrace = $this->tracedErrors & $type ? $this->cleanTrace(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 3), $type, $file, $line, false) : array();
- $errorAsException = new SilencedErrorContext($type, $file, $line, $lightTrace);
- } elseif (isset(self::$silencedErrorCache[$id][$message])) {
- $lightTrace = null;
- $errorAsException = self::$silencedErrorCache[$id][$message];
- ++$errorAsException->count;
- } else {
- $lightTrace = array();
- $errorAsException = null;
- }
-
- if (100 < ++self::$silencedErrorCount) {
- self::$silencedErrorCache = $lightTrace = array();
- self::$silencedErrorCount = 1;
- }
- if ($errorAsException) {
- self::$silencedErrorCache[$id][$message] = $errorAsException;
- }
- if (null === $lightTrace) {
- return;
- }
- } else {
- if ($scope) {
- $errorAsException = new ContextErrorException($logMessage, 0, $type, $file, $line, $context);
- } else {
- $errorAsException = new \ErrorException($logMessage, 0, $type, $file, $line);
- }
-
- // Clean the trace by removing function arguments and the first frames added by the error handler itself.
- if ($throw || $this->tracedErrors & $type) {
- $backtrace = $backtrace ?: $errorAsException->getTrace();
- $lightTrace = $this->cleanTrace($backtrace, $type, $file, $line, $throw);
- $this->traceReflector->setValue($errorAsException, $lightTrace);
- } else {
- $this->traceReflector->setValue($errorAsException, array());
- }
- }
-
- if ($throw) {
- if (E_USER_ERROR & $type) {
- for ($i = 1; isset($backtrace[$i]); ++$i) {
- if (isset($backtrace[$i]['function'], $backtrace[$i]['type'], $backtrace[$i - 1]['function'])
- && '__toString' === $backtrace[$i]['function']
- && '->' === $backtrace[$i]['type']
- && !isset($backtrace[$i - 1]['class'])
- && ('trigger_error' === $backtrace[$i - 1]['function'] || 'user_error' === $backtrace[$i - 1]['function'])
- ) {
- // Here, we know trigger_error() has been called from __toString().
- // HHVM is fine with throwing from __toString() but PHP triggers a fatal error instead.
- // A small convention allows working around the limitation:
- // given a caught $e exception in __toString(), quitting the method with
- // `return trigger_error($e, E_USER_ERROR);` allows this error handler
- // to make $e get through the __toString() barrier.
-
- foreach ($context as $e) {
- if (($e instanceof \Exception || $e instanceof \Throwable) && $e->__toString() === $message) {
- if (1 === $i) {
- // On HHVM
- $errorAsException = $e;
- break;
- }
- self::$toStringException = $e;
-
- return true;
- }
- }
-
- if (1 < $i) {
- // On PHP (not on HHVM), display the original error message instead of the default one.
- $this->handleException($errorAsException);
-
- // Stop the process by giving back the error to the native handler.
- return false;
- }
- }
- }
- }
-
- throw $errorAsException;
- }
-
- if ($this->isRecursive) {
- $log = 0;
- } elseif (self::$stackedErrorLevels) {
- self::$stackedErrors[] = array(
- $this->loggers[$type][0],
- ($type & $level) ? $this->loggers[$type][1] : LogLevel::DEBUG,
- $logMessage,
- $errorAsException ? array('exception' => $errorAsException) : array(),
- );
- } else {
- try {
- $this->isRecursive = true;
- $level = ($type & $level) ? $this->loggers[$type][1] : LogLevel::DEBUG;
- $this->loggers[$type][0]->log($level, $logMessage, $errorAsException ? array('exception' => $errorAsException) : array());
- } finally {
- $this->isRecursive = false;
- }
- }
-
- return $type && $log;
- }
-
- /**
- * Handles an exception by logging then forwarding it to another handler.
- *
- * @param \Exception|\Throwable $exception An exception to handle
- * @param array $error An array as returned by error_get_last()
- *
- * @internal
- */
- public function handleException($exception, array $error = null)
- {
- if (null === $error) {
- self::$exitCode = 255;
- }
- if (!$exception instanceof \Exception) {
- $exception = new FatalThrowableError($exception);
- }
- $type = $exception instanceof FatalErrorException ? $exception->getSeverity() : E_ERROR;
- $handlerException = null;
-
- if (($this->loggedErrors & $type) || $exception instanceof FatalThrowableError) {
- if ($exception instanceof FatalErrorException) {
- if ($exception instanceof FatalThrowableError) {
- $error = array(
- 'type' => $type,
- 'message' => $message = $exception->getMessage(),
- 'file' => $exception->getFile(),
- 'line' => $exception->getLine(),
- );
- } else {
- $message = 'Fatal '.$exception->getMessage();
- }
- } elseif ($exception instanceof \ErrorException) {
- $message = 'Uncaught '.$exception->getMessage();
- } else {
- $message = 'Uncaught Exception: '.$exception->getMessage();
- }
- }
- if ($this->loggedErrors & $type) {
- try {
- $this->loggers[$type][0]->log($this->loggers[$type][1], $message, array('exception' => $exception));
- } catch (\Exception $handlerException) {
- } catch (\Throwable $handlerException) {
- }
- }
- if ($exception instanceof FatalErrorException && !$exception instanceof OutOfMemoryException && $error) {
- foreach ($this->getFatalErrorHandlers() as $handler) {
- if ($e = $handler->handleError($error, $exception)) {
- $exception = $e;
- break;
- }
- }
- }
- try {
- if (null !== $this->exceptionHandler) {
- return \call_user_func($this->exceptionHandler, $exception);
- }
- $handlerException = $handlerException ?: $exception;
- } catch (\Exception $handlerException) {
- } catch (\Throwable $handlerException) {
- }
- $this->exceptionHandler = null;
- if ($exception === $handlerException) {
- self::$reservedMemory = null; // Disable the fatal error handler
- throw $exception; // Give back $exception to the native handler
- }
- $this->handleException($handlerException);
- }
-
- /**
- * Shutdown registered function for handling PHP fatal errors.
- *
- * @param array $error An array as returned by error_get_last()
- *
- * @internal
- */
- public static function handleFatalError(array $error = null)
- {
- if (null === self::$reservedMemory) {
- return;
- }
-
- $handler = self::$reservedMemory = null;
- $handlers = array();
-
- while (!is_array($handler) || !$handler[0] instanceof self) {
- $handler = set_exception_handler('var_dump');
- restore_exception_handler();
-
- if (!$handler) {
- break;
- }
- restore_exception_handler();
- array_unshift($handlers, $handler);
- }
- foreach ($handlers as $h) {
- set_exception_handler($h);
- }
- if (!$handler) {
- return;
- }
- if ($handler !== $h) {
- $handler[0]->setExceptionHandler($h);
- }
- $handler = $handler[0];
- $handlers = array();
-
- if ($exit = null === $error) {
- $error = error_get_last();
- }
-
- try {
- while (self::$stackedErrorLevels) {
- static::unstackErrors();
- }
- } catch (\Exception $exception) {
- // Handled below
- } catch (\Throwable $exception) {
- // Handled below
- }
-
- if ($error && $error['type'] &= E_PARSE | E_ERROR | E_CORE_ERROR | E_COMPILE_ERROR) {
- // Let's not throw anymore but keep logging
- $handler->throwAt(0, true);
- $trace = isset($error['backtrace']) ? $error['backtrace'] : null;
-
- if (0 === strpos($error['message'], 'Allowed memory') || 0 === strpos($error['message'], 'Out of memory')) {
- $exception = new OutOfMemoryException($handler->levels[$error['type']].': '.$error['message'], 0, $error['type'], $error['file'], $error['line'], 2, false, $trace);
- } else {
- $exception = new FatalErrorException($handler->levels[$error['type']].': '.$error['message'], 0, $error['type'], $error['file'], $error['line'], 2, true, $trace);
- }
- }
-
- try {
- if (isset($exception)) {
- self::$exitCode = 255;
- $handler->handleException($exception, $error);
- }
- } catch (FatalErrorException $e) {
- // Ignore this re-throw
- }
-
- if ($exit && self::$exitCode) {
- $exitCode = self::$exitCode;
- register_shutdown_function('register_shutdown_function', function () use ($exitCode) { exit($exitCode); });
- }
- }
-
- /**
- * Configures the error handler for delayed handling.
- * Ensures also that non-catchable fatal errors are never silenced.
- *
- * As shown by http://bugs.php.net/42098 and http://bugs.php.net/60724
- * PHP has a compile stage where it behaves unusually. To workaround it,
- * we plug an error handler that only stacks errors for later.
- *
- * The most important feature of this is to prevent
- * autoloading until unstackErrors() is called.
- *
- * @deprecated since version 3.4, to be removed in 4.0.
- */
- public static function stackErrors()
- {
- @trigger_error('Support for stacking errors is deprecated since Symfony 3.4 and will be removed in 4.0.', E_USER_DEPRECATED);
-
- self::$stackedErrorLevels[] = error_reporting(error_reporting() | E_PARSE | E_ERROR | E_CORE_ERROR | E_COMPILE_ERROR);
- }
-
- /**
- * Unstacks stacked errors and forwards to the logger.
- *
- * @deprecated since version 3.4, to be removed in 4.0.
- */
- public static function unstackErrors()
- {
- @trigger_error('Support for unstacking errors is deprecated since Symfony 3.4 and will be removed in 4.0.', E_USER_DEPRECATED);
-
- $level = array_pop(self::$stackedErrorLevels);
-
- if (null !== $level) {
- $errorReportingLevel = error_reporting($level);
- if ($errorReportingLevel !== ($level | E_PARSE | E_ERROR | E_CORE_ERROR | E_COMPILE_ERROR)) {
- // If the user changed the error level, do not overwrite it
- error_reporting($errorReportingLevel);
- }
- }
-
- if (empty(self::$stackedErrorLevels)) {
- $errors = self::$stackedErrors;
- self::$stackedErrors = array();
-
- foreach ($errors as $error) {
- $error[0]->log($error[1], $error[2], $error[3]);
- }
- }
- }
-
- /**
- * Gets the fatal error handlers.
- *
- * Override this method if you want to define more fatal error handlers.
- *
- * @return FatalErrorHandlerInterface[] An array of FatalErrorHandlerInterface
- */
- protected function getFatalErrorHandlers()
- {
- return array(
- new UndefinedFunctionFatalErrorHandler(),
- new UndefinedMethodFatalErrorHandler(),
- new ClassNotFoundFatalErrorHandler(),
- );
- }
-
- private function cleanTrace($backtrace, $type, $file, $line, $throw)
- {
- $lightTrace = $backtrace;
-
- for ($i = 0; isset($backtrace[$i]); ++$i) {
- if (isset($backtrace[$i]['file'], $backtrace[$i]['line']) && $backtrace[$i]['line'] === $line && $backtrace[$i]['file'] === $file) {
- $lightTrace = array_slice($lightTrace, 1 + $i);
- break;
- }
- }
- if (!($throw || $this->scopedErrors & $type)) {
- for ($i = 0; isset($lightTrace[$i]); ++$i) {
- unset($lightTrace[$i]['args'], $lightTrace[$i]['object']);
- }
- }
-
- return $lightTrace;
- }
-}
diff --git a/vendor/symfony/debug/Exception/ClassNotFoundException.php b/vendor/symfony/debug/Exception/ClassNotFoundException.php
deleted file mode 100644
index b91bf4663..000000000
--- a/vendor/symfony/debug/Exception/ClassNotFoundException.php
+++ /dev/null
@@ -1,33 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Debug\Exception;
-
-/**
- * Class (or Trait or Interface) Not Found Exception.
- *
- * @author Konstanton Myakshin
- */
-class ClassNotFoundException extends FatalErrorException
-{
- public function __construct($message, \ErrorException $previous)
- {
- parent::__construct(
- $message,
- $previous->getCode(),
- $previous->getSeverity(),
- $previous->getFile(),
- $previous->getLine(),
- $previous->getPrevious()
- );
- $this->setTrace($previous->getTrace());
- }
-}
diff --git a/vendor/symfony/debug/Exception/ContextErrorException.php b/vendor/symfony/debug/Exception/ContextErrorException.php
deleted file mode 100644
index 6561d4df3..000000000
--- a/vendor/symfony/debug/Exception/ContextErrorException.php
+++ /dev/null
@@ -1,40 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Debug\Exception;
-
-/**
- * Error Exception with Variable Context.
- *
- * @author Christian Sciberras
- *
- * @deprecated since version 3.3. Instead, \ErrorException will be used directly in 4.0.
- */
-class ContextErrorException extends \ErrorException
-{
- private $context = array();
-
- public function __construct($message, $code, $severity, $filename, $lineno, $context = array())
- {
- parent::__construct($message, $code, $severity, $filename, $lineno);
- $this->context = $context;
- }
-
- /**
- * @return array Array of variables that existed when the exception occurred
- */
- public function getContext()
- {
- @trigger_error(sprintf('The %s class is deprecated since version 3.3 and will be removed in 4.0.', __CLASS__), E_USER_DEPRECATED);
-
- return $this->context;
- }
-}
diff --git a/vendor/symfony/debug/Exception/FatalErrorException.php b/vendor/symfony/debug/Exception/FatalErrorException.php
deleted file mode 100644
index f24a54e77..000000000
--- a/vendor/symfony/debug/Exception/FatalErrorException.php
+++ /dev/null
@@ -1,82 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Debug\Exception;
-
-/**
- * Fatal Error Exception.
- *
- * @author Konstanton Myakshin
- */
-class FatalErrorException extends \ErrorException
-{
- public function __construct($message, $code, $severity, $filename, $lineno, $traceOffset = null, $traceArgs = true, array $trace = null)
- {
- parent::__construct($message, $code, $severity, $filename, $lineno);
-
- if (null !== $trace) {
- if (!$traceArgs) {
- foreach ($trace as &$frame) {
- unset($frame['args'], $frame['this'], $frame);
- }
- }
-
- $this->setTrace($trace);
- } elseif (null !== $traceOffset) {
- if (function_exists('xdebug_get_function_stack')) {
- $trace = xdebug_get_function_stack();
- if (0 < $traceOffset) {
- array_splice($trace, -$traceOffset);
- }
-
- foreach ($trace as &$frame) {
- if (!isset($frame['type'])) {
- // XDebug pre 2.1.1 doesn't currently set the call type key http://bugs.xdebug.org/view.php?id=695
- if (isset($frame['class'])) {
- $frame['type'] = '::';
- }
- } elseif ('dynamic' === $frame['type']) {
- $frame['type'] = '->';
- } elseif ('static' === $frame['type']) {
- $frame['type'] = '::';
- }
-
- // XDebug also has a different name for the parameters array
- if (!$traceArgs) {
- unset($frame['params'], $frame['args']);
- } elseif (isset($frame['params']) && !isset($frame['args'])) {
- $frame['args'] = $frame['params'];
- unset($frame['params']);
- }
- }
-
- unset($frame);
- $trace = array_reverse($trace);
- } elseif (function_exists('symfony_debug_backtrace')) {
- $trace = symfony_debug_backtrace();
- if (0 < $traceOffset) {
- array_splice($trace, 0, $traceOffset);
- }
- } else {
- $trace = array();
- }
-
- $this->setTrace($trace);
- }
- }
-
- protected function setTrace($trace)
- {
- $traceReflector = new \ReflectionProperty('Exception', 'trace');
- $traceReflector->setAccessible(true);
- $traceReflector->setValue($this, $trace);
- }
-}
diff --git a/vendor/symfony/debug/Exception/FatalThrowableError.php b/vendor/symfony/debug/Exception/FatalThrowableError.php
deleted file mode 100644
index 34f43b17b..000000000
--- a/vendor/symfony/debug/Exception/FatalThrowableError.php
+++ /dev/null
@@ -1,44 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Debug\Exception;
-
-/**
- * Fatal Throwable Error.
- *
- * @author Nicolas Grekas
- */
-class FatalThrowableError extends FatalErrorException
-{
- public function __construct(\Throwable $e)
- {
- if ($e instanceof \ParseError) {
- $message = 'Parse error: '.$e->getMessage();
- $severity = E_PARSE;
- } elseif ($e instanceof \TypeError) {
- $message = 'Type error: '.$e->getMessage();
- $severity = E_RECOVERABLE_ERROR;
- } else {
- $message = $e->getMessage();
- $severity = E_ERROR;
- }
-
- \ErrorException::__construct(
- $message,
- $e->getCode(),
- $severity,
- $e->getFile(),
- $e->getLine()
- );
-
- $this->setTrace($e->getTrace());
- }
-}
diff --git a/vendor/symfony/debug/Exception/FlattenException.php b/vendor/symfony/debug/Exception/FlattenException.php
deleted file mode 100644
index 24679dcaa..000000000
--- a/vendor/symfony/debug/Exception/FlattenException.php
+++ /dev/null
@@ -1,263 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Debug\Exception;
-
-use Symfony\Component\HttpFoundation\Exception\RequestExceptionInterface;
-use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
-
-/**
- * FlattenException wraps a PHP Exception to be able to serialize it.
- *
- * Basically, this class removes all objects from the trace.
- *
- * @author Fabien Potencier
- */
-class FlattenException
-{
- private $message;
- private $code;
- private $previous;
- private $trace;
- private $class;
- private $statusCode;
- private $headers;
- private $file;
- private $line;
-
- public static function create(\Exception $exception, $statusCode = null, array $headers = array())
- {
- $e = new static();
- $e->setMessage($exception->getMessage());
- $e->setCode($exception->getCode());
-
- if ($exception instanceof HttpExceptionInterface) {
- $statusCode = $exception->getStatusCode();
- $headers = array_merge($headers, $exception->getHeaders());
- } elseif ($exception instanceof RequestExceptionInterface) {
- $statusCode = 400;
- }
-
- if (null === $statusCode) {
- $statusCode = 500;
- }
-
- $e->setStatusCode($statusCode);
- $e->setHeaders($headers);
- $e->setTraceFromException($exception);
- $e->setClass(get_class($exception));
- $e->setFile($exception->getFile());
- $e->setLine($exception->getLine());
-
- $previous = $exception->getPrevious();
-
- if ($previous instanceof \Exception) {
- $e->setPrevious(static::create($previous));
- } elseif ($previous instanceof \Throwable) {
- $e->setPrevious(static::create(new FatalThrowableError($previous)));
- }
-
- return $e;
- }
-
- public function toArray()
- {
- $exceptions = array();
- foreach (array_merge(array($this), $this->getAllPrevious()) as $exception) {
- $exceptions[] = array(
- 'message' => $exception->getMessage(),
- 'class' => $exception->getClass(),
- 'trace' => $exception->getTrace(),
- );
- }
-
- return $exceptions;
- }
-
- public function getStatusCode()
- {
- return $this->statusCode;
- }
-
- public function setStatusCode($code)
- {
- $this->statusCode = $code;
- }
-
- public function getHeaders()
- {
- return $this->headers;
- }
-
- public function setHeaders(array $headers)
- {
- $this->headers = $headers;
- }
-
- public function getClass()
- {
- return $this->class;
- }
-
- public function setClass($class)
- {
- $this->class = $class;
- }
-
- public function getFile()
- {
- return $this->file;
- }
-
- public function setFile($file)
- {
- $this->file = $file;
- }
-
- public function getLine()
- {
- return $this->line;
- }
-
- public function setLine($line)
- {
- $this->line = $line;
- }
-
- public function getMessage()
- {
- return $this->message;
- }
-
- public function setMessage($message)
- {
- $this->message = $message;
- }
-
- public function getCode()
- {
- return $this->code;
- }
-
- public function setCode($code)
- {
- $this->code = $code;
- }
-
- public function getPrevious()
- {
- return $this->previous;
- }
-
- public function setPrevious(FlattenException $previous)
- {
- $this->previous = $previous;
- }
-
- public function getAllPrevious()
- {
- $exceptions = array();
- $e = $this;
- while ($e = $e->getPrevious()) {
- $exceptions[] = $e;
- }
-
- return $exceptions;
- }
-
- public function getTrace()
- {
- return $this->trace;
- }
-
- public function setTraceFromException(\Exception $exception)
- {
- $this->setTrace($exception->getTrace(), $exception->getFile(), $exception->getLine());
- }
-
- public function setTrace($trace, $file, $line)
- {
- $this->trace = array();
- $this->trace[] = array(
- 'namespace' => '',
- 'short_class' => '',
- 'class' => '',
- 'type' => '',
- 'function' => '',
- 'file' => $file,
- 'line' => $line,
- 'args' => array(),
- );
- foreach ($trace as $entry) {
- $class = '';
- $namespace = '';
- if (isset($entry['class'])) {
- $parts = explode('\\', $entry['class']);
- $class = array_pop($parts);
- $namespace = implode('\\', $parts);
- }
-
- $this->trace[] = array(
- 'namespace' => $namespace,
- 'short_class' => $class,
- 'class' => isset($entry['class']) ? $entry['class'] : '',
- 'type' => isset($entry['type']) ? $entry['type'] : '',
- 'function' => isset($entry['function']) ? $entry['function'] : null,
- 'file' => isset($entry['file']) ? $entry['file'] : null,
- 'line' => isset($entry['line']) ? $entry['line'] : null,
- 'args' => isset($entry['args']) ? $this->flattenArgs($entry['args']) : array(),
- );
- }
- }
-
- private function flattenArgs($args, $level = 0, &$count = 0)
- {
- $result = array();
- foreach ($args as $key => $value) {
- if (++$count > 1e4) {
- return array('array', '*SKIPPED over 10000 entries*');
- }
- if ($value instanceof \__PHP_Incomplete_Class) {
- // is_object() returns false on PHP<=7.1
- $result[$key] = array('incomplete-object', $this->getClassNameFromIncomplete($value));
- } elseif (is_object($value)) {
- $result[$key] = array('object', get_class($value));
- } elseif (is_array($value)) {
- if ($level > 10) {
- $result[$key] = array('array', '*DEEP NESTED ARRAY*');
- } else {
- $result[$key] = array('array', $this->flattenArgs($value, $level + 1, $count));
- }
- } elseif (null === $value) {
- $result[$key] = array('null', null);
- } elseif (is_bool($value)) {
- $result[$key] = array('boolean', $value);
- } elseif (is_int($value)) {
- $result[$key] = array('integer', $value);
- } elseif (is_float($value)) {
- $result[$key] = array('float', $value);
- } elseif (is_resource($value)) {
- $result[$key] = array('resource', get_resource_type($value));
- } else {
- $result[$key] = array('string', (string) $value);
- }
- }
-
- return $result;
- }
-
- private function getClassNameFromIncomplete(\__PHP_Incomplete_Class $value)
- {
- $array = new \ArrayObject($value);
-
- return $array['__PHP_Incomplete_Class_Name'];
- }
-}
diff --git a/vendor/symfony/debug/Exception/SilencedErrorContext.php b/vendor/symfony/debug/Exception/SilencedErrorContext.php
deleted file mode 100644
index 4be83491b..000000000
--- a/vendor/symfony/debug/Exception/SilencedErrorContext.php
+++ /dev/null
@@ -1,67 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Debug\Exception;
-
-/**
- * Data Object that represents a Silenced Error.
- *
- * @author Grégoire Pineau
- */
-class SilencedErrorContext implements \JsonSerializable
-{
- public $count = 1;
-
- private $severity;
- private $file;
- private $line;
- private $trace;
-
- public function __construct($severity, $file, $line, array $trace = array(), $count = 1)
- {
- $this->severity = $severity;
- $this->file = $file;
- $this->line = $line;
- $this->trace = $trace;
- $this->count = $count;
- }
-
- public function getSeverity()
- {
- return $this->severity;
- }
-
- public function getFile()
- {
- return $this->file;
- }
-
- public function getLine()
- {
- return $this->line;
- }
-
- public function getTrace()
- {
- return $this->trace;
- }
-
- public function JsonSerialize()
- {
- return array(
- 'severity' => $this->severity,
- 'file' => $this->file,
- 'line' => $this->line,
- 'trace' => $this->trace,
- 'count' => $this->count,
- );
- }
-}
diff --git a/vendor/symfony/debug/Exception/UndefinedFunctionException.php b/vendor/symfony/debug/Exception/UndefinedFunctionException.php
deleted file mode 100644
index a66ae2a38..000000000
--- a/vendor/symfony/debug/Exception/UndefinedFunctionException.php
+++ /dev/null
@@ -1,33 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Debug\Exception;
-
-/**
- * Undefined Function Exception.
- *
- * @author Konstanton Myakshin
- */
-class UndefinedFunctionException extends FatalErrorException
-{
- public function __construct($message, \ErrorException $previous)
- {
- parent::__construct(
- $message,
- $previous->getCode(),
- $previous->getSeverity(),
- $previous->getFile(),
- $previous->getLine(),
- $previous->getPrevious()
- );
- $this->setTrace($previous->getTrace());
- }
-}
diff --git a/vendor/symfony/debug/Exception/UndefinedMethodException.php b/vendor/symfony/debug/Exception/UndefinedMethodException.php
deleted file mode 100644
index 350dc3187..000000000
--- a/vendor/symfony/debug/Exception/UndefinedMethodException.php
+++ /dev/null
@@ -1,33 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Debug\Exception;
-
-/**
- * Undefined Method Exception.
- *
- * @author Grégoire Pineau
- */
-class UndefinedMethodException extends FatalErrorException
-{
- public function __construct($message, \ErrorException $previous)
- {
- parent::__construct(
- $message,
- $previous->getCode(),
- $previous->getSeverity(),
- $previous->getFile(),
- $previous->getLine(),
- $previous->getPrevious()
- );
- $this->setTrace($previous->getTrace());
- }
-}
diff --git a/vendor/symfony/debug/ExceptionHandler.php b/vendor/symfony/debug/ExceptionHandler.php
deleted file mode 100644
index 97470cb6b..000000000
--- a/vendor/symfony/debug/ExceptionHandler.php
+++ /dev/null
@@ -1,410 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Debug;
-
-use Symfony\Component\Debug\Exception\FlattenException;
-use Symfony\Component\Debug\Exception\OutOfMemoryException;
-use Symfony\Component\HttpKernel\Debug\FileLinkFormatter;
-
-/**
- * ExceptionHandler converts an exception to a Response object.
- *
- * It is mostly useful in debug mode to replace the default PHP/XDebug
- * output with something prettier and more useful.
- *
- * As this class is mainly used during Kernel boot, where nothing is yet
- * available, the Response content is always HTML.
- *
- * @author Fabien Potencier
- * @author Nicolas Grekas
- */
-class ExceptionHandler
-{
- private $debug;
- private $charset;
- private $handler;
- private $caughtBuffer;
- private $caughtLength;
- private $fileLinkFormat;
-
- public function __construct($debug = true, $charset = null, $fileLinkFormat = null)
- {
- $this->debug = $debug;
- $this->charset = $charset ?: ini_get('default_charset') ?: 'UTF-8';
- $this->fileLinkFormat = $fileLinkFormat ?: ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format');
- }
-
- /**
- * Registers the exception handler.
- *
- * @param bool $debug Enable/disable debug mode, where the stack trace is displayed
- * @param string|null $charset The charset used by exception messages
- * @param string|null $fileLinkFormat The IDE link template
- *
- * @return static
- */
- public static function register($debug = true, $charset = null, $fileLinkFormat = null)
- {
- $handler = new static($debug, $charset, $fileLinkFormat);
-
- $prev = set_exception_handler(array($handler, 'handle'));
- if (is_array($prev) && $prev[0] instanceof ErrorHandler) {
- restore_exception_handler();
- $prev[0]->setExceptionHandler(array($handler, 'handle'));
- }
-
- return $handler;
- }
-
- /**
- * Sets a user exception handler.
- *
- * @param callable $handler An handler that will be called on Exception
- *
- * @return callable|null The previous exception handler if any
- */
- public function setHandler(callable $handler = null)
- {
- $old = $this->handler;
- $this->handler = $handler;
-
- return $old;
- }
-
- /**
- * Sets the format for links to source files.
- *
- * @param string|FileLinkFormatter $fileLinkFormat The format for links to source files
- *
- * @return string The previous file link format
- */
- public function setFileLinkFormat($fileLinkFormat)
- {
- $old = $this->fileLinkFormat;
- $this->fileLinkFormat = $fileLinkFormat;
-
- return $old;
- }
-
- /**
- * Sends a response for the given Exception.
- *
- * To be as fail-safe as possible, the exception is first handled
- * by our simple exception handler, then by the user exception handler.
- * The latter takes precedence and any output from the former is cancelled,
- * if and only if nothing bad happens in this handling path.
- */
- public function handle(\Exception $exception)
- {
- if (null === $this->handler || $exception instanceof OutOfMemoryException) {
- $this->sendPhpResponse($exception);
-
- return;
- }
-
- $caughtLength = $this->caughtLength = 0;
-
- ob_start(function ($buffer) {
- $this->caughtBuffer = $buffer;
-
- return '';
- });
-
- $this->sendPhpResponse($exception);
- while (null === $this->caughtBuffer && ob_end_flush()) {
- // Empty loop, everything is in the condition
- }
- if (isset($this->caughtBuffer[0])) {
- ob_start(function ($buffer) {
- if ($this->caughtLength) {
- // use substr_replace() instead of substr() for mbstring overloading resistance
- $cleanBuffer = substr_replace($buffer, '', 0, $this->caughtLength);
- if (isset($cleanBuffer[0])) {
- $buffer = $cleanBuffer;
- }
- }
-
- return $buffer;
- });
-
- echo $this->caughtBuffer;
- $caughtLength = ob_get_length();
- }
- $this->caughtBuffer = null;
-
- try {
- call_user_func($this->handler, $exception);
- $this->caughtLength = $caughtLength;
- } catch (\Exception $e) {
- if (!$caughtLength) {
- // All handlers failed. Let PHP handle that now.
- throw $exception;
- }
- }
- }
-
- /**
- * Sends the error associated with the given Exception as a plain PHP response.
- *
- * This method uses plain PHP functions like header() and echo to output
- * the response.
- *
- * @param \Exception|FlattenException $exception An \Exception or FlattenException instance
- */
- public function sendPhpResponse($exception)
- {
- if (!$exception instanceof FlattenException) {
- $exception = FlattenException::create($exception);
- }
-
- if (!headers_sent()) {
- header(sprintf('HTTP/1.0 %s', $exception->getStatusCode()));
- foreach ($exception->getHeaders() as $name => $value) {
- header($name.': '.$value, false);
- }
- header('Content-Type: text/html; charset='.$this->charset);
- }
-
- echo $this->decorate($this->getContent($exception), $this->getStylesheet($exception));
- }
-
- /**
- * Gets the full HTML content associated with the given exception.
- *
- * @param \Exception|FlattenException $exception An \Exception or FlattenException instance
- *
- * @return string The HTML content as a string
- */
- public function getHtml($exception)
- {
- if (!$exception instanceof FlattenException) {
- $exception = FlattenException::create($exception);
- }
-
- return $this->decorate($this->getContent($exception), $this->getStylesheet($exception));
- }
-
- /**
- * Gets the HTML content associated with the given exception.
- *
- * @return string The content as a string
- */
- public function getContent(FlattenException $exception)
- {
- switch ($exception->getStatusCode()) {
- case 404:
- $title = 'Sorry, the page you are looking for could not be found.';
- break;
- default:
- $title = 'Whoops, looks like something went wrong.';
- }
-
- $content = '';
- if ($this->debug) {
- try {
- $count = count($exception->getAllPrevious());
- $total = $count + 1;
- foreach ($exception->toArray() as $position => $e) {
- $ind = $count - $position + 1;
- $class = $this->formatClass($e['class']);
- $message = nl2br($this->escapeHtml($e['message']));
- $content .= sprintf(<<<'EOF'
-
-
-
-
- (%d/%d)
- %s
-
- %s
- |
-
-EOF
- , $ind, $total, $class, $message);
- foreach ($e['trace'] as $trace) {
- $content .= '| ';
- if ($trace['function']) {
- $content .= sprintf('at %s%s%s(%s)', $this->formatClass($trace['class']), $trace['type'], $trace['function'], $this->formatArgs($trace['args']));
- }
- if (isset($trace['file']) && isset($trace['line'])) {
- $content .= $this->formatPath($trace['file'], $trace['line']);
- }
- $content .= " |
\n";
- }
-
- $content .= "\n
\n
\n";
- }
- } catch (\Exception $e) {
- // something nasty happened and we cannot throw an exception anymore
- if ($this->debug) {
- $title = sprintf('Exception thrown when handling an exception (%s: %s)', get_class($e), $this->escapeHtml($e->getMessage()));
- } else {
- $title = 'Whoops, looks like something went wrong.';
- }
- }
- }
-
- $symfonyGhostImageContents = $this->getSymfonyGhostAsSvg();
-
- return <<
-
-
-
$title
-
$symfonyGhostImageContents
-
-
-
-
-
- $content
-
-EOF;
- }
-
- /**
- * Gets the stylesheet associated with the given exception.
- *
- * @return string The stylesheet as a string
- */
- public function getStylesheet(FlattenException $exception)
- {
- return <<<'EOF'
- body { background-color: #F9F9F9; color: #222; font: 14px/1.4 Helvetica, Arial, sans-serif; margin: 0; padding-bottom: 45px; }
-
- a { cursor: pointer; text-decoration: none; }
- a:hover { text-decoration: underline; }
- abbr[title] { border-bottom: none; cursor: help; text-decoration: none; }
-
- code, pre { font: 13px/1.5 Consolas, Monaco, Menlo, "Ubuntu Mono", "Liberation Mono", monospace; }
-
- table, tr, th, td { background: #FFF; border-collapse: collapse; vertical-align: top; }
- table { background: #FFF; border: 1px solid #E0E0E0; box-shadow: 0px 0px 1px rgba(128, 128, 128, .2); margin: 1em 0; width: 100%; }
- table th, table td { border: solid #E0E0E0; border-width: 1px 0; padding: 8px 10px; }
- table th { background-color: #E0E0E0; font-weight: bold; text-align: left; }
-
- .hidden-xs-down { display: none; }
- .block { display: block; }
- .break-long-words { -ms-word-break: break-all; word-break: break-all; word-break: break-word; -webkit-hyphens: auto; -moz-hyphens: auto; hyphens: auto; }
- .text-muted { color: #999; }
-
- .container { max-width: 1024px; margin: 0 auto; padding: 0 15px; }
- .container::after { content: ""; display: table; clear: both; }
-
- .exception-summary { background: #B0413E; border-bottom: 2px solid rgba(0, 0, 0, 0.1); border-top: 1px solid rgba(0, 0, 0, .3); flex: 0 0 auto; margin-bottom: 30px; }
-
- .exception-message-wrapper { display: flex; align-items: center; min-height: 70px; }
- .exception-message { flex-grow: 1; padding: 30px 0; }
- .exception-message, .exception-message a { color: #FFF; font-size: 21px; font-weight: 400; margin: 0; }
- .exception-message.long { font-size: 18px; }
- .exception-message a { border-bottom: 1px solid rgba(255, 255, 255, 0.5); font-size: inherit; text-decoration: none; }
- .exception-message a:hover { border-bottom-color: #ffffff; }
-
- .exception-illustration { flex-basis: 111px; flex-shrink: 0; height: 66px; margin-left: 15px; opacity: .7; }
-
- .trace + .trace { margin-top: 30px; }
- .trace-head .trace-class { color: #222; font-size: 18px; font-weight: bold; line-height: 1.3; margin: 0; position: relative; }
-
- .trace-message { font-size: 14px; font-weight: normal; margin: .5em 0 0; }
-
- .trace-file-path, .trace-file-path a { color: #222; margin-top: 3px; font-size: 13px; }
- .trace-class { color: #B0413E; }
- .trace-type { padding: 0 2px; }
- .trace-method { color: #B0413E; font-weight: bold; }
- .trace-arguments { color: #777; font-weight: normal; padding-left: 2px; }
-
- @media (min-width: 575px) {
- .hidden-xs-down { display: initial; }
- }
-EOF;
- }
-
- private function decorate($content, $css)
- {
- return <<
-
-
-
-
-
-
-
- $content
-
-
-EOF;
- }
-
- private function formatClass($class)
- {
- $parts = explode('\\', $class);
-
- return sprintf('%s', $class, array_pop($parts));
- }
-
- private function formatPath($path, $line)
- {
- $file = $this->escapeHtml(preg_match('#[^/\\\\]*+$#', $path, $file) ? $file[0] : $path);
- $fmt = $this->fileLinkFormat;
-
- if ($fmt && $link = is_string($fmt) ? strtr($fmt, array('%f' => $path, '%l' => $line)) : $fmt->format($path, $line)) {
- return sprintf('in %s (line %d)', $this->escapeHtml($link), $file, $line);
- }
-
- return sprintf('in %s (line %d)', $this->escapeHtml($path), $file, $line);
- }
-
- /**
- * Formats an array as a string.
- *
- * @param array $args The argument array
- *
- * @return string
- */
- private function formatArgs(array $args)
- {
- $result = array();
- foreach ($args as $key => $item) {
- if ('object' === $item[0]) {
- $formattedValue = sprintf('object(%s)', $this->formatClass($item[1]));
- } elseif ('array' === $item[0]) {
- $formattedValue = sprintf('array(%s)', is_array($item[1]) ? $this->formatArgs($item[1]) : $item[1]);
- } elseif ('null' === $item[0]) {
- $formattedValue = 'null';
- } elseif ('boolean' === $item[0]) {
- $formattedValue = ''.strtolower(var_export($item[1], true)).'';
- } elseif ('resource' === $item[0]) {
- $formattedValue = 'resource';
- } else {
- $formattedValue = str_replace("\n", '', $this->escapeHtml(var_export($item[1], true)));
- }
-
- $result[] = is_int($key) ? $formattedValue : sprintf("'%s' => %s", $this->escapeHtml($key), $formattedValue);
- }
-
- return implode(', ', $result);
- }
-
- /**
- * HTML-encodes a string.
- */
- private function escapeHtml($str)
- {
- return htmlspecialchars($str, ENT_COMPAT | ENT_SUBSTITUTE, $this->charset);
- }
-
- private function getSymfonyGhostAsSvg()
- {
- return '';
- }
-}
diff --git a/vendor/symfony/debug/FatalErrorHandler/ClassNotFoundFatalErrorHandler.php b/vendor/symfony/debug/FatalErrorHandler/ClassNotFoundFatalErrorHandler.php
deleted file mode 100644
index 32ba9a09c..000000000
--- a/vendor/symfony/debug/FatalErrorHandler/ClassNotFoundFatalErrorHandler.php
+++ /dev/null
@@ -1,206 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Debug\FatalErrorHandler;
-
-use Symfony\Component\Debug\Exception\ClassNotFoundException;
-use Symfony\Component\Debug\Exception\FatalErrorException;
-use Symfony\Component\Debug\DebugClassLoader;
-use Composer\Autoload\ClassLoader as ComposerClassLoader;
-use Symfony\Component\ClassLoader\ClassLoader as SymfonyClassLoader;
-
-/**
- * ErrorHandler for classes that do not exist.
- *
- * @author Fabien Potencier
- */
-class ClassNotFoundFatalErrorHandler implements FatalErrorHandlerInterface
-{
- /**
- * {@inheritdoc}
- */
- public function handleError(array $error, FatalErrorException $exception)
- {
- $messageLen = strlen($error['message']);
- $notFoundSuffix = '\' not found';
- $notFoundSuffixLen = strlen($notFoundSuffix);
- if ($notFoundSuffixLen > $messageLen) {
- return;
- }
-
- if (0 !== substr_compare($error['message'], $notFoundSuffix, -$notFoundSuffixLen)) {
- return;
- }
-
- foreach (array('class', 'interface', 'trait') as $typeName) {
- $prefix = ucfirst($typeName).' \'';
- $prefixLen = strlen($prefix);
- if (0 !== strpos($error['message'], $prefix)) {
- continue;
- }
-
- $fullyQualifiedClassName = substr($error['message'], $prefixLen, -$notFoundSuffixLen);
- if (false !== $namespaceSeparatorIndex = strrpos($fullyQualifiedClassName, '\\')) {
- $className = substr($fullyQualifiedClassName, $namespaceSeparatorIndex + 1);
- $namespacePrefix = substr($fullyQualifiedClassName, 0, $namespaceSeparatorIndex);
- $message = sprintf('Attempted to load %s "%s" from namespace "%s".', $typeName, $className, $namespacePrefix);
- $tail = ' for another namespace?';
- } else {
- $className = $fullyQualifiedClassName;
- $message = sprintf('Attempted to load %s "%s" from the global namespace.', $typeName, $className);
- $tail = '?';
- }
-
- if ($candidates = $this->getClassCandidates($className)) {
- $tail = array_pop($candidates).'"?';
- if ($candidates) {
- $tail = ' for e.g. "'.implode('", "', $candidates).'" or "'.$tail;
- } else {
- $tail = ' for "'.$tail;
- }
- }
- $message .= "\nDid you forget a \"use\" statement".$tail;
-
- return new ClassNotFoundException($message, $exception);
- }
- }
-
- /**
- * Tries to guess the full namespace for a given class name.
- *
- * By default, it looks for PSR-0 and PSR-4 classes registered via a Symfony or a Composer
- * autoloader (that should cover all common cases).
- *
- * @param string $class A class name (without its namespace)
- *
- * @return array An array of possible fully qualified class names
- */
- private function getClassCandidates($class)
- {
- if (!is_array($functions = spl_autoload_functions())) {
- return array();
- }
-
- // find Symfony and Composer autoloaders
- $classes = array();
-
- foreach ($functions as $function) {
- if (!is_array($function)) {
- continue;
- }
- // get class loaders wrapped by DebugClassLoader
- if ($function[0] instanceof DebugClassLoader) {
- $function = $function[0]->getClassLoader();
-
- if (!is_array($function)) {
- continue;
- }
- }
-
- if ($function[0] instanceof ComposerClassLoader || $function[0] instanceof SymfonyClassLoader) {
- foreach ($function[0]->getPrefixes() as $prefix => $paths) {
- foreach ($paths as $path) {
- $classes = array_merge($classes, $this->findClassInPath($path, $class, $prefix));
- }
- }
- }
- if ($function[0] instanceof ComposerClassLoader) {
- foreach ($function[0]->getPrefixesPsr4() as $prefix => $paths) {
- foreach ($paths as $path) {
- $classes = array_merge($classes, $this->findClassInPath($path, $class, $prefix));
- }
- }
- }
- }
-
- return array_unique($classes);
- }
-
- /**
- * @param string $path
- * @param string $class
- * @param string $prefix
- *
- * @return array
- */
- private function findClassInPath($path, $class, $prefix)
- {
- if (!$path = realpath($path.'/'.strtr($prefix, '\\_', '//')) ?: realpath($path.'/'.dirname(strtr($prefix, '\\_', '//'))) ?: realpath($path)) {
- return array();
- }
-
- $classes = array();
- $filename = $class.'.php';
- foreach (new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($path, \RecursiveDirectoryIterator::SKIP_DOTS), \RecursiveIteratorIterator::LEAVES_ONLY) as $file) {
- if ($filename == $file->getFileName() && $class = $this->convertFileToClass($path, $file->getPathName(), $prefix)) {
- $classes[] = $class;
- }
- }
-
- return $classes;
- }
-
- /**
- * @param string $path
- * @param string $file
- * @param string $prefix
- *
- * @return string|null
- */
- private function convertFileToClass($path, $file, $prefix)
- {
- $candidates = array(
- // namespaced class
- $namespacedClass = str_replace(array($path.DIRECTORY_SEPARATOR, '.php', '/'), array('', '', '\\'), $file),
- // namespaced class (with target dir)
- $prefix.$namespacedClass,
- // namespaced class (with target dir and separator)
- $prefix.'\\'.$namespacedClass,
- // PEAR class
- str_replace('\\', '_', $namespacedClass),
- // PEAR class (with target dir)
- str_replace('\\', '_', $prefix.$namespacedClass),
- // PEAR class (with target dir and separator)
- str_replace('\\', '_', $prefix.'\\'.$namespacedClass),
- );
-
- if ($prefix) {
- $candidates = array_filter($candidates, function ($candidate) use ($prefix) { return 0 === strpos($candidate, $prefix); });
- }
-
- // We cannot use the autoloader here as most of them use require; but if the class
- // is not found, the new autoloader call will require the file again leading to a
- // "cannot redeclare class" error.
- foreach ($candidates as $candidate) {
- if ($this->classExists($candidate)) {
- return $candidate;
- }
- }
-
- require_once $file;
-
- foreach ($candidates as $candidate) {
- if ($this->classExists($candidate)) {
- return $candidate;
- }
- }
- }
-
- /**
- * @param string $class
- *
- * @return bool
- */
- private function classExists($class)
- {
- return class_exists($class, false) || interface_exists($class, false) || trait_exists($class, false);
- }
-}
diff --git a/vendor/symfony/debug/FatalErrorHandler/FatalErrorHandlerInterface.php b/vendor/symfony/debug/FatalErrorHandler/FatalErrorHandlerInterface.php
deleted file mode 100644
index 6b87eb30a..000000000
--- a/vendor/symfony/debug/FatalErrorHandler/FatalErrorHandlerInterface.php
+++ /dev/null
@@ -1,32 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Debug\FatalErrorHandler;
-
-use Symfony\Component\Debug\Exception\FatalErrorException;
-
-/**
- * Attempts to convert fatal errors to exceptions.
- *
- * @author Fabien Potencier
- */
-interface FatalErrorHandlerInterface
-{
- /**
- * Attempts to convert an error into an exception.
- *
- * @param array $error An array as returned by error_get_last()
- * @param FatalErrorException $exception A FatalErrorException instance
- *
- * @return FatalErrorException|null A FatalErrorException instance if the class is able to convert the error, null otherwise
- */
- public function handleError(array $error, FatalErrorException $exception);
-}
diff --git a/vendor/symfony/debug/FatalErrorHandler/UndefinedFunctionFatalErrorHandler.php b/vendor/symfony/debug/FatalErrorHandler/UndefinedFunctionFatalErrorHandler.php
deleted file mode 100644
index c6f391a79..000000000
--- a/vendor/symfony/debug/FatalErrorHandler/UndefinedFunctionFatalErrorHandler.php
+++ /dev/null
@@ -1,84 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Debug\FatalErrorHandler;
-
-use Symfony\Component\Debug\Exception\UndefinedFunctionException;
-use Symfony\Component\Debug\Exception\FatalErrorException;
-
-/**
- * ErrorHandler for undefined functions.
- *
- * @author Fabien Potencier
- */
-class UndefinedFunctionFatalErrorHandler implements FatalErrorHandlerInterface
-{
- /**
- * {@inheritdoc}
- */
- public function handleError(array $error, FatalErrorException $exception)
- {
- $messageLen = strlen($error['message']);
- $notFoundSuffix = '()';
- $notFoundSuffixLen = strlen($notFoundSuffix);
- if ($notFoundSuffixLen > $messageLen) {
- return;
- }
-
- if (0 !== substr_compare($error['message'], $notFoundSuffix, -$notFoundSuffixLen)) {
- return;
- }
-
- $prefix = 'Call to undefined function ';
- $prefixLen = strlen($prefix);
- if (0 !== strpos($error['message'], $prefix)) {
- return;
- }
-
- $fullyQualifiedFunctionName = substr($error['message'], $prefixLen, -$notFoundSuffixLen);
- if (false !== $namespaceSeparatorIndex = strrpos($fullyQualifiedFunctionName, '\\')) {
- $functionName = substr($fullyQualifiedFunctionName, $namespaceSeparatorIndex + 1);
- $namespacePrefix = substr($fullyQualifiedFunctionName, 0, $namespaceSeparatorIndex);
- $message = sprintf('Attempted to call function "%s" from namespace "%s".', $functionName, $namespacePrefix);
- } else {
- $functionName = $fullyQualifiedFunctionName;
- $message = sprintf('Attempted to call function "%s" from the global namespace.', $functionName);
- }
-
- $candidates = array();
- foreach (get_defined_functions() as $type => $definedFunctionNames) {
- foreach ($definedFunctionNames as $definedFunctionName) {
- if (false !== $namespaceSeparatorIndex = strrpos($definedFunctionName, '\\')) {
- $definedFunctionNameBasename = substr($definedFunctionName, $namespaceSeparatorIndex + 1);
- } else {
- $definedFunctionNameBasename = $definedFunctionName;
- }
-
- if ($definedFunctionNameBasename === $functionName) {
- $candidates[] = '\\'.$definedFunctionName;
- }
- }
- }
-
- if ($candidates) {
- sort($candidates);
- $last = array_pop($candidates).'"?';
- if ($candidates) {
- $candidates = 'e.g. "'.implode('", "', $candidates).'" or "'.$last;
- } else {
- $candidates = '"'.$last;
- }
- $message .= "\nDid you mean to call ".$candidates;
- }
-
- return new UndefinedFunctionException($message, $exception);
- }
-}
diff --git a/vendor/symfony/debug/FatalErrorHandler/UndefinedMethodFatalErrorHandler.php b/vendor/symfony/debug/FatalErrorHandler/UndefinedMethodFatalErrorHandler.php
deleted file mode 100644
index 6fa62b6f2..000000000
--- a/vendor/symfony/debug/FatalErrorHandler/UndefinedMethodFatalErrorHandler.php
+++ /dev/null
@@ -1,66 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Debug\FatalErrorHandler;
-
-use Symfony\Component\Debug\Exception\FatalErrorException;
-use Symfony\Component\Debug\Exception\UndefinedMethodException;
-
-/**
- * ErrorHandler for undefined methods.
- *
- * @author Grégoire Pineau
- */
-class UndefinedMethodFatalErrorHandler implements FatalErrorHandlerInterface
-{
- /**
- * {@inheritdoc}
- */
- public function handleError(array $error, FatalErrorException $exception)
- {
- preg_match('/^Call to undefined method (.*)::(.*)\(\)$/', $error['message'], $matches);
- if (!$matches) {
- return;
- }
-
- $className = $matches[1];
- $methodName = $matches[2];
-
- $message = sprintf('Attempted to call an undefined method named "%s" of class "%s".', $methodName, $className);
-
- if (!class_exists($className) || null === $methods = get_class_methods($className)) {
- // failed to get the class or its methods on which an unknown method was called (for example on an anonymous class)
- return new UndefinedMethodException($message, $exception);
- }
-
- $candidates = array();
- foreach ($methods as $definedMethodName) {
- $lev = levenshtein($methodName, $definedMethodName);
- if ($lev <= strlen($methodName) / 3 || false !== strpos($definedMethodName, $methodName)) {
- $candidates[] = $definedMethodName;
- }
- }
-
- if ($candidates) {
- sort($candidates);
- $last = array_pop($candidates).'"?';
- if ($candidates) {
- $candidates = 'e.g. "'.implode('", "', $candidates).'" or "'.$last;
- } else {
- $candidates = '"'.$last;
- }
-
- $message .= "\nDid you mean to call ".$candidates;
- }
-
- return new UndefinedMethodException($message, $exception);
- }
-}
diff --git a/vendor/symfony/debug/README.md b/vendor/symfony/debug/README.md
deleted file mode 100644
index a1d16175c..000000000
--- a/vendor/symfony/debug/README.md
+++ /dev/null
@@ -1,13 +0,0 @@
-Debug Component
-===============
-
-The Debug component provides tools to ease debugging PHP code.
-
-Resources
----------
-
- * [Documentation](https://symfony.com/doc/current/components/debug/index.html)
- * [Contributing](https://symfony.com/doc/current/contributing/index.html)
- * [Report issues](https://github.com/symfony/symfony/issues) and
- [send Pull Requests](https://github.com/symfony/symfony/pulls)
- in the [main Symfony repository](https://github.com/symfony/symfony)
diff --git a/vendor/symfony/debug/Resources/ext/README.md b/vendor/symfony/debug/Resources/ext/README.md
deleted file mode 100644
index 25dccf076..000000000
--- a/vendor/symfony/debug/Resources/ext/README.md
+++ /dev/null
@@ -1,134 +0,0 @@
-Symfony Debug Extension for PHP 5
-=================================
-
-This extension publishes several functions to help building powerful debugging tools.
-It is compatible with PHP 5.3, 5.4, 5.5 and 5.6; with ZTS and non-ZTS modes.
-It is not required thus not provided for PHP 7.
-
-symfony_zval_info()
--------------------
-
-- exposes zval_hash/refcounts, allowing e.g. efficient exploration of arbitrary structures in PHP,
-- does work with references, preventing memory copying.
-
-Its behavior is about the same as:
-
-```php
- gettype($array[$key]),
- 'zval_hash' => /* hashed memory address of $array[$key] */,
- 'zval_refcount' => /* internal zval refcount of $array[$key] */,
- 'zval_isref' => /* is_ref status of $array[$key] */,
- );
-
- switch ($info['type']) {
- case 'object':
- $info += array(
- 'object_class' => get_class($array[$key]),
- 'object_refcount' => /* internal object refcount of $array[$key] */,
- 'object_hash' => spl_object_hash($array[$key]),
- 'object_handle' => /* internal object handle $array[$key] */,
- );
- break;
-
- case 'resource':
- $info += array(
- 'resource_handle' => (int) $array[$key],
- 'resource_type' => get_resource_type($array[$key]),
- 'resource_refcount' => /* internal resource refcount of $array[$key] */,
- );
- break;
-
- case 'array':
- $info += array(
- 'array_count' => count($array[$key]),
- );
- break;
-
- case 'string':
- $info += array(
- 'strlen' => strlen($array[$key]),
- );
- break;
- }
-
- return $info;
-}
-```
-
-symfony_debug_backtrace()
--------------------------
-
-This function works like debug_backtrace(), except that it can fetch the full backtrace in case of fatal errors:
-
-```php
-function foo() { fatal(); }
-function bar() { foo(); }
-
-function sd() { var_dump(symfony_debug_backtrace()); }
-
-register_shutdown_function('sd');
-
-bar();
-
-/* Will output
-Fatal error: Call to undefined function fatal() in foo.php on line 42
-array(3) {
- [0]=>
- array(2) {
- ["function"]=>
- string(2) "sd"
- ["args"]=>
- array(0) {
- }
- }
- [1]=>
- array(4) {
- ["file"]=>
- string(7) "foo.php"
- ["line"]=>
- int(1)
- ["function"]=>
- string(3) "foo"
- ["args"]=>
- array(0) {
- }
- }
- [2]=>
- array(4) {
- ["file"]=>
- string(102) "foo.php"
- ["line"]=>
- int(2)
- ["function"]=>
- string(3) "bar"
- ["args"]=>
- array(0) {
- }
- }
-}
-*/
-```
-
-Usage
------
-
-To enable the extension from source, run:
-
-```
- phpize
- ./configure
- make
- sudo make install
-```
diff --git a/vendor/symfony/debug/Resources/ext/config.m4 b/vendor/symfony/debug/Resources/ext/config.m4
deleted file mode 100644
index 3c5604715..000000000
--- a/vendor/symfony/debug/Resources/ext/config.m4
+++ /dev/null
@@ -1,63 +0,0 @@
-dnl $Id$
-dnl config.m4 for extension symfony_debug
-
-dnl Comments in this file start with the string 'dnl'.
-dnl Remove where necessary. This file will not work
-dnl without editing.
-
-dnl If your extension references something external, use with:
-
-dnl PHP_ARG_WITH(symfony_debug, for symfony_debug support,
-dnl Make sure that the comment is aligned:
-dnl [ --with-symfony_debug Include symfony_debug support])
-
-dnl Otherwise use enable:
-
-PHP_ARG_ENABLE(symfony_debug, whether to enable symfony_debug support,
-dnl Make sure that the comment is aligned:
-[ --enable-symfony_debug Enable symfony_debug support])
-
-if test "$PHP_SYMFONY_DEBUG" != "no"; then
- dnl Write more examples of tests here...
-
- dnl # --with-symfony_debug -> check with-path
- dnl SEARCH_PATH="/usr/local /usr" # you might want to change this
- dnl SEARCH_FOR="/include/symfony_debug.h" # you most likely want to change this
- dnl if test -r $PHP_SYMFONY_DEBUG/$SEARCH_FOR; then # path given as parameter
- dnl SYMFONY_DEBUG_DIR=$PHP_SYMFONY_DEBUG
- dnl else # search default path list
- dnl AC_MSG_CHECKING([for symfony_debug files in default path])
- dnl for i in $SEARCH_PATH ; do
- dnl if test -r $i/$SEARCH_FOR; then
- dnl SYMFONY_DEBUG_DIR=$i
- dnl AC_MSG_RESULT(found in $i)
- dnl fi
- dnl done
- dnl fi
- dnl
- dnl if test -z "$SYMFONY_DEBUG_DIR"; then
- dnl AC_MSG_RESULT([not found])
- dnl AC_MSG_ERROR([Please reinstall the symfony_debug distribution])
- dnl fi
-
- dnl # --with-symfony_debug -> add include path
- dnl PHP_ADD_INCLUDE($SYMFONY_DEBUG_DIR/include)
-
- dnl # --with-symfony_debug -> check for lib and symbol presence
- dnl LIBNAME=symfony_debug # you may want to change this
- dnl LIBSYMBOL=symfony_debug # you most likely want to change this
-
- dnl PHP_CHECK_LIBRARY($LIBNAME,$LIBSYMBOL,
- dnl [
- dnl PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $SYMFONY_DEBUG_DIR/lib, SYMFONY_DEBUG_SHARED_LIBADD)
- dnl AC_DEFINE(HAVE_SYMFONY_DEBUGLIB,1,[ ])
- dnl ],[
- dnl AC_MSG_ERROR([wrong symfony_debug lib version or lib not found])
- dnl ],[
- dnl -L$SYMFONY_DEBUG_DIR/lib -lm
- dnl ])
- dnl
- dnl PHP_SUBST(SYMFONY_DEBUG_SHARED_LIBADD)
-
- PHP_NEW_EXTENSION(symfony_debug, symfony_debug.c, $ext_shared)
-fi
diff --git a/vendor/symfony/debug/Resources/ext/config.w32 b/vendor/symfony/debug/Resources/ext/config.w32
deleted file mode 100644
index 487e69138..000000000
--- a/vendor/symfony/debug/Resources/ext/config.w32
+++ /dev/null
@@ -1,13 +0,0 @@
-// $Id$
-// vim:ft=javascript
-
-// If your extension references something external, use ARG_WITH
-// ARG_WITH("symfony_debug", "for symfony_debug support", "no");
-
-// Otherwise, use ARG_ENABLE
-// ARG_ENABLE("symfony_debug", "enable symfony_debug support", "no");
-
-if (PHP_SYMFONY_DEBUG != "no") {
- EXTENSION("symfony_debug", "symfony_debug.c");
-}
-
diff --git a/vendor/symfony/debug/Resources/ext/php_symfony_debug.h b/vendor/symfony/debug/Resources/ext/php_symfony_debug.h
deleted file mode 100644
index 26d0e8c01..000000000
--- a/vendor/symfony/debug/Resources/ext/php_symfony_debug.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * This file is part of the Symfony package.
- *
- * (c) Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-#ifndef PHP_SYMFONY_DEBUG_H
-#define PHP_SYMFONY_DEBUG_H
-
-extern zend_module_entry symfony_debug_module_entry;
-#define phpext_symfony_debug_ptr &symfony_debug_module_entry
-
-#define PHP_SYMFONY_DEBUG_VERSION "2.7"
-
-#ifdef PHP_WIN32
-# define PHP_SYMFONY_DEBUG_API __declspec(dllexport)
-#elif defined(__GNUC__) && __GNUC__ >= 4
-# define PHP_SYMFONY_DEBUG_API __attribute__ ((visibility("default")))
-#else
-# define PHP_SYMFONY_DEBUG_API
-#endif
-
-#ifdef ZTS
-#include "TSRM.h"
-#endif
-
-ZEND_BEGIN_MODULE_GLOBALS(symfony_debug)
- intptr_t req_rand_init;
- void (*old_error_cb)(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args);
- zval *debug_bt;
-ZEND_END_MODULE_GLOBALS(symfony_debug)
-
-PHP_MINIT_FUNCTION(symfony_debug);
-PHP_MSHUTDOWN_FUNCTION(symfony_debug);
-PHP_RINIT_FUNCTION(symfony_debug);
-PHP_RSHUTDOWN_FUNCTION(symfony_debug);
-PHP_MINFO_FUNCTION(symfony_debug);
-PHP_GINIT_FUNCTION(symfony_debug);
-PHP_GSHUTDOWN_FUNCTION(symfony_debug);
-
-PHP_FUNCTION(symfony_zval_info);
-PHP_FUNCTION(symfony_debug_backtrace);
-
-static char *_symfony_debug_memory_address_hash(void * TSRMLS_DC);
-static const char *_symfony_debug_zval_type(zval *);
-static const char* _symfony_debug_get_resource_type(long TSRMLS_DC);
-static int _symfony_debug_get_resource_refcount(long TSRMLS_DC);
-
-void symfony_debug_error_cb(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args);
-
-#ifdef ZTS
-#define SYMFONY_DEBUG_G(v) TSRMG(symfony_debug_globals_id, zend_symfony_debug_globals *, v)
-#else
-#define SYMFONY_DEBUG_G(v) (symfony_debug_globals.v)
-#endif
-
-#endif /* PHP_SYMFONY_DEBUG_H */
diff --git a/vendor/symfony/debug/Resources/ext/symfony_debug.c b/vendor/symfony/debug/Resources/ext/symfony_debug.c
deleted file mode 100644
index 0d7cb6023..000000000
--- a/vendor/symfony/debug/Resources/ext/symfony_debug.c
+++ /dev/null
@@ -1,283 +0,0 @@
-/*
- * This file is part of the Symfony package.
- *
- * (c) Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "php.h"
-#ifdef ZTS
-#include "TSRM.h"
-#endif
-#include "php_ini.h"
-#include "ext/standard/info.h"
-#include "php_symfony_debug.h"
-#include "ext/standard/php_rand.h"
-#include "ext/standard/php_lcg.h"
-#include "ext/spl/php_spl.h"
-#include "Zend/zend_gc.h"
-#include "Zend/zend_builtin_functions.h"
-#include "Zend/zend_extensions.h" /* for ZEND_EXTENSION_API_NO */
-#include "ext/standard/php_array.h"
-#include "Zend/zend_interfaces.h"
-#include "SAPI.h"
-
-#define IS_PHP_53 ZEND_EXTENSION_API_NO == 220090626
-
-ZEND_DECLARE_MODULE_GLOBALS(symfony_debug)
-
-ZEND_BEGIN_ARG_INFO_EX(symfony_zval_arginfo, 0, 0, 2)
- ZEND_ARG_INFO(0, key)
- ZEND_ARG_ARRAY_INFO(0, array, 0)
- ZEND_ARG_INFO(0, options)
-ZEND_END_ARG_INFO()
-
-const zend_function_entry symfony_debug_functions[] = {
- PHP_FE(symfony_zval_info, symfony_zval_arginfo)
- PHP_FE(symfony_debug_backtrace, NULL)
- PHP_FE_END
-};
-
-PHP_FUNCTION(symfony_debug_backtrace)
-{
- if (zend_parse_parameters_none() == FAILURE) {
- return;
- }
-#if IS_PHP_53
- zend_fetch_debug_backtrace(return_value, 1, 0 TSRMLS_CC);
-#else
- zend_fetch_debug_backtrace(return_value, 1, 0, 0 TSRMLS_CC);
-#endif
-
- if (!SYMFONY_DEBUG_G(debug_bt)) {
- return;
- }
-
- php_array_merge(Z_ARRVAL_P(return_value), Z_ARRVAL_P(SYMFONY_DEBUG_G(debug_bt)), 0 TSRMLS_CC);
-}
-
-PHP_FUNCTION(symfony_zval_info)
-{
- zval *key = NULL, *arg = NULL;
- zval **data = NULL;
- HashTable *array = NULL;
- long options = 0;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zh|l", &key, &array, &options) == FAILURE) {
- return;
- }
-
- switch (Z_TYPE_P(key)) {
- case IS_STRING:
- if (zend_symtable_find(array, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, (void **)&data) == FAILURE) {
- return;
- }
- break;
- case IS_LONG:
- if (zend_hash_index_find(array, Z_LVAL_P(key), (void **)&data)) {
- return;
- }
- break;
- }
-
- arg = *data;
-
- array_init(return_value);
-
- add_assoc_string(return_value, "type", (char *)_symfony_debug_zval_type(arg), 1);
- add_assoc_stringl(return_value, "zval_hash", _symfony_debug_memory_address_hash((void *)arg TSRMLS_CC), 16, 0);
- add_assoc_long(return_value, "zval_refcount", Z_REFCOUNT_P(arg));
- add_assoc_bool(return_value, "zval_isref", (zend_bool)Z_ISREF_P(arg));
-
- if (Z_TYPE_P(arg) == IS_OBJECT) {
- char hash[33] = {0};
-
- php_spl_object_hash(arg, (char *)hash TSRMLS_CC);
- add_assoc_stringl(return_value, "object_class", (char *)Z_OBJCE_P(arg)->name, Z_OBJCE_P(arg)->name_length, 1);
- add_assoc_long(return_value, "object_refcount", EG(objects_store).object_buckets[Z_OBJ_HANDLE_P(arg)].bucket.obj.refcount);
- add_assoc_string(return_value, "object_hash", hash, 1);
- add_assoc_long(return_value, "object_handle", Z_OBJ_HANDLE_P(arg));
- } else if (Z_TYPE_P(arg) == IS_ARRAY) {
- add_assoc_long(return_value, "array_count", zend_hash_num_elements(Z_ARRVAL_P(arg)));
- } else if(Z_TYPE_P(arg) == IS_RESOURCE) {
- add_assoc_long(return_value, "resource_handle", Z_LVAL_P(arg));
- add_assoc_string(return_value, "resource_type", (char *)_symfony_debug_get_resource_type(Z_LVAL_P(arg) TSRMLS_CC), 1);
- add_assoc_long(return_value, "resource_refcount", _symfony_debug_get_resource_refcount(Z_LVAL_P(arg) TSRMLS_CC));
- } else if (Z_TYPE_P(arg) == IS_STRING) {
- add_assoc_long(return_value, "strlen", Z_STRLEN_P(arg));
- }
-}
-
-void symfony_debug_error_cb(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args)
-{
- TSRMLS_FETCH();
- zval *retval;
-
- switch (type) {
- case E_ERROR:
- case E_PARSE:
- case E_CORE_ERROR:
- case E_CORE_WARNING:
- case E_COMPILE_ERROR:
- case E_COMPILE_WARNING:
- ALLOC_INIT_ZVAL(retval);
-#if IS_PHP_53
- zend_fetch_debug_backtrace(retval, 1, 0 TSRMLS_CC);
-#else
- zend_fetch_debug_backtrace(retval, 1, 0, 0 TSRMLS_CC);
-#endif
- SYMFONY_DEBUG_G(debug_bt) = retval;
- }
-
- SYMFONY_DEBUG_G(old_error_cb)(type, error_filename, error_lineno, format, args);
-}
-
-static const char* _symfony_debug_get_resource_type(long rsid TSRMLS_DC)
-{
- const char *res_type;
- res_type = zend_rsrc_list_get_rsrc_type(rsid TSRMLS_CC);
-
- if (!res_type) {
- return "Unknown";
- }
-
- return res_type;
-}
-
-static int _symfony_debug_get_resource_refcount(long rsid TSRMLS_DC)
-{
- zend_rsrc_list_entry *le;
-
- if (zend_hash_index_find(&EG(regular_list), rsid, (void **) &le)==SUCCESS) {
- return le->refcount;
- }
-
- return 0;
-}
-
-static char *_symfony_debug_memory_address_hash(void *address TSRMLS_DC)
-{
- char *result = NULL;
- intptr_t address_rand;
-
- if (!SYMFONY_DEBUG_G(req_rand_init)) {
- if (!BG(mt_rand_is_seeded)) {
- php_mt_srand(GENERATE_SEED() TSRMLS_CC);
- }
- SYMFONY_DEBUG_G(req_rand_init) = (intptr_t)php_mt_rand(TSRMLS_C);
- }
-
- address_rand = (intptr_t)address ^ SYMFONY_DEBUG_G(req_rand_init);
-
- spprintf(&result, 17, "%016zx", address_rand);
-
- return result;
-}
-
-static const char *_symfony_debug_zval_type(zval *zv)
-{
- switch (Z_TYPE_P(zv)) {
- case IS_NULL:
- return "NULL";
- break;
-
- case IS_BOOL:
- return "boolean";
- break;
-
- case IS_LONG:
- return "integer";
- break;
-
- case IS_DOUBLE:
- return "double";
- break;
-
- case IS_STRING:
- return "string";
- break;
-
- case IS_ARRAY:
- return "array";
- break;
-
- case IS_OBJECT:
- return "object";
-
- case IS_RESOURCE:
- return "resource";
-
- default:
- return "unknown type";
- }
-}
-
-zend_module_entry symfony_debug_module_entry = {
- STANDARD_MODULE_HEADER,
- "symfony_debug",
- symfony_debug_functions,
- PHP_MINIT(symfony_debug),
- PHP_MSHUTDOWN(symfony_debug),
- PHP_RINIT(symfony_debug),
- PHP_RSHUTDOWN(symfony_debug),
- PHP_MINFO(symfony_debug),
- PHP_SYMFONY_DEBUG_VERSION,
- PHP_MODULE_GLOBALS(symfony_debug),
- PHP_GINIT(symfony_debug),
- PHP_GSHUTDOWN(symfony_debug),
- NULL,
- STANDARD_MODULE_PROPERTIES_EX
-};
-
-#ifdef COMPILE_DL_SYMFONY_DEBUG
-ZEND_GET_MODULE(symfony_debug)
-#endif
-
-PHP_GINIT_FUNCTION(symfony_debug)
-{
- memset(symfony_debug_globals, 0 , sizeof(*symfony_debug_globals));
-}
-
-PHP_GSHUTDOWN_FUNCTION(symfony_debug)
-{
-
-}
-
-PHP_MINIT_FUNCTION(symfony_debug)
-{
- SYMFONY_DEBUG_G(old_error_cb) = zend_error_cb;
- zend_error_cb = symfony_debug_error_cb;
-
- return SUCCESS;
-}
-
-PHP_MSHUTDOWN_FUNCTION(symfony_debug)
-{
- zend_error_cb = SYMFONY_DEBUG_G(old_error_cb);
-
- return SUCCESS;
-}
-
-PHP_RINIT_FUNCTION(symfony_debug)
-{
- return SUCCESS;
-}
-
-PHP_RSHUTDOWN_FUNCTION(symfony_debug)
-{
- return SUCCESS;
-}
-
-PHP_MINFO_FUNCTION(symfony_debug)
-{
- php_info_print_table_start();
- php_info_print_table_header(2, "Symfony Debug support", "enabled");
- php_info_print_table_header(2, "Symfony Debug version", PHP_SYMFONY_DEBUG_VERSION);
- php_info_print_table_end();
-}
diff --git a/vendor/symfony/debug/Resources/ext/tests/001.phpt b/vendor/symfony/debug/Resources/ext/tests/001.phpt
deleted file mode 100644
index 15e183a70..000000000
--- a/vendor/symfony/debug/Resources/ext/tests/001.phpt
+++ /dev/null
@@ -1,153 +0,0 @@
---TEST--
-Test symfony_zval_info API
---SKIPIF--
-
---FILE--
- $int,
- 'float' => $float,
- 'str' => $str,
- 'object' => $object,
- 'array' => $array,
- 'resource' => $resource,
- 'null' => $null,
- 'bool' => $bool,
- 'refcount' => &$refcount2,
-);
-
-var_dump(symfony_zval_info('int', $var));
-var_dump(symfony_zval_info('float', $var));
-var_dump(symfony_zval_info('str', $var));
-var_dump(symfony_zval_info('object', $var));
-var_dump(symfony_zval_info('array', $var));
-var_dump(symfony_zval_info('resource', $var));
-var_dump(symfony_zval_info('null', $var));
-var_dump(symfony_zval_info('bool', $var));
-
-var_dump(symfony_zval_info('refcount', $var));
-var_dump(symfony_zval_info('not-exist', $var));
-?>
---EXPECTF--
-array(4) {
- ["type"]=>
- string(7) "integer"
- ["zval_hash"]=>
- string(16) "%s"
- ["zval_refcount"]=>
- int(2)
- ["zval_isref"]=>
- bool(false)
-}
-array(4) {
- ["type"]=>
- string(6) "double"
- ["zval_hash"]=>
- string(16) "%s"
- ["zval_refcount"]=>
- int(2)
- ["zval_isref"]=>
- bool(false)
-}
-array(5) {
- ["type"]=>
- string(6) "string"
- ["zval_hash"]=>
- string(16) "%s"
- ["zval_refcount"]=>
- int(2)
- ["zval_isref"]=>
- bool(false)
- ["strlen"]=>
- int(6)
-}
-array(8) {
- ["type"]=>
- string(6) "object"
- ["zval_hash"]=>
- string(16) "%s"
- ["zval_refcount"]=>
- int(2)
- ["zval_isref"]=>
- bool(false)
- ["object_class"]=>
- string(8) "stdClass"
- ["object_refcount"]=>
- int(1)
- ["object_hash"]=>
- string(32) "%s"
- ["object_handle"]=>
- int(%d)
-}
-array(5) {
- ["type"]=>
- string(5) "array"
- ["zval_hash"]=>
- string(16) "%s"
- ["zval_refcount"]=>
- int(2)
- ["zval_isref"]=>
- bool(false)
- ["array_count"]=>
- int(2)
-}
-array(7) {
- ["type"]=>
- string(8) "resource"
- ["zval_hash"]=>
- string(16) "%s"
- ["zval_refcount"]=>
- int(2)
- ["zval_isref"]=>
- bool(false)
- ["resource_handle"]=>
- int(%d)
- ["resource_type"]=>
- string(6) "stream"
- ["resource_refcount"]=>
- int(1)
-}
-array(4) {
- ["type"]=>
- string(4) "NULL"
- ["zval_hash"]=>
- string(16) "%s"
- ["zval_refcount"]=>
- int(2)
- ["zval_isref"]=>
- bool(false)
-}
-array(4) {
- ["type"]=>
- string(7) "boolean"
- ["zval_hash"]=>
- string(16) "%s"
- ["zval_refcount"]=>
- int(2)
- ["zval_isref"]=>
- bool(false)
-}
-array(4) {
- ["type"]=>
- string(7) "integer"
- ["zval_hash"]=>
- string(16) "%s"
- ["zval_refcount"]=>
- int(3)
- ["zval_isref"]=>
- bool(true)
-}
-NULL
diff --git a/vendor/symfony/debug/Resources/ext/tests/002.phpt b/vendor/symfony/debug/Resources/ext/tests/002.phpt
deleted file mode 100644
index 2bc6d7127..000000000
--- a/vendor/symfony/debug/Resources/ext/tests/002.phpt
+++ /dev/null
@@ -1,63 +0,0 @@
---TEST--
-Test symfony_debug_backtrace in case of fatal error
---SKIPIF--
-
---FILE--
-
---EXPECTF--
-Fatal error: Call to undefined function notexist() in %s on line %d
-Array
-(
- [0] => Array
- (
- [function] => bt
- [args] => Array
- (
- )
-
- )
-
- [1] => Array
- (
- [file] => %s
- [line] => %d
- [function] => foo
- [args] => Array
- (
- )
-
- )
-
- [2] => Array
- (
- [file] => %s
- [line] => %d
- [function] => bar
- [args] => Array
- (
- )
-
- )
-
-)
diff --git a/vendor/symfony/debug/Resources/ext/tests/002_1.phpt b/vendor/symfony/debug/Resources/ext/tests/002_1.phpt
deleted file mode 100644
index 4e9e34f1b..000000000
--- a/vendor/symfony/debug/Resources/ext/tests/002_1.phpt
+++ /dev/null
@@ -1,46 +0,0 @@
---TEST--
-Test symfony_debug_backtrace in case of non fatal error
---SKIPIF--
-
---FILE--
-
---EXPECTF--
-Array
-(
- [0] => Array
- (
- [file] => %s
- [line] => %d
- [function] => bt
- [args] => Array
- (
- )
-
- )
-
- [1] => Array
- (
- [file] => %s
- [line] => %d
- [function] => bar
- [args] => Array
- (
- )
-
- )
-
-)
diff --git a/vendor/symfony/debug/Resources/ext/tests/003.phpt b/vendor/symfony/debug/Resources/ext/tests/003.phpt
deleted file mode 100644
index 2a494e27a..000000000
--- a/vendor/symfony/debug/Resources/ext/tests/003.phpt
+++ /dev/null
@@ -1,85 +0,0 @@
---TEST--
-Test ErrorHandler in case of fatal error
---SKIPIF--
-
---FILE--
-setExceptionHandler('print_r');
-
-if (function_exists('xdebug_disable')) {
- xdebug_disable();
-}
-
-bar();
-?>
---EXPECTF--
-Fatal error: Call to undefined function Symfony\Component\Debug\notexist() in %s on line %d
-Symfony\Component\Debug\Exception\UndefinedFunctionException Object
-(
- [message:protected] => Attempted to call function "notexist" from namespace "Symfony\Component\Debug".
- [string:Exception:private] =>
- [code:protected] => 0
- [file:protected] => %s
- [line:protected] => %d
- [trace:Exception:private] => Array
- (
- [0] => Array
- (
-%A [function] => Symfony\Component\Debug\foo
-%A [args] => Array
- (
- )
-
- )
-
- [1] => Array
- (
-%A [function] => Symfony\Component\Debug\bar
-%A [args] => Array
- (
- )
-
- )
-%A
- )
-
- [previous:Exception:private] =>
- [severity:protected] => 1
-)
diff --git a/vendor/symfony/debug/Tests/DebugClassLoaderTest.php b/vendor/symfony/debug/Tests/DebugClassLoaderTest.php
deleted file mode 100644
index 0219f5335..000000000
--- a/vendor/symfony/debug/Tests/DebugClassLoaderTest.php
+++ /dev/null
@@ -1,425 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Debug\Tests;
-
-use PHPUnit\Framework\TestCase;
-use Symfony\Component\Debug\DebugClassLoader;
-use Symfony\Component\Debug\ErrorHandler;
-
-class DebugClassLoaderTest extends TestCase
-{
- /**
- * @var int Error reporting level before running tests
- */
- private $errorReporting;
-
- private $loader;
-
- protected function setUp()
- {
- $this->errorReporting = error_reporting(E_ALL);
- $this->loader = new ClassLoader();
- spl_autoload_register(array($this->loader, 'loadClass'), true, true);
- DebugClassLoader::enable();
- }
-
- protected function tearDown()
- {
- DebugClassLoader::disable();
- spl_autoload_unregister(array($this->loader, 'loadClass'));
- error_reporting($this->errorReporting);
- }
-
- public function testIdempotence()
- {
- DebugClassLoader::enable();
-
- $functions = spl_autoload_functions();
- foreach ($functions as $function) {
- if (is_array($function) && $function[0] instanceof DebugClassLoader) {
- $reflClass = new \ReflectionClass($function[0]);
- $reflProp = $reflClass->getProperty('classLoader');
- $reflProp->setAccessible(true);
-
- $this->assertNotInstanceOf('Symfony\Component\Debug\DebugClassLoader', $reflProp->getValue($function[0]));
-
- return;
- }
- }
-
- $this->fail('DebugClassLoader did not register');
- }
-
- /**
- * @expectedException \Exception
- * @expectedExceptionMessage boo
- */
- public function testThrowingClass()
- {
- try {
- class_exists(__NAMESPACE__.'\Fixtures\Throwing');
- $this->fail('Exception expected');
- } catch (\Exception $e) {
- $this->assertSame('boo', $e->getMessage());
- }
-
- // the second call also should throw
- class_exists(__NAMESPACE__.'\Fixtures\Throwing');
- }
-
- public function testUnsilencing()
- {
- if (\PHP_VERSION_ID >= 70000) {
- $this->markTestSkipped('PHP7 throws exceptions, unsilencing is not required anymore.');
- }
- if (defined('HHVM_VERSION')) {
- $this->markTestSkipped('HHVM is not handled in this test case.');
- }
-
- ob_start();
-
- $this->iniSet('log_errors', 0);
- $this->iniSet('display_errors', 1);
-
- // See below: this will fail with parse error
- // but this should not be @-silenced.
- @class_exists(__NAMESPACE__.'\TestingUnsilencing', true);
-
- $output = ob_get_clean();
-
- $this->assertStringMatchesFormat('%aParse error%a', $output);
- }
-
- public function testStacking()
- {
- // the ContextErrorException must not be loaded to test the workaround
- // for https://bugs.php.net/65322.
- if (class_exists('Symfony\Component\Debug\Exception\ContextErrorException', false)) {
- $this->markTestSkipped('The ContextErrorException class is already loaded.');
- }
- if (defined('HHVM_VERSION')) {
- $this->markTestSkipped('HHVM is not handled in this test case.');
- }
-
- ErrorHandler::register();
-
- try {
- // Trigger autoloading + E_STRICT at compile time
- // which in turn triggers $errorHandler->handle()
- // that again triggers autoloading for ContextErrorException.
- // Error stacking works around the bug above and everything is fine.
-
- eval('
- namespace '.__NAMESPACE__.';
- class ChildTestingStacking extends TestingStacking { function foo($bar) {} }
- ');
- $this->fail('ContextErrorException expected');
- } catch (\ErrorException $exception) {
- // if an exception is thrown, the test passed
- $this->assertStringStartsWith(__FILE__, $exception->getFile());
- if (\PHP_VERSION_ID < 70000) {
- $this->assertRegExp('/^Runtime Notice: Declaration/', $exception->getMessage());
- $this->assertEquals(E_STRICT, $exception->getSeverity());
- } else {
- $this->assertRegExp('/^Warning: Declaration/', $exception->getMessage());
- $this->assertEquals(E_WARNING, $exception->getSeverity());
- }
- } finally {
- restore_error_handler();
- restore_exception_handler();
- }
- }
-
- /**
- * @expectedException \RuntimeException
- * @expectedExceptionMessage Case mismatch between loaded and declared class names
- */
- public function testNameCaseMismatch()
- {
- class_exists(__NAMESPACE__.'\TestingCaseMismatch', true);
- }
-
- /**
- * @expectedException \RuntimeException
- * @expectedExceptionMessage Case mismatch between class and real file names
- */
- public function testFileCaseMismatch()
- {
- if (!file_exists(__DIR__.'/Fixtures/CaseMismatch.php')) {
- $this->markTestSkipped('Can only be run on case insensitive filesystems');
- }
-
- class_exists(__NAMESPACE__.'\Fixtures\CaseMismatch', true);
- }
-
- /**
- * @expectedException \RuntimeException
- * @expectedExceptionMessage Case mismatch between loaded and declared class names
- */
- public function testPsr4CaseMismatch()
- {
- class_exists(__NAMESPACE__.'\Fixtures\Psr4CaseMismatch', true);
- }
-
- public function testNotPsr0()
- {
- $this->assertTrue(class_exists(__NAMESPACE__.'\Fixtures\NotPSR0', true));
- }
-
- public function testNotPsr0Bis()
- {
- $this->assertTrue(class_exists(__NAMESPACE__.'\Fixtures\NotPSR0bis', true));
- }
-
- public function testClassAlias()
- {
- $this->assertTrue(class_exists(__NAMESPACE__.'\Fixtures\ClassAlias', true));
- }
-
- /**
- * @dataProvider provideDeprecatedSuper
- */
- public function testDeprecatedSuper($class, $super, $type)
- {
- set_error_handler(function () { return false; });
- $e = error_reporting(0);
- trigger_error('', E_USER_DEPRECATED);
-
- class_exists('Test\\'.__NAMESPACE__.'\\'.$class, true);
-
- error_reporting($e);
- restore_error_handler();
-
- $lastError = error_get_last();
- unset($lastError['file'], $lastError['line']);
-
- $xError = array(
- 'type' => E_USER_DEPRECATED,
- 'message' => 'The "Test\Symfony\Component\Debug\Tests\\'.$class.'" class '.$type.' "Symfony\Component\Debug\Tests\Fixtures\\'.$super.'" that is deprecated but this is a test deprecation notice.',
- );
-
- $this->assertSame($xError, $lastError);
- }
-
- public function provideDeprecatedSuper()
- {
- return array(
- array('DeprecatedInterfaceClass', 'DeprecatedInterface', 'implements'),
- array('DeprecatedParentClass', 'DeprecatedClass', 'extends'),
- );
- }
-
- public function testInterfaceExtendsDeprecatedInterface()
- {
- set_error_handler(function () { return false; });
- $e = error_reporting(0);
- trigger_error('', E_USER_NOTICE);
-
- class_exists('Test\\'.__NAMESPACE__.'\\NonDeprecatedInterfaceClass', true);
-
- error_reporting($e);
- restore_error_handler();
-
- $lastError = error_get_last();
- unset($lastError['file'], $lastError['line']);
-
- $xError = array(
- 'type' => E_USER_NOTICE,
- 'message' => '',
- );
-
- $this->assertSame($xError, $lastError);
- }
-
- public function testDeprecatedSuperInSameNamespace()
- {
- set_error_handler(function () { return false; });
- $e = error_reporting(0);
- trigger_error('', E_USER_NOTICE);
-
- class_exists('Symfony\Bridge\Debug\Tests\Fixtures\ExtendsDeprecatedParent', true);
-
- error_reporting($e);
- restore_error_handler();
-
- $lastError = error_get_last();
- unset($lastError['file'], $lastError['line']);
-
- $xError = array(
- 'type' => E_USER_NOTICE,
- 'message' => '',
- );
-
- $this->assertSame($xError, $lastError);
- }
-
- public function testReservedForPhp7()
- {
- if (\PHP_VERSION_ID >= 70000) {
- $this->markTestSkipped('PHP7 already prevents using reserved names.');
- }
-
- set_error_handler(function () { return false; });
- $e = error_reporting(0);
- trigger_error('', E_USER_NOTICE);
-
- class_exists('Test\\'.__NAMESPACE__.'\\Float', true);
-
- error_reporting($e);
- restore_error_handler();
-
- $lastError = error_get_last();
- unset($lastError['file'], $lastError['line']);
-
- $xError = array(
- 'type' => E_USER_DEPRECATED,
- 'message' => 'The "Test\Symfony\Component\Debug\Tests\Float" class uses the reserved name "Float", it will break on PHP 7 and higher',
- );
-
- $this->assertSame($xError, $lastError);
- }
-
- public function testExtendedFinalClass()
- {
- set_error_handler(function () { return false; });
- $e = error_reporting(0);
- trigger_error('', E_USER_NOTICE);
-
- class_exists('Test\\'.__NAMESPACE__.'\\ExtendsFinalClass', true);
-
- error_reporting($e);
- restore_error_handler();
-
- $lastError = error_get_last();
- unset($lastError['file'], $lastError['line']);
-
- $xError = array(
- 'type' => E_USER_DEPRECATED,
- 'message' => 'The "Symfony\Component\Debug\Tests\Fixtures\FinalClass" class is considered final since version 3.3. It may change without further notice as of its next major version. You should not extend it from "Test\Symfony\Component\Debug\Tests\ExtendsFinalClass".',
- );
-
- $this->assertSame($xError, $lastError);
- }
-
- public function testExtendedFinalMethod()
- {
- set_error_handler(function () { return false; });
- $e = error_reporting(0);
- trigger_error('', E_USER_NOTICE);
-
- class_exists(__NAMESPACE__.'\\Fixtures\\ExtendedFinalMethod', true);
-
- error_reporting($e);
- restore_error_handler();
-
- $lastError = error_get_last();
- unset($lastError['file'], $lastError['line']);
-
- $xError = array(
- 'type' => E_USER_DEPRECATED,
- 'message' => 'The "Symfony\Component\Debug\Tests\Fixtures\FinalMethod::finalMethod()" method is considered final since version 3.3. It may change without further notice as of its next major version. You should not extend it from "Symfony\Component\Debug\Tests\Fixtures\ExtendedFinalMethod".',
- );
-
- $this->assertSame($xError, $lastError);
- }
-
- public function testExtendedDeprecatedMethodDoesntTriggerAnyNotice()
- {
- set_error_handler(function () { return false; });
- $e = error_reporting(0);
- trigger_error('', E_USER_NOTICE);
-
- class_exists('Test\\'.__NAMESPACE__.'\\ExtendsAnnotatedClass', true);
-
- error_reporting($e);
- restore_error_handler();
-
- $lastError = error_get_last();
- unset($lastError['file'], $lastError['line']);
-
- $this->assertSame(array('type' => E_USER_NOTICE, 'message' => ''), $lastError);
- }
-
- public function testInternalsUse()
- {
- $deprecations = array();
- set_error_handler(function ($type, $msg) use (&$deprecations) { $deprecations[] = $msg; });
- $e = error_reporting(E_USER_DEPRECATED);
-
- class_exists('Test\\'.__NAMESPACE__.'\\ExtendsInternals', true);
-
- error_reporting($e);
- restore_error_handler();
-
- $this->assertSame($deprecations, array(
- 'The "Symfony\Component\Debug\Tests\Fixtures\InternalClass" class is considered internal since version 3.4. It may change without further notice. You should not use it from "Test\Symfony\Component\Debug\Tests\ExtendsInternalsParent".',
- 'The "Symfony\Component\Debug\Tests\Fixtures\InternalInterface" interface is considered internal. It may change without further notice. You should not use it from "Test\Symfony\Component\Debug\Tests\ExtendsInternalsParent".',
- 'The "Symfony\Component\Debug\Tests\Fixtures\InternalTrait" trait is considered internal. It may change without further notice. You should not use it from "Test\Symfony\Component\Debug\Tests\ExtendsInternals".',
- 'The "Symfony\Component\Debug\Tests\Fixtures\InternalTrait2::internalMethod()" method is considered internal since version 3.4. It may change without further notice. You should not extend it from "Test\Symfony\Component\Debug\Tests\ExtendsInternals".',
- ));
- }
-}
-
-class ClassLoader
-{
- public function loadClass($class)
- {
- }
-
- public function getClassMap()
- {
- return array(__NAMESPACE__.'\Fixtures\NotPSR0bis' => __DIR__.'/Fixtures/notPsr0Bis.php');
- }
-
- public function findFile($class)
- {
- $fixtureDir = __DIR__.DIRECTORY_SEPARATOR.'Fixtures'.DIRECTORY_SEPARATOR;
-
- if (__NAMESPACE__.'\TestingUnsilencing' === $class) {
- eval('-- parse error --');
- } elseif (__NAMESPACE__.'\TestingStacking' === $class) {
- eval('namespace '.__NAMESPACE__.'; class TestingStacking { function foo() {} }');
- } elseif (__NAMESPACE__.'\TestingCaseMismatch' === $class) {
- eval('namespace '.__NAMESPACE__.'; class TestingCaseMisMatch {}');
- } elseif (__NAMESPACE__.'\Fixtures\Psr4CaseMismatch' === $class) {
- return $fixtureDir.'psr4'.DIRECTORY_SEPARATOR.'Psr4CaseMismatch.php';
- } elseif (__NAMESPACE__.'\Fixtures\NotPSR0' === $class) {
- return $fixtureDir.'reallyNotPsr0.php';
- } elseif (__NAMESPACE__.'\Fixtures\NotPSR0bis' === $class) {
- return $fixtureDir.'notPsr0Bis.php';
- } elseif ('Symfony\Bridge\Debug\Tests\Fixtures\ExtendsDeprecatedParent' === $class) {
- eval('namespace Symfony\Bridge\Debug\Tests\Fixtures; class ExtendsDeprecatedParent extends \\'.__NAMESPACE__.'\Fixtures\DeprecatedClass {}');
- } elseif ('Test\\'.__NAMESPACE__.'\DeprecatedParentClass' === $class) {
- eval('namespace Test\\'.__NAMESPACE__.'; class DeprecatedParentClass extends \\'.__NAMESPACE__.'\Fixtures\DeprecatedClass {}');
- } elseif ('Test\\'.__NAMESPACE__.'\DeprecatedInterfaceClass' === $class) {
- eval('namespace Test\\'.__NAMESPACE__.'; class DeprecatedInterfaceClass implements \\'.__NAMESPACE__.'\Fixtures\DeprecatedInterface {}');
- } elseif ('Test\\'.__NAMESPACE__.'\NonDeprecatedInterfaceClass' === $class) {
- eval('namespace Test\\'.__NAMESPACE__.'; class NonDeprecatedInterfaceClass implements \\'.__NAMESPACE__.'\Fixtures\NonDeprecatedInterface {}');
- } elseif ('Test\\'.__NAMESPACE__.'\Float' === $class) {
- eval('namespace Test\\'.__NAMESPACE__.'; class Float {}');
- } elseif ('Test\\'.__NAMESPACE__.'\ExtendsFinalClass' === $class) {
- eval('namespace Test\\'.__NAMESPACE__.'; class ExtendsFinalClass extends \\'.__NAMESPACE__.'\Fixtures\FinalClass {}');
- } elseif ('Test\\'.__NAMESPACE__.'\ExtendsAnnotatedClass' === $class) {
- eval('namespace Test\\'.__NAMESPACE__.'; class ExtendsAnnotatedClass extends \\'.__NAMESPACE__.'\Fixtures\AnnotatedClass {
- public function deprecatedMethod() { }
- }');
- } elseif ('Test\\'.__NAMESPACE__.'\ExtendsInternals' === $class) {
- eval('namespace Test\\'.__NAMESPACE__.'; class ExtendsInternals extends ExtendsInternalsParent {
- use \\'.__NAMESPACE__.'\Fixtures\InternalTrait;
-
- public function internalMethod() { }
- }');
- } elseif ('Test\\'.__NAMESPACE__.'\ExtendsInternalsParent' === $class) {
- eval('namespace Test\\'.__NAMESPACE__.'; class ExtendsInternalsParent extends \\'.__NAMESPACE__.'\Fixtures\InternalClass implements \\'.__NAMESPACE__.'\Fixtures\InternalInterface { }');
- }
- }
-}
diff --git a/vendor/symfony/debug/Tests/ErrorHandlerTest.php b/vendor/symfony/debug/Tests/ErrorHandlerTest.php
deleted file mode 100644
index 4cbe47f35..000000000
--- a/vendor/symfony/debug/Tests/ErrorHandlerTest.php
+++ /dev/null
@@ -1,536 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Debug\Tests;
-
-use PHPUnit\Framework\TestCase;
-use Psr\Log\LogLevel;
-use Symfony\Component\Debug\BufferingLogger;
-use Symfony\Component\Debug\ErrorHandler;
-use Symfony\Component\Debug\Exception\SilencedErrorContext;
-
-/**
- * ErrorHandlerTest.
- *
- * @author Robert Schönthal
- * @author Nicolas Grekas
- */
-class ErrorHandlerTest extends TestCase
-{
- public function testRegister()
- {
- $handler = ErrorHandler::register();
-
- try {
- $this->assertInstanceOf('Symfony\Component\Debug\ErrorHandler', $handler);
- $this->assertSame($handler, ErrorHandler::register());
-
- $newHandler = new ErrorHandler();
-
- $this->assertSame($newHandler, ErrorHandler::register($newHandler, false));
- $h = set_error_handler('var_dump');
- restore_error_handler();
- $this->assertSame(array($handler, 'handleError'), $h);
-
- try {
- $this->assertSame($newHandler, ErrorHandler::register($newHandler, true));
- $h = set_error_handler('var_dump');
- restore_error_handler();
- $this->assertSame(array($newHandler, 'handleError'), $h);
- } catch (\Exception $e) {
- }
-
- restore_error_handler();
- restore_exception_handler();
-
- if (isset($e)) {
- throw $e;
- }
- } catch (\Exception $e) {
- }
-
- restore_error_handler();
- restore_exception_handler();
-
- if (isset($e)) {
- throw $e;
- }
- }
-
- public function testNotice()
- {
- ErrorHandler::register();
-
- try {
- self::triggerNotice($this);
- $this->fail('ErrorException expected');
- } catch (\ErrorException $exception) {
- // if an exception is thrown, the test passed
- $this->assertEquals(E_NOTICE, $exception->getSeverity());
- $this->assertEquals(__FILE__, $exception->getFile());
- $this->assertRegExp('/^Notice: Undefined variable: (foo|bar)/', $exception->getMessage());
-
- $trace = $exception->getTrace();
-
- $this->assertEquals(__FILE__, $trace[0]['file']);
- $this->assertEquals(__CLASS__, $trace[0]['class']);
- $this->assertEquals('triggerNotice', $trace[0]['function']);
- $this->assertEquals('::', $trace[0]['type']);
-
- $this->assertEquals(__FILE__, $trace[0]['file']);
- $this->assertEquals(__CLASS__, $trace[1]['class']);
- $this->assertEquals(__FUNCTION__, $trace[1]['function']);
- $this->assertEquals('->', $trace[1]['type']);
- } finally {
- restore_error_handler();
- restore_exception_handler();
- }
- }
-
- // dummy function to test trace in error handler.
- private static function triggerNotice($that)
- {
- $that->assertSame('', $foo.$foo.$bar);
- }
-
- public function testConstruct()
- {
- try {
- $handler = ErrorHandler::register();
- $handler->throwAt(3, true);
- $this->assertEquals(3 | E_RECOVERABLE_ERROR | E_USER_ERROR, $handler->throwAt(0));
- } finally {
- restore_error_handler();
- restore_exception_handler();
- }
- }
-
- public function testDefaultLogger()
- {
- try {
- $handler = ErrorHandler::register();
-
- $logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock();
-
- $handler->setDefaultLogger($logger, E_NOTICE);
- $handler->setDefaultLogger($logger, array(E_USER_NOTICE => LogLevel::CRITICAL));
-
- $loggers = array(
- E_DEPRECATED => array(null, LogLevel::INFO),
- E_USER_DEPRECATED => array(null, LogLevel::INFO),
- E_NOTICE => array($logger, LogLevel::WARNING),
- E_USER_NOTICE => array($logger, LogLevel::CRITICAL),
- E_STRICT => array(null, LogLevel::WARNING),
- E_WARNING => array(null, LogLevel::WARNING),
- E_USER_WARNING => array(null, LogLevel::WARNING),
- E_COMPILE_WARNING => array(null, LogLevel::WARNING),
- E_CORE_WARNING => array(null, LogLevel::WARNING),
- E_USER_ERROR => array(null, LogLevel::CRITICAL),
- E_RECOVERABLE_ERROR => array(null, LogLevel::CRITICAL),
- E_COMPILE_ERROR => array(null, LogLevel::CRITICAL),
- E_PARSE => array(null, LogLevel::CRITICAL),
- E_ERROR => array(null, LogLevel::CRITICAL),
- E_CORE_ERROR => array(null, LogLevel::CRITICAL),
- );
- $this->assertSame($loggers, $handler->setLoggers(array()));
- } finally {
- restore_error_handler();
- restore_exception_handler();
- }
- }
-
- public function testHandleError()
- {
- try {
- $handler = ErrorHandler::register();
- $handler->throwAt(0, true);
- $this->assertFalse($handler->handleError(0, 'foo', 'foo.php', 12, array()));
-
- restore_error_handler();
- restore_exception_handler();
-
- $handler = ErrorHandler::register();
- $handler->throwAt(3, true);
- $this->assertFalse($handler->handleError(4, 'foo', 'foo.php', 12, array()));
-
- restore_error_handler();
- restore_exception_handler();
-
- $handler = ErrorHandler::register();
- $handler->throwAt(3, true);
- try {
- $handler->handleError(4, 'foo', 'foo.php', 12, array());
- } catch (\ErrorException $e) {
- $this->assertSame('Parse Error: foo', $e->getMessage());
- $this->assertSame(4, $e->getSeverity());
- $this->assertSame('foo.php', $e->getFile());
- $this->assertSame(12, $e->getLine());
- }
-
- restore_error_handler();
- restore_exception_handler();
-
- $handler = ErrorHandler::register();
- $handler->throwAt(E_USER_DEPRECATED, true);
- $this->assertFalse($handler->handleError(E_USER_DEPRECATED, 'foo', 'foo.php', 12, array()));
-
- restore_error_handler();
- restore_exception_handler();
-
- $handler = ErrorHandler::register();
- $handler->throwAt(E_DEPRECATED, true);
- $this->assertFalse($handler->handleError(E_DEPRECATED, 'foo', 'foo.php', 12, array()));
-
- restore_error_handler();
- restore_exception_handler();
-
- $logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock();
-
- $warnArgCheck = function ($logLevel, $message, $context) {
- $this->assertEquals('info', $logLevel);
- $this->assertEquals('User Deprecated: foo', $message);
- $this->assertArrayHasKey('exception', $context);
- $exception = $context['exception'];
- $this->assertInstanceOf(\ErrorException::class, $exception);
- $this->assertSame('User Deprecated: foo', $exception->getMessage());
- $this->assertSame(E_USER_DEPRECATED, $exception->getSeverity());
- };
-
- $logger
- ->expects($this->once())
- ->method('log')
- ->will($this->returnCallback($warnArgCheck))
- ;
-
- $handler = ErrorHandler::register();
- $handler->setDefaultLogger($logger, E_USER_DEPRECATED);
- $this->assertTrue($handler->handleError(E_USER_DEPRECATED, 'foo', 'foo.php', 12, array()));
-
- restore_error_handler();
- restore_exception_handler();
-
- $logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock();
-
- $line = null;
- $logArgCheck = function ($level, $message, $context) use (&$line) {
- $this->assertEquals('Notice: Undefined variable: undefVar', $message);
- $this->assertArrayHasKey('exception', $context);
- $exception = $context['exception'];
- $this->assertInstanceOf(SilencedErrorContext::class, $exception);
- $this->assertSame(E_NOTICE, $exception->getSeverity());
- $this->assertSame(__FILE__, $exception->getFile());
- $this->assertSame($line, $exception->getLine());
- $this->assertNotEmpty($exception->getTrace());
- $this->assertSame(1, $exception->count);
- };
-
- $logger
- ->expects($this->once())
- ->method('log')
- ->will($this->returnCallback($logArgCheck))
- ;
-
- $handler = ErrorHandler::register();
- $handler->setDefaultLogger($logger, E_NOTICE);
- $handler->screamAt(E_NOTICE);
- unset($undefVar);
- $line = __LINE__ + 1;
- @$undefVar++;
-
- restore_error_handler();
- restore_exception_handler();
- } catch (\Exception $e) {
- restore_error_handler();
- restore_exception_handler();
-
- throw $e;
- }
- }
-
- public function testHandleUserError()
- {
- try {
- $handler = ErrorHandler::register();
- $handler->throwAt(0, true);
-
- $e = null;
- $x = new \Exception('Foo');
-
- try {
- $f = new Fixtures\ToStringThrower($x);
- $f .= ''; // Trigger $f->__toString()
- } catch (\Exception $e) {
- }
-
- $this->assertSame($x, $e);
- } finally {
- restore_error_handler();
- restore_exception_handler();
- }
- }
-
- public function testHandleDeprecation()
- {
- $logArgCheck = function ($level, $message, $context) {
- $this->assertEquals(LogLevel::INFO, $level);
- $this->assertArrayHasKey('exception', $context);
- $exception = $context['exception'];
- $this->assertInstanceOf(\ErrorException::class, $exception);
- $this->assertSame('User Deprecated: Foo deprecation', $exception->getMessage());
- };
-
- $logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock();
- $logger
- ->expects($this->once())
- ->method('log')
- ->will($this->returnCallback($logArgCheck))
- ;
-
- $handler = new ErrorHandler();
- $handler->setDefaultLogger($logger);
- @$handler->handleError(E_USER_DEPRECATED, 'Foo deprecation', __FILE__, __LINE__, array());
- }
-
- public function testHandleException()
- {
- try {
- $handler = ErrorHandler::register();
-
- $exception = new \Exception('foo');
-
- $logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock();
-
- $logArgCheck = function ($level, $message, $context) {
- $this->assertSame('Uncaught Exception: foo', $message);
- $this->assertArrayHasKey('exception', $context);
- $this->assertInstanceOf(\Exception::class, $context['exception']);
- };
-
- $logger
- ->expects($this->exactly(2))
- ->method('log')
- ->will($this->returnCallback($logArgCheck))
- ;
-
- $handler->setDefaultLogger($logger, E_ERROR);
-
- try {
- $handler->handleException($exception);
- $this->fail('Exception expected');
- } catch (\Exception $e) {
- $this->assertSame($exception, $e);
- }
-
- $handler->setExceptionHandler(function ($e) use ($exception) {
- $this->assertSame($exception, $e);
- });
-
- $handler->handleException($exception);
- } finally {
- restore_error_handler();
- restore_exception_handler();
- }
- }
-
- /**
- * @group legacy
- */
- public function testErrorStacking()
- {
- try {
- $handler = ErrorHandler::register();
- $handler->screamAt(E_USER_WARNING);
-
- $logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock();
-
- $logger
- ->expects($this->exactly(2))
- ->method('log')
- ->withConsecutive(
- array($this->equalTo(LogLevel::WARNING), $this->equalTo('Dummy log')),
- array($this->equalTo(LogLevel::DEBUG), $this->equalTo('User Warning: Silenced warning'))
- )
- ;
-
- $handler->setDefaultLogger($logger, array(E_USER_WARNING => LogLevel::WARNING));
-
- ErrorHandler::stackErrors();
- @trigger_error('Silenced warning', E_USER_WARNING);
- $logger->log(LogLevel::WARNING, 'Dummy log');
- ErrorHandler::unstackErrors();
- } finally {
- restore_error_handler();
- restore_exception_handler();
- }
- }
-
- public function testBootstrappingLogger()
- {
- $bootLogger = new BufferingLogger();
- $handler = new ErrorHandler($bootLogger);
-
- $loggers = array(
- E_DEPRECATED => array($bootLogger, LogLevel::INFO),
- E_USER_DEPRECATED => array($bootLogger, LogLevel::INFO),
- E_NOTICE => array($bootLogger, LogLevel::WARNING),
- E_USER_NOTICE => array($bootLogger, LogLevel::WARNING),
- E_STRICT => array($bootLogger, LogLevel::WARNING),
- E_WARNING => array($bootLogger, LogLevel::WARNING),
- E_USER_WARNING => array($bootLogger, LogLevel::WARNING),
- E_COMPILE_WARNING => array($bootLogger, LogLevel::WARNING),
- E_CORE_WARNING => array($bootLogger, LogLevel::WARNING),
- E_USER_ERROR => array($bootLogger, LogLevel::CRITICAL),
- E_RECOVERABLE_ERROR => array($bootLogger, LogLevel::CRITICAL),
- E_COMPILE_ERROR => array($bootLogger, LogLevel::CRITICAL),
- E_PARSE => array($bootLogger, LogLevel::CRITICAL),
- E_ERROR => array($bootLogger, LogLevel::CRITICAL),
- E_CORE_ERROR => array($bootLogger, LogLevel::CRITICAL),
- );
-
- $this->assertSame($loggers, $handler->setLoggers(array()));
-
- $handler->handleError(E_DEPRECATED, 'Foo message', __FILE__, 123, array());
-
- $logs = $bootLogger->cleanLogs();
-
- $this->assertCount(1, $logs);
- $log = $logs[0];
- $this->assertSame('info', $log[0]);
- $this->assertSame('Deprecated: Foo message', $log[1]);
- $this->assertArrayHasKey('exception', $log[2]);
- $exception = $log[2]['exception'];
- $this->assertInstanceOf(\ErrorException::class, $exception);
- $this->assertSame('Deprecated: Foo message', $exception->getMessage());
- $this->assertSame(__FILE__, $exception->getFile());
- $this->assertSame(123, $exception->getLine());
- $this->assertSame(E_DEPRECATED, $exception->getSeverity());
-
- $bootLogger->log(LogLevel::WARNING, 'Foo message', array('exception' => $exception));
-
- $mockLogger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock();
- $mockLogger->expects($this->once())
- ->method('log')
- ->with(LogLevel::WARNING, 'Foo message', array('exception' => $exception));
-
- $handler->setLoggers(array(E_DEPRECATED => array($mockLogger, LogLevel::WARNING)));
- }
-
- public function testSettingLoggerWhenExceptionIsBuffered()
- {
- $bootLogger = new BufferingLogger();
- $handler = new ErrorHandler($bootLogger);
-
- $exception = new \Exception('Foo message');
-
- $mockLogger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock();
- $mockLogger->expects($this->once())
- ->method('log')
- ->with(LogLevel::CRITICAL, 'Uncaught Exception: Foo message', array('exception' => $exception));
-
- $handler->setExceptionHandler(function () use ($handler, $mockLogger) {
- $handler->setDefaultLogger($mockLogger);
- });
-
- $handler->handleException($exception);
- }
-
- public function testHandleFatalError()
- {
- try {
- $handler = ErrorHandler::register();
-
- $error = array(
- 'type' => E_PARSE,
- 'message' => 'foo',
- 'file' => 'bar',
- 'line' => 123,
- );
-
- $logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock();
-
- $logArgCheck = function ($level, $message, $context) {
- $this->assertEquals('Fatal Parse Error: foo', $message);
- $this->assertArrayHasKey('exception', $context);
- $this->assertInstanceOf(\Exception::class, $context['exception']);
- };
-
- $logger
- ->expects($this->once())
- ->method('log')
- ->will($this->returnCallback($logArgCheck))
- ;
-
- $handler->setDefaultLogger($logger, E_PARSE);
-
- $handler->handleFatalError($error);
-
- restore_error_handler();
- restore_exception_handler();
- } catch (\Exception $e) {
- restore_error_handler();
- restore_exception_handler();
-
- throw $e;
- }
- }
-
- /**
- * @requires PHP 7
- */
- public function testHandleErrorException()
- {
- $exception = new \Error("Class 'Foo' not found");
-
- $handler = new ErrorHandler();
- $handler->setExceptionHandler(function () use (&$args) {
- $args = func_get_args();
- });
-
- $handler->handleException($exception);
-
- $this->assertInstanceOf('Symfony\Component\Debug\Exception\ClassNotFoundException', $args[0]);
- $this->assertStringStartsWith("Attempted to load class \"Foo\" from the global namespace.\nDid you forget a \"use\" statement", $args[0]->getMessage());
- }
-
- public function testHandleFatalErrorOnHHVM()
- {
- try {
- $handler = ErrorHandler::register();
-
- $logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock();
- $logger
- ->expects($this->once())
- ->method('log')
- ->with(
- $this->equalTo(LogLevel::CRITICAL),
- $this->equalTo('Fatal Error: foo')
- )
- ;
-
- $handler->setDefaultLogger($logger, E_ERROR);
-
- $error = array(
- 'type' => E_ERROR + 0x1000000, // This error level is used by HHVM for fatal errors
- 'message' => 'foo',
- 'file' => 'bar',
- 'line' => 123,
- 'context' => array(123),
- 'backtrace' => array(456),
- );
-
- call_user_func_array(array($handler, 'handleError'), $error);
- $handler->handleFatalError($error);
- } finally {
- restore_error_handler();
- restore_exception_handler();
- }
- }
-}
diff --git a/vendor/symfony/debug/Tests/Exception/FlattenExceptionTest.php b/vendor/symfony/debug/Tests/Exception/FlattenExceptionTest.php
deleted file mode 100644
index e7762bdec..000000000
--- a/vendor/symfony/debug/Tests/Exception/FlattenExceptionTest.php
+++ /dev/null
@@ -1,301 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Debug\Tests\Exception;
-
-use PHPUnit\Framework\TestCase;
-use Symfony\Component\Debug\Exception\FlattenException;
-use Symfony\Component\HttpFoundation\Exception\SuspiciousOperationException;
-use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
-use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException;
-use Symfony\Component\HttpKernel\Exception\UnauthorizedHttpException;
-use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
-use Symfony\Component\HttpKernel\Exception\NotAcceptableHttpException;
-use Symfony\Component\HttpKernel\Exception\ConflictHttpException;
-use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
-use Symfony\Component\HttpKernel\Exception\GoneHttpException;
-use Symfony\Component\HttpKernel\Exception\LengthRequiredHttpException;
-use Symfony\Component\HttpKernel\Exception\PreconditionFailedHttpException;
-use Symfony\Component\HttpKernel\Exception\PreconditionRequiredHttpException;
-use Symfony\Component\HttpKernel\Exception\ServiceUnavailableHttpException;
-use Symfony\Component\HttpKernel\Exception\TooManyRequestsHttpException;
-use Symfony\Component\HttpKernel\Exception\UnsupportedMediaTypeHttpException;
-
-class FlattenExceptionTest extends TestCase
-{
- public function testStatusCode()
- {
- $flattened = FlattenException::create(new \RuntimeException(), 403);
- $this->assertEquals('403', $flattened->getStatusCode());
-
- $flattened = FlattenException::create(new \RuntimeException());
- $this->assertEquals('500', $flattened->getStatusCode());
-
- $flattened = FlattenException::create(new NotFoundHttpException());
- $this->assertEquals('404', $flattened->getStatusCode());
-
- $flattened = FlattenException::create(new UnauthorizedHttpException('Basic realm="My Realm"'));
- $this->assertEquals('401', $flattened->getStatusCode());
-
- $flattened = FlattenException::create(new BadRequestHttpException());
- $this->assertEquals('400', $flattened->getStatusCode());
-
- $flattened = FlattenException::create(new NotAcceptableHttpException());
- $this->assertEquals('406', $flattened->getStatusCode());
-
- $flattened = FlattenException::create(new ConflictHttpException());
- $this->assertEquals('409', $flattened->getStatusCode());
-
- $flattened = FlattenException::create(new MethodNotAllowedHttpException(array('POST')));
- $this->assertEquals('405', $flattened->getStatusCode());
-
- $flattened = FlattenException::create(new AccessDeniedHttpException());
- $this->assertEquals('403', $flattened->getStatusCode());
-
- $flattened = FlattenException::create(new GoneHttpException());
- $this->assertEquals('410', $flattened->getStatusCode());
-
- $flattened = FlattenException::create(new LengthRequiredHttpException());
- $this->assertEquals('411', $flattened->getStatusCode());
-
- $flattened = FlattenException::create(new PreconditionFailedHttpException());
- $this->assertEquals('412', $flattened->getStatusCode());
-
- $flattened = FlattenException::create(new PreconditionRequiredHttpException());
- $this->assertEquals('428', $flattened->getStatusCode());
-
- $flattened = FlattenException::create(new ServiceUnavailableHttpException());
- $this->assertEquals('503', $flattened->getStatusCode());
-
- $flattened = FlattenException::create(new TooManyRequestsHttpException());
- $this->assertEquals('429', $flattened->getStatusCode());
-
- $flattened = FlattenException::create(new UnsupportedMediaTypeHttpException());
- $this->assertEquals('415', $flattened->getStatusCode());
-
- if (class_exists(SuspiciousOperationException::class)) {
- $flattened = FlattenException::create(new SuspiciousOperationException());
- $this->assertEquals('400', $flattened->getStatusCode());
- }
- }
-
- public function testHeadersForHttpException()
- {
- $flattened = FlattenException::create(new MethodNotAllowedHttpException(array('POST')));
- $this->assertEquals(array('Allow' => 'POST'), $flattened->getHeaders());
-
- $flattened = FlattenException::create(new UnauthorizedHttpException('Basic realm="My Realm"'));
- $this->assertEquals(array('WWW-Authenticate' => 'Basic realm="My Realm"'), $flattened->getHeaders());
-
- $flattened = FlattenException::create(new ServiceUnavailableHttpException('Fri, 31 Dec 1999 23:59:59 GMT'));
- $this->assertEquals(array('Retry-After' => 'Fri, 31 Dec 1999 23:59:59 GMT'), $flattened->getHeaders());
-
- $flattened = FlattenException::create(new ServiceUnavailableHttpException(120));
- $this->assertEquals(array('Retry-After' => 120), $flattened->getHeaders());
-
- $flattened = FlattenException::create(new TooManyRequestsHttpException('Fri, 31 Dec 1999 23:59:59 GMT'));
- $this->assertEquals(array('Retry-After' => 'Fri, 31 Dec 1999 23:59:59 GMT'), $flattened->getHeaders());
-
- $flattened = FlattenException::create(new TooManyRequestsHttpException(120));
- $this->assertEquals(array('Retry-After' => 120), $flattened->getHeaders());
- }
-
- /**
- * @dataProvider flattenDataProvider
- */
- public function testFlattenHttpException(\Exception $exception, $statusCode)
- {
- $flattened = FlattenException::create($exception);
- $flattened2 = FlattenException::create($exception);
-
- $flattened->setPrevious($flattened2);
-
- $this->assertEquals($exception->getMessage(), $flattened->getMessage(), 'The message is copied from the original exception.');
- $this->assertEquals($exception->getCode(), $flattened->getCode(), 'The code is copied from the original exception.');
- $this->assertInstanceOf($flattened->getClass(), $exception, 'The class is set to the class of the original exception');
- }
-
- /**
- * @dataProvider flattenDataProvider
- */
- public function testPrevious(\Exception $exception, $statusCode)
- {
- $flattened = FlattenException::create($exception);
- $flattened2 = FlattenException::create($exception);
-
- $flattened->setPrevious($flattened2);
-
- $this->assertSame($flattened2, $flattened->getPrevious());
-
- $this->assertSame(array($flattened2), $flattened->getAllPrevious());
- }
-
- /**
- * @requires PHP 7.0
- */
- public function testPreviousError()
- {
- $exception = new \Exception('test', 123, new \ParseError('Oh noes!', 42));
-
- $flattened = FlattenException::create($exception)->getPrevious();
-
- $this->assertEquals($flattened->getMessage(), 'Parse error: Oh noes!', 'The message is copied from the original exception.');
- $this->assertEquals($flattened->getCode(), 42, 'The code is copied from the original exception.');
- $this->assertEquals($flattened->getClass(), 'Symfony\Component\Debug\Exception\FatalThrowableError', 'The class is set to the class of the original exception');
- }
-
- /**
- * @dataProvider flattenDataProvider
- */
- public function testLine(\Exception $exception)
- {
- $flattened = FlattenException::create($exception);
- $this->assertSame($exception->getLine(), $flattened->getLine());
- }
-
- /**
- * @dataProvider flattenDataProvider
- */
- public function testFile(\Exception $exception)
- {
- $flattened = FlattenException::create($exception);
- $this->assertSame($exception->getFile(), $flattened->getFile());
- }
-
- /**
- * @dataProvider flattenDataProvider
- */
- public function testToArray(\Exception $exception, $statusCode)
- {
- $flattened = FlattenException::create($exception);
- $flattened->setTrace(array(), 'foo.php', 123);
-
- $this->assertEquals(array(
- array(
- 'message' => 'test',
- 'class' => 'Exception',
- 'trace' => array(array(
- 'namespace' => '', 'short_class' => '', 'class' => '', 'type' => '', 'function' => '', 'file' => 'foo.php', 'line' => 123,
- 'args' => array(),
- )),
- ),
- ), $flattened->toArray());
- }
-
- public function flattenDataProvider()
- {
- return array(
- array(new \Exception('test', 123), 500),
- );
- }
-
- public function testArguments()
- {
- $dh = opendir(__DIR__);
- $fh = tmpfile();
-
- $incomplete = unserialize('O:14:"BogusTestClass":0:{}');
-
- $exception = $this->createException(array(
- (object) array('foo' => 1),
- new NotFoundHttpException(),
- $incomplete,
- $dh,
- $fh,
- function () {},
- array(1, 2),
- array('foo' => 123),
- null,
- true,
- false,
- 0,
- 0.0,
- '0',
- '',
- INF,
- NAN,
- ));
-
- $flattened = FlattenException::create($exception);
- $trace = $flattened->getTrace();
- $args = $trace[1]['args'];
- $array = $args[0][1];
-
- closedir($dh);
- fclose($fh);
-
- $i = 0;
- $this->assertSame(array('object', 'stdClass'), $array[$i++]);
- $this->assertSame(array('object', 'Symfony\Component\HttpKernel\Exception\NotFoundHttpException'), $array[$i++]);
- $this->assertSame(array('incomplete-object', 'BogusTestClass'), $array[$i++]);
- $this->assertSame(array('resource', defined('HHVM_VERSION') ? 'Directory' : 'stream'), $array[$i++]);
- $this->assertSame(array('resource', 'stream'), $array[$i++]);
-
- $args = $array[$i++];
- $this->assertSame($args[0], 'object');
- $this->assertTrue('Closure' === $args[1] || is_subclass_of($args[1], '\Closure'), 'Expect object class name to be Closure or a subclass of Closure.');
-
- $this->assertSame(array('array', array(array('integer', 1), array('integer', 2))), $array[$i++]);
- $this->assertSame(array('array', array('foo' => array('integer', 123))), $array[$i++]);
- $this->assertSame(array('null', null), $array[$i++]);
- $this->assertSame(array('boolean', true), $array[$i++]);
- $this->assertSame(array('boolean', false), $array[$i++]);
- $this->assertSame(array('integer', 0), $array[$i++]);
- $this->assertSame(array('float', 0.0), $array[$i++]);
- $this->assertSame(array('string', '0'), $array[$i++]);
- $this->assertSame(array('string', ''), $array[$i++]);
- $this->assertSame(array('float', INF), $array[$i++]);
-
- // assertEquals() does not like NAN values.
- $this->assertEquals($array[$i][0], 'float');
- $this->assertTrue(is_nan($array[$i++][1]));
- }
-
- public function testRecursionInArguments()
- {
- $a = array('foo', array(2, &$a));
- $exception = $this->createException($a);
-
- $flattened = FlattenException::create($exception);
- $trace = $flattened->getTrace();
- $this->assertContains('*DEEP NESTED ARRAY*', serialize($trace));
- }
-
- public function testTooBigArray()
- {
- $a = array();
- for ($i = 0; $i < 20; ++$i) {
- for ($j = 0; $j < 50; ++$j) {
- for ($k = 0; $k < 10; ++$k) {
- $a[$i][$j][$k] = 'value';
- }
- }
- }
- $a[20] = 'value';
- $a[21] = 'value1';
- $exception = $this->createException($a);
-
- $flattened = FlattenException::create($exception);
- $trace = $flattened->getTrace();
-
- $this->assertSame($trace[1]['args'][0], array('array', array('array', '*SKIPPED over 10000 entries*')));
-
- $serializeTrace = serialize($trace);
-
- $this->assertContains('*SKIPPED over 10000 entries*', $serializeTrace);
- $this->assertNotContains('*value1*', $serializeTrace);
- }
-
- private function createException($foo)
- {
- return new \Exception();
- }
-}
diff --git a/vendor/symfony/debug/Tests/ExceptionHandlerTest.php b/vendor/symfony/debug/Tests/ExceptionHandlerTest.php
deleted file mode 100644
index 0285eff13..000000000
--- a/vendor/symfony/debug/Tests/ExceptionHandlerTest.php
+++ /dev/null
@@ -1,133 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Debug\Tests;
-
-use PHPUnit\Framework\TestCase;
-use Symfony\Component\Debug\ExceptionHandler;
-use Symfony\Component\Debug\Exception\OutOfMemoryException;
-use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
-use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException;
-
-require_once __DIR__.'/HeaderMock.php';
-
-class ExceptionHandlerTest extends TestCase
-{
- protected function setUp()
- {
- testHeader();
- }
-
- protected function tearDown()
- {
- testHeader();
- }
-
- public function testDebug()
- {
- $handler = new ExceptionHandler(false);
-
- ob_start();
- $handler->sendPhpResponse(new \RuntimeException('Foo'));
- $response = ob_get_clean();
-
- $this->assertContains('Whoops, looks like something went wrong.', $response);
- $this->assertNotContains('
', $response);
-
- $handler = new ExceptionHandler(true);
-
- ob_start();
- $handler->sendPhpResponse(new \RuntimeException('Foo'));
- $response = ob_get_clean();
-
- $this->assertContains('Whoops, looks like something went wrong.', $response);
- $this->assertContains('
', $response);
- }
-
- public function testStatusCode()
- {
- $handler = new ExceptionHandler(false, 'iso8859-1');
-
- ob_start();
- $handler->sendPhpResponse(new NotFoundHttpException('Foo'));
- $response = ob_get_clean();
-
- $this->assertContains('Sorry, the page you are looking for could not be found.', $response);
-
- $expectedHeaders = array(
- array('HTTP/1.0 404', true, null),
- array('Content-Type: text/html; charset=iso8859-1', true, null),
- );
-
- $this->assertSame($expectedHeaders, testHeader());
- }
-
- public function testHeaders()
- {
- $handler = new ExceptionHandler(false, 'iso8859-1');
-
- ob_start();
- $handler->sendPhpResponse(new MethodNotAllowedHttpException(array('POST')));
- $response = ob_get_clean();
-
- $expectedHeaders = array(
- array('HTTP/1.0 405', true, null),
- array('Allow: POST', false, null),
- array('Content-Type: text/html; charset=iso8859-1', true, null),
- );
-
- $this->assertSame($expectedHeaders, testHeader());
- }
-
- public function testNestedExceptions()
- {
- $handler = new ExceptionHandler(true);
- ob_start();
- $handler->sendPhpResponse(new \RuntimeException('Foo', 0, new \RuntimeException('Bar')));
- $response = ob_get_clean();
-
- $this->assertStringMatchesFormat('%A
Foo
%A
Bar
%A', $response);
- }
-
- public function testHandle()
- {
- $exception = new \Exception('foo');
-
- $handler = $this->getMockBuilder('Symfony\Component\Debug\ExceptionHandler')->setMethods(array('sendPhpResponse'))->getMock();
- $handler
- ->expects($this->exactly(2))
- ->method('sendPhpResponse');
-
- $handler->handle($exception);
-
- $handler->setHandler(function ($e) use ($exception) {
- $this->assertSame($exception, $e);
- });
-
- $handler->handle($exception);
- }
-
- public function testHandleOutOfMemoryException()
- {
- $exception = new OutOfMemoryException('foo', 0, E_ERROR, __FILE__, __LINE__);
-
- $handler = $this->getMockBuilder('Symfony\Component\Debug\ExceptionHandler')->setMethods(array('sendPhpResponse'))->getMock();
- $handler
- ->expects($this->once())
- ->method('sendPhpResponse');
-
- $handler->setHandler(function ($e) {
- $this->fail('OutOfMemoryException should bypass the handler');
- });
-
- $handler->handle($exception);
- }
-}
diff --git a/vendor/symfony/debug/Tests/FatalErrorHandler/ClassNotFoundFatalErrorHandlerTest.php b/vendor/symfony/debug/Tests/FatalErrorHandler/ClassNotFoundFatalErrorHandlerTest.php
deleted file mode 100644
index 65c80fc1c..000000000
--- a/vendor/symfony/debug/Tests/FatalErrorHandler/ClassNotFoundFatalErrorHandlerTest.php
+++ /dev/null
@@ -1,176 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Debug\Tests\FatalErrorHandler;
-
-use PHPUnit\Framework\TestCase;
-use Symfony\Component\Debug\Exception\FatalErrorException;
-use Symfony\Component\Debug\FatalErrorHandler\ClassNotFoundFatalErrorHandler;
-use Symfony\Component\Debug\DebugClassLoader;
-use Composer\Autoload\ClassLoader as ComposerClassLoader;
-
-class ClassNotFoundFatalErrorHandlerTest extends TestCase
-{
- public static function setUpBeforeClass()
- {
- foreach (spl_autoload_functions() as $function) {
- if (!is_array($function)) {
- continue;
- }
-
- // get class loaders wrapped by DebugClassLoader
- if ($function[0] instanceof DebugClassLoader) {
- $function = $function[0]->getClassLoader();
- }
-
- if ($function[0] instanceof ComposerClassLoader) {
- $function[0]->add('Symfony_Component_Debug_Tests_Fixtures', dirname(dirname(dirname(dirname(dirname(__DIR__))))));
- break;
- }
- }
- }
-
- /**
- * @dataProvider provideClassNotFoundData
- */
- public function testHandleClassNotFound($error, $translatedMessage, $autoloader = null)
- {
- if ($autoloader) {
- // Unregister all autoloaders to ensure the custom provided
- // autoloader is the only one to be used during the test run.
- $autoloaders = spl_autoload_functions();
- array_map('spl_autoload_unregister', $autoloaders);
- spl_autoload_register($autoloader);
- }
-
- $handler = new ClassNotFoundFatalErrorHandler();
-
- $exception = $handler->handleError($error, new FatalErrorException('', 0, $error['type'], $error['file'], $error['line']));
-
- if ($autoloader) {
- spl_autoload_unregister($autoloader);
- array_map('spl_autoload_register', $autoloaders);
- }
-
- $this->assertInstanceOf('Symfony\Component\Debug\Exception\ClassNotFoundException', $exception);
- $this->assertSame($translatedMessage, $exception->getMessage());
- $this->assertSame($error['type'], $exception->getSeverity());
- $this->assertSame($error['file'], $exception->getFile());
- $this->assertSame($error['line'], $exception->getLine());
- }
-
- public function provideClassNotFoundData()
- {
- $autoloader = new ComposerClassLoader();
- $autoloader->add('Symfony\Component\Debug\Exception\\', realpath(__DIR__.'/../../Exception'));
-
- $debugClassLoader = new DebugClassLoader(array($autoloader, 'loadClass'));
-
- return array(
- array(
- array(
- 'type' => 1,
- 'line' => 12,
- 'file' => 'foo.php',
- 'message' => 'Class \'WhizBangFactory\' not found',
- ),
- "Attempted to load class \"WhizBangFactory\" from the global namespace.\nDid you forget a \"use\" statement?",
- ),
- array(
- array(
- 'type' => 1,
- 'line' => 12,
- 'file' => 'foo.php',
- 'message' => 'Class \'Foo\\Bar\\WhizBangFactory\' not found',
- ),
- "Attempted to load class \"WhizBangFactory\" from namespace \"Foo\\Bar\".\nDid you forget a \"use\" statement for another namespace?",
- ),
- array(
- array(
- 'type' => 1,
- 'line' => 12,
- 'file' => 'foo.php',
- 'message' => 'Class \'UndefinedFunctionException\' not found',
- ),
- "Attempted to load class \"UndefinedFunctionException\" from the global namespace.\nDid you forget a \"use\" statement for \"Symfony\Component\Debug\Exception\UndefinedFunctionException\"?",
- ),
- array(
- array(
- 'type' => 1,
- 'line' => 12,
- 'file' => 'foo.php',
- 'message' => 'Class \'PEARClass\' not found',
- ),
- "Attempted to load class \"PEARClass\" from the global namespace.\nDid you forget a \"use\" statement for \"Symfony_Component_Debug_Tests_Fixtures_PEARClass\"?",
- ),
- array(
- array(
- 'type' => 1,
- 'line' => 12,
- 'file' => 'foo.php',
- 'message' => 'Class \'Foo\\Bar\\UndefinedFunctionException\' not found',
- ),
- "Attempted to load class \"UndefinedFunctionException\" from namespace \"Foo\Bar\".\nDid you forget a \"use\" statement for \"Symfony\Component\Debug\Exception\UndefinedFunctionException\"?",
- ),
- array(
- array(
- 'type' => 1,
- 'line' => 12,
- 'file' => 'foo.php',
- 'message' => 'Class \'Foo\\Bar\\UndefinedFunctionException\' not found',
- ),
- "Attempted to load class \"UndefinedFunctionException\" from namespace \"Foo\Bar\".\nDid you forget a \"use\" statement for \"Symfony\Component\Debug\Exception\UndefinedFunctionException\"?",
- array($autoloader, 'loadClass'),
- ),
- array(
- array(
- 'type' => 1,
- 'line' => 12,
- 'file' => 'foo.php',
- 'message' => 'Class \'Foo\\Bar\\UndefinedFunctionException\' not found',
- ),
- "Attempted to load class \"UndefinedFunctionException\" from namespace \"Foo\Bar\".\nDid you forget a \"use\" statement for \"Symfony\Component\Debug\Exception\UndefinedFunctionException\"?",
- array($debugClassLoader, 'loadClass'),
- ),
- array(
- array(
- 'type' => 1,
- 'line' => 12,
- 'file' => 'foo.php',
- 'message' => 'Class \'Foo\\Bar\\UndefinedFunctionException\' not found',
- ),
- "Attempted to load class \"UndefinedFunctionException\" from namespace \"Foo\\Bar\".\nDid you forget a \"use\" statement for another namespace?",
- function ($className) { /* do nothing here */ },
- ),
- );
- }
-
- public function testCannotRedeclareClass()
- {
- if (!file_exists(__DIR__.'/../FIXTURES2/REQUIREDTWICE.PHP')) {
- $this->markTestSkipped('Can only be run on case insensitive filesystems');
- }
-
- require_once __DIR__.'/../FIXTURES2/REQUIREDTWICE.PHP';
-
- $error = array(
- 'type' => 1,
- 'line' => 12,
- 'file' => 'foo.php',
- 'message' => 'Class \'Foo\\Bar\\RequiredTwice\' not found',
- );
-
- $handler = new ClassNotFoundFatalErrorHandler();
- $exception = $handler->handleError($error, new FatalErrorException('', 0, $error['type'], $error['file'], $error['line']));
-
- $this->assertInstanceOf('Symfony\Component\Debug\Exception\ClassNotFoundException', $exception);
- }
-}
diff --git a/vendor/symfony/debug/Tests/FatalErrorHandler/UndefinedFunctionFatalErrorHandlerTest.php b/vendor/symfony/debug/Tests/FatalErrorHandler/UndefinedFunctionFatalErrorHandlerTest.php
deleted file mode 100644
index 1dc212004..000000000
--- a/vendor/symfony/debug/Tests/FatalErrorHandler/UndefinedFunctionFatalErrorHandlerTest.php
+++ /dev/null
@@ -1,81 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Debug\Tests\FatalErrorHandler;
-
-use PHPUnit\Framework\TestCase;
-use Symfony\Component\Debug\Exception\FatalErrorException;
-use Symfony\Component\Debug\FatalErrorHandler\UndefinedFunctionFatalErrorHandler;
-
-class UndefinedFunctionFatalErrorHandlerTest extends TestCase
-{
- /**
- * @dataProvider provideUndefinedFunctionData
- */
- public function testUndefinedFunction($error, $translatedMessage)
- {
- $handler = new UndefinedFunctionFatalErrorHandler();
- $exception = $handler->handleError($error, new FatalErrorException('', 0, $error['type'], $error['file'], $error['line']));
-
- $this->assertInstanceOf('Symfony\Component\Debug\Exception\UndefinedFunctionException', $exception);
- // class names are case insensitive and PHP/HHVM do not return the same
- $this->assertSame(strtolower($translatedMessage), strtolower($exception->getMessage()));
- $this->assertSame($error['type'], $exception->getSeverity());
- $this->assertSame($error['file'], $exception->getFile());
- $this->assertSame($error['line'], $exception->getLine());
- }
-
- public function provideUndefinedFunctionData()
- {
- return array(
- array(
- array(
- 'type' => 1,
- 'line' => 12,
- 'file' => 'foo.php',
- 'message' => 'Call to undefined function test_namespaced_function()',
- ),
- "Attempted to call function \"test_namespaced_function\" from the global namespace.\nDid you mean to call \"\\symfony\\component\\debug\\tests\\fatalerrorhandler\\test_namespaced_function\"?",
- ),
- array(
- array(
- 'type' => 1,
- 'line' => 12,
- 'file' => 'foo.php',
- 'message' => 'Call to undefined function Foo\\Bar\\Baz\\test_namespaced_function()',
- ),
- "Attempted to call function \"test_namespaced_function\" from namespace \"Foo\\Bar\\Baz\".\nDid you mean to call \"\\symfony\\component\\debug\\tests\\fatalerrorhandler\\test_namespaced_function\"?",
- ),
- array(
- array(
- 'type' => 1,
- 'line' => 12,
- 'file' => 'foo.php',
- 'message' => 'Call to undefined function foo()',
- ),
- 'Attempted to call function "foo" from the global namespace.',
- ),
- array(
- array(
- 'type' => 1,
- 'line' => 12,
- 'file' => 'foo.php',
- 'message' => 'Call to undefined function Foo\\Bar\\Baz\\foo()',
- ),
- 'Attempted to call function "foo" from namespace "Foo\Bar\Baz".',
- ),
- );
- }
-}
-
-function test_namespaced_function()
-{
-}
diff --git a/vendor/symfony/debug/Tests/FatalErrorHandler/UndefinedMethodFatalErrorHandlerTest.php b/vendor/symfony/debug/Tests/FatalErrorHandler/UndefinedMethodFatalErrorHandlerTest.php
deleted file mode 100644
index 739e5b2b1..000000000
--- a/vendor/symfony/debug/Tests/FatalErrorHandler/UndefinedMethodFatalErrorHandlerTest.php
+++ /dev/null
@@ -1,76 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Debug\Tests\FatalErrorHandler;
-
-use PHPUnit\Framework\TestCase;
-use Symfony\Component\Debug\Exception\FatalErrorException;
-use Symfony\Component\Debug\FatalErrorHandler\UndefinedMethodFatalErrorHandler;
-
-class UndefinedMethodFatalErrorHandlerTest extends TestCase
-{
- /**
- * @dataProvider provideUndefinedMethodData
- */
- public function testUndefinedMethod($error, $translatedMessage)
- {
- $handler = new UndefinedMethodFatalErrorHandler();
- $exception = $handler->handleError($error, new FatalErrorException('', 0, $error['type'], $error['file'], $error['line']));
-
- $this->assertInstanceOf('Symfony\Component\Debug\Exception\UndefinedMethodException', $exception);
- $this->assertSame($translatedMessage, $exception->getMessage());
- $this->assertSame($error['type'], $exception->getSeverity());
- $this->assertSame($error['file'], $exception->getFile());
- $this->assertSame($error['line'], $exception->getLine());
- }
-
- public function provideUndefinedMethodData()
- {
- return array(
- array(
- array(
- 'type' => 1,
- 'line' => 12,
- 'file' => 'foo.php',
- 'message' => 'Call to undefined method SplObjectStorage::what()',
- ),
- 'Attempted to call an undefined method named "what" of class "SplObjectStorage".',
- ),
- array(
- array(
- 'type' => 1,
- 'line' => 12,
- 'file' => 'foo.php',
- 'message' => 'Call to undefined method SplObjectStorage::walid()',
- ),
- "Attempted to call an undefined method named \"walid\" of class \"SplObjectStorage\".\nDid you mean to call \"valid\"?",
- ),
- array(
- array(
- 'type' => 1,
- 'line' => 12,
- 'file' => 'foo.php',
- 'message' => 'Call to undefined method SplObjectStorage::offsetFet()',
- ),
- "Attempted to call an undefined method named \"offsetFet\" of class \"SplObjectStorage\".\nDid you mean to call e.g. \"offsetGet\", \"offsetSet\" or \"offsetUnset\"?",
- ),
- array(
- array(
- 'type' => 1,
- 'message' => 'Call to undefined method class@anonymous::test()',
- 'file' => '/home/possum/work/symfony/test.php',
- 'line' => 11,
- ),
- 'Attempted to call an undefined method named "test" of class "class@anonymous".',
- ),
- );
- }
-}
diff --git a/vendor/symfony/debug/Tests/Fixtures/AnnotatedClass.php b/vendor/symfony/debug/Tests/Fixtures/AnnotatedClass.php
deleted file mode 100644
index dff9517d0..000000000
--- a/vendor/symfony/debug/Tests/Fixtures/AnnotatedClass.php
+++ /dev/null
@@ -1,13 +0,0 @@
-exception = $e;
- }
-
- public function __toString()
- {
- try {
- throw $this->exception;
- } catch (\Exception $e) {
- // Using user_error() here is on purpose so we do not forget
- // that this alias also should work alongside with trigger_error().
- return user_error($e, E_USER_ERROR);
- }
- }
-}
diff --git a/vendor/symfony/debug/Tests/Fixtures/casemismatch.php b/vendor/symfony/debug/Tests/Fixtures/casemismatch.php
deleted file mode 100644
index 691d660fd..000000000
--- a/vendor/symfony/debug/Tests/Fixtures/casemismatch.php
+++ /dev/null
@@ -1,7 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Debug;
-
-function headers_sent()
-{
- return false;
-}
-
-function header($str, $replace = true, $status = null)
-{
- Tests\testHeader($str, $replace, $status);
-}
-
-namespace Symfony\Component\Debug\Tests;
-
-function testHeader()
-{
- static $headers = array();
-
- if (!$h = func_get_args()) {
- $h = $headers;
- $headers = array();
-
- return $h;
- }
-
- $headers[] = func_get_args();
-}
diff --git a/vendor/symfony/debug/Tests/phpt/exception_rethrown.phpt b/vendor/symfony/debug/Tests/phpt/exception_rethrown.phpt
deleted file mode 100644
index 877e208f4..000000000
--- a/vendor/symfony/debug/Tests/phpt/exception_rethrown.phpt
+++ /dev/null
@@ -1,36 +0,0 @@
---TEST--
-Test rethrowing in custom exception handler
---FILE--
-setDefaultLogger(new TestLogger());
-ini_set('display_errors', 1);
-
-throw new \Exception('foo');
-
-?>
---EXPECTF--
-Uncaught Exception: foo
-123
-Fatal error: Uncaught %s:25
-Stack trace:
-%a
diff --git a/vendor/symfony/debug/Tests/phpt/fatal_with_nested_handlers.phpt b/vendor/symfony/debug/Tests/phpt/fatal_with_nested_handlers.phpt
deleted file mode 100644
index bd7b644dc..000000000
--- a/vendor/symfony/debug/Tests/phpt/fatal_with_nested_handlers.phpt
+++ /dev/null
@@ -1,40 +0,0 @@
---TEST--
-Test catching fatal errors when handlers are nested
---FILE--
-setExceptionHandler('print_r');
-
-if (true) {
- class Broken implements \Serializable {};
-}
-
-?>
---EXPECTF--
-array(1) {
- [0]=>
- string(37) "Error and exception handlers do match"
-}
-object(Symfony\Component\Debug\Exception\FatalErrorException)#%d (%d) {
- ["message":protected]=>
- string(199) "Error: Class Symfony\Component\Debug\Broken contains 2 abstract methods and must therefore be declared abstract or implement the remaining methods (Serializable::serialize, Serializable::unserialize)"
-%a
-}
diff --git a/vendor/symfony/debug/composer.json b/vendor/symfony/debug/composer.json
deleted file mode 100644
index f98a5d07b..000000000
--- a/vendor/symfony/debug/composer.json
+++ /dev/null
@@ -1,40 +0,0 @@
-{
- "name": "symfony/debug",
- "type": "library",
- "description": "Symfony Debug Component",
- "keywords": [],
- "homepage": "https://symfony.com",
- "license": "MIT",
- "authors": [
- {
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "require": {
- "php": "^5.5.9|>=7.0.8",
- "psr/log": "~1.0"
- },
- "conflict": {
- "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2"
- },
- "require-dev": {
- "symfony/http-kernel": "~2.8|~3.0|~4.0"
- },
- "autoload": {
- "psr-4": { "Symfony\\Component\\Debug\\": "" },
- "exclude-from-classmap": [
- "/Tests/"
- ]
- },
- "minimum-stability": "dev",
- "extra": {
- "branch-alias": {
- "dev-master": "3.4-dev"
- }
- }
-}