+ *
+ * @final since Symfony 4.4
*/
class ConsoleTerminateEvent extends ConsoleEvent
{
diff --git a/vendor/symfony/console/EventListener/ErrorListener.php b/vendor/symfony/console/EventListener/ErrorListener.php
index 212ad1d96..897d9853f 100644
--- a/vendor/symfony/console/EventListener/ErrorListener.php
+++ b/vendor/symfony/console/EventListener/ErrorListener.php
@@ -40,10 +40,12 @@ class ErrorListener implements EventSubscriberInterface
$error = $event->getError();
if (!$inputString = $this->getInputString($event)) {
- return $this->logger->error('An error occurred while using the console. Message: "{message}"', ['exception' => $error, 'message' => $error->getMessage()]);
+ $this->logger->critical('An error occurred while using the console. Message: "{message}"', ['exception' => $error, 'message' => $error->getMessage()]);
+
+ return;
}
- $this->logger->error('Error thrown while running command "{command}". Message: "{message}"', ['exception' => $error, 'command' => $inputString, 'message' => $error->getMessage()]);
+ $this->logger->critical('Error thrown while running command "{command}". Message: "{message}"', ['exception' => $error, 'command' => $inputString, 'message' => $error->getMessage()]);
}
public function onConsoleTerminate(ConsoleTerminateEvent $event)
@@ -59,7 +61,9 @@ class ErrorListener implements EventSubscriberInterface
}
if (!$inputString = $this->getInputString($event)) {
- return $this->logger->debug('The console exited with code "{code}"', ['code' => $exitCode]);
+ $this->logger->debug('The console exited with code "{code}"', ['code' => $exitCode]);
+
+ return;
}
$this->logger->debug('Command "{command}" exited with code "{code}"', ['command' => $inputString, 'code' => $exitCode]);
@@ -73,7 +77,7 @@ class ErrorListener implements EventSubscriberInterface
];
}
- private static function getInputString(ConsoleEvent $event)
+ private static function getInputString(ConsoleEvent $event): ?string
{
$commandName = $event->getCommand() ? $event->getCommand()->getName() : null;
$input = $event->getInput();
diff --git a/vendor/symfony/console/Exception/CommandNotFoundException.php b/vendor/symfony/console/Exception/CommandNotFoundException.php
index 15ac522c6..590a71c77 100644
--- a/vendor/symfony/console/Exception/CommandNotFoundException.php
+++ b/vendor/symfony/console/Exception/CommandNotFoundException.php
@@ -21,12 +21,12 @@ class CommandNotFoundException extends \InvalidArgumentException implements Exce
private $alternatives;
/**
- * @param string $message Exception message to throw
- * @param array $alternatives List of similar defined names
- * @param int $code Exception code
- * @param \Exception $previous Previous exception used for the exception chaining
+ * @param string $message Exception message to throw
+ * @param string[] $alternatives List of similar defined names
+ * @param int $code Exception code
+ * @param \Throwable|null $previous Previous exception used for the exception chaining
*/
- public function __construct(string $message, array $alternatives = [], int $code = 0, \Exception $previous = null)
+ public function __construct(string $message, array $alternatives = [], int $code = 0, \Throwable $previous = null)
{
parent::__construct($message, $code, $previous);
@@ -34,7 +34,7 @@ class CommandNotFoundException extends \InvalidArgumentException implements Exce
}
/**
- * @return array A list of similar defined names
+ * @return string[] A list of similar defined names
*/
public function getAlternatives()
{
diff --git a/vendor/symfony/contracts/HttpClient/Exception/ExceptionInterface.php b/vendor/symfony/console/Exception/MissingInputException.php
similarity index 51%
rename from vendor/symfony/contracts/HttpClient/Exception/ExceptionInterface.php
rename to vendor/symfony/console/Exception/MissingInputException.php
index 6d59715f7..04f02ade4 100644
--- a/vendor/symfony/contracts/HttpClient/Exception/ExceptionInterface.php
+++ b/vendor/symfony/console/Exception/MissingInputException.php
@@ -9,15 +9,13 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Contracts\HttpClient\Exception;
+namespace Symfony\Component\Console\Exception;
/**
- * The base interface for all exceptions in the contract.
+ * Represents failure to read input from stdin.
*
- * @author Nicolas Grekas
- *
- * @experimental in 1.1
+ * @author Gabriel Ostrolucký
*/
-interface ExceptionInterface extends \Throwable
+class MissingInputException extends RuntimeException implements ExceptionInterface
{
}
diff --git a/vendor/symfony/console/Formatter/OutputFormatter.php b/vendor/symfony/console/Formatter/OutputFormatter.php
index 2b6db373d..e8c10e700 100644
--- a/vendor/symfony/console/Formatter/OutputFormatter.php
+++ b/vendor/symfony/console/Formatter/OutputFormatter.php
@@ -25,8 +25,16 @@ class OutputFormatter implements WrappableOutputFormatterInterface
private $styles = [];
private $styleStack;
+ public function __clone()
+ {
+ $this->styleStack = clone $this->styleStack;
+ foreach ($this->styles as $key => $value) {
+ $this->styles[$key] = clone $value;
+ }
+ }
+
/**
- * Escapes "<" special char in given text.
+ * Escapes "<" and ">" special chars in given text.
*
* @param string $text Text to escape
*
@@ -34,7 +42,7 @@ class OutputFormatter implements WrappableOutputFormatterInterface
*/
public static function escape($text)
{
- $text = preg_replace('/([^\\\\]?)', '$1\\<', $text);
+ $text = preg_replace('/([^\\\\]|^)([<>])/', '$1\\\\$2', $text);
return self::escapeTrailingBackslash($text);
}
@@ -42,15 +50,11 @@ class OutputFormatter implements WrappableOutputFormatterInterface
/**
* Escapes trailing "\" in given text.
*
- * @param string $text Text to escape
- *
- * @return string Escaped text
- *
* @internal
*/
- public static function escapeTrailingBackslash($text)
+ public static function escapeTrailingBackslash(string $text): string
{
- if ('\\' === substr($text, -1)) {
+ if (str_ends_with($text, '\\')) {
$len = \strlen($text);
$text = rtrim($text, '\\');
$text = str_replace("\0", '', $text);
@@ -63,8 +67,7 @@ class OutputFormatter implements WrappableOutputFormatterInterface
/**
* Initializes console output formatter.
*
- * @param bool $decorated Whether this formatter should actually decorate strings
- * @param OutputFormatterStyleInterface[] $styles Array of "name => FormatterStyle" instances
+ * @param OutputFormatterStyleInterface[] $styles Array of "name => FormatterStyle" instances
*/
public function __construct(bool $decorated = false, array $styles = [])
{
@@ -120,7 +123,7 @@ class OutputFormatter implements WrappableOutputFormatterInterface
public function getStyle($name)
{
if (!$this->hasStyle($name)) {
- throw new InvalidArgumentException(sprintf('Undefined style: %s', $name));
+ throw new InvalidArgumentException(sprintf('Undefined style: "%s".', $name));
}
return $this->styles[strtolower($name)];
@@ -141,9 +144,10 @@ class OutputFormatter implements WrappableOutputFormatterInterface
{
$offset = 0;
$output = '';
- $tagRegex = '[a-z][a-z0-9,_=;-]*+';
+ $openTagRegex = '[a-z](?:[^\\\\<>]*+ | \\\\.)*';
+ $closeTagRegex = '[a-z][^<>]*+';
$currentLineLength = 0;
- preg_match_all("#<(($tagRegex) | /($tagRegex)?)>#ix", $message, $matches, PREG_OFFSET_CAPTURE);
+ preg_match_all("#<(($openTagRegex) | /($closeTagRegex)?)>#ix", $message, $matches, \PREG_OFFSET_CAPTURE);
foreach ($matches[0] as $i => $match) {
$pos = $match[1];
$text = $match[0];
@@ -160,13 +164,13 @@ class OutputFormatter implements WrappableOutputFormatterInterface
if ($open = '/' != $text[1]) {
$tag = $matches[1][$i][0];
} else {
- $tag = isset($matches[3][$i][0]) ? $matches[3][$i][0] : '';
+ $tag = $matches[3][$i][0] ?? '';
}
if (!$open && !$tag) {
// >
$this->styleStack->pop();
- } elseif (false === $style = $this->createStyleFromString($tag)) {
+ } elseif (null === $style = $this->createStyleFromString($tag)) {
$output .= $this->applyCurrentStyle($text, $output, $width, $currentLineLength);
} elseif ($open) {
$this->styleStack->push($style);
@@ -177,11 +181,7 @@ class OutputFormatter implements WrappableOutputFormatterInterface
$output .= $this->applyCurrentStyle(substr($message, $offset), $output, $width, $currentLineLength);
- if (false !== strpos($output, "\0")) {
- return strtr($output, ["\0" => '\\', '\\<' => '<']);
- }
-
- return str_replace('\\<', '<', $output);
+ return strtr($output, ["\0" => '\\', '\\<' => '<', '\\>' => '>']);
}
/**
@@ -194,17 +194,15 @@ class OutputFormatter implements WrappableOutputFormatterInterface
/**
* Tries to create new style instance from string.
- *
- * @return OutputFormatterStyle|false False if string is not format string
*/
- private function createStyleFromString(string $string)
+ private function createStyleFromString(string $string): ?OutputFormatterStyleInterface
{
if (isset($this->styles[$string])) {
return $this->styles[$string];
}
- if (!preg_match_all('/([^=]+)=([^;]+)(;|$)/', $string, $matches, PREG_SET_ORDER)) {
- return false;
+ if (!preg_match_all('/([^=]+)=([^;]+)(;|$)/', $string, $matches, \PREG_SET_ORDER)) {
+ return null;
}
$style = new OutputFormatterStyle();
@@ -216,6 +214,9 @@ class OutputFormatter implements WrappableOutputFormatterInterface
$style->setForeground(strtolower($match[1]));
} elseif ('bg' == $match[0]) {
$style->setBackground(strtolower($match[1]));
+ } elseif ('href' === $match[0]) {
+ $url = preg_replace('{\\\\([<>])}', '$1', $match[1]);
+ $style->setHref($url);
} elseif ('options' === $match[0]) {
preg_match_all('([^,;]+)', strtolower($match[1]), $options);
$options = array_shift($options);
@@ -223,7 +224,7 @@ class OutputFormatter implements WrappableOutputFormatterInterface
$style->setOption($option);
}
} else {
- return false;
+ return null;
}
}
diff --git a/vendor/symfony/console/Formatter/OutputFormatterInterface.php b/vendor/symfony/console/Formatter/OutputFormatterInterface.php
index 281e240c5..22f40a34e 100644
--- a/vendor/symfony/console/Formatter/OutputFormatterInterface.php
+++ b/vendor/symfony/console/Formatter/OutputFormatterInterface.php
@@ -35,8 +35,7 @@ interface OutputFormatterInterface
/**
* Sets a new style.
*
- * @param string $name The style name
- * @param OutputFormatterStyleInterface $style The style instance
+ * @param string $name The style name
*/
public function setStyle($name, OutputFormatterStyleInterface $style);
diff --git a/vendor/symfony/console/Formatter/OutputFormatterStyle.php b/vendor/symfony/console/Formatter/OutputFormatterStyle.php
index d1d33ca2e..7cb6116b4 100644
--- a/vendor/symfony/console/Formatter/OutputFormatterStyle.php
+++ b/vendor/symfony/console/Formatter/OutputFormatterStyle.php
@@ -52,14 +52,15 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface
private $foreground;
private $background;
+ private $href;
private $options = [];
+ private $handlesHrefGracefully;
/**
* Initializes output formatter style.
*
* @param string|null $foreground The style foreground color name
* @param string|null $background The style background color name
- * @param array $options The style options
*/
public function __construct(string $foreground = null, string $background = null, array $options = [])
{
@@ -86,7 +87,7 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface
}
if (!isset(static::$availableForegroundColors[$color])) {
- throw new InvalidArgumentException(sprintf('Invalid foreground color specified: "%s". Expected one of (%s)', $color, implode(', ', array_keys(static::$availableForegroundColors))));
+ throw new InvalidArgumentException(sprintf('Invalid foreground color specified: "%s". Expected one of (%s).', $color, implode(', ', array_keys(static::$availableForegroundColors))));
}
$this->foreground = static::$availableForegroundColors[$color];
@@ -104,19 +105,24 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface
}
if (!isset(static::$availableBackgroundColors[$color])) {
- throw new InvalidArgumentException(sprintf('Invalid background color specified: "%s". Expected one of (%s)', $color, implode(', ', array_keys(static::$availableBackgroundColors))));
+ throw new InvalidArgumentException(sprintf('Invalid background color specified: "%s". Expected one of (%s).', $color, implode(', ', array_keys(static::$availableBackgroundColors))));
}
$this->background = static::$availableBackgroundColors[$color];
}
+ public function setHref(string $url): void
+ {
+ $this->href = $url;
+ }
+
/**
* {@inheritdoc}
*/
public function setOption($option)
{
if (!isset(static::$availableOptions[$option])) {
- throw new InvalidArgumentException(sprintf('Invalid option specified: "%s". Expected one of (%s)', $option, implode(', ', array_keys(static::$availableOptions))));
+ throw new InvalidArgumentException(sprintf('Invalid option specified: "%s". Expected one of (%s).', $option, implode(', ', array_keys(static::$availableOptions))));
}
if (!\in_array(static::$availableOptions[$option], $this->options)) {
@@ -130,7 +136,7 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface
public function unsetOption($option)
{
if (!isset(static::$availableOptions[$option])) {
- throw new InvalidArgumentException(sprintf('Invalid option specified: "%s". Expected one of (%s)', $option, implode(', ', array_keys(static::$availableOptions))));
+ throw new InvalidArgumentException(sprintf('Invalid option specified: "%s". Expected one of (%s).', $option, implode(', ', array_keys(static::$availableOptions))));
}
$pos = array_search(static::$availableOptions[$option], $this->options);
@@ -159,6 +165,11 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface
$setCodes = [];
$unsetCodes = [];
+ if (null === $this->handlesHrefGracefully) {
+ $this->handlesHrefGracefully = 'JetBrains-JediTerm' !== getenv('TERMINAL_EMULATOR')
+ && (!getenv('KONSOLE_VERSION') || (int) getenv('KONSOLE_VERSION') > 201100);
+ }
+
if (null !== $this->foreground) {
$setCodes[] = $this->foreground['set'];
$unsetCodes[] = $this->foreground['unset'];
@@ -167,11 +178,14 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface
$setCodes[] = $this->background['set'];
$unsetCodes[] = $this->background['unset'];
}
- if (\count($this->options)) {
- foreach ($this->options as $option) {
- $setCodes[] = $option['set'];
- $unsetCodes[] = $option['unset'];
- }
+
+ foreach ($this->options as $option) {
+ $setCodes[] = $option['set'];
+ $unsetCodes[] = $option['unset'];
+ }
+
+ if (null !== $this->href && $this->handlesHrefGracefully) {
+ $text = "\033]8;;$this->href\033\\$text\033]8;;\033\\";
}
if (0 === \count($setCodes)) {
diff --git a/vendor/symfony/console/Formatter/OutputFormatterStyleStack.php b/vendor/symfony/console/Formatter/OutputFormatterStyleStack.php
index 33f7d5222..fc48dc0e1 100644
--- a/vendor/symfony/console/Formatter/OutputFormatterStyleStack.php
+++ b/vendor/symfony/console/Formatter/OutputFormatterStyleStack.php
@@ -28,7 +28,7 @@ class OutputFormatterStyleStack implements ResetInterface
public function __construct(OutputFormatterStyleInterface $emptyStyle = null)
{
- $this->emptyStyle = $emptyStyle ?: new OutputFormatterStyle();
+ $this->emptyStyle = $emptyStyle ?? new OutputFormatterStyle();
$this->reset();
}
diff --git a/vendor/symfony/console/Helper/DebugFormatterHelper.php b/vendor/symfony/console/Helper/DebugFormatterHelper.php
index 16d117553..1653edeb1 100644
--- a/vendor/symfony/console/Helper/DebugFormatterHelper.php
+++ b/vendor/symfony/console/Helper/DebugFormatterHelper.php
@@ -107,12 +107,7 @@ class DebugFormatterHelper extends Helper
return $message;
}
- /**
- * @param string $id The id of the formatting session
- *
- * @return string
- */
- private function getBorder($id)
+ private function getBorder(string $id): string
{
return sprintf(' >', $this->colors[$this->started[$id]['border']]);
}
diff --git a/vendor/symfony/console/Helper/DescriptorHelper.php b/vendor/symfony/console/Helper/DescriptorHelper.php
index f8a3847b4..3055baefd 100644
--- a/vendor/symfony/console/Helper/DescriptorHelper.php
+++ b/vendor/symfony/console/Helper/DescriptorHelper.php
@@ -48,9 +48,7 @@ class DescriptorHelper extends Helper
* * format: string, the output format name
* * raw_text: boolean, sets output type as raw
*
- * @param OutputInterface $output
- * @param object $object
- * @param array $options
+ * @param object $object
*
* @throws InvalidArgumentException when the given format is not supported
*/
@@ -72,8 +70,7 @@ class DescriptorHelper extends Helper
/**
* Registers a descriptor.
*
- * @param string $format
- * @param DescriptorInterface $descriptor
+ * @param string $format
*
* @return $this
*/
diff --git a/vendor/symfony/console/Helper/Dumper.php b/vendor/symfony/console/Helper/Dumper.php
new file mode 100644
index 000000000..b013b6c52
--- /dev/null
+++ b/vendor/symfony/console/Helper/Dumper.php
@@ -0,0 +1,64 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Console\Helper;
+
+use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\VarDumper\Cloner\ClonerInterface;
+use Symfony\Component\VarDumper\Cloner\VarCloner;
+use Symfony\Component\VarDumper\Dumper\CliDumper;
+
+/**
+ * @author Roland Franssen
+ */
+final class Dumper
+{
+ private $output;
+ private $dumper;
+ private $cloner;
+ private $handler;
+
+ public function __construct(OutputInterface $output, CliDumper $dumper = null, ClonerInterface $cloner = null)
+ {
+ $this->output = $output;
+ $this->dumper = $dumper;
+ $this->cloner = $cloner;
+
+ if (class_exists(CliDumper::class)) {
+ $this->handler = function ($var): string {
+ $dumper = $this->dumper ?? $this->dumper = new CliDumper(null, null, CliDumper::DUMP_LIGHT_ARRAY | CliDumper::DUMP_COMMA_SEPARATOR);
+ $dumper->setColors($this->output->isDecorated());
+
+ return rtrim($dumper->dump(($this->cloner ?? $this->cloner = new VarCloner())->cloneVar($var)->withRefHandles(false), true));
+ };
+ } else {
+ $this->handler = function ($var): string {
+ switch (true) {
+ case null === $var:
+ return 'null';
+ case true === $var:
+ return 'true';
+ case false === $var:
+ return 'false';
+ case \is_string($var):
+ return '"'.$var.'"';
+ default:
+ return rtrim(print_r($var, true));
+ }
+ };
+ }
+ }
+
+ public function __invoke($var): string
+ {
+ return ($this->handler)($var);
+ }
+}
diff --git a/vendor/symfony/console/Helper/FormatterHelper.php b/vendor/symfony/console/Helper/FormatterHelper.php
index 4ad63856d..d6eccee8e 100644
--- a/vendor/symfony/console/Helper/FormatterHelper.php
+++ b/vendor/symfony/console/Helper/FormatterHelper.php
@@ -54,12 +54,12 @@ class FormatterHelper extends Helper
foreach ($messages as $message) {
$message = OutputFormatter::escape($message);
$lines[] = sprintf($large ? ' %s ' : ' %s ', $message);
- $len = max($this->strlen($message) + ($large ? 4 : 2), $len);
+ $len = max(self::strlen($message) + ($large ? 4 : 2), $len);
}
$messages = $large ? [str_repeat(' ', $len)] : [];
for ($i = 0; isset($lines[$i]); ++$i) {
- $messages[] = $lines[$i].str_repeat(' ', $len - $this->strlen($lines[$i]));
+ $messages[] = $lines[$i].str_repeat(' ', $len - self::strlen($lines[$i]));
}
if ($large) {
$messages[] = str_repeat(' ', $len);
@@ -83,17 +83,13 @@ class FormatterHelper extends Helper
*/
public function truncate($message, $length, $suffix = '...')
{
- $computedLength = $length - $this->strlen($suffix);
+ $computedLength = $length - self::strlen($suffix);
- if ($computedLength > $this->strlen($message)) {
+ if ($computedLength > self::strlen($message)) {
return $message;
}
- if (false === $encoding = mb_detect_encoding($message, null, true)) {
- return substr($message, 0, $length).$suffix;
- }
-
- return mb_substr($message, 0, $length, $encoding).$suffix;
+ return self::substr($message, 0, $length).$suffix;
}
/**
diff --git a/vendor/symfony/console/Helper/Helper.php b/vendor/symfony/console/Helper/Helper.php
index 0ddddf6bc..0521aaf7d 100644
--- a/vendor/symfony/console/Helper/Helper.php
+++ b/vendor/symfony/console/Helper/Helper.php
@@ -47,6 +47,8 @@ abstract class Helper implements HelperInterface
*/
public static function strlen($string)
{
+ $string = (string) $string;
+
if (false === $encoding = mb_detect_encoding($string, null, true)) {
return \strlen($string);
}
@@ -65,6 +67,8 @@ abstract class Helper implements HelperInterface
*/
public static function substr($string, $from, $length = null)
{
+ $string = (string) $string;
+
if (false === $encoding = mb_detect_encoding($string, null, true)) {
return substr($string, $from, $length);
}
diff --git a/vendor/symfony/console/Helper/HelperSet.php b/vendor/symfony/console/Helper/HelperSet.php
index c73fecd47..9aa1e67ba 100644
--- a/vendor/symfony/console/Helper/HelperSet.php
+++ b/vendor/symfony/console/Helper/HelperSet.php
@@ -40,8 +40,7 @@ class HelperSet implements \IteratorAggregate
/**
* Sets a helper.
*
- * @param HelperInterface $helper The helper instance
- * @param string $alias An alias
+ * @param string $alias An alias
*/
public function set(HelperInterface $helper, $alias = null)
{
@@ -99,8 +98,9 @@ class HelperSet implements \IteratorAggregate
}
/**
- * @return Helper[]
+ * @return \Traversable
*/
+ #[\ReturnTypeWillChange]
public function getIterator()
{
return new \ArrayIterator($this->helpers);
diff --git a/vendor/symfony/console/Helper/ProcessHelper.php b/vendor/symfony/console/Helper/ProcessHelper.php
index 41f128bb4..862d09f21 100644
--- a/vendor/symfony/console/Helper/ProcessHelper.php
+++ b/vendor/symfony/console/Helper/ProcessHelper.php
@@ -28,17 +28,20 @@ class ProcessHelper extends Helper
/**
* Runs an external process.
*
- * @param OutputInterface $output An OutputInterface instance
- * @param array|Process $cmd An instance of Process or an array of the command and arguments
- * @param string|null $error An error message that must be displayed if something went wrong
- * @param callable|null $callback A PHP callback to run whenever there is some
- * output available on STDOUT or STDERR
- * @param int $verbosity The threshold for verbosity
+ * @param array|Process $cmd An instance of Process or an array of the command and arguments
+ * @param string|null $error An error message that must be displayed if something went wrong
+ * @param callable|null $callback A PHP callback to run whenever there is some
+ * output available on STDOUT or STDERR
+ * @param int $verbosity The threshold for verbosity
*
* @return Process The process that ran
*/
public function run(OutputInterface $output, $cmd, $error = null, callable $callback = null, $verbosity = OutputInterface::VERBOSITY_VERY_VERBOSE)
{
+ if (!class_exists(Process::class)) {
+ throw new \LogicException('The ProcessHelper cannot be run as the Process component is not installed. Try running "compose require symfony/process".');
+ }
+
if ($output instanceof ConsoleOutputInterface) {
$output = $output->getErrorOutput();
}
@@ -50,7 +53,7 @@ class ProcessHelper extends Helper
}
if (!\is_array($cmd)) {
- @trigger_error(sprintf('Passing a command as a string to "%s()" is deprecated since Symfony 4.2, pass it the command as an array of arguments instead.', __METHOD__), E_USER_DEPRECATED);
+ @trigger_error(sprintf('Passing a command as a string to "%s()" is deprecated since Symfony 4.2, pass it the command as an array of arguments instead.', __METHOD__), \E_USER_DEPRECATED);
$cmd = [method_exists(Process::class, 'fromShellCommandline') ? Process::fromShellCommandline($cmd) : new Process($cmd)];
}
@@ -92,11 +95,10 @@ class ProcessHelper extends Helper
* This is identical to run() except that an exception is thrown if the process
* exits with a non-zero exit code.
*
- * @param OutputInterface $output An OutputInterface instance
- * @param string|Process $cmd An instance of Process or a command to run
- * @param string|null $error An error message that must be displayed if something went wrong
- * @param callable|null $callback A PHP callback to run whenever there is some
- * output available on STDOUT or STDERR
+ * @param array|Process $cmd An instance of Process or a command to run
+ * @param string|null $error An error message that must be displayed if something went wrong
+ * @param callable|null $callback A PHP callback to run whenever there is some
+ * output available on STDOUT or STDERR
*
* @return Process The process that ran
*
@@ -118,10 +120,6 @@ class ProcessHelper extends Helper
/**
* Wraps a Process callback to add debugging output.
*
- * @param OutputInterface $output An OutputInterface interface
- * @param Process $process The Process
- * @param callable|null $callback A PHP callable
- *
* @return callable
*/
public function wrapCallback(OutputInterface $output, Process $process, callable $callback = null)
@@ -141,7 +139,7 @@ class ProcessHelper extends Helper
};
}
- private function escapeString($str)
+ private function escapeString(string $str): string
{
return str_replace('<', '\\<', $str);
}
diff --git a/vendor/symfony/console/Helper/ProgressBar.php b/vendor/symfony/console/Helper/ProgressBar.php
index 12a6cf224..1de9b7b3c 100644
--- a/vendor/symfony/console/Helper/ProgressBar.php
+++ b/vendor/symfony/console/Helper/ProgressBar.php
@@ -32,6 +32,10 @@ final class ProgressBar
private $format;
private $internalFormat;
private $redrawFreq = 1;
+ private $writeCount;
+ private $lastWriteTime;
+ private $minSecondsBetweenRedraws = 0;
+ private $maxSecondsBetweenRedraws = 1;
private $output;
private $step = 0;
private $max;
@@ -42,16 +46,15 @@ final class ProgressBar
private $messages = [];
private $overwrite = true;
private $terminal;
- private $firstRun = true;
+ private $previousMessage;
private static $formatters;
private static $formats;
/**
- * @param OutputInterface $output An OutputInterface instance
- * @param int $max Maximum steps (0 if unknown)
+ * @param int $max Maximum steps (0 if unknown)
*/
- public function __construct(OutputInterface $output, int $max = 0)
+ public function __construct(OutputInterface $output, int $max = 0, float $minSecondsBetweenRedraws = 0.1)
{
if ($output instanceof ConsoleOutputInterface) {
$output = $output->getErrorOutput();
@@ -61,12 +64,17 @@ final class ProgressBar
$this->setMaxSteps($max);
$this->terminal = new Terminal();
+ if (0 < $minSecondsBetweenRedraws) {
+ $this->redrawFreq = null;
+ $this->minSecondsBetweenRedraws = $minSecondsBetweenRedraws;
+ }
+
if (!$this->output->isDecorated()) {
// disable overwrite when output does not support ANSI codes.
$this->overwrite = false;
// set a reasonable redraw frequency so output isn't flooded
- $this->setRedrawFrequency($max / 10);
+ $this->redrawFreq = null;
}
$this->startTime = time();
@@ -102,7 +110,7 @@ final class ProgressBar
self::$formatters = self::initPlaceholderFormatters();
}
- return isset(self::$formatters[$name]) ? self::$formatters[$name] : null;
+ return self::$formatters[$name] ?? null;
}
/**
@@ -135,7 +143,7 @@ final class ProgressBar
self::$formats = self::initFormats();
}
- return isset(self::$formats[$name]) ? self::$formats[$name] : null;
+ return self::$formats[$name] ?? null;
}
/**
@@ -183,6 +191,11 @@ final class ProgressBar
return $this->percent;
}
+ public function getBarOffset(): int
+ {
+ return floor($this->max ? $this->percent * $this->barWidth : (null === $this->redrawFreq ? (int) (min(5, $this->barWidth / 15) * $this->writeCount) : $this->step) % $this->barWidth);
+ }
+
public function setBarWidth(int $size)
{
$this->barWidth = max(1, $size);
@@ -236,11 +249,39 @@ final class ProgressBar
/**
* Sets the redraw frequency.
*
- * @param int|float $freq The frequency in steps
+ * @param int|null $freq The frequency in steps
*/
- public function setRedrawFrequency(int $freq)
+ public function setRedrawFrequency(?int $freq)
{
- $this->redrawFreq = max($freq, 1);
+ $this->redrawFreq = null !== $freq ? max(1, $freq) : null;
+ }
+
+ public function minSecondsBetweenRedraws(float $seconds): void
+ {
+ $this->minSecondsBetweenRedraws = $seconds;
+ }
+
+ public function maxSecondsBetweenRedraws(float $seconds): void
+ {
+ $this->maxSecondsBetweenRedraws = $seconds;
+ }
+
+ /**
+ * Returns an iterator that will automatically update the progress bar when iterated.
+ *
+ * @param int|null $max Number of steps to complete the bar (0 if indeterminate), if null it will be inferred from $iterable
+ */
+ public function iterate(iterable $iterable, int $max = null): iterable
+ {
+ $this->start($max ?? (is_countable($iterable) ? \count($iterable) : 0));
+
+ foreach ($iterable as $key => $value) {
+ yield $key => $value;
+
+ $this->advance();
+ }
+
+ $this->finish();
}
/**
@@ -287,11 +328,27 @@ final class ProgressBar
$step = 0;
}
- $prevPeriod = (int) ($this->step / $this->redrawFreq);
- $currPeriod = (int) ($step / $this->redrawFreq);
+ $redrawFreq = $this->redrawFreq ?? (($this->max ?: 10) / 10);
+ $prevPeriod = (int) ($this->step / $redrawFreq);
+ $currPeriod = (int) ($step / $redrawFreq);
$this->step = $step;
$this->percent = $this->max ? (float) $this->step / $this->max : 0;
- if ($prevPeriod !== $currPeriod || $this->max === $step) {
+ $timeInterval = microtime(true) - $this->lastWriteTime;
+
+ // Draw regardless of other limits
+ if ($this->max === $step) {
+ $this->display();
+
+ return;
+ }
+
+ // Throttling
+ if ($timeInterval < $this->minSecondsBetweenRedraws) {
+ return;
+ }
+
+ // Draw each step period, but not too late
+ if ($prevPeriod !== $currPeriod || $timeInterval >= $this->maxSecondsBetweenRedraws) {
$this->display();
}
}
@@ -375,11 +432,24 @@ final class ProgressBar
*/
private function overwrite(string $message): void
{
+ if ($this->previousMessage === $message) {
+ return;
+ }
+
+ $originalMessage = $message;
+
if ($this->overwrite) {
- if (!$this->firstRun) {
+ if (null !== $this->previousMessage) {
if ($this->output instanceof ConsoleSectionOutput) {
- $lines = floor(Helper::strlen($message) / $this->terminal->getWidth()) + $this->formatLineCount + 1;
- $this->output->clear($lines);
+ $messageLines = explode("\n", $message);
+ $lineCount = \count($messageLines);
+ foreach ($messageLines as $messageLine) {
+ $messageLineLength = Helper::strlenWithoutDecoration($this->output->getFormatter(), $messageLine);
+ if ($messageLineLength > $this->terminal->getWidth()) {
+ $lineCount += floor($messageLineLength / $this->terminal->getWidth());
+ }
+ }
+ $this->output->clear($lineCount);
} else {
// Erase previous lines
if ($this->formatLineCount > 0) {
@@ -391,12 +461,14 @@ final class ProgressBar
}
}
} elseif ($this->step > 0) {
- $message = PHP_EOL.$message;
+ $message = \PHP_EOL.$message;
}
- $this->firstRun = false;
+ $this->previousMessage = $originalMessage;
+ $this->lastWriteTime = microtime(true);
$this->output->write($message);
+ ++$this->writeCount;
}
private function determineBestFormat(): string
@@ -418,7 +490,7 @@ final class ProgressBar
{
return [
'bar' => function (self $bar, OutputInterface $output) {
- $completeBars = floor($bar->getMaxSteps() > 0 ? $bar->getProgressPercent() * $bar->getBarWidth() : $bar->getProgress() % $bar->getBarWidth());
+ $completeBars = $bar->getBarOffset();
$display = str_repeat($bar->getBarCharacter(), $completeBars);
if ($completeBars < $bar->getBarWidth()) {
$emptyBars = $bar->getBarWidth() - $completeBars - Helper::strlenWithoutDecoration($output->getFormatter(), $bar->getProgressCharacter());
@@ -460,7 +532,7 @@ final class ProgressBar
return Helper::formatMemory(memory_get_usage(true));
},
'current' => function (self $bar) {
- return str_pad($bar->getProgress(), $bar->getStepWidth(), ' ', STR_PAD_LEFT);
+ return str_pad($bar->getProgress(), $bar->getStepWidth(), ' ', \STR_PAD_LEFT);
},
'max' => function (self $bar) {
return $bar->getMaxSteps();
diff --git a/vendor/symfony/console/Helper/ProgressIndicator.php b/vendor/symfony/console/Helper/ProgressIndicator.php
index 301be27ea..dc37148ed 100644
--- a/vendor/symfony/console/Helper/ProgressIndicator.php
+++ b/vendor/symfony/console/Helper/ProgressIndicator.php
@@ -34,10 +34,9 @@ class ProgressIndicator
private static $formats;
/**
- * @param OutputInterface $output
- * @param string|null $format Indicator format
- * @param int $indicatorChangeInterval Change interval in milliseconds
- * @param array|null $indicatorValues Animated indicator characters
+ * @param string|null $format Indicator format
+ * @param int $indicatorChangeInterval Change interval in milliseconds
+ * @param array|null $indicatorValues Animated indicator characters
*/
public function __construct(OutputInterface $output, string $format = null, int $indicatorChangeInterval = 100, array $indicatorValues = null)
{
@@ -150,7 +149,7 @@ class ProgressIndicator
self::$formats = self::initFormats();
}
- return isset(self::$formats[$name]) ? self::$formats[$name] : null;
+ return self::$formats[$name] ?? null;
}
/**
@@ -183,7 +182,7 @@ class ProgressIndicator
self::$formatters = self::initPlaceholderFormatters();
}
- return isset(self::$formatters[$name]) ? self::$formatters[$name] : null;
+ return self::$formatters[$name] ?? null;
}
private function display()
@@ -192,18 +191,16 @@ class ProgressIndicator
return;
}
- $self = $this;
-
- $this->overwrite(preg_replace_callback("{%([a-z\-_]+)(?:\:([^%]+))?%}i", function ($matches) use ($self) {
- if ($formatter = $self::getPlaceholderFormatterDefinition($matches[1])) {
- return $formatter($self);
+ $this->overwrite(preg_replace_callback("{%([a-z\-_]+)(?:\:([^%]+))?%}i", function ($matches) {
+ if ($formatter = self::getPlaceholderFormatterDefinition($matches[1])) {
+ return $formatter($this);
}
return $matches[0];
- }, $this->format));
+ }, $this->format ?? ''));
}
- private function determineBestFormat()
+ private function determineBestFormat(): string
{
switch ($this->output->getVerbosity()) {
// OutputInterface::VERBOSITY_QUIET: display is disabled anyway
@@ -230,12 +227,12 @@ class ProgressIndicator
}
}
- private function getCurrentTimeInMilliseconds()
+ private function getCurrentTimeInMilliseconds(): float
{
return round(microtime(true) * 1000);
}
- private static function initPlaceholderFormatters()
+ private static function initPlaceholderFormatters(): array
{
return [
'indicator' => function (self $indicator) {
@@ -253,7 +250,7 @@ class ProgressIndicator
];
}
- private static function initFormats()
+ private static function initFormats(): array
{
return [
'normal' => ' %indicator% %message%',
diff --git a/vendor/symfony/console/Helper/QuestionHelper.php b/vendor/symfony/console/Helper/QuestionHelper.php
index 4c8c8e166..a4754b824 100644
--- a/vendor/symfony/console/Helper/QuestionHelper.php
+++ b/vendor/symfony/console/Helper/QuestionHelper.php
@@ -11,6 +11,7 @@
namespace Symfony\Component\Console\Helper;
+use Symfony\Component\Console\Exception\MissingInputException;
use Symfony\Component\Console\Exception\RuntimeException;
use Symfony\Component\Console\Formatter\OutputFormatter;
use Symfony\Component\Console\Formatter\OutputFormatterStyle;
@@ -21,6 +22,7 @@ use Symfony\Component\Console\Output\ConsoleSectionOutput;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Question\ChoiceQuestion;
use Symfony\Component\Console\Question\Question;
+use Symfony\Component\Console\Terminal;
/**
* The QuestionHelper class provides helpers to interact with the user.
@@ -31,7 +33,8 @@ class QuestionHelper extends Helper
{
private $inputStream;
private static $shell;
- private static $stty;
+ private static $stty = true;
+ private static $stdinIsInteractive;
/**
* Asks a question to the user.
@@ -47,44 +50,32 @@ class QuestionHelper extends Helper
}
if (!$input->isInteractive()) {
- $default = $question->getDefault();
-
- if (null === $default) {
- return $default;
- }
-
- if ($validator = $question->getValidator()) {
- return \call_user_func($question->getValidator(), $default);
- } elseif ($question instanceof ChoiceQuestion) {
- $choices = $question->getChoices();
-
- if (!$question->isMultiselect()) {
- return isset($choices[$default]) ? $choices[$default] : $default;
- }
-
- $default = explode(',', $default);
- foreach ($default as $k => $v) {
- $v = trim($v);
- $default[$k] = isset($choices[$v]) ? $choices[$v] : $v;
- }
- }
-
- return $default;
+ return $this->getDefaultAnswer($question);
}
if ($input instanceof StreamableInputInterface && $stream = $input->getStream()) {
$this->inputStream = $stream;
}
- if (!$question->getValidator()) {
- return $this->doAsk($output, $question);
+ try {
+ if (!$question->getValidator()) {
+ return $this->doAsk($output, $question);
+ }
+
+ $interviewer = function () use ($output, $question) {
+ return $this->doAsk($output, $question);
+ };
+
+ return $this->validateAttempts($interviewer, $output, $question);
+ } catch (MissingInputException $exception) {
+ $input->setInteractive(false);
+
+ if (null === $fallbackOutput = $this->getDefaultAnswer($question)) {
+ throw $exception;
+ }
+
+ return $fallbackOutput;
}
-
- $interviewer = function () use ($output, $question) {
- return $this->doAsk($output, $question);
- };
-
- return $this->validateAttempts($interviewer, $output, $question);
}
/**
@@ -106,7 +97,7 @@ class QuestionHelper extends Helper
/**
* Asks the question to the user.
*
- * @return bool|mixed|string|null
+ * @return mixed
*
* @throws RuntimeException In case the fallback is deactivated and the response cannot be hidden
*/
@@ -114,14 +105,15 @@ class QuestionHelper extends Helper
{
$this->writePrompt($output, $question);
- $inputStream = $this->inputStream ?: STDIN;
- $autocomplete = $question->getAutocompleterValues();
+ $inputStream = $this->inputStream ?: \STDIN;
+ $autocomplete = $question->getAutocompleterCallback();
- if (null === $autocomplete || !$this->hasSttyAvailable()) {
+ if (null === $autocomplete || !self::$stty || !Terminal::hasSttyAvailable()) {
$ret = false;
if ($question->isHidden()) {
try {
- $ret = trim($this->getHiddenResponse($output, $inputStream));
+ $hiddenResponse = $this->getHiddenResponse($output, $inputStream, $question->isTrimmable());
+ $ret = $question->isTrimmable() ? trim($hiddenResponse) : $hiddenResponse;
} catch (RuntimeException $e) {
if (!$question->isHiddenFallback()) {
throw $e;
@@ -130,14 +122,19 @@ class QuestionHelper extends Helper
}
if (false === $ret) {
+ $cp = $this->setIOCodepage();
$ret = fgets($inputStream, 4096);
+ $ret = $this->resetIOCodepage($cp, $ret);
if (false === $ret) {
- throw new RuntimeException('Aborted.');
+ throw new MissingInputException('Aborted.');
+ }
+ if ($question->isTrimmable()) {
+ $ret = trim($ret);
}
- $ret = trim($ret);
}
} else {
- $ret = trim($this->autocomplete($output, $question, $inputStream, \is_array($autocomplete) ? $autocomplete : iterator_to_array($autocomplete, false)));
+ $autocomplete = $this->autocomplete($output, $question, $inputStream, $autocomplete);
+ $ret = $question->isTrimmable() ? trim($autocomplete) : $autocomplete;
}
if ($output instanceof ConsoleSectionOutput) {
@@ -153,6 +150,36 @@ class QuestionHelper extends Helper
return $ret;
}
+ /**
+ * @return mixed
+ */
+ private function getDefaultAnswer(Question $question)
+ {
+ $default = $question->getDefault();
+
+ if (null === $default) {
+ return $default;
+ }
+
+ if ($validator = $question->getValidator()) {
+ return \call_user_func($question->getValidator(), $default);
+ } elseif ($question instanceof ChoiceQuestion) {
+ $choices = $question->getChoices();
+
+ if (!$question->isMultiselect()) {
+ return $choices[$default] ?? $default;
+ }
+
+ $default = explode(',', $default);
+ foreach ($default as $k => $v) {
+ $v = $question->isTrimmable() ? trim($v) : $v;
+ $default[$k] = $choices[$v] ?? $v;
+ }
+ }
+
+ return $default;
+ }
+
/**
* Outputs the question prompt.
*/
@@ -161,15 +188,9 @@ class QuestionHelper extends Helper
$message = $question->getQuestion();
if ($question instanceof ChoiceQuestion) {
- $maxWidth = max(array_map([$this, 'strlen'], array_keys($question->getChoices())));
-
- $messages = (array) $question->getQuestion();
- foreach ($question->getChoices() as $key => $value) {
- $width = $maxWidth - $this->strlen($key);
- $messages[] = ' ['.$key.str_repeat(' ', $width).'] '.$value;
- }
-
- $output->writeln($messages);
+ $output->writeln(array_merge([
+ $question->getQuestion(),
+ ], $this->formatChoiceQuestionChoices($question, 'info')));
$message = $question->getPrompt();
}
@@ -177,6 +198,26 @@ class QuestionHelper extends Helper
$output->write($message);
}
+ /**
+ * @param string $tag
+ *
+ * @return string[]
+ */
+ protected function formatChoiceQuestionChoices(ChoiceQuestion $question, $tag)
+ {
+ $messages = [];
+
+ $maxWidth = max(array_map([__CLASS__, 'strlen'], array_keys($choices = $question->getChoices())));
+
+ foreach ($choices as $key => $value) {
+ $padding = str_repeat(' ', $maxWidth - self::strlen($key));
+
+ $messages[] = sprintf(" [<$tag>%s$padding$tag>] %s", $key, $value);
+ }
+
+ return $messages;
+ }
+
/**
* Outputs an error message.
*/
@@ -194,18 +235,16 @@ class QuestionHelper extends Helper
/**
* Autocompletes a question.
*
- * @param OutputInterface $output
- * @param Question $question
- * @param resource $inputStream
+ * @param resource $inputStream
*/
- private function autocomplete(OutputInterface $output, Question $question, $inputStream, array $autocomplete): string
+ private function autocomplete(OutputInterface $output, Question $question, $inputStream, callable $autocomplete): string
{
$fullChoice = '';
$ret = '';
$i = 0;
$ofs = -1;
- $matches = $autocomplete;
+ $matches = $autocomplete($ret);
$numMatches = \count($matches);
$sttyMode = shell_exec('stty -g');
@@ -223,25 +262,25 @@ class QuestionHelper extends Helper
// as opposed to fgets(), fread() returns an empty string when the stream content is empty, not false.
if (false === $c || ('' === $ret && '' === $c && null === $question->getDefault())) {
shell_exec(sprintf('stty %s', $sttyMode));
- throw new RuntimeException('Aborted.');
+ throw new MissingInputException('Aborted.');
} elseif ("\177" === $c) { // Backspace Character
if (0 === $numMatches && 0 !== $i) {
--$i;
- $fullChoice = substr($fullChoice, 0, -1);
+ $fullChoice = self::substr($fullChoice, 0, $i);
// Move cursor backwards
$output->write("\033[1D");
}
if (0 === $i) {
$ofs = -1;
- $matches = $autocomplete;
+ $matches = $autocomplete($ret);
$numMatches = \count($matches);
} else {
$numMatches = 0;
}
// Pop the last character off the end of our string
- $ret = substr($ret, 0, $i);
+ $ret = self::substr($ret, 0, $i);
} elseif ("\033" === $c) {
// Did we read an escape sequence?
$c .= fread($inputStream, 2);
@@ -262,12 +301,21 @@ class QuestionHelper extends Helper
} elseif (\ord($c) < 32) {
if ("\t" === $c || "\n" === $c) {
if ($numMatches > 0 && -1 !== $ofs) {
- $ret = $matches[$ofs];
+ $ret = (string) $matches[$ofs];
// Echo out remaining chars for current match
$remainingCharacters = substr($ret, \strlen(trim($this->mostRecentlyEnteredValue($fullChoice))));
$output->write($remainingCharacters);
$fullChoice .= $remainingCharacters;
- $i = \strlen($fullChoice);
+ $i = (false === $encoding = mb_detect_encoding($fullChoice, null, true)) ? \strlen($fullChoice) : mb_strlen($fullChoice, $encoding);
+
+ $matches = array_filter(
+ $autocomplete($ret),
+ function ($match) use ($ret) {
+ return '' === $ret || str_starts_with($match, $ret);
+ }
+ );
+ $numMatches = \count($matches);
+ $ofs = -1;
}
if ("\n" === $c) {
@@ -298,9 +346,9 @@ class QuestionHelper extends Helper
$numMatches = 0;
$ofs = 0;
- foreach ($autocomplete as $value) {
+ foreach ($autocomplete($ret) as $value) {
// If typed characters match the beginning chunk of value (e.g. [AcmeDe]moBundle)
- if (0 === strpos($value, $tempRet)) {
+ if (str_starts_with($value, $tempRet)) {
$matches[$numMatches++] = $value;
}
}
@@ -326,15 +374,15 @@ class QuestionHelper extends Helper
return $fullChoice;
}
- private function mostRecentlyEnteredValue($entered)
+ private function mostRecentlyEnteredValue(string $entered): string
{
// Determine the most recent value that the user entered
- if (false === strpos($entered, ',')) {
+ if (!str_contains($entered, ',')) {
return $entered;
}
$choices = explode(',', $entered);
- if (\strlen($lastChoice = trim($choices[\count($choices) - 1])) > 0) {
+ if ('' !== $lastChoice = trim($choices[\count($choices) - 1])) {
return $lastChoice;
}
@@ -344,12 +392,12 @@ class QuestionHelper extends Helper
/**
* Gets a hidden response from user.
*
- * @param OutputInterface $output An Output instance
- * @param resource $inputStream The handler resource
+ * @param resource $inputStream The handler resource
+ * @param bool $trimmable Is the answer trimmable
*
* @throws RuntimeException In case the fallback is deactivated and the response cannot be hidden
*/
- private function getHiddenResponse(OutputInterface $output, $inputStream): string
+ private function getHiddenResponse(OutputInterface $output, $inputStream, bool $trimmable = true): string
{
if ('\\' === \DIRECTORY_SEPARATOR) {
$exe = __DIR__.'/../Resources/bin/hiddeninput.exe';
@@ -361,7 +409,8 @@ class QuestionHelper extends Helper
$exe = $tmpExe;
}
- $value = rtrim(shell_exec($exe));
+ $sExec = shell_exec('"'.$exe.'"');
+ $value = $trimmable ? rtrim($sExec) : $sExec;
$output->writeln('');
if (isset($tmpExe)) {
@@ -371,41 +420,34 @@ class QuestionHelper extends Helper
return $value;
}
- if ($this->hasSttyAvailable()) {
+ if (self::$stty && Terminal::hasSttyAvailable()) {
$sttyMode = shell_exec('stty -g');
-
shell_exec('stty -echo');
- $value = fgets($inputStream, 4096);
+ } elseif ($this->isInteractiveInput($inputStream)) {
+ throw new RuntimeException('Unable to hide the response.');
+ }
+
+ $value = fgets($inputStream, 4096);
+
+ if (self::$stty && Terminal::hasSttyAvailable()) {
shell_exec(sprintf('stty %s', $sttyMode));
+ }
- if (false === $value) {
- throw new RuntimeException('Aborted.');
- }
-
+ if (false === $value) {
+ throw new MissingInputException('Aborted.');
+ }
+ if ($trimmable) {
$value = trim($value);
- $output->writeln('');
-
- return $value;
}
+ $output->writeln('');
- if (false !== $shell = $this->getShell()) {
- $readCmd = 'csh' === $shell ? 'set mypassword = $<' : 'read -r mypassword';
- $command = sprintf("/usr/bin/env %s -c 'stty -echo; %s; stty echo; echo \$mypassword'", $shell, $readCmd);
- $value = rtrim(shell_exec($command));
- $output->writeln('');
-
- return $value;
- }
-
- throw new RuntimeException('Unable to hide the response.');
+ return $value;
}
/**
* Validates an attempt.
*
- * @param callable $interviewer A callable that will ask for a question and return the result
- * @param OutputInterface $output An Output instance
- * @param Question $question A Question instance
+ * @param callable $interviewer A callable that will ask for a question and return the result
*
* @return mixed The validated response
*
@@ -415,6 +457,7 @@ class QuestionHelper extends Helper
{
$error = null;
$attempts = $question->getMaxAttempts();
+
while (null === $attempts || $attempts--) {
if (null !== $error) {
$this->writeError($output, $error);
@@ -431,44 +474,67 @@ class QuestionHelper extends Helper
throw $error;
}
- /**
- * Returns a valid unix shell.
- *
- * @return string|bool The valid shell name, false in case no valid shell is found
- */
- private function getShell()
+ private function isInteractiveInput($inputStream): bool
{
- if (null !== self::$shell) {
- return self::$shell;
+ if ('php://stdin' !== (stream_get_meta_data($inputStream)['uri'] ?? null)) {
+ return false;
}
- self::$shell = false;
+ if (null !== self::$stdinIsInteractive) {
+ return self::$stdinIsInteractive;
+ }
- if (file_exists('/usr/bin/env')) {
- // handle other OSs with bash/zsh/ksh/csh if available to hide the answer
- $test = "/usr/bin/env %s -c 'echo OK' 2> /dev/null";
- foreach (['bash', 'zsh', 'ksh', 'csh'] as $sh) {
- if ('OK' === rtrim(shell_exec(sprintf($test, $sh)))) {
- self::$shell = $sh;
- break;
- }
+ if (\function_exists('stream_isatty')) {
+ return self::$stdinIsInteractive = @stream_isatty(fopen('php://stdin', 'r'));
+ }
+
+ if (\function_exists('posix_isatty')) {
+ return self::$stdinIsInteractive = @posix_isatty(fopen('php://stdin', 'r'));
+ }
+
+ if (!\function_exists('exec')) {
+ return self::$stdinIsInteractive = true;
+ }
+
+ exec('stty 2> /dev/null', $output, $status);
+
+ return self::$stdinIsInteractive = 1 !== $status;
+ }
+
+ /**
+ * Sets console I/O to the host code page.
+ *
+ * @return int Previous code page in IBM/EBCDIC format
+ */
+ private function setIOCodepage(): int
+ {
+ if (\function_exists('sapi_windows_cp_set')) {
+ $cp = sapi_windows_cp_get();
+ sapi_windows_cp_set(sapi_windows_cp_get('oem'));
+
+ return $cp;
+ }
+
+ return 0;
+ }
+
+ /**
+ * Sets console I/O to the specified code page and converts the user input.
+ *
+ * @param string|false $input
+ *
+ * @return string|false
+ */
+ private function resetIOCodepage(int $cp, $input)
+ {
+ if (0 !== $cp) {
+ sapi_windows_cp_set($cp);
+
+ if (false !== $input && '' !== $input) {
+ $input = sapi_windows_cp_conv(sapi_windows_cp_get('oem'), $cp, $input);
}
}
- return self::$shell;
- }
-
- /**
- * Returns whether Stty is available or not.
- */
- private function hasSttyAvailable(): bool
- {
- if (null !== self::$stty) {
- return self::$stty;
- }
-
- exec('stty 2>&1', $output, $exitcode);
-
- return self::$stty = 0 === $exitcode;
+ return $input;
}
}
diff --git a/vendor/symfony/console/Helper/SymfonyQuestionHelper.php b/vendor/symfony/console/Helper/SymfonyQuestionHelper.php
index 260c03e20..ace5e1868 100644
--- a/vendor/symfony/console/Helper/SymfonyQuestionHelper.php
+++ b/vendor/symfony/console/Helper/SymfonyQuestionHelper.php
@@ -58,7 +58,7 @@ class SymfonyQuestionHelper extends QuestionHelper
case $question instanceof ChoiceQuestion:
$choices = $question->getChoices();
- $text = sprintf(' %s [%s]:', $text, OutputFormatter::escape(isset($choices[$default]) ? $choices[$default] : $default));
+ $text = sprintf(' %s [%s]:', $text, OutputFormatter::escape($choices[$default] ?? $default));
break;
@@ -68,15 +68,15 @@ class SymfonyQuestionHelper extends QuestionHelper
$output->writeln($text);
- if ($question instanceof ChoiceQuestion) {
- $width = max(array_map('strlen', array_keys($question->getChoices())));
+ $prompt = ' > ';
- foreach ($question->getChoices() as $key => $value) {
- $output->writeln(sprintf(" [%-${width}s] %s", $key, $value));
- }
+ if ($question instanceof ChoiceQuestion) {
+ $output->writeln($this->formatChoiceQuestionChoices($question, 'comment'));
+
+ $prompt = $question->getPrompt();
}
- $output->write(' > ');
+ $output->write($prompt);
}
/**
diff --git a/vendor/symfony/console/Helper/Table.php b/vendor/symfony/console/Helper/Table.php
index ce759953f..1d0a22baa 100644
--- a/vendor/symfony/console/Helper/Table.php
+++ b/vendor/symfony/console/Helper/Table.php
@@ -48,6 +48,7 @@ class Table
* Table rows.
*/
private $rows = [];
+ private $horizontal = false;
/**
* Column widths cache.
@@ -102,8 +103,7 @@ class Table
/**
* Sets a style definition.
*
- * @param string $name The style name
- * @param TableStyle $style A TableStyle instance
+ * @param string $name The style name
*/
public static function setStyleDefinition($name, TableStyle $style)
{
@@ -207,8 +207,6 @@ class Table
/**
* Sets the minimum width of all columns.
*
- * @param array $widths
- *
* @return $this
*/
public function setColumnWidths(array $widths)
@@ -325,6 +323,13 @@ class Table
return $this;
}
+ public function setHorizontal(bool $horizontal = true): self
+ {
+ $this->horizontal = $horizontal;
+
+ return $this;
+ }
+
/**
* Renders table to output.
*
@@ -340,14 +345,36 @@ class Table
*/
public function render()
{
- $rows = array_merge($this->headers, [$divider = new TableSeparator()], $this->rows);
+ $divider = new TableSeparator();
+ if ($this->horizontal) {
+ $rows = [];
+ foreach ($this->headers[0] ?? [] as $i => $header) {
+ $rows[$i] = [$header];
+ foreach ($this->rows as $row) {
+ if ($row instanceof TableSeparator) {
+ continue;
+ }
+ if (isset($row[$i])) {
+ $rows[$i][] = $row[$i];
+ } elseif ($rows[$i][0] instanceof TableCell && $rows[$i][0]->getColspan() >= 2) {
+ // Noop, there is a "title"
+ } else {
+ $rows[$i][] = null;
+ }
+ }
+ }
+ } else {
+ $rows = array_merge($this->headers, [$divider], $this->rows);
+ }
+
$this->calculateNumberOfColumns($rows);
$rows = $this->buildTableRows($rows);
$this->calculateColumnsWidth($rows);
- $isHeader = true;
- $isFirstRow = false;
+ $isHeader = !$this->horizontal;
+ $isFirstRow = $this->horizontal;
+ $hasTitle = (bool) $this->headerTitle;
foreach ($rows as $row) {
if ($divider === $row) {
$isHeader = false;
@@ -365,15 +392,19 @@ class Table
}
if ($isHeader || $isFirstRow) {
- if ($isFirstRow) {
- $this->renderRowSeparator(self::SEPARATOR_TOP_BOTTOM);
- $isFirstRow = false;
- } else {
- $this->renderRowSeparator(self::SEPARATOR_TOP, $this->headerTitle, $this->style->getHeaderTitleFormat());
- }
+ $this->renderRowSeparator(
+ $isHeader ? self::SEPARATOR_TOP : self::SEPARATOR_TOP_BOTTOM,
+ $hasTitle ? $this->headerTitle : null,
+ $hasTitle ? $this->style->getHeaderTitleFormat() : null
+ );
+ $isFirstRow = false;
+ $hasTitle = false;
+ }
+ if ($this->horizontal) {
+ $this->renderRow($row, $this->style->getCellRowFormat(), $this->style->getCellHeaderFormat());
+ } else {
+ $this->renderRow($row, $isHeader ? $this->style->getCellHeaderFormat() : $this->style->getCellRowFormat());
}
-
- $this->renderRow($row, $isHeader ? $this->style->getCellHeaderFormat() : $this->style->getCellRowFormat());
}
$this->renderRowSeparator(self::SEPARATOR_BOTTOM, $this->footerTitle, $this->style->getFooterTitleFormat());
@@ -401,13 +432,13 @@ class Table
$crossings = $this->style->getCrossingChars();
if (self::SEPARATOR_MID === $type) {
- list($horizontal, $leftChar, $midChar, $rightChar) = [$borders[2], $crossings[8], $crossings[0], $crossings[4]];
+ [$horizontal, $leftChar, $midChar, $rightChar] = [$borders[2], $crossings[8], $crossings[0], $crossings[4]];
} elseif (self::SEPARATOR_TOP === $type) {
- list($horizontal, $leftChar, $midChar, $rightChar) = [$borders[0], $crossings[1], $crossings[2], $crossings[3]];
+ [$horizontal, $leftChar, $midChar, $rightChar] = [$borders[0], $crossings[1], $crossings[2], $crossings[3]];
} elseif (self::SEPARATOR_TOP_BOTTOM === $type) {
- list($horizontal, $leftChar, $midChar, $rightChar) = [$borders[0], $crossings[9], $crossings[10], $crossings[11]];
+ [$horizontal, $leftChar, $midChar, $rightChar] = [$borders[0], $crossings[9], $crossings[10], $crossings[11]];
} else {
- list($horizontal, $leftChar, $midChar, $rightChar) = [$borders[0], $crossings[7], $crossings[6], $crossings[5]];
+ [$horizontal, $leftChar, $midChar, $rightChar] = [$borders[0], $crossings[7], $crossings[6], $crossings[5]];
}
$markup = $leftChar;
@@ -425,7 +456,7 @@ class Table
$formattedTitle = sprintf($titleFormat, Helper::substr($title, 0, $limit - $formatLength - 3).'...');
}
- $titleStart = ($markupLength - $titleLength) / 2;
+ $titleStart = intdiv($markupLength - $titleLength, 2);
if (false === mb_detect_encoding($markup, null, true)) {
$markup = substr_replace($markup, $formattedTitle, $titleStart, $titleLength);
} else {
@@ -439,7 +470,7 @@ class Table
/**
* Renders vertical column separator.
*/
- private function renderColumnSeparator($type = self::BORDER_OUTSIDE)
+ private function renderColumnSeparator(int $type = self::BORDER_OUTSIDE): string
{
$borders = $this->style->getBorderChars();
@@ -453,13 +484,17 @@ class Table
*
* | 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens |
*/
- private function renderRow(array $row, string $cellFormat)
+ private function renderRow(array $row, string $cellFormat, string $firstCellFormat = null)
{
$rowContent = $this->renderColumnSeparator(self::BORDER_OUTSIDE);
$columns = $this->getRowColumns($row);
$last = \count($columns) - 1;
foreach ($columns as $i => $column) {
- $rowContent .= $this->renderCell($row, $column, $cellFormat);
+ if ($firstCellFormat && 0 === $i) {
+ $rowContent .= $this->renderCell($row, $column, $firstCellFormat);
+ } else {
+ $rowContent .= $this->renderCell($row, $column, $cellFormat);
+ }
$rowContent .= $this->renderColumnSeparator($last === $i ? self::BORDER_OUTSIDE : self::BORDER_INSIDE);
}
$this->output->writeln($rowContent);
@@ -468,9 +503,9 @@ class Table
/**
* Renders table cell with padding.
*/
- private function renderCell(array $row, int $column, string $cellFormat)
+ private function renderCell(array $row, int $column, string $cellFormat): string
{
- $cell = isset($row[$column]) ? $row[$column] : '';
+ $cell = $row[$column] ?? '';
$width = $this->effectiveColumnWidths[$column];
if ($cell instanceof TableCell && $cell->getColspan() > 1) {
// add the width of the following columns(numbers of colspan).
@@ -499,7 +534,7 @@ class Table
/**
* Calculate number of columns for this table.
*/
- private function calculateNumberOfColumns($rows)
+ private function calculateNumberOfColumns(array $rows)
{
$columns = [0];
foreach ($rows as $row) {
@@ -513,7 +548,7 @@ class Table
$this->numberOfColumns = max($columns);
}
- private function buildTableRows($rows)
+ private function buildTableRows(array $rows): TableRows
{
/** @var WrappableOutputFormatterInterface $formatter */
$formatter = $this->output->getFormatter();
@@ -528,7 +563,7 @@ class Table
if (isset($this->columnMaxWidths[$column]) && Helper::strlenWithoutDecoration($formatter, $cell) > $this->columnMaxWidths[$column]) {
$cell = $formatter->formatAndWrap($cell, $this->columnMaxWidths[$column] * $colspan);
}
- if (!strstr($cell, "\n")) {
+ if (!strstr($cell ?? '', "\n")) {
continue;
}
$escaped = implode("\n", array_map([OutputFormatter::class, 'escapeTrailingBackslash'], explode("\n", $cell)));
@@ -541,19 +576,22 @@ class Table
if (0 === $lineKey) {
$rows[$rowKey][$column] = $line;
} else {
+ if (!\array_key_exists($rowKey, $unmergedRows) || !\array_key_exists($lineKey, $unmergedRows[$rowKey])) {
+ $unmergedRows[$rowKey][$lineKey] = $this->copyRow($rows, $rowKey);
+ }
$unmergedRows[$rowKey][$lineKey][$column] = $line;
}
}
}
}
- return new TableRows(function () use ($rows, $unmergedRows) {
+ return new TableRows(function () use ($rows, $unmergedRows): \Traversable {
foreach ($rows as $rowKey => $row) {
- yield $this->fillCells($row);
+ yield $row instanceof TableSeparator ? $row : $this->fillCells($row);
if (isset($unmergedRows[$rowKey])) {
foreach ($unmergedRows[$rowKey] as $row) {
- yield $row;
+ yield $row instanceof TableSeparator ? $row : $this->fillCells($row);
}
}
}
@@ -568,7 +606,9 @@ class Table
++$numberOfRows; // Add row for header separator
}
- ++$numberOfRows; // Add row for footer separator
+ if (\count($this->rows) > 0) {
+ ++$numberOfRows; // Add row for footer separator
+ }
return $numberOfRows;
}
@@ -583,7 +623,7 @@ class Table
$unmergedRows = [];
foreach ($rows[$line] as $column => $cell) {
if (null !== $cell && !$cell instanceof TableCell && !is_scalar($cell) && !(\is_object($cell) && method_exists($cell, '__toString'))) {
- throw new InvalidArgumentException(sprintf('A cell must be a TableCell, a scalar or an object implementing __toString, %s given.', \gettype($cell)));
+ throw new InvalidArgumentException(sprintf('A cell must be a TableCell, a scalar or an object implementing "__toString()", "%s" given.', \gettype($cell)));
}
if ($cell instanceof TableCell && $cell->getRowspan() > 1) {
$nbLines = $cell->getRowspan() - 1;
@@ -599,7 +639,7 @@ class Table
// create a two dimensional array (rowspan x colspan)
$unmergedRows = array_replace_recursive(array_fill($line + 1, $nbLines, []), $unmergedRows);
foreach ($unmergedRows as $unmergedRowKey => $unmergedRow) {
- $value = isset($lines[$unmergedRowKey - $line]) ? $lines[$unmergedRowKey - $line] : '';
+ $value = $lines[$unmergedRowKey - $line] ?? '';
$unmergedRows[$unmergedRowKey][$column] = new TableCell($value, ['colspan' => $cell->getColspan()]);
if ($nbLines === $unmergedRowKey - $line) {
break;
@@ -632,9 +672,10 @@ class Table
/**
* fill cells for a row that contains colspan > 1.
*/
- private function fillCells($row)
+ private function fillCells(iterable $row)
{
$newRow = [];
+
foreach ($row as $column => $cell) {
$newRow[] = $cell;
if ($cell instanceof TableCell && $cell->getColspan() > 1) {
@@ -736,7 +777,7 @@ class Table
$cellWidth = Helper::strlenWithoutDecoration($this->output->getFormatter(), $cell);
}
- $columnWidth = isset($this->columnWidths[$column]) ? $this->columnWidths[$column] : 0;
+ $columnWidth = $this->columnWidths[$column] ?? 0;
$cellWidth = max($cellWidth, $columnWidth);
return isset($this->columnMaxWidths[$column]) ? min($this->columnMaxWidths[$column], $cellWidth) : $cellWidth;
@@ -751,7 +792,7 @@ class Table
$this->numberOfColumns = null;
}
- private static function initStyles()
+ private static function initStyles(): array
{
$borderless = new TableStyle();
$borderless
@@ -798,7 +839,7 @@ class Table
];
}
- private function resolveStyle($name)
+ private function resolveStyle($name): TableStyle
{
if ($name instanceof TableStyle) {
return $name;
diff --git a/vendor/symfony/console/Helper/TableRows.php b/vendor/symfony/console/Helper/TableRows.php
index 4809daf1c..16aabb3fc 100644
--- a/vendor/symfony/console/Helper/TableRows.php
+++ b/vendor/symfony/console/Helper/TableRows.php
@@ -23,7 +23,7 @@ class TableRows implements \IteratorAggregate
$this->generator = $generator;
}
- public function getIterator()
+ public function getIterator(): \Traversable
{
$g = $this->generator;
diff --git a/vendor/symfony/console/Helper/TableStyle.php b/vendor/symfony/console/Helper/TableStyle.php
index 02dd693c8..a8df59b3a 100644
--- a/vendor/symfony/console/Helper/TableStyle.php
+++ b/vendor/symfony/console/Helper/TableStyle.php
@@ -46,7 +46,7 @@ class TableStyle
private $cellRowFormat = '%s';
private $cellRowContentFormat = ' %s ';
private $borderFormat = '%s';
- private $padType = STR_PAD_RIGHT;
+ private $padType = \STR_PAD_RIGHT;
/**
* Sets padding character, used for cell padding.
@@ -58,7 +58,7 @@ class TableStyle
public function setPaddingChar($paddingChar)
{
if (!$paddingChar) {
- throw new LogicException('The padding char must not be empty');
+ throw new LogicException('The padding char must not be empty.');
}
$this->paddingChar = $paddingChar;
@@ -112,7 +112,7 @@ class TableStyle
*/
public function setHorizontalBorderChar($horizontalBorderChar)
{
- @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1, use setHorizontalBorderChars() instead.', __METHOD__), E_USER_DEPRECATED);
+ @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1, use setHorizontalBorderChars() instead.', __METHOD__), \E_USER_DEPRECATED);
return $this->setHorizontalBorderChars($horizontalBorderChar, $horizontalBorderChar);
}
@@ -126,7 +126,7 @@ class TableStyle
*/
public function getHorizontalBorderChar()
{
- @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1, use getBorderChars() instead.', __METHOD__), E_USER_DEPRECATED);
+ @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1, use getBorderChars() instead.', __METHOD__), \E_USER_DEPRECATED);
return $this->horizontalOutsideBorderChar;
}
@@ -168,7 +168,7 @@ class TableStyle
*/
public function setVerticalBorderChar($verticalBorderChar)
{
- @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1, use setVerticalBorderChars() instead.', __METHOD__), E_USER_DEPRECATED);
+ @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1, use setVerticalBorderChars() instead.', __METHOD__), \E_USER_DEPRECATED);
return $this->setVerticalBorderChars($verticalBorderChar, $verticalBorderChar);
}
@@ -182,7 +182,7 @@ class TableStyle
*/
public function getVerticalBorderChar()
{
- @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1, use getBorderChars() instead.', __METHOD__), E_USER_DEPRECATED);
+ @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1, use getBorderChars() instead.', __METHOD__), \E_USER_DEPRECATED);
return $this->verticalOutsideBorderChar;
}
@@ -192,7 +192,7 @@ class TableStyle
*
* @internal
*/
- public function getBorderChars()
+ public function getBorderChars(): array
{
return [
$this->horizontalOutsideBorderChar,
@@ -270,7 +270,7 @@ class TableStyle
*/
public function setCrossingChar($crossingChar)
{
- @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1. Use setDefaultCrossingChar() instead.', __METHOD__), E_USER_DEPRECATED);
+ @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1. Use setDefaultCrossingChar() instead.', __METHOD__), \E_USER_DEPRECATED);
return $this->setDefaultCrossingChar($crossingChar);
}
@@ -413,7 +413,7 @@ class TableStyle
*/
public function setPadType($padType)
{
- if (!\in_array($padType, [STR_PAD_LEFT, STR_PAD_RIGHT, STR_PAD_BOTH], true)) {
+ if (!\in_array($padType, [\STR_PAD_LEFT, \STR_PAD_RIGHT, \STR_PAD_BOTH], true)) {
throw new InvalidArgumentException('Invalid padding type. Expected one of (STR_PAD_LEFT, STR_PAD_RIGHT, STR_PAD_BOTH).');
}
diff --git a/vendor/symfony/console/Input/ArgvInput.php b/vendor/symfony/console/Input/ArgvInput.php
index c56c20c68..63f40f271 100644
--- a/vendor/symfony/console/Input/ArgvInput.php
+++ b/vendor/symfony/console/Input/ArgvInput.php
@@ -44,14 +44,11 @@ class ArgvInput extends Input
private $parsed;
/**
- * @param array|null $argv An array of parameters from the CLI (in the argv format)
- * @param InputDefinition|null $definition A InputDefinition instance
+ * @param array|null $argv An array of parameters from the CLI (in the argv format)
*/
public function __construct(array $argv = null, InputDefinition $definition = null)
{
- if (null === $argv) {
- $argv = $_SERVER['argv'];
- }
+ $argv = $argv ?? $_SERVER['argv'] ?? [];
// strip the application name
array_shift($argv);
@@ -78,7 +75,7 @@ class ArgvInput extends Input
$this->parseArgument($token);
} elseif ($parseOptions && '--' == $token) {
$parseOptions = false;
- } elseif ($parseOptions && 0 === strpos($token, '--')) {
+ } elseif ($parseOptions && str_starts_with($token, '--')) {
$this->parseLongOption($token);
} elseif ($parseOptions && '-' === $token[0] && '-' !== $token) {
$this->parseShortOption($token);
@@ -90,10 +87,8 @@ class ArgvInput extends Input
/**
* Parses a short option.
- *
- * @param string $token The current token
*/
- private function parseShortOption($token)
+ private function parseShortOption(string $token)
{
$name = substr($token, 1);
@@ -112,11 +107,9 @@ class ArgvInput extends Input
/**
* Parses a short option set.
*
- * @param string $name The current token
- *
* @throws RuntimeException When option given doesn't exist
*/
- private function parseShortOptionSet($name)
+ private function parseShortOptionSet(string $name)
{
$len = \strlen($name);
for ($i = 0; $i < $len; ++$i) {
@@ -138,15 +131,13 @@ class ArgvInput extends Input
/**
* Parses a long option.
- *
- * @param string $token The current token
*/
- private function parseLongOption($token)
+ private function parseLongOption(string $token)
{
$name = substr($token, 2);
if (false !== $pos = strpos($name, '=')) {
- if (0 === \strlen($value = substr($name, $pos + 1))) {
+ if ('' === $value = substr($name, $pos + 1)) {
array_unshift($this->parsed, $value);
}
$this->addLongOption(substr($name, 0, $pos), $value);
@@ -158,11 +149,9 @@ class ArgvInput extends Input
/**
* Parses an argument.
*
- * @param string $token The current token
- *
* @throws RuntimeException When too many arguments are given
*/
- private function parseArgument($token)
+ private function parseArgument(string $token)
{
$c = \count($this->arguments);
@@ -190,12 +179,9 @@ class ArgvInput extends Input
/**
* Adds a short option value.
*
- * @param string $shortcut The short option key
- * @param mixed $value The value for the option
- *
* @throws RuntimeException When option given doesn't exist
*/
- private function addShortOption($shortcut, $value)
+ private function addShortOption(string $shortcut, $value)
{
if (!$this->definition->hasShortcut($shortcut)) {
throw new RuntimeException(sprintf('The "-%s" option does not exist.', $shortcut));
@@ -207,12 +193,9 @@ class ArgvInput extends Input
/**
* Adds a long option value.
*
- * @param string $name The long option key
- * @param mixed $value The value for the option
- *
* @throws RuntimeException When option given doesn't exist
*/
- private function addLongOption($name, $value)
+ private function addLongOption(string $name, $value)
{
if (!$this->definition->hasOption($name)) {
throw new RuntimeException(sprintf('The "--%s" option does not exist.', $name));
@@ -260,7 +243,7 @@ class ArgvInput extends Input
$isOption = false;
foreach ($this->tokens as $i => $token) {
if ($token && '-' === $token[0]) {
- if (false !== strpos($token, '=') || !isset($this->tokens[$i + 1])) {
+ if (str_contains($token, '=') || !isset($this->tokens[$i + 1])) {
continue;
}
@@ -283,6 +266,8 @@ class ArgvInput extends Input
return $token;
}
+
+ return null;
}
/**
@@ -300,8 +285,8 @@ class ArgvInput extends Input
// Options with values:
// For long options, test for '--option=' at beginning
// For short options, test for '-o' at beginning
- $leading = 0 === strpos($value, '--') ? $value.'=' : $value;
- if ($token === $value || '' !== $leading && 0 === strpos($token, $leading)) {
+ $leading = str_starts_with($value, '--') ? $value.'=' : $value;
+ if ($token === $value || '' !== $leading && str_starts_with($token, $leading)) {
return true;
}
}
@@ -331,8 +316,8 @@ class ArgvInput extends Input
// Options with values:
// For long options, test for '--option=' at beginning
// For short options, test for '-o' at beginning
- $leading = 0 === strpos($value, '--') ? $value.'=' : $value;
- if ('' !== $leading && 0 === strpos($token, $leading)) {
+ $leading = str_starts_with($value, '--') ? $value.'=' : $value;
+ if ('' !== $leading && str_starts_with($token, $leading)) {
return substr($token, \strlen($leading));
}
}
diff --git a/vendor/symfony/console/Input/ArrayInput.php b/vendor/symfony/console/Input/ArrayInput.php
index 44c2f0d5c..30bd2054a 100644
--- a/vendor/symfony/console/Input/ArrayInput.php
+++ b/vendor/symfony/console/Input/ArrayInput.php
@@ -39,13 +39,15 @@ class ArrayInput extends Input
*/
public function getFirstArgument()
{
- foreach ($this->parameters as $key => $value) {
- if ($key && '-' === $key[0]) {
+ foreach ($this->parameters as $param => $value) {
+ if ($param && \is_string($param) && '-' === $param[0]) {
continue;
}
return $value;
}
+
+ return null;
}
/**
@@ -105,13 +107,14 @@ class ArrayInput extends Input
{
$params = [];
foreach ($this->parameters as $param => $val) {
- if ($param && '-' === $param[0]) {
+ if ($param && \is_string($param) && '-' === $param[0]) {
+ $glue = ('-' === $param[1]) ? '=' : ' ';
if (\is_array($val)) {
foreach ($val as $v) {
- $params[] = $param.('' != $v ? '='.$this->escapeToken($v) : '');
+ $params[] = $param.('' != $v ? $glue.$this->escapeToken($v) : '');
}
} else {
- $params[] = $param.('' != $val ? '='.$this->escapeToken($val) : '');
+ $params[] = $param.('' != $val ? $glue.$this->escapeToken($val) : '');
}
} else {
$params[] = \is_array($val) ? implode(' ', array_map([$this, 'escapeToken'], $val)) : $this->escapeToken($val);
@@ -130,9 +133,9 @@ class ArrayInput extends Input
if ('--' === $key) {
return;
}
- if (0 === strpos($key, '--')) {
+ if (str_starts_with($key, '--')) {
$this->addLongOption(substr($key, 2), $value);
- } elseif ('-' === $key[0]) {
+ } elseif (str_starts_with($key, '-')) {
$this->addShortOption(substr($key, 1), $value);
} else {
$this->addArgument($key, $value);
@@ -143,12 +146,9 @@ class ArrayInput extends Input
/**
* Adds a short option value.
*
- * @param string $shortcut The short option key
- * @param mixed $value The value for the option
- *
* @throws InvalidOptionException When option given doesn't exist
*/
- private function addShortOption($shortcut, $value)
+ private function addShortOption(string $shortcut, $value)
{
if (!$this->definition->hasShortcut($shortcut)) {
throw new InvalidOptionException(sprintf('The "-%s" option does not exist.', $shortcut));
@@ -160,13 +160,10 @@ class ArrayInput extends Input
/**
* Adds a long option value.
*
- * @param string $name The long option key
- * @param mixed $value The value for the option
- *
* @throws InvalidOptionException When option given doesn't exist
* @throws InvalidOptionException When a required value is missing
*/
- private function addLongOption($name, $value)
+ private function addLongOption(string $name, $value)
{
if (!$this->definition->hasOption($name)) {
throw new InvalidOptionException(sprintf('The "--%s" option does not exist.', $name));
@@ -190,8 +187,8 @@ class ArrayInput extends Input
/**
* Adds an argument value.
*
- * @param string $name The argument name
- * @param mixed $value The value for the argument
+ * @param string|int $name The argument name
+ * @param mixed $value The value for the argument
*
* @throws InvalidArgumentException When argument given doesn't exist
*/
diff --git a/vendor/symfony/console/Input/Input.php b/vendor/symfony/console/Input/Input.php
index c1220316d..d7f29073e 100644
--- a/vendor/symfony/console/Input/Input.php
+++ b/vendor/symfony/console/Input/Input.php
@@ -106,11 +106,11 @@ abstract class Input implements InputInterface, StreamableInputInterface
*/
public function getArgument($name)
{
- if (!$this->definition->hasArgument($name)) {
+ if (!$this->definition->hasArgument((string) $name)) {
throw new InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name));
}
- return isset($this->arguments[$name]) ? $this->arguments[$name] : $this->definition->getArgument($name)->getDefault();
+ return $this->arguments[$name] ?? $this->definition->getArgument($name)->getDefault();
}
/**
@@ -118,7 +118,7 @@ abstract class Input implements InputInterface, StreamableInputInterface
*/
public function setArgument($name, $value)
{
- if (!$this->definition->hasArgument($name)) {
+ if (!$this->definition->hasArgument((string) $name)) {
throw new InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name));
}
@@ -130,7 +130,7 @@ abstract class Input implements InputInterface, StreamableInputInterface
*/
public function hasArgument($name)
{
- return $this->definition->hasArgument($name);
+ return $this->definition->hasArgument((string) $name);
}
/**
diff --git a/vendor/symfony/console/Input/InputArgument.php b/vendor/symfony/console/Input/InputArgument.php
index b6aa6452a..085aca5a7 100644
--- a/vendor/symfony/console/Input/InputArgument.php
+++ b/vendor/symfony/console/Input/InputArgument.php
@@ -21,9 +21,9 @@ use Symfony\Component\Console\Exception\LogicException;
*/
class InputArgument
{
- const REQUIRED = 1;
- const OPTIONAL = 2;
- const IS_ARRAY = 4;
+ public const REQUIRED = 1;
+ public const OPTIONAL = 2;
+ public const IS_ARRAY = 4;
private $name;
private $mode;
@@ -31,10 +31,10 @@ class InputArgument
private $description;
/**
- * @param string $name The argument name
- * @param int|null $mode The argument mode: self::REQUIRED or self::OPTIONAL
- * @param string $description A description text
- * @param string|string[]|null $default The default value (for self::OPTIONAL mode only)
+ * @param string $name The argument name
+ * @param int|null $mode The argument mode: self::REQUIRED or self::OPTIONAL
+ * @param string $description A description text
+ * @param string|bool|int|float|array|null $default The default value (for self::OPTIONAL mode only)
*
* @throws InvalidArgumentException When argument mode is not valid
*/
@@ -86,7 +86,7 @@ class InputArgument
/**
* Sets the default value.
*
- * @param string|string[]|null $default The default value
+ * @param string|bool|int|float|array|null $default
*
* @throws LogicException When incorrect default value is given
*/
@@ -110,7 +110,7 @@ class InputArgument
/**
* Returns the default value.
*
- * @return string|string[]|null The default value
+ * @return string|bool|int|float|array|null
*/
public function getDefault()
{
diff --git a/vendor/symfony/console/Input/InputDefinition.php b/vendor/symfony/console/Input/InputDefinition.php
index 2189c4628..e2cd6d714 100644
--- a/vendor/symfony/console/Input/InputDefinition.php
+++ b/vendor/symfony/console/Input/InputDefinition.php
@@ -171,7 +171,7 @@ class InputDefinition
*/
public function getArgumentCount()
{
- return $this->hasAnArrayArgument ? PHP_INT_MAX : \count($this->arguments);
+ return $this->hasAnArrayArgument ? \PHP_INT_MAX : \count($this->arguments);
}
/**
@@ -185,9 +185,7 @@ class InputDefinition
}
/**
- * Gets the default values.
- *
- * @return array An array of default values
+ * @return array
*/
public function getArgumentDefaults()
{
@@ -316,9 +314,7 @@ class InputDefinition
}
/**
- * Gets an array of default values.
- *
- * @return array An array of all default values
+ * @return array
*/
public function getOptionDefaults()
{
@@ -333,15 +329,11 @@ class InputDefinition
/**
* Returns the InputOption name given a shortcut.
*
- * @param string $shortcut The shortcut
- *
- * @return string The InputOption name
- *
* @throws InvalidArgumentException When option given does not exist
*
* @internal
*/
- public function shortcutToName($shortcut)
+ public function shortcutToName(string $shortcut): string
{
if (!isset($this->shortcuts[$shortcut])) {
throw new InvalidArgumentException(sprintf('The "-%s" option does not exist.', $shortcut));
diff --git a/vendor/symfony/console/Input/InputInterface.php b/vendor/symfony/console/Input/InputInterface.php
index b9bcf3bbc..8efc62326 100644
--- a/vendor/symfony/console/Input/InputInterface.php
+++ b/vendor/symfony/console/Input/InputInterface.php
@@ -51,9 +51,9 @@ interface InputInterface
* Does not necessarily return the correct result for short options
* when multiple flags are combined in the same option.
*
- * @param string|array $values The value(s) to look for in the raw parameters (can be an array)
- * @param mixed $default The default value to return if no result is found
- * @param bool $onlyParams Only check real parameters, skip those following an end of options (--) signal
+ * @param string|array $values The value(s) to look for in the raw parameters (can be an array)
+ * @param string|bool|int|float|array|null $default The default value to return if no result is found
+ * @param bool $onlyParams Only check real parameters, skip those following an end of options (--) signal
*
* @return mixed The option value
*/
@@ -76,7 +76,7 @@ interface InputInterface
/**
* Returns all the given arguments merged with the default values.
*
- * @return array
+ * @return array
*/
public function getArguments();
@@ -85,7 +85,7 @@ interface InputInterface
*
* @param string $name The argument name
*
- * @return string|string[]|null The argument value
+ * @return mixed
*
* @throws InvalidArgumentException When argument given doesn't exist
*/
@@ -94,8 +94,8 @@ interface InputInterface
/**
* Sets an argument value by name.
*
- * @param string $name The argument name
- * @param string|string[]|null $value The argument value
+ * @param string $name The argument name
+ * @param mixed $value The argument value
*
* @throws InvalidArgumentException When argument given doesn't exist
*/
@@ -104,7 +104,7 @@ interface InputInterface
/**
* Returns true if an InputArgument object exists by name or position.
*
- * @param string|int $name The InputArgument name or position
+ * @param string $name The argument name
*
* @return bool true if the InputArgument object exists, false otherwise
*/
@@ -113,7 +113,7 @@ interface InputInterface
/**
* Returns all the given options merged with the default values.
*
- * @return array
+ * @return array
*/
public function getOptions();
@@ -122,7 +122,7 @@ interface InputInterface
*
* @param string $name The option name
*
- * @return string|string[]|bool|null The option value
+ * @return mixed
*
* @throws InvalidArgumentException When option given doesn't exist
*/
@@ -131,8 +131,8 @@ interface InputInterface
/**
* Sets an option value by name.
*
- * @param string $name The option name
- * @param string|string[]|bool|null $value The option value
+ * @param string $name The option name
+ * @param mixed $value The option value
*
* @throws InvalidArgumentException When option given doesn't exist
*/
diff --git a/vendor/symfony/console/Input/InputOption.php b/vendor/symfony/console/Input/InputOption.php
index d62e0aea0..c7729db20 100644
--- a/vendor/symfony/console/Input/InputOption.php
+++ b/vendor/symfony/console/Input/InputOption.php
@@ -21,10 +21,25 @@ use Symfony\Component\Console\Exception\LogicException;
*/
class InputOption
{
- const VALUE_NONE = 1;
- const VALUE_REQUIRED = 2;
- const VALUE_OPTIONAL = 4;
- const VALUE_IS_ARRAY = 8;
+ /**
+ * Do not accept input for the option (e.g. --yell). This is the default behavior of options.
+ */
+ public const VALUE_NONE = 1;
+
+ /**
+ * A value must be passed when the option is used (e.g. --iterations=5 or -i5).
+ */
+ public const VALUE_REQUIRED = 2;
+
+ /**
+ * The option may or may not have a value (e.g. --yell or --yell=loud).
+ */
+ public const VALUE_OPTIONAL = 4;
+
+ /**
+ * The option accepts multiple values (e.g. --dir=/foo --dir=/bar).
+ */
+ public const VALUE_IS_ARRAY = 8;
private $name;
private $shortcut;
@@ -33,17 +48,17 @@ class InputOption
private $description;
/**
- * @param string $name The option name
- * @param string|array|null $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts
- * @param int|null $mode The option mode: One of the VALUE_* constants
- * @param string $description A description text
- * @param string|string[]|int|bool|null $default The default value (must be null for self::VALUE_NONE)
+ * @param string $name The option name
+ * @param string|array|null $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts
+ * @param int|null $mode The option mode: One of the VALUE_* constants
+ * @param string $description A description text
+ * @param string|bool|int|float|array|null $default The default value (must be null for self::VALUE_NONE)
*
* @throws InvalidArgumentException If option mode is invalid or incompatible
*/
public function __construct(string $name, $shortcut = null, int $mode = null, string $description = '', $default = null)
{
- if (0 === strpos($name, '--')) {
+ if (str_starts_with($name, '--')) {
$name = substr($name, 2);
}
@@ -147,11 +162,7 @@ class InputOption
}
/**
- * Sets the default value.
- *
- * @param string|string[]|int|bool|null $default The default value
- *
- * @throws LogicException When incorrect default value is given
+ * @param string|bool|int|float|array|null $default
*/
public function setDefault($default = null)
{
@@ -173,7 +184,7 @@ class InputOption
/**
* Returns the default value.
*
- * @return string|string[]|int|bool|null The default value
+ * @return string|bool|int|float|array|null
*/
public function getDefault()
{
diff --git a/vendor/symfony/console/Input/StringInput.php b/vendor/symfony/console/Input/StringInput.php
index 0c63ed0e0..76f1d5030 100644
--- a/vendor/symfony/console/Input/StringInput.php
+++ b/vendor/symfony/console/Input/StringInput.php
@@ -24,8 +24,8 @@ use Symfony\Component\Console\Exception\InvalidArgumentException;
*/
class StringInput extends ArgvInput
{
- const REGEX_STRING = '([^\s]+?)(?:\s|(?
*
- * @see http://www.php-fig.org/psr/psr-3/
+ * @see https://www.php-fig.org/psr/psr-3/
*/
class ConsoleLogger extends AbstractLogger
{
- const INFO = 'info';
- const ERROR = 'error';
+ public const INFO = 'info';
+ public const ERROR = 'error';
private $output;
private $verbosityLevelMap = [
@@ -61,6 +61,8 @@ class ConsoleLogger extends AbstractLogger
/**
* {@inheritdoc}
+ *
+ * @return void
*/
public function log($level, $message, array $context = [])
{
@@ -102,7 +104,7 @@ class ConsoleLogger extends AbstractLogger
*/
private function interpolate(string $message, array $context): string
{
- if (false === strpos($message, '{')) {
+ if (!str_contains($message, '{')) {
return $message;
}
diff --git a/vendor/symfony/console/Output/BufferedOutput.php b/vendor/symfony/console/Output/BufferedOutput.php
index 8afc8931e..fefaac271 100644
--- a/vendor/symfony/console/Output/BufferedOutput.php
+++ b/vendor/symfony/console/Output/BufferedOutput.php
@@ -39,7 +39,7 @@ class BufferedOutput extends Output
$this->buffer .= $message;
if ($newline) {
- $this->buffer .= PHP_EOL;
+ $this->buffer .= \PHP_EOL;
}
}
}
diff --git a/vendor/symfony/console/Output/ConsoleOutput.php b/vendor/symfony/console/Output/ConsoleOutput.php
index 8430c9c82..484fcbdea 100644
--- a/vendor/symfony/console/Output/ConsoleOutput.php
+++ b/vendor/symfony/console/Output/ConsoleOutput.php
@@ -41,6 +41,13 @@ class ConsoleOutput extends StreamOutput implements ConsoleOutputInterface
{
parent::__construct($this->openOutputStream(), $verbosity, $decorated, $formatter);
+ if (null === $formatter) {
+ // for BC reasons, stdErr has it own Formatter only when user don't inject a specific formatter.
+ $this->stderr = new StreamOutput($this->openErrorStream(), $verbosity, $decorated);
+
+ return;
+ }
+
$actualDecorated = $this->isDecorated();
$this->stderr = new StreamOutput($this->openErrorStream(), $verbosity, $decorated, $this->getFormatter());
@@ -125,15 +132,13 @@ class ConsoleOutput extends StreamOutput implements ConsoleOutputInterface
/**
* Checks if current executing environment is IBM iSeries (OS400), which
* doesn't properly convert character-encodings between ASCII to EBCDIC.
- *
- * @return bool
*/
- private function isRunningOS400()
+ private function isRunningOS400(): bool
{
$checks = [
\function_exists('php_uname') ? php_uname('s') : '',
getenv('OSTYPE'),
- PHP_OS,
+ \PHP_OS,
];
return false !== stripos(implode(';', $checks), 'OS400');
@@ -148,7 +153,8 @@ class ConsoleOutput extends StreamOutput implements ConsoleOutputInterface
return fopen('php://output', 'w');
}
- return @fopen('php://stdout', 'w') ?: fopen('php://output', 'w');
+ // Use STDOUT when possible to prevent from opening too many file descriptors
+ return \defined('STDOUT') ? \STDOUT : (@fopen('php://stdout', 'w') ?: fopen('php://output', 'w'));
}
/**
@@ -156,6 +162,11 @@ class ConsoleOutput extends StreamOutput implements ConsoleOutputInterface
*/
private function openErrorStream()
{
- return fopen($this->hasStderrSupport() ? 'php://stderr' : 'php://output', 'w');
+ if (!$this->hasStderrSupport()) {
+ return fopen('php://output', 'w');
+ }
+
+ // Use STDERR when possible to prevent from opening too many file descriptors
+ return \defined('STDERR') ? \STDERR : (@fopen('php://stderr', 'w') ?: fopen('php://output', 'w'));
}
}
diff --git a/vendor/symfony/console/Output/ConsoleSectionOutput.php b/vendor/symfony/console/Output/ConsoleSectionOutput.php
index ce2c28ba1..c19edbf95 100644
--- a/vendor/symfony/console/Output/ConsoleSectionOutput.php
+++ b/vendor/symfony/console/Output/ConsoleSectionOutput.php
@@ -82,10 +82,10 @@ class ConsoleSectionOutput extends StreamOutput
*/
public function addContent(string $input)
{
- foreach (explode(PHP_EOL, $input) as $lineContent) {
+ foreach (explode(\PHP_EOL, $input) as $lineContent) {
$this->lines += ceil($this->getDisplayLength($lineContent) / $this->terminal->getWidth()) ?: 1;
$this->content[] = $lineContent;
- $this->content[] = PHP_EOL;
+ $this->content[] = \PHP_EOL;
}
}
@@ -95,7 +95,9 @@ class ConsoleSectionOutput extends StreamOutput
protected function doWrite($message, $newline)
{
if (!$this->isDecorated()) {
- return parent::doWrite($message, $newline);
+ parent::doWrite($message, $newline);
+
+ return;
}
$erasedContent = $this->popStreamContentUntilCurrentSection();
diff --git a/vendor/symfony/console/Output/Output.php b/vendor/symfony/console/Output/Output.php
index 9dd765113..fb838f053 100644
--- a/vendor/symfony/console/Output/Output.php
+++ b/vendor/symfony/console/Output/Output.php
@@ -40,7 +40,7 @@ abstract class Output implements OutputInterface
public function __construct(?int $verbosity = self::VERBOSITY_NORMAL, bool $decorated = false, OutputFormatterInterface $formatter = null)
{
$this->verbosity = null === $verbosity ? self::VERBOSITY_NORMAL : $verbosity;
- $this->formatter = $formatter ?: new OutputFormatter();
+ $this->formatter = $formatter ?? new OutputFormatter();
$this->formatter->setDecorated($decorated);
}
@@ -163,7 +163,7 @@ abstract class Output implements OutputInterface
break;
}
- $this->doWrite($message, $newline);
+ $this->doWrite($message ?? '', $newline);
}
}
diff --git a/vendor/symfony/console/Output/OutputInterface.php b/vendor/symfony/console/Output/OutputInterface.php
index 0dfd12b98..671d5bd78 100644
--- a/vendor/symfony/console/Output/OutputInterface.php
+++ b/vendor/symfony/console/Output/OutputInterface.php
@@ -20,15 +20,15 @@ use Symfony\Component\Console\Formatter\OutputFormatterInterface;
*/
interface OutputInterface
{
- const VERBOSITY_QUIET = 16;
- const VERBOSITY_NORMAL = 32;
- const VERBOSITY_VERBOSE = 64;
- const VERBOSITY_VERY_VERBOSE = 128;
- const VERBOSITY_DEBUG = 256;
+ public const VERBOSITY_QUIET = 16;
+ public const VERBOSITY_NORMAL = 32;
+ public const VERBOSITY_VERBOSE = 64;
+ public const VERBOSITY_VERY_VERBOSE = 128;
+ public const VERBOSITY_DEBUG = 256;
- const OUTPUT_NORMAL = 1;
- const OUTPUT_RAW = 2;
- const OUTPUT_PLAIN = 4;
+ public const OUTPUT_NORMAL = 1;
+ public const OUTPUT_RAW = 2;
+ public const OUTPUT_PLAIN = 4;
/**
* Writes a message to the output.
diff --git a/vendor/symfony/console/Output/StreamOutput.php b/vendor/symfony/console/Output/StreamOutput.php
index 43f7a2f23..9c2243644 100644
--- a/vendor/symfony/console/Output/StreamOutput.php
+++ b/vendor/symfony/console/Output/StreamOutput.php
@@ -12,7 +12,6 @@
namespace Symfony\Component\Console\Output;
use Symfony\Component\Console\Exception\InvalidArgumentException;
-use Symfony\Component\Console\Exception\RuntimeException;
use Symfony\Component\Console\Formatter\OutputFormatterInterface;
/**
@@ -71,13 +70,10 @@ class StreamOutput extends Output
protected function doWrite($message, $newline)
{
if ($newline) {
- $message .= PHP_EOL;
+ $message .= \PHP_EOL;
}
- if (false === @fwrite($this->stream, $message)) {
- // should never happen
- throw new RuntimeException('Unable to write output.');
- }
+ @fwrite($this->stream, $message);
fflush($this->stream);
}
@@ -97,6 +93,11 @@ class StreamOutput extends Output
*/
protected function hasColorSupport()
{
+ // Follow https://no-color.org/
+ if (isset($_SERVER['NO_COLOR']) || false !== getenv('NO_COLOR')) {
+ return false;
+ }
+
if ('Hyper' === getenv('TERM_PROGRAM')) {
return true;
}
diff --git a/vendor/symfony/console/Output/TrimmedBufferOutput.php b/vendor/symfony/console/Output/TrimmedBufferOutput.php
new file mode 100644
index 000000000..87c04a892
--- /dev/null
+++ b/vendor/symfony/console/Output/TrimmedBufferOutput.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\Component\Console\Output;
+
+use Symfony\Component\Console\Exception\InvalidArgumentException;
+use Symfony\Component\Console\Formatter\OutputFormatterInterface;
+
+/**
+ * A BufferedOutput that keeps only the last N chars.
+ *
+ * @author Jérémy Derussé
+ */
+class TrimmedBufferOutput extends Output
+{
+ private $maxLength;
+ private $buffer = '';
+
+ public function __construct(int $maxLength, ?int $verbosity = self::VERBOSITY_NORMAL, bool $decorated = false, OutputFormatterInterface $formatter = null)
+ {
+ if ($maxLength <= 0) {
+ throw new InvalidArgumentException(sprintf('"%s()" expects a strictly positive maxLength. Got %d.', __METHOD__, $maxLength));
+ }
+
+ parent::__construct($verbosity, $decorated, $formatter);
+ $this->maxLength = $maxLength;
+ }
+
+ /**
+ * Empties buffer and returns its content.
+ *
+ * @return string
+ */
+ public function fetch()
+ {
+ $content = $this->buffer;
+ $this->buffer = '';
+
+ return $content;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doWrite($message, $newline)
+ {
+ $this->buffer .= $message;
+
+ if ($newline) {
+ $this->buffer .= \PHP_EOL;
+ }
+
+ $this->buffer = substr($this->buffer, 0 - $this->maxLength);
+ }
+}
diff --git a/vendor/symfony/console/Question/ChoiceQuestion.php b/vendor/symfony/console/Question/ChoiceQuestion.php
index 44b70abf1..6247ca716 100644
--- a/vendor/symfony/console/Question/ChoiceQuestion.php
+++ b/vendor/symfony/console/Question/ChoiceQuestion.php
@@ -131,13 +131,19 @@ class ChoiceQuestion extends Question
return function ($selected) use ($choices, $errorMessage, $multiselect, $isAssoc) {
if ($multiselect) {
// Check for a separated comma values
- if (!preg_match('/^[^,]+(?:,[^,]+)*$/', $selected, $matches)) {
+ if (!preg_match('/^[^,]+(?:,[^,]+)*$/', (string) $selected, $matches)) {
throw new InvalidArgumentException(sprintf($errorMessage, $selected));
}
- $selectedChoices = array_map('trim', explode(',', $selected));
+ $selectedChoices = explode(',', (string) $selected);
} else {
- $selectedChoices = [trim($selected)];
+ $selectedChoices = [$selected];
+ }
+
+ if ($this->isTrimmable()) {
+ foreach ($selectedChoices as $k => $v) {
+ $selectedChoices[$k] = trim((string) $v);
+ }
}
$multiselectChoices = [];
@@ -150,7 +156,7 @@ class ChoiceQuestion extends Question
}
if (\count($results) > 1) {
- throw new InvalidArgumentException(sprintf('The provided answer is ambiguous. Value should be one of %s.', implode(' or ', $results)));
+ throw new InvalidArgumentException(sprintf('The provided answer is ambiguous. Value should be one of "%s".', implode('" or "', $results)));
}
$result = array_search($value, $choices);
diff --git a/vendor/symfony/console/Question/ConfirmationQuestion.php b/vendor/symfony/console/Question/ConfirmationQuestion.php
index 88227dfa6..4228521b9 100644
--- a/vendor/symfony/console/Question/ConfirmationQuestion.php
+++ b/vendor/symfony/console/Question/ConfirmationQuestion.php
@@ -35,10 +35,8 @@ class ConfirmationQuestion extends Question
/**
* Returns the default answer normalizer.
- *
- * @return callable
*/
- private function getDefaultNormalizer()
+ private function getDefaultNormalizer(): callable
{
$default = $this->getDefault();
$regex = $this->trueAnswerRegex;
diff --git a/vendor/symfony/console/Question/Question.php b/vendor/symfony/console/Question/Question.php
index eac82cfad..cc108018f 100644
--- a/vendor/symfony/console/Question/Question.php
+++ b/vendor/symfony/console/Question/Question.php
@@ -25,14 +25,15 @@ class Question
private $attempts;
private $hidden = false;
private $hiddenFallback = true;
- private $autocompleterValues;
+ private $autocompleterCallback;
private $validator;
private $default;
private $normalizer;
+ private $trimmable = true;
/**
- * @param string $question The question to ask to the user
- * @param mixed $default The default answer to return if the user enters nothing
+ * @param string $question The question to ask to the user
+ * @param string|bool|int|float|null $default The default answer to return if the user enters nothing
*/
public function __construct(string $question, $default = null)
{
@@ -53,7 +54,7 @@ class Question
/**
* Returns the default answer.
*
- * @return mixed
+ * @return string|bool|int|float|null
*/
public function getDefault()
{
@@ -81,7 +82,7 @@ class Question
*/
public function setHidden($hidden)
{
- if ($this->autocompleterValues) {
+ if ($this->autocompleterCallback) {
throw new LogicException('A hidden question cannot use the autocompleter.');
}
@@ -121,7 +122,9 @@ class Question
*/
public function getAutocompleterValues()
{
- return $this->autocompleterValues;
+ $callback = $this->getAutocompleterCallback();
+
+ return $callback ? $callback('') : null;
}
/**
@@ -138,17 +141,46 @@ class Question
{
if (\is_array($values)) {
$values = $this->isAssoc($values) ? array_merge(array_keys($values), array_values($values)) : array_values($values);
- }
- if (null !== $values && !\is_array($values) && !$values instanceof \Traversable) {
+ $callback = static function () use ($values) {
+ return $values;
+ };
+ } elseif ($values instanceof \Traversable) {
+ $valueCache = null;
+ $callback = static function () use ($values, &$valueCache) {
+ return $valueCache ?? $valueCache = iterator_to_array($values, false);
+ };
+ } elseif (null === $values) {
+ $callback = null;
+ } else {
throw new InvalidArgumentException('Autocompleter values can be either an array, "null" or a "Traversable" object.');
}
- if ($this->hidden) {
+ return $this->setAutocompleterCallback($callback);
+ }
+
+ /**
+ * Gets the callback function used for the autocompleter.
+ */
+ public function getAutocompleterCallback(): ?callable
+ {
+ return $this->autocompleterCallback;
+ }
+
+ /**
+ * Sets the callback function used for the autocompleter.
+ *
+ * The callback is passed the user input as argument and should return an iterable of corresponding suggestions.
+ *
+ * @return $this
+ */
+ public function setAutocompleterCallback(callable $callback = null): self
+ {
+ if ($this->hidden && null !== $callback) {
throw new LogicException('A hidden question cannot use the autocompleter.');
}
- $this->autocompleterValues = $values;
+ $this->autocompleterCallback = $callback;
return $this;
}
@@ -156,8 +188,6 @@ class Question
/**
* Sets a validator for the question.
*
- * @param callable|null $validator
- *
* @return $this
*/
public function setValidator(callable $validator = null)
@@ -190,8 +220,11 @@ class Question
*/
public function setMaxAttempts($attempts)
{
- if (null !== $attempts && $attempts < 1) {
- throw new InvalidArgumentException('Maximum number of attempts must be a positive value.');
+ if (null !== $attempts) {
+ $attempts = (int) $attempts;
+ if ($attempts < 1) {
+ throw new InvalidArgumentException('Maximum number of attempts must be a positive value.');
+ }
}
$this->attempts = $attempts;
@@ -216,8 +249,6 @@ class Question
*
* The normalizer can be a callable (a string), a closure or a class implementing __invoke.
*
- * @param callable $normalizer
- *
* @return $this
*/
public function setNormalizer(callable $normalizer)
@@ -232,7 +263,7 @@ class Question
*
* The normalizer can ba a callable (a string), a closure or a class implementing __invoke.
*
- * @return callable
+ * @return callable|null
*/
public function getNormalizer()
{
@@ -243,4 +274,19 @@ class Question
{
return (bool) \count(array_filter(array_keys($array), 'is_string'));
}
+
+ public function isTrimmable(): bool
+ {
+ return $this->trimmable;
+ }
+
+ /**
+ * @return $this
+ */
+ public function setTrimmable(bool $trimmable): self
+ {
+ $this->trimmable = $trimmable;
+
+ return $this;
+ }
}
diff --git a/vendor/symfony/console/README.md b/vendor/symfony/console/README.md
index 664a37c0e..c89b4a1a2 100644
--- a/vendor/symfony/console/README.md
+++ b/vendor/symfony/console/README.md
@@ -7,11 +7,11 @@ interfaces.
Resources
---------
- * [Documentation](https://symfony.com/doc/current/components/console/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)
+ * [Documentation](https://symfony.com/doc/current/components/console.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)
Credits
-------
diff --git a/vendor/symfony/console/Style/OutputStyle.php b/vendor/symfony/console/Style/OutputStyle.php
index b1262b55d..14d2d60b2 100644
--- a/vendor/symfony/console/Style/OutputStyle.php
+++ b/vendor/symfony/console/Style/OutputStyle.php
@@ -35,7 +35,7 @@ abstract class OutputStyle implements OutputInterface, StyleInterface
*/
public function newLine($count = 1)
{
- $this->output->write(str_repeat(PHP_EOL, $count));
+ $this->output->write(str_repeat(\PHP_EOL, $count));
}
/**
diff --git a/vendor/symfony/console/Style/StyleInterface.php b/vendor/symfony/console/Style/StyleInterface.php
index 475c268ff..3b5b8af51 100644
--- a/vendor/symfony/console/Style/StyleInterface.php
+++ b/vendor/symfony/console/Style/StyleInterface.php
@@ -119,7 +119,6 @@ interface StyleInterface
* Asks a choice question.
*
* @param string $question
- * @param array $choices
* @param string|int|null $default
*
* @return mixed
diff --git a/vendor/symfony/console/Style/SymfonyStyle.php b/vendor/symfony/console/Style/SymfonyStyle.php
index b46162de6..66db3ad5a 100644
--- a/vendor/symfony/console/Style/SymfonyStyle.php
+++ b/vendor/symfony/console/Style/SymfonyStyle.php
@@ -11,15 +11,18 @@
namespace Symfony\Component\Console\Style;
+use Symfony\Component\Console\Exception\InvalidArgumentException;
use Symfony\Component\Console\Exception\RuntimeException;
use Symfony\Component\Console\Formatter\OutputFormatter;
use Symfony\Component\Console\Helper\Helper;
use Symfony\Component\Console\Helper\ProgressBar;
use Symfony\Component\Console\Helper\SymfonyQuestionHelper;
use Symfony\Component\Console\Helper\Table;
+use Symfony\Component\Console\Helper\TableCell;
+use Symfony\Component\Console\Helper\TableSeparator;
use Symfony\Component\Console\Input\InputInterface;
-use Symfony\Component\Console\Output\BufferedOutput;
use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Output\TrimmedBufferOutput;
use Symfony\Component\Console\Question\ChoiceQuestion;
use Symfony\Component\Console\Question\ConfirmationQuestion;
use Symfony\Component\Console\Question\Question;
@@ -32,7 +35,7 @@ use Symfony\Component\Console\Terminal;
*/
class SymfonyStyle extends OutputStyle
{
- const MAX_LINE_LENGTH = 120;
+ public const MAX_LINE_LENGTH = 120;
private $input;
private $questionHelper;
@@ -43,7 +46,7 @@ class SymfonyStyle extends OutputStyle
public function __construct(InputInterface $input, OutputInterface $output)
{
$this->input = $input;
- $this->bufferedOutput = new BufferedOutput($output->getVerbosity(), false, clone $output->getFormatter());
+ $this->bufferedOutput = new TrimmedBufferOutput(\DIRECTORY_SEPARATOR === '\\' ? 4 : 2, $output->getVerbosity(), false, clone $output->getFormatter());
// Windows cmd wraps lines as soon as the terminal width is reached, whether there are following chars or not.
$width = (new Terminal())->getWidth() ?: self::MAX_LINE_LENGTH;
$this->lineLength = min($width - (int) (\DIRECTORY_SEPARATOR === '\\'), self::MAX_LINE_LENGTH);
@@ -154,7 +157,7 @@ class SymfonyStyle extends OutputStyle
*/
public function warning($message)
{
- $this->block($message, 'WARNING', 'fg=white;bg=red', ' ', true);
+ $this->block($message, 'WARNING', 'fg=black;bg=yellow', ' ', true);
}
/**
@@ -190,6 +193,69 @@ class SymfonyStyle extends OutputStyle
$this->newLine();
}
+ /**
+ * Formats a horizontal table.
+ */
+ public function horizontalTable(array $headers, array $rows)
+ {
+ $style = clone Table::getStyleDefinition('symfony-style-guide');
+ $style->setCellHeaderFormat('%s');
+
+ $table = new Table($this);
+ $table->setHeaders($headers);
+ $table->setRows($rows);
+ $table->setStyle($style);
+ $table->setHorizontal(true);
+
+ $table->render();
+ $this->newLine();
+ }
+
+ /**
+ * Formats a list of key/value horizontally.
+ *
+ * Each row can be one of:
+ * * 'A title'
+ * * ['key' => 'value']
+ * * new TableSeparator()
+ *
+ * @param string|array|TableSeparator ...$list
+ */
+ public function definitionList(...$list)
+ {
+ $style = clone Table::getStyleDefinition('symfony-style-guide');
+ $style->setCellHeaderFormat('%s');
+
+ $table = new Table($this);
+ $headers = [];
+ $row = [];
+ foreach ($list as $value) {
+ if ($value instanceof TableSeparator) {
+ $headers[] = $value;
+ $row[] = $value;
+ continue;
+ }
+ if (\is_string($value)) {
+ $headers[] = new TableCell($value, ['colspan' => 2]);
+ $row[] = null;
+ continue;
+ }
+ if (!\is_array($value)) {
+ throw new InvalidArgumentException('Value should be an array, string, or an instance of TableSeparator.');
+ }
+ $headers[] = key($value);
+ $row[] = current($value);
+ }
+
+ $table->setHeaders($headers);
+ $table->setRows([$row]);
+ $table->setHorizontal();
+ $table->setStyle($style);
+
+ $table->render();
+ $this->newLine();
+ }
+
/**
* {@inheritdoc}
*/
@@ -229,7 +295,7 @@ class SymfonyStyle extends OutputStyle
{
if (null !== $default) {
$values = array_flip($choices);
- $default = $values[$default];
+ $default = $values[$default] ?? $default;
}
return $this->askQuestion(new ChoiceQuestion($question, $choices, $default));
@@ -361,7 +427,7 @@ class SymfonyStyle extends OutputStyle
private function autoPrependBlock(): void
{
- $chars = substr(str_replace(PHP_EOL, "\n", $this->bufferedOutput->fetch()), -2);
+ $chars = substr(str_replace(\PHP_EOL, "\n", $this->bufferedOutput->fetch()), -2);
if (!isset($chars[0])) {
$this->newLine(); //empty history, so we should start with a new line.
@@ -376,19 +442,18 @@ class SymfonyStyle extends OutputStyle
{
$fetched = $this->bufferedOutput->fetch();
//Prepend new line if last char isn't EOL:
- if ("\n" !== substr($fetched, -1)) {
+ if (!str_ends_with($fetched, "\n")) {
$this->newLine();
}
}
private function writeBuffer(string $message, bool $newLine, int $type): void
{
- // We need to know if the two last chars are PHP_EOL
- // Preserve the last 4 chars inserted (PHP_EOL on windows is two chars) in the history buffer
- $this->bufferedOutput->write(substr($message, -4), $newLine, $type);
+ // We need to know if the last chars are PHP_EOL
+ $this->bufferedOutput->write($message, $newLine, $type);
}
- private function createBlock(iterable $messages, string $type = null, string $style = null, string $prefix = ' ', bool $padding = false, bool $escape = false)
+ private function createBlock(iterable $messages, string $type = null, string $style = null, string $prefix = ' ', bool $padding = false, bool $escape = false): array
{
$indentLength = 0;
$prefixLength = Helper::strlenWithoutDecoration($this->getFormatter(), $prefix);
@@ -406,7 +471,12 @@ class SymfonyStyle extends OutputStyle
$message = OutputFormatter::escape($message);
}
- $lines = array_merge($lines, explode(PHP_EOL, wordwrap($message, $this->lineLength - $prefixLength - $indentLength, PHP_EOL, true)));
+ $decorationLength = Helper::strlen($message) - Helper::strlenWithoutDecoration($this->getFormatter(), $message);
+ $messageLineLength = min($this->lineLength - $prefixLength - $indentLength + $decorationLength, $this->lineLength);
+ $messageLines = explode(\PHP_EOL, wordwrap($message, $messageLineLength, \PHP_EOL, true));
+ foreach ($messageLines as $messageLine) {
+ $lines[] = $messageLine;
+ }
if (\count($messages) > 1 && $key < \count($messages) - 1) {
$lines[] = '';
@@ -426,7 +496,7 @@ class SymfonyStyle extends OutputStyle
}
$line = $prefix.$line;
- $line .= str_repeat(' ', $this->lineLength - Helper::strlenWithoutDecoration($this->getFormatter(), $line));
+ $line .= str_repeat(' ', max($this->lineLength - Helper::strlenWithoutDecoration($this->getFormatter(), $line), 0));
if ($style) {
$line = sprintf('<%s>%s>', $style, $line);
diff --git a/vendor/symfony/console/Terminal.php b/vendor/symfony/console/Terminal.php
index 456cca11c..5e5a3c2f7 100644
--- a/vendor/symfony/console/Terminal.php
+++ b/vendor/symfony/console/Terminal.php
@@ -15,6 +15,7 @@ class Terminal
{
private static $width;
private static $height;
+ private static $stty;
/**
* Gets the terminal width.
@@ -54,6 +55,27 @@ class Terminal
return self::$height ?: 50;
}
+ /**
+ * @internal
+ *
+ * @return bool
+ */
+ public static function hasSttyAvailable()
+ {
+ if (null !== self::$stty) {
+ return self::$stty;
+ }
+
+ // skip check if exec function is disabled
+ if (!\function_exists('exec')) {
+ return false;
+ }
+
+ exec('stty 2>&1', $output, $exitcode);
+
+ return self::$stty = 0 === $exitcode;
+ }
+
private static function initDimensions()
{
if ('\\' === \DIRECTORY_SEPARATOR) {
@@ -62,12 +84,34 @@ class Terminal
// or [w, h] from "wxh"
self::$width = (int) $matches[1];
self::$height = isset($matches[4]) ? (int) $matches[4] : (int) $matches[2];
+ } elseif (!self::hasVt100Support() && self::hasSttyAvailable()) {
+ // only use stty on Windows if the terminal does not support vt100 (e.g. Windows 7 + git-bash)
+ // testing for stty in a Windows 10 vt100-enabled console will implicitly disable vt100 support on STDOUT
+ self::initDimensionsUsingStty();
} elseif (null !== $dimensions = self::getConsoleMode()) {
// extract [w, h] from "wxh"
self::$width = (int) $dimensions[0];
self::$height = (int) $dimensions[1];
}
- } elseif ($sttyString = self::getSttyColumns()) {
+ } else {
+ self::initDimensionsUsingStty();
+ }
+ }
+
+ /**
+ * Returns whether STDOUT has vt100 support (some Windows 10+ configurations).
+ */
+ private static function hasVt100Support(): bool
+ {
+ return \function_exists('sapi_windows_vt100_support') && sapi_windows_vt100_support(fopen('php://stdout', 'w'));
+ }
+
+ /**
+ * Initializes dimensions using the output of an stty columns line.
+ */
+ private static function initDimensionsUsingStty()
+ {
+ if ($sttyString = self::getSttyColumns()) {
if (preg_match('/rows.(\d+);.columns.(\d+);/i', $sttyString, $matches)) {
// extract [w, h] from "rows h; columns w;"
self::$width = (int) $matches[2];
@@ -85,38 +129,29 @@ class Terminal
*
* @return int[]|null An array composed of the width and the height or null if it could not be parsed
*/
- private static function getConsoleMode()
+ private static function getConsoleMode(): ?array
{
- if (!\function_exists('proc_open')) {
- return;
+ $info = self::readFromProcess('mode CON');
+
+ if (null === $info || !preg_match('/--------+\r?\n.+?(\d+)\r?\n.+?(\d+)\r?\n/', $info, $matches)) {
+ return null;
}
- $descriptorspec = [
- 1 => ['pipe', 'w'],
- 2 => ['pipe', 'w'],
- ];
- $process = proc_open('mode CON', $descriptorspec, $pipes, null, null, ['suppress_errors' => true]);
- if (\is_resource($process)) {
- $info = stream_get_contents($pipes[1]);
- fclose($pipes[1]);
- fclose($pipes[2]);
- proc_close($process);
-
- if (preg_match('/--------+\r?\n.+?(\d+)\r?\n.+?(\d+)\r?\n/', $info, $matches)) {
- return [(int) $matches[2], (int) $matches[1]];
- }
- }
+ return [(int) $matches[2], (int) $matches[1]];
}
/**
* Runs and parses stty -a if it's available, suppressing any error output.
- *
- * @return string|null
*/
- private static function getSttyColumns()
+ private static function getSttyColumns(): ?string
+ {
+ return self::readFromProcess('stty -a | grep columns');
+ }
+
+ private static function readFromProcess(string $command): ?string
{
if (!\function_exists('proc_open')) {
- return;
+ return null;
}
$descriptorspec = [
@@ -124,14 +159,16 @@ class Terminal
2 => ['pipe', 'w'],
];
- $process = proc_open('stty -a | grep columns', $descriptorspec, $pipes, null, null, ['suppress_errors' => true]);
- if (\is_resource($process)) {
- $info = stream_get_contents($pipes[1]);
- fclose($pipes[1]);
- fclose($pipes[2]);
- proc_close($process);
-
- return $info;
+ $process = proc_open($command, $descriptorspec, $pipes, null, null, ['suppress_errors' => true]);
+ if (!\is_resource($process)) {
+ return null;
}
+
+ $info = stream_get_contents($pipes[1]);
+ fclose($pipes[1]);
+ fclose($pipes[2]);
+ proc_close($process);
+
+ return $info;
}
}
diff --git a/vendor/symfony/console/Tester/ApplicationTester.php b/vendor/symfony/console/Tester/ApplicationTester.php
index ced56cff2..4f99da18d 100644
--- a/vendor/symfony/console/Tester/ApplicationTester.php
+++ b/vendor/symfony/console/Tester/ApplicationTester.php
@@ -59,19 +59,12 @@ class ApplicationTester
$this->input->setInteractive($options['interactive']);
}
- $shellInteractive = getenv('SHELL_INTERACTIVE');
-
if ($this->inputs) {
$this->input->setStream(self::createStream($this->inputs));
- putenv('SHELL_INTERACTIVE=1');
}
$this->initOutput($options);
- $this->statusCode = $this->application->run($this->input, $this->output);
-
- putenv($shellInteractive ? "SHELL_INTERACTIVE=$shellInteractive" : 'SHELL_INTERACTIVE');
-
- return $this->statusCode;
+ return $this->statusCode = $this->application->run($this->input, $this->output);
}
}
diff --git a/vendor/symfony/console/Tester/TesterTrait.php b/vendor/symfony/console/Tester/TesterTrait.php
index 5b7e993a8..27d598559 100644
--- a/vendor/symfony/console/Tester/TesterTrait.php
+++ b/vendor/symfony/console/Tester/TesterTrait.php
@@ -44,7 +44,7 @@ trait TesterTrait
$display = stream_get_contents($this->output->getStream());
if ($normalize) {
- $display = str_replace(PHP_EOL, "\n", $display);
+ $display = str_replace(\PHP_EOL, "\n", $display);
}
return $display;
@@ -68,7 +68,7 @@ trait TesterTrait
$display = stream_get_contents($this->output->getErrorOutput()->getStream());
if ($normalize) {
- $display = str_replace(PHP_EOL, "\n", $display);
+ $display = str_replace(\PHP_EOL, "\n", $display);
}
return $display;
@@ -110,7 +110,7 @@ trait TesterTrait
* @param array $inputs An array of strings representing each input
* passed to the command input stream
*
- * @return self
+ * @return $this
*/
public function setInputs(array $inputs)
{
@@ -141,8 +141,8 @@ trait TesterTrait
}
} else {
$this->output = new ConsoleOutput(
- isset($options['verbosity']) ? $options['verbosity'] : ConsoleOutput::VERBOSITY_NORMAL,
- isset($options['decorated']) ? $options['decorated'] : null
+ $options['verbosity'] ?? ConsoleOutput::VERBOSITY_NORMAL,
+ $options['decorated'] ?? null
);
$errorOutput = new StreamOutput(fopen('php://memory', 'w', false));
@@ -162,12 +162,15 @@ trait TesterTrait
}
}
+ /**
+ * @return resource
+ */
private static function createStream(array $inputs)
{
$stream = fopen('php://memory', 'r+', false);
foreach ($inputs as $input) {
- fwrite($stream, $input.PHP_EOL);
+ fwrite($stream, $input.\PHP_EOL);
}
rewind($stream);
diff --git a/vendor/symfony/console/Tests/ApplicationTest.php b/vendor/symfony/console/Tests/ApplicationTest.php
deleted file mode 100644
index e153e5609..000000000
--- a/vendor/symfony/console/Tests/ApplicationTest.php
+++ /dev/null
@@ -1,1836 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Console\Tests;
-
-use PHPUnit\Framework\TestCase;
-use Symfony\Component\Console\Application;
-use Symfony\Component\Console\Command\Command;
-use Symfony\Component\Console\CommandLoader\FactoryCommandLoader;
-use Symfony\Component\Console\DependencyInjection\AddConsoleCommandPass;
-use Symfony\Component\Console\Event\ConsoleCommandEvent;
-use Symfony\Component\Console\Event\ConsoleErrorEvent;
-use Symfony\Component\Console\Event\ConsoleTerminateEvent;
-use Symfony\Component\Console\Exception\CommandNotFoundException;
-use Symfony\Component\Console\Exception\NamespaceNotFoundException;
-use Symfony\Component\Console\Helper\FormatterHelper;
-use Symfony\Component\Console\Helper\HelperSet;
-use Symfony\Component\Console\Input\ArgvInput;
-use Symfony\Component\Console\Input\ArrayInput;
-use Symfony\Component\Console\Input\InputArgument;
-use Symfony\Component\Console\Input\InputDefinition;
-use Symfony\Component\Console\Input\InputInterface;
-use Symfony\Component\Console\Input\InputOption;
-use Symfony\Component\Console\Output\NullOutput;
-use Symfony\Component\Console\Output\Output;
-use Symfony\Component\Console\Output\OutputInterface;
-use Symfony\Component\Console\Output\StreamOutput;
-use Symfony\Component\Console\Tester\ApplicationTester;
-use Symfony\Component\DependencyInjection\ContainerBuilder;
-use Symfony\Component\EventDispatcher\EventDispatcher;
-
-class ApplicationTest extends TestCase
-{
- protected static $fixturesPath;
-
- private $colSize;
-
- protected function setUp()
- {
- $this->colSize = getenv('COLUMNS');
- }
-
- protected function tearDown()
- {
- putenv($this->colSize ? 'COLUMNS='.$this->colSize : 'COLUMNS');
- putenv('SHELL_VERBOSITY');
- unset($_ENV['SHELL_VERBOSITY']);
- unset($_SERVER['SHELL_VERBOSITY']);
- }
-
- public static function setUpBeforeClass()
- {
- self::$fixturesPath = realpath(__DIR__.'/Fixtures/');
- require_once self::$fixturesPath.'/FooCommand.php';
- require_once self::$fixturesPath.'/FooOptCommand.php';
- require_once self::$fixturesPath.'/Foo1Command.php';
- require_once self::$fixturesPath.'/Foo2Command.php';
- require_once self::$fixturesPath.'/Foo3Command.php';
- require_once self::$fixturesPath.'/Foo4Command.php';
- require_once self::$fixturesPath.'/Foo5Command.php';
- require_once self::$fixturesPath.'/FooSameCaseUppercaseCommand.php';
- require_once self::$fixturesPath.'/FooSameCaseLowercaseCommand.php';
- require_once self::$fixturesPath.'/FoobarCommand.php';
- require_once self::$fixturesPath.'/BarBucCommand.php';
- require_once self::$fixturesPath.'/FooSubnamespaced1Command.php';
- require_once self::$fixturesPath.'/FooSubnamespaced2Command.php';
- require_once self::$fixturesPath.'/FooWithoutAliasCommand.php';
- require_once self::$fixturesPath.'/TestAmbiguousCommandRegistering.php';
- require_once self::$fixturesPath.'/TestAmbiguousCommandRegistering2.php';
- }
-
- protected function normalizeLineBreaks($text)
- {
- return str_replace(PHP_EOL, "\n", $text);
- }
-
- /**
- * Replaces the dynamic placeholders of the command help text with a static version.
- * The placeholder %command.full_name% includes the script path that is not predictable
- * and can not be tested against.
- */
- protected function ensureStaticCommandHelp(Application $application)
- {
- foreach ($application->all() as $command) {
- $command->setHelp(str_replace('%command.full_name%', 'app/console %command.name%', $command->getHelp()));
- }
- }
-
- public function testConstructor()
- {
- $application = new Application('foo', 'bar');
- $this->assertEquals('foo', $application->getName(), '__construct() takes the application name as its first argument');
- $this->assertEquals('bar', $application->getVersion(), '__construct() takes the application version as its second argument');
- $this->assertEquals(['help', 'list'], array_keys($application->all()), '__construct() registered the help and list commands by default');
- }
-
- public function testSetGetName()
- {
- $application = new Application();
- $application->setName('foo');
- $this->assertEquals('foo', $application->getName(), '->setName() sets the name of the application');
- }
-
- public function testSetGetVersion()
- {
- $application = new Application();
- $application->setVersion('bar');
- $this->assertEquals('bar', $application->getVersion(), '->setVersion() sets the version of the application');
- }
-
- public function testGetLongVersion()
- {
- $application = new Application('foo', 'bar');
- $this->assertEquals('foo bar', $application->getLongVersion(), '->getLongVersion() returns the long version of the application');
- }
-
- public function testHelp()
- {
- $application = new Application();
- $this->assertStringEqualsFile(self::$fixturesPath.'/application_gethelp.txt', $this->normalizeLineBreaks($application->getHelp()), '->getHelp() returns a help message');
- }
-
- public function testAll()
- {
- $application = new Application();
- $commands = $application->all();
- $this->assertInstanceOf('Symfony\\Component\\Console\\Command\\HelpCommand', $commands['help'], '->all() returns the registered commands');
-
- $application->add(new \FooCommand());
- $commands = $application->all('foo');
- $this->assertCount(1, $commands, '->all() takes a namespace as its first argument');
- }
-
- public function testAllWithCommandLoader()
- {
- $application = new Application();
- $commands = $application->all();
- $this->assertInstanceOf('Symfony\\Component\\Console\\Command\\HelpCommand', $commands['help'], '->all() returns the registered commands');
-
- $application->add(new \FooCommand());
- $commands = $application->all('foo');
- $this->assertCount(1, $commands, '->all() takes a namespace as its first argument');
-
- $application->setCommandLoader(new FactoryCommandLoader([
- 'foo:bar1' => function () { return new \Foo1Command(); },
- ]));
- $commands = $application->all('foo');
- $this->assertCount(2, $commands, '->all() takes a namespace as its first argument');
- $this->assertInstanceOf(\FooCommand::class, $commands['foo:bar'], '->all() returns the registered commands');
- $this->assertInstanceOf(\Foo1Command::class, $commands['foo:bar1'], '->all() returns the registered commands');
- }
-
- public function testRegister()
- {
- $application = new Application();
- $command = $application->register('foo');
- $this->assertEquals('foo', $command->getName(), '->register() registers a new command');
- }
-
- public function testRegisterAmbiguous()
- {
- $code = function (InputInterface $input, OutputInterface $output) {
- $output->writeln('It works!');
- };
-
- $application = new Application();
- $application->setAutoExit(false);
- $application
- ->register('test-foo')
- ->setAliases(['test'])
- ->setCode($code);
-
- $application
- ->register('test-bar')
- ->setCode($code);
-
- $tester = new ApplicationTester($application);
- $tester->run(['test']);
- $this->assertContains('It works!', $tester->getDisplay(true));
- }
-
- public function testAdd()
- {
- $application = new Application();
- $application->add($foo = new \FooCommand());
- $commands = $application->all();
- $this->assertEquals($foo, $commands['foo:bar'], '->add() registers a command');
-
- $application = new Application();
- $application->addCommands([$foo = new \FooCommand(), $foo1 = new \Foo1Command()]);
- $commands = $application->all();
- $this->assertEquals([$foo, $foo1], [$commands['foo:bar'], $commands['foo:bar1']], '->addCommands() registers an array of commands');
- }
-
- /**
- * @expectedException \LogicException
- * @expectedExceptionMessage Command class "Foo5Command" is not correctly initialized. You probably forgot to call the parent constructor.
- */
- public function testAddCommandWithEmptyConstructor()
- {
- $application = new Application();
- $application->add(new \Foo5Command());
- }
-
- public function testHasGet()
- {
- $application = new Application();
- $this->assertTrue($application->has('list'), '->has() returns true if a named command is registered');
- $this->assertFalse($application->has('afoobar'), '->has() returns false if a named command is not registered');
-
- $application->add($foo = new \FooCommand());
- $this->assertTrue($application->has('afoobar'), '->has() returns true if an alias is registered');
- $this->assertEquals($foo, $application->get('foo:bar'), '->get() returns a command by name');
- $this->assertEquals($foo, $application->get('afoobar'), '->get() returns a command by alias');
-
- $application = new Application();
- $application->add($foo = new \FooCommand());
- // simulate --help
- $r = new \ReflectionObject($application);
- $p = $r->getProperty('wantHelps');
- $p->setAccessible(true);
- $p->setValue($application, true);
- $command = $application->get('foo:bar');
- $this->assertInstanceOf('Symfony\Component\Console\Command\HelpCommand', $command, '->get() returns the help command if --help is provided as the input');
- }
-
- public function testHasGetWithCommandLoader()
- {
- $application = new Application();
- $this->assertTrue($application->has('list'), '->has() returns true if a named command is registered');
- $this->assertFalse($application->has('afoobar'), '->has() returns false if a named command is not registered');
-
- $application->add($foo = new \FooCommand());
- $this->assertTrue($application->has('afoobar'), '->has() returns true if an alias is registered');
- $this->assertEquals($foo, $application->get('foo:bar'), '->get() returns a command by name');
- $this->assertEquals($foo, $application->get('afoobar'), '->get() returns a command by alias');
-
- $application->setCommandLoader(new FactoryCommandLoader([
- 'foo:bar1' => function () { return new \Foo1Command(); },
- ]));
-
- $this->assertTrue($application->has('afoobar'), '->has() returns true if an instance is registered for an alias even with command loader');
- $this->assertEquals($foo, $application->get('foo:bar'), '->get() returns an instance by name even with command loader');
- $this->assertEquals($foo, $application->get('afoobar'), '->get() returns an instance by alias even with command loader');
- $this->assertTrue($application->has('foo:bar1'), '->has() returns true for commands registered in the loader');
- $this->assertInstanceOf(\Foo1Command::class, $foo1 = $application->get('foo:bar1'), '->get() returns a command by name from the command loader');
- $this->assertTrue($application->has('afoobar1'), '->has() returns true for commands registered in the loader');
- $this->assertEquals($foo1, $application->get('afoobar1'), '->get() returns a command by name from the command loader');
- }
-
- public function testSilentHelp()
- {
- $application = new Application();
- $application->setAutoExit(false);
- $application->setCatchExceptions(false);
-
- $tester = new ApplicationTester($application);
- $tester->run(['-h' => true, '-q' => true], ['decorated' => false]);
-
- $this->assertEmpty($tester->getDisplay(true));
- }
-
- /**
- * @expectedException \Symfony\Component\Console\Exception\CommandNotFoundException
- * @expectedExceptionMessage The command "foofoo" does not exist.
- */
- public function testGetInvalidCommand()
- {
- $application = new Application();
- $application->get('foofoo');
- }
-
- public function testGetNamespaces()
- {
- $application = new Application();
- $application->add(new \FooCommand());
- $application->add(new \Foo1Command());
- $this->assertEquals(['foo'], $application->getNamespaces(), '->getNamespaces() returns an array of unique used namespaces');
- }
-
- public function testFindNamespace()
- {
- $application = new Application();
- $application->add(new \FooCommand());
- $this->assertEquals('foo', $application->findNamespace('foo'), '->findNamespace() returns the given namespace if it exists');
- $this->assertEquals('foo', $application->findNamespace('f'), '->findNamespace() finds a namespace given an abbreviation');
- $application->add(new \Foo2Command());
- $this->assertEquals('foo', $application->findNamespace('foo'), '->findNamespace() returns the given namespace if it exists');
- }
-
- public function testFindNamespaceWithSubnamespaces()
- {
- $application = new Application();
- $application->add(new \FooSubnamespaced1Command());
- $application->add(new \FooSubnamespaced2Command());
- $this->assertEquals('foo', $application->findNamespace('foo'), '->findNamespace() returns commands even if the commands are only contained in subnamespaces');
- }
-
- public function testFindAmbiguousNamespace()
- {
- $application = new Application();
- $application->add(new \BarBucCommand());
- $application->add(new \FooCommand());
- $application->add(new \Foo2Command());
-
- $expectedMsg = "The namespace \"f\" is ambiguous.\nDid you mean one of these?\n foo\n foo1";
-
- if (method_exists($this, 'expectException')) {
- $this->expectException(NamespaceNotFoundException::class);
- $this->expectExceptionMessage($expectedMsg);
- } else {
- $this->setExpectedException(NamespaceNotFoundException::class, $expectedMsg);
- }
-
- $application->findNamespace('f');
- }
-
- public function testFindNonAmbiguous()
- {
- $application = new Application();
- $application->add(new \TestAmbiguousCommandRegistering());
- $application->add(new \TestAmbiguousCommandRegistering2());
- $this->assertEquals('test-ambiguous', $application->find('test')->getName());
- }
-
- /**
- * @expectedException \Symfony\Component\Console\Exception\NamespaceNotFoundException
- * @expectedExceptionMessage There are no commands defined in the "bar" namespace.
- */
- public function testFindInvalidNamespace()
- {
- $application = new Application();
- $application->findNamespace('bar');
- }
-
- /**
- * @expectedException \Symfony\Component\Console\Exception\CommandNotFoundException
- * @expectedExceptionMessage Command "foo1" is not defined
- */
- public function testFindUniqueNameButNamespaceName()
- {
- $application = new Application();
- $application->add(new \FooCommand());
- $application->add(new \Foo1Command());
- $application->add(new \Foo2Command());
-
- $application->find($commandName = 'foo1');
- }
-
- public function testFind()
- {
- $application = new Application();
- $application->add(new \FooCommand());
-
- $this->assertInstanceOf('FooCommand', $application->find('foo:bar'), '->find() returns a command if its name exists');
- $this->assertInstanceOf('Symfony\Component\Console\Command\HelpCommand', $application->find('h'), '->find() returns a command if its name exists');
- $this->assertInstanceOf('FooCommand', $application->find('f:bar'), '->find() returns a command if the abbreviation for the namespace exists');
- $this->assertInstanceOf('FooCommand', $application->find('f:b'), '->find() returns a command if the abbreviation for the namespace and the command name exist');
- $this->assertInstanceOf('FooCommand', $application->find('a'), '->find() returns a command if the abbreviation exists for an alias');
- }
-
- public function testFindCaseSensitiveFirst()
- {
- $application = new Application();
- $application->add(new \FooSameCaseUppercaseCommand());
- $application->add(new \FooSameCaseLowercaseCommand());
-
- $this->assertInstanceOf('FooSameCaseUppercaseCommand', $application->find('f:B'), '->find() returns a command if the abbreviation is the correct case');
- $this->assertInstanceOf('FooSameCaseUppercaseCommand', $application->find('f:BAR'), '->find() returns a command if the abbreviation is the correct case');
- $this->assertInstanceOf('FooSameCaseLowercaseCommand', $application->find('f:b'), '->find() returns a command if the abbreviation is the correct case');
- $this->assertInstanceOf('FooSameCaseLowercaseCommand', $application->find('f:bar'), '->find() returns a command if the abbreviation is the correct case');
- }
-
- public function testFindCaseInsensitiveAsFallback()
- {
- $application = new Application();
- $application->add(new \FooSameCaseLowercaseCommand());
-
- $this->assertInstanceOf('FooSameCaseLowercaseCommand', $application->find('f:b'), '->find() returns a command if the abbreviation is the correct case');
- $this->assertInstanceOf('FooSameCaseLowercaseCommand', $application->find('f:B'), '->find() will fallback to case insensitivity');
- $this->assertInstanceOf('FooSameCaseLowercaseCommand', $application->find('FoO:BaR'), '->find() will fallback to case insensitivity');
- }
-
- /**
- * @expectedException \Symfony\Component\Console\Exception\CommandNotFoundException
- * @expectedExceptionMessage Command "FoO:BaR" is ambiguous
- */
- public function testFindCaseInsensitiveSuggestions()
- {
- $application = new Application();
- $application->add(new \FooSameCaseLowercaseCommand());
- $application->add(new \FooSameCaseUppercaseCommand());
-
- $this->assertInstanceOf('FooSameCaseLowercaseCommand', $application->find('FoO:BaR'), '->find() will find two suggestions with case insensitivity');
- }
-
- public function testFindWithCommandLoader()
- {
- $application = new Application();
- $application->setCommandLoader(new FactoryCommandLoader([
- 'foo:bar' => $f = function () { return new \FooCommand(); },
- ]));
-
- $this->assertInstanceOf('FooCommand', $application->find('foo:bar'), '->find() returns a command if its name exists');
- $this->assertInstanceOf('Symfony\Component\Console\Command\HelpCommand', $application->find('h'), '->find() returns a command if its name exists');
- $this->assertInstanceOf('FooCommand', $application->find('f:bar'), '->find() returns a command if the abbreviation for the namespace exists');
- $this->assertInstanceOf('FooCommand', $application->find('f:b'), '->find() returns a command if the abbreviation for the namespace and the command name exist');
- $this->assertInstanceOf('FooCommand', $application->find('a'), '->find() returns a command if the abbreviation exists for an alias');
- }
-
- /**
- * @dataProvider provideAmbiguousAbbreviations
- */
- public function testFindWithAmbiguousAbbreviations($abbreviation, $expectedExceptionMessage)
- {
- putenv('COLUMNS=120');
- if (method_exists($this, 'expectException')) {
- $this->expectException('Symfony\Component\Console\Exception\CommandNotFoundException');
- $this->expectExceptionMessage($expectedExceptionMessage);
- } else {
- $this->setExpectedException('Symfony\Component\Console\Exception\CommandNotFoundException', $expectedExceptionMessage);
- }
-
- $application = new Application();
- $application->add(new \FooCommand());
- $application->add(new \Foo1Command());
- $application->add(new \Foo2Command());
-
- $application->find($abbreviation);
- }
-
- public function provideAmbiguousAbbreviations()
- {
- return [
- ['f', 'Command "f" is not defined.'],
- [
- 'a',
- "Command \"a\" is ambiguous.\nDid you mean one of these?\n".
- " afoobar The foo:bar command\n".
- " afoobar1 The foo:bar1 command\n".
- ' afoobar2 The foo1:bar command',
- ],
- [
- 'foo:b',
- "Command \"foo:b\" is ambiguous.\nDid you mean one of these?\n".
- " foo:bar The foo:bar command\n".
- " foo:bar1 The foo:bar1 command\n".
- ' foo1:bar The foo1:bar command',
- ],
- ];
- }
-
- public function testFindCommandEqualNamespace()
- {
- $application = new Application();
- $application->add(new \Foo3Command());
- $application->add(new \Foo4Command());
-
- $this->assertInstanceOf('Foo3Command', $application->find('foo3:bar'), '->find() returns the good command even if a namespace has same name');
- $this->assertInstanceOf('Foo4Command', $application->find('foo3:bar:toh'), '->find() returns a command even if its namespace equals another command name');
- }
-
- public function testFindCommandWithAmbiguousNamespacesButUniqueName()
- {
- $application = new Application();
- $application->add(new \FooCommand());
- $application->add(new \FoobarCommand());
-
- $this->assertInstanceOf('FoobarCommand', $application->find('f:f'));
- }
-
- public function testFindCommandWithMissingNamespace()
- {
- $application = new Application();
- $application->add(new \Foo4Command());
-
- $this->assertInstanceOf('Foo4Command', $application->find('f::t'));
- }
-
- /**
- * @dataProvider provideInvalidCommandNamesSingle
- * @expectedException \Symfony\Component\Console\Exception\CommandNotFoundException
- * @expectedExceptionMessage Did you mean this
- */
- public function testFindAlternativeExceptionMessageSingle($name)
- {
- $application = new Application();
- $application->add(new \Foo3Command());
- $application->find($name);
- }
-
- public function testDontRunAlternativeNamespaceName()
- {
- $application = new Application();
- $application->add(new \Foo1Command());
- $application->setAutoExit(false);
- $tester = new ApplicationTester($application);
- $tester->run(['command' => 'foos:bar1'], ['decorated' => false]);
- $this->assertSame('
-
- There are no commands defined in the "foos" namespace.
-
- Did you mean this?
- foo
-
-
-', $tester->getDisplay(true));
- }
-
- public function testCanRunAlternativeCommandName()
- {
- $application = new Application();
- $application->add(new \FooWithoutAliasCommand());
- $application->setAutoExit(false);
- $tester = new ApplicationTester($application);
- $tester->setInputs(['y']);
- $tester->run(['command' => 'foos'], ['decorated' => false]);
- $display = trim($tester->getDisplay(true));
- $this->assertContains('Command "foos" is not defined', $display);
- $this->assertContains('Do you want to run "foo" instead? (yes/no) [no]:', $display);
- $this->assertContains('called', $display);
- }
-
- public function testDontRunAlternativeCommandName()
- {
- $application = new Application();
- $application->add(new \FooWithoutAliasCommand());
- $application->setAutoExit(false);
- $tester = new ApplicationTester($application);
- $tester->setInputs(['n']);
- $exitCode = $tester->run(['command' => 'foos'], ['decorated' => false]);
- $this->assertSame(1, $exitCode);
- $display = trim($tester->getDisplay(true));
- $this->assertContains('Command "foos" is not defined', $display);
- $this->assertContains('Do you want to run "foo" instead? (yes/no) [no]:', $display);
- }
-
- public function provideInvalidCommandNamesSingle()
- {
- return [
- ['foo3:barr'],
- ['fooo3:bar'],
- ];
- }
-
- public function testFindAlternativeExceptionMessageMultiple()
- {
- putenv('COLUMNS=120');
- $application = new Application();
- $application->add(new \FooCommand());
- $application->add(new \Foo1Command());
- $application->add(new \Foo2Command());
-
- // Command + plural
- try {
- $application->find('foo:baR');
- $this->fail('->find() throws a CommandNotFoundException if command does not exist, with alternatives');
- } catch (\Exception $e) {
- $this->assertInstanceOf('Symfony\Component\Console\Exception\CommandNotFoundException', $e, '->find() throws a CommandNotFoundException if command does not exist, with alternatives');
- $this->assertRegExp('/Did you mean one of these/', $e->getMessage(), '->find() throws a CommandNotFoundException if command does not exist, with alternatives');
- $this->assertRegExp('/foo1:bar/', $e->getMessage());
- $this->assertRegExp('/foo:bar/', $e->getMessage());
- }
-
- // Namespace + plural
- try {
- $application->find('foo2:bar');
- $this->fail('->find() throws a CommandNotFoundException if command does not exist, with alternatives');
- } catch (\Exception $e) {
- $this->assertInstanceOf('Symfony\Component\Console\Exception\CommandNotFoundException', $e, '->find() throws a CommandNotFoundException if command does not exist, with alternatives');
- $this->assertRegExp('/Did you mean one of these/', $e->getMessage(), '->find() throws a CommandNotFoundException if command does not exist, with alternatives');
- $this->assertRegExp('/foo1/', $e->getMessage());
- }
-
- $application->add(new \Foo3Command());
- $application->add(new \Foo4Command());
-
- // Subnamespace + plural
- try {
- $a = $application->find('foo3:');
- $this->fail('->find() should throw an Symfony\Component\Console\Exception\CommandNotFoundException if a command is ambiguous because of a subnamespace, with alternatives');
- } catch (\Exception $e) {
- $this->assertInstanceOf('Symfony\Component\Console\Exception\CommandNotFoundException', $e);
- $this->assertRegExp('/foo3:bar/', $e->getMessage());
- $this->assertRegExp('/foo3:bar:toh/', $e->getMessage());
- }
- }
-
- public function testFindAlternativeCommands()
- {
- $application = new Application();
-
- $application->add(new \FooCommand());
- $application->add(new \Foo1Command());
- $application->add(new \Foo2Command());
-
- try {
- $application->find($commandName = 'Unknown command');
- $this->fail('->find() throws a CommandNotFoundException if command does not exist');
- } catch (\Exception $e) {
- $this->assertInstanceOf('Symfony\Component\Console\Exception\CommandNotFoundException', $e, '->find() throws a CommandNotFoundException if command does not exist');
- $this->assertSame([], $e->getAlternatives());
- $this->assertEquals(sprintf('Command "%s" is not defined.', $commandName), $e->getMessage(), '->find() throws a CommandNotFoundException if command does not exist, without alternatives');
- }
-
- // Test if "bar1" command throw a "CommandNotFoundException" and does not contain
- // "foo:bar" as alternative because "bar1" is too far from "foo:bar"
- try {
- $application->find($commandName = 'bar1');
- $this->fail('->find() throws a CommandNotFoundException if command does not exist');
- } catch (\Exception $e) {
- $this->assertInstanceOf('Symfony\Component\Console\Exception\CommandNotFoundException', $e, '->find() throws a CommandNotFoundException if command does not exist');
- $this->assertSame(['afoobar1', 'foo:bar1'], $e->getAlternatives());
- $this->assertRegExp(sprintf('/Command "%s" is not defined./', $commandName), $e->getMessage(), '->find() throws a CommandNotFoundException if command does not exist, with alternatives');
- $this->assertRegExp('/afoobar1/', $e->getMessage(), '->find() throws a CommandNotFoundException if command does not exist, with alternative : "afoobar1"');
- $this->assertRegExp('/foo:bar1/', $e->getMessage(), '->find() throws a CommandNotFoundException if command does not exist, with alternative : "foo:bar1"');
- $this->assertNotRegExp('/foo:bar(?>!1)/', $e->getMessage(), '->find() throws a CommandNotFoundException if command does not exist, without "foo:bar" alternative');
- }
- }
-
- public function testFindAlternativeCommandsWithAnAlias()
- {
- $fooCommand = new \FooCommand();
- $fooCommand->setAliases(['foo2']);
-
- $application = new Application();
- $application->add($fooCommand);
-
- $result = $application->find('foo');
-
- $this->assertSame($fooCommand, $result);
- }
-
- public function testFindAlternativeNamespace()
- {
- $application = new Application();
-
- $application->add(new \FooCommand());
- $application->add(new \Foo1Command());
- $application->add(new \Foo2Command());
- $application->add(new \Foo3Command());
-
- try {
- $application->find('Unknown-namespace:Unknown-command');
- $this->fail('->find() throws a CommandNotFoundException if namespace does not exist');
- } catch (\Exception $e) {
- $this->assertInstanceOf('Symfony\Component\Console\Exception\CommandNotFoundException', $e, '->find() throws a CommandNotFoundException if namespace does not exist');
- $this->assertSame([], $e->getAlternatives());
- $this->assertEquals('There are no commands defined in the "Unknown-namespace" namespace.', $e->getMessage(), '->find() throws a CommandNotFoundException if namespace does not exist, without alternatives');
- }
-
- try {
- $application->find('foo2:command');
- $this->fail('->find() throws a CommandNotFoundException if namespace does not exist');
- } catch (\Exception $e) {
- $this->assertInstanceOf('Symfony\Component\Console\Exception\NamespaceNotFoundException', $e, '->find() throws a NamespaceNotFoundException if namespace does not exist');
- $this->assertInstanceOf('Symfony\Component\Console\Exception\CommandNotFoundException', $e, 'NamespaceNotFoundException extends from CommandNotFoundException');
- $this->assertCount(3, $e->getAlternatives());
- $this->assertContains('foo', $e->getAlternatives());
- $this->assertContains('foo1', $e->getAlternatives());
- $this->assertContains('foo3', $e->getAlternatives());
- $this->assertRegExp('/There are no commands defined in the "foo2" namespace./', $e->getMessage(), '->find() throws a CommandNotFoundException if namespace does not exist, with alternative');
- $this->assertRegExp('/foo/', $e->getMessage(), '->find() throws a CommandNotFoundException if namespace does not exist, with alternative : "foo"');
- $this->assertRegExp('/foo1/', $e->getMessage(), '->find() throws a CommandNotFoundException if namespace does not exist, with alternative : "foo1"');
- $this->assertRegExp('/foo3/', $e->getMessage(), '->find() throws a CommandNotFoundException if namespace does not exist, with alternative : "foo3"');
- }
- }
-
- public function testFindAlternativesOutput()
- {
- $application = new Application();
-
- $application->add(new \FooCommand());
- $application->add(new \Foo1Command());
- $application->add(new \Foo2Command());
- $application->add(new \Foo3Command());
-
- $expectedAlternatives = [
- 'afoobar',
- 'afoobar1',
- 'afoobar2',
- 'foo1:bar',
- 'foo3:bar',
- 'foo:bar',
- 'foo:bar1',
- ];
-
- try {
- $application->find('foo');
- $this->fail('->find() throws a CommandNotFoundException if command is not defined');
- } catch (\Exception $e) {
- $this->assertInstanceOf('Symfony\Component\Console\Exception\CommandNotFoundException', $e, '->find() throws a CommandNotFoundException if command is not defined');
- $this->assertSame($expectedAlternatives, $e->getAlternatives());
-
- $this->assertRegExp('/Command "foo" is not defined\..*Did you mean one of these\?.*/Ums', $e->getMessage());
- }
- }
-
- public function testFindNamespaceDoesNotFailOnDeepSimilarNamespaces()
- {
- $application = $this->getMockBuilder('Symfony\Component\Console\Application')->setMethods(['getNamespaces'])->getMock();
- $application->expects($this->once())
- ->method('getNamespaces')
- ->willReturn(['foo:sublong', 'bar:sub']);
-
- $this->assertEquals('foo:sublong', $application->findNamespace('f:sub'));
- }
-
- /**
- * @expectedException \Symfony\Component\Console\Exception\CommandNotFoundException
- * @expectedExceptionMessage Command "foo::bar" is not defined.
- */
- public function testFindWithDoubleColonInNameThrowsException()
- {
- $application = new Application();
- $application->add(new \FooCommand());
- $application->add(new \Foo4Command());
- $application->find('foo::bar');
- }
-
- public function testSetCatchExceptions()
- {
- $application = new Application();
- $application->setAutoExit(false);
- putenv('COLUMNS=120');
- $tester = new ApplicationTester($application);
-
- $application->setCatchExceptions(true);
- $this->assertTrue($application->areExceptionsCaught());
-
- $tester->run(['command' => 'foo'], ['decorated' => false]);
- $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception1.txt', $tester->getDisplay(true), '->setCatchExceptions() sets the catch exception flag');
-
- $tester->run(['command' => 'foo'], ['decorated' => false, 'capture_stderr_separately' => true]);
- $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception1.txt', $tester->getErrorOutput(true), '->setCatchExceptions() sets the catch exception flag');
- $this->assertSame('', $tester->getDisplay(true));
-
- $application->setCatchExceptions(false);
- try {
- $tester->run(['command' => 'foo'], ['decorated' => false]);
- $this->fail('->setCatchExceptions() sets the catch exception flag');
- } catch (\Exception $e) {
- $this->assertInstanceOf('\Exception', $e, '->setCatchExceptions() sets the catch exception flag');
- $this->assertEquals('Command "foo" is not defined.', $e->getMessage(), '->setCatchExceptions() sets the catch exception flag');
- }
- }
-
- public function testAutoExitSetting()
- {
- $application = new Application();
- $this->assertTrue($application->isAutoExitEnabled());
-
- $application->setAutoExit(false);
- $this->assertFalse($application->isAutoExitEnabled());
- }
-
- public function testRenderException()
- {
- $application = new Application();
- $application->setAutoExit(false);
- putenv('COLUMNS=120');
- $tester = new ApplicationTester($application);
-
- $tester->run(['command' => 'foo'], ['decorated' => false, 'capture_stderr_separately' => true]);
- $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception1.txt', $tester->getErrorOutput(true), '->renderException() renders a pretty exception');
-
- $tester->run(['command' => 'foo'], ['decorated' => false, 'verbosity' => Output::VERBOSITY_VERBOSE, 'capture_stderr_separately' => true]);
- $this->assertContains('Exception trace', $tester->getErrorOutput(), '->renderException() renders a pretty exception with a stack trace when verbosity is verbose');
-
- $tester->run(['command' => 'list', '--foo' => true], ['decorated' => false, 'capture_stderr_separately' => true]);
- $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception2.txt', $tester->getErrorOutput(true), '->renderException() renders the command synopsis when an exception occurs in the context of a command');
-
- $application->add(new \Foo3Command());
- $tester = new ApplicationTester($application);
- $tester->run(['command' => 'foo3:bar'], ['decorated' => false, 'capture_stderr_separately' => true]);
- $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception3.txt', $tester->getErrorOutput(true), '->renderException() renders a pretty exceptions with previous exceptions');
-
- $tester->run(['command' => 'foo3:bar'], ['decorated' => false, 'verbosity' => Output::VERBOSITY_VERBOSE]);
- $this->assertRegExp('/\[Exception\]\s*First exception/', $tester->getDisplay(), '->renderException() renders a pretty exception without code exception when code exception is default and verbosity is verbose');
- $this->assertRegExp('/\[Exception\]\s*Second exception/', $tester->getDisplay(), '->renderException() renders a pretty exception without code exception when code exception is 0 and verbosity is verbose');
- $this->assertRegExp('/\[Exception \(404\)\]\s*Third exception/', $tester->getDisplay(), '->renderException() renders a pretty exception with code exception when code exception is 404 and verbosity is verbose');
-
- $tester->run(['command' => 'foo3:bar'], ['decorated' => true]);
- $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception3decorated.txt', $tester->getDisplay(true), '->renderException() renders a pretty exceptions with previous exceptions');
-
- $tester->run(['command' => 'foo3:bar'], ['decorated' => true, 'capture_stderr_separately' => true]);
- $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception3decorated.txt', $tester->getErrorOutput(true), '->renderException() renders a pretty exceptions with previous exceptions');
-
- $application = new Application();
- $application->setAutoExit(false);
- putenv('COLUMNS=32');
- $tester = new ApplicationTester($application);
-
- $tester->run(['command' => 'foo'], ['decorated' => false, 'capture_stderr_separately' => true]);
- $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception4.txt', $tester->getErrorOutput(true), '->renderException() wraps messages when they are bigger than the terminal');
- putenv('COLUMNS=120');
- }
-
- public function testRenderExceptionWithDoubleWidthCharacters()
- {
- $application = new Application();
- $application->setAutoExit(false);
- putenv('COLUMNS=120');
- $application->register('foo')->setCode(function () {
- throw new \Exception('エラーメッセージ');
- });
- $tester = new ApplicationTester($application);
-
- $tester->run(['command' => 'foo'], ['decorated' => false, 'capture_stderr_separately' => true]);
- $this->assertStringMatchesFormatFile(self::$fixturesPath.'/application_renderexception_doublewidth1.txt', $tester->getErrorOutput(true), '->renderException() renders a pretty exceptions with previous exceptions');
-
- $tester->run(['command' => 'foo'], ['decorated' => true, 'capture_stderr_separately' => true]);
- $this->assertStringMatchesFormatFile(self::$fixturesPath.'/application_renderexception_doublewidth1decorated.txt', $tester->getErrorOutput(true), '->renderException() renders a pretty exceptions with previous exceptions');
-
- $application = new Application();
- $application->setAutoExit(false);
- putenv('COLUMNS=32');
- $application->register('foo')->setCode(function () {
- throw new \Exception('コマンドの実行中にエラーが発生しました。');
- });
- $tester = new ApplicationTester($application);
- $tester->run(['command' => 'foo'], ['decorated' => false, 'capture_stderr_separately' => true]);
- $this->assertStringMatchesFormatFile(self::$fixturesPath.'/application_renderexception_doublewidth2.txt', $tester->getErrorOutput(true), '->renderException() wraps messages when they are bigger than the terminal');
- putenv('COLUMNS=120');
- }
-
- public function testRenderExceptionEscapesLines()
- {
- $application = new Application();
- $application->setAutoExit(false);
- putenv('COLUMNS=22');
- $application->register('foo')->setCode(function () {
- throw new \Exception('dont break here !');
- });
- $tester = new ApplicationTester($application);
-
- $tester->run(['command' => 'foo'], ['decorated' => false]);
- $this->assertStringMatchesFormatFile(self::$fixturesPath.'/application_renderexception_escapeslines.txt', $tester->getDisplay(true), '->renderException() escapes lines containing formatting');
- putenv('COLUMNS=120');
- }
-
- public function testRenderExceptionLineBreaks()
- {
- $application = $this->getMockBuilder('Symfony\Component\Console\Application')->setMethods(['getTerminalWidth'])->getMock();
- $application->setAutoExit(false);
- $application->expects($this->any())
- ->method('getTerminalWidth')
- ->willReturn(120);
- $application->register('foo')->setCode(function () {
- throw new \InvalidArgumentException("\n\nline 1 with extra spaces \nline 2\n\nline 4\n");
- });
- $tester = new ApplicationTester($application);
-
- $tester->run(['command' => 'foo'], ['decorated' => false]);
- $this->assertStringMatchesFormatFile(self::$fixturesPath.'/application_renderexception_linebreaks.txt', $tester->getDisplay(true), '->renderException() keep multiple line breaks');
- }
-
- public function testRenderAnonymousException()
- {
- $application = new Application();
- $application->setAutoExit(false);
- $application->register('foo')->setCode(function () {
- throw new class('') extends \InvalidArgumentException {
- };
- });
- $tester = new ApplicationTester($application);
-
- $tester->run(['command' => 'foo'], ['decorated' => false]);
- $this->assertContains('[InvalidArgumentException@anonymous]', $tester->getDisplay(true));
-
- $application = new Application();
- $application->setAutoExit(false);
- $application->register('foo')->setCode(function () {
- throw new \InvalidArgumentException(sprintf('Dummy type "%s" is invalid.', \get_class(new class() {
- })));
- });
- $tester = new ApplicationTester($application);
-
- $tester->run(['command' => 'foo'], ['decorated' => false]);
- $this->assertContains('Dummy type "@anonymous" is invalid.', $tester->getDisplay(true));
- }
-
- public function testRenderExceptionStackTraceContainsRootException()
- {
- $application = new Application();
- $application->setAutoExit(false);
- $application->register('foo')->setCode(function () {
- throw new class('') extends \InvalidArgumentException {
- };
- });
- $tester = new ApplicationTester($application);
-
- $tester->run(['command' => 'foo'], ['decorated' => false]);
- $this->assertContains('[InvalidArgumentException@anonymous]', $tester->getDisplay(true));
-
- $application = new Application();
- $application->setAutoExit(false);
- $application->register('foo')->setCode(function () {
- throw new \InvalidArgumentException(sprintf('Dummy type "%s" is invalid.', \get_class(new class() {
- })));
- });
- $tester = new ApplicationTester($application);
-
- $tester->run(['command' => 'foo'], ['decorated' => false]);
- $this->assertContains('Dummy type "@anonymous" is invalid.', $tester->getDisplay(true));
- }
-
- public function testRun()
- {
- $application = new Application();
- $application->setAutoExit(false);
- $application->setCatchExceptions(false);
- $application->add($command = new \Foo1Command());
- $_SERVER['argv'] = ['cli.php', 'foo:bar1'];
-
- ob_start();
- $application->run();
- ob_end_clean();
-
- $this->assertInstanceOf('Symfony\Component\Console\Input\ArgvInput', $command->input, '->run() creates an ArgvInput by default if none is given');
- $this->assertInstanceOf('Symfony\Component\Console\Output\ConsoleOutput', $command->output, '->run() creates a ConsoleOutput by default if none is given');
-
- $application = new Application();
- $application->setAutoExit(false);
- $application->setCatchExceptions(false);
-
- $this->ensureStaticCommandHelp($application);
- $tester = new ApplicationTester($application);
-
- $tester->run([], ['decorated' => false]);
- $this->assertStringEqualsFile(self::$fixturesPath.'/application_run1.txt', $tester->getDisplay(true), '->run() runs the list command if no argument is passed');
-
- $tester->run(['--help' => true], ['decorated' => false]);
- $this->assertStringEqualsFile(self::$fixturesPath.'/application_run2.txt', $tester->getDisplay(true), '->run() runs the help command if --help is passed');
-
- $tester->run(['-h' => true], ['decorated' => false]);
- $this->assertStringEqualsFile(self::$fixturesPath.'/application_run2.txt', $tester->getDisplay(true), '->run() runs the help command if -h is passed');
-
- $tester->run(['command' => 'list', '--help' => true], ['decorated' => false]);
- $this->assertStringEqualsFile(self::$fixturesPath.'/application_run3.txt', $tester->getDisplay(true), '->run() displays the help if --help is passed');
-
- $tester->run(['command' => 'list', '-h' => true], ['decorated' => false]);
- $this->assertStringEqualsFile(self::$fixturesPath.'/application_run3.txt', $tester->getDisplay(true), '->run() displays the help if -h is passed');
-
- $tester->run(['--ansi' => true]);
- $this->assertTrue($tester->getOutput()->isDecorated(), '->run() forces color output if --ansi is passed');
-
- $tester->run(['--no-ansi' => true]);
- $this->assertFalse($tester->getOutput()->isDecorated(), '->run() forces color output to be disabled if --no-ansi is passed');
-
- $tester->run(['--version' => true], ['decorated' => false]);
- $this->assertStringEqualsFile(self::$fixturesPath.'/application_run4.txt', $tester->getDisplay(true), '->run() displays the program version if --version is passed');
-
- $tester->run(['-V' => true], ['decorated' => false]);
- $this->assertStringEqualsFile(self::$fixturesPath.'/application_run4.txt', $tester->getDisplay(true), '->run() displays the program version if -v is passed');
-
- $tester->run(['command' => 'list', '--quiet' => true]);
- $this->assertSame('', $tester->getDisplay(), '->run() removes all output if --quiet is passed');
- $this->assertFalse($tester->getInput()->isInteractive(), '->run() sets off the interactive mode if --quiet is passed');
-
- $tester->run(['command' => 'list', '-q' => true]);
- $this->assertSame('', $tester->getDisplay(), '->run() removes all output if -q is passed');
- $this->assertFalse($tester->getInput()->isInteractive(), '->run() sets off the interactive mode if -q is passed');
-
- $tester->run(['command' => 'list', '--verbose' => true]);
- $this->assertSame(Output::VERBOSITY_VERBOSE, $tester->getOutput()->getVerbosity(), '->run() sets the output to verbose if --verbose is passed');
-
- $tester->run(['command' => 'list', '--verbose' => 1]);
- $this->assertSame(Output::VERBOSITY_VERBOSE, $tester->getOutput()->getVerbosity(), '->run() sets the output to verbose if --verbose=1 is passed');
-
- $tester->run(['command' => 'list', '--verbose' => 2]);
- $this->assertSame(Output::VERBOSITY_VERY_VERBOSE, $tester->getOutput()->getVerbosity(), '->run() sets the output to very verbose if --verbose=2 is passed');
-
- $tester->run(['command' => 'list', '--verbose' => 3]);
- $this->assertSame(Output::VERBOSITY_DEBUG, $tester->getOutput()->getVerbosity(), '->run() sets the output to debug if --verbose=3 is passed');
-
- $tester->run(['command' => 'list', '--verbose' => 4]);
- $this->assertSame(Output::VERBOSITY_VERBOSE, $tester->getOutput()->getVerbosity(), '->run() sets the output to verbose if unknown --verbose level is passed');
-
- $tester->run(['command' => 'list', '-v' => true]);
- $this->assertSame(Output::VERBOSITY_VERBOSE, $tester->getOutput()->getVerbosity(), '->run() sets the output to verbose if -v is passed');
-
- $tester->run(['command' => 'list', '-vv' => true]);
- $this->assertSame(Output::VERBOSITY_VERY_VERBOSE, $tester->getOutput()->getVerbosity(), '->run() sets the output to verbose if -v is passed');
-
- $tester->run(['command' => 'list', '-vvv' => true]);
- $this->assertSame(Output::VERBOSITY_DEBUG, $tester->getOutput()->getVerbosity(), '->run() sets the output to verbose if -v is passed');
-
- $application = new Application();
- $application->setAutoExit(false);
- $application->setCatchExceptions(false);
- $application->add(new \FooCommand());
- $tester = new ApplicationTester($application);
-
- $tester->run(['command' => 'foo:bar', '--no-interaction' => true], ['decorated' => false]);
- $this->assertSame('called'.PHP_EOL, $tester->getDisplay(), '->run() does not call interact() if --no-interaction is passed');
-
- $tester->run(['command' => 'foo:bar', '-n' => true], ['decorated' => false]);
- $this->assertSame('called'.PHP_EOL, $tester->getDisplay(), '->run() does not call interact() if -n is passed');
- }
-
- public function testRunWithGlobalOptionAndNoCommand()
- {
- $application = new Application();
- $application->setAutoExit(false);
- $application->setCatchExceptions(false);
- $application->getDefinition()->addOption(new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL));
-
- $output = new StreamOutput(fopen('php://memory', 'w', false));
- $input = new ArgvInput(['cli.php', '--foo', 'bar']);
-
- $this->assertSame(0, $application->run($input, $output));
- }
-
- /**
- * Issue #9285.
- *
- * If the "verbose" option is just before an argument in ArgvInput,
- * an argument value should not be treated as verbosity value.
- * This test will fail with "Not enough arguments." if broken
- */
- public function testVerboseValueNotBreakArguments()
- {
- $application = new Application();
- $application->setAutoExit(false);
- $application->setCatchExceptions(false);
- $application->add(new \FooCommand());
-
- $output = new StreamOutput(fopen('php://memory', 'w', false));
-
- $input = new ArgvInput(['cli.php', '-v', 'foo:bar']);
- $application->run($input, $output);
-
- $this->addToAssertionCount(1);
-
- $input = new ArgvInput(['cli.php', '--verbose', 'foo:bar']);
- $application->run($input, $output);
-
- $this->addToAssertionCount(1);
- }
-
- public function testRunReturnsIntegerExitCode()
- {
- $exception = new \Exception('', 4);
-
- $application = $this->getMockBuilder('Symfony\Component\Console\Application')->setMethods(['doRun'])->getMock();
- $application->setAutoExit(false);
- $application->expects($this->once())
- ->method('doRun')
- ->willThrowException($exception);
-
- $exitCode = $application->run(new ArrayInput([]), new NullOutput());
-
- $this->assertSame(4, $exitCode, '->run() returns integer exit code extracted from raised exception');
- }
-
- public function testRunDispatchesIntegerExitCode()
- {
- $passedRightValue = false;
-
- // We can assume here that some other test asserts that the event is dispatched at all
- $dispatcher = new EventDispatcher();
- $dispatcher->addListener('console.terminate', function (ConsoleTerminateEvent $event) use (&$passedRightValue) {
- $passedRightValue = (4 === $event->getExitCode());
- });
-
- $application = new Application();
- $application->setDispatcher($dispatcher);
- $application->setAutoExit(false);
-
- $application->register('test')->setCode(function (InputInterface $input, OutputInterface $output) {
- throw new \Exception('', 4);
- });
-
- $tester = new ApplicationTester($application);
- $tester->run(['command' => 'test']);
-
- $this->assertTrue($passedRightValue, '-> exit code 4 was passed in the console.terminate event');
- }
-
- public function testRunReturnsExitCodeOneForExceptionCodeZero()
- {
- $exception = new \Exception('', 0);
-
- $application = $this->getMockBuilder('Symfony\Component\Console\Application')->setMethods(['doRun'])->getMock();
- $application->setAutoExit(false);
- $application->expects($this->once())
- ->method('doRun')
- ->willThrowException($exception);
-
- $exitCode = $application->run(new ArrayInput([]), new NullOutput());
-
- $this->assertSame(1, $exitCode, '->run() returns exit code 1 when exception code is 0');
- }
-
- public function testRunDispatchesExitCodeOneForExceptionCodeZero()
- {
- $passedRightValue = false;
-
- // We can assume here that some other test asserts that the event is dispatched at all
- $dispatcher = new EventDispatcher();
- $dispatcher->addListener('console.terminate', function (ConsoleTerminateEvent $event) use (&$passedRightValue) {
- $passedRightValue = (1 === $event->getExitCode());
- });
-
- $application = new Application();
- $application->setDispatcher($dispatcher);
- $application->setAutoExit(false);
-
- $application->register('test')->setCode(function (InputInterface $input, OutputInterface $output) {
- throw new \Exception();
- });
-
- $tester = new ApplicationTester($application);
- $tester->run(['command' => 'test']);
-
- $this->assertTrue($passedRightValue, '-> exit code 1 was passed in the console.terminate event');
- }
-
- /**
- * @expectedException \LogicException
- * @expectedExceptionMessage An option with shortcut "e" already exists.
- */
- public function testAddingOptionWithDuplicateShortcut()
- {
- $dispatcher = new EventDispatcher();
- $application = new Application();
- $application->setAutoExit(false);
- $application->setCatchExceptions(false);
- $application->setDispatcher($dispatcher);
-
- $application->getDefinition()->addOption(new InputOption('--env', '-e', InputOption::VALUE_REQUIRED, 'Environment'));
-
- $application
- ->register('foo')
- ->setAliases(['f'])
- ->setDefinition([new InputOption('survey', 'e', InputOption::VALUE_REQUIRED, 'My option with a shortcut.')])
- ->setCode(function (InputInterface $input, OutputInterface $output) {})
- ;
-
- $input = new ArrayInput(['command' => 'foo']);
- $output = new NullOutput();
-
- $application->run($input, $output);
- }
-
- /**
- * @expectedException \LogicException
- * @dataProvider getAddingAlreadySetDefinitionElementData
- */
- public function testAddingAlreadySetDefinitionElementData($def)
- {
- $application = new Application();
- $application->setAutoExit(false);
- $application->setCatchExceptions(false);
- $application
- ->register('foo')
- ->setDefinition([$def])
- ->setCode(function (InputInterface $input, OutputInterface $output) {})
- ;
-
- $input = new ArrayInput(['command' => 'foo']);
- $output = new NullOutput();
- $application->run($input, $output);
- }
-
- public function getAddingAlreadySetDefinitionElementData()
- {
- return [
- [new InputArgument('command', InputArgument::REQUIRED)],
- [new InputOption('quiet', '', InputOption::VALUE_NONE)],
- [new InputOption('query', 'q', InputOption::VALUE_NONE)],
- ];
- }
-
- public function testGetDefaultHelperSetReturnsDefaultValues()
- {
- $application = new Application();
- $application->setAutoExit(false);
- $application->setCatchExceptions(false);
-
- $helperSet = $application->getHelperSet();
-
- $this->assertTrue($helperSet->has('formatter'));
- }
-
- public function testAddingSingleHelperSetOverwritesDefaultValues()
- {
- $application = new Application();
- $application->setAutoExit(false);
- $application->setCatchExceptions(false);
-
- $application->setHelperSet(new HelperSet([new FormatterHelper()]));
-
- $helperSet = $application->getHelperSet();
-
- $this->assertTrue($helperSet->has('formatter'));
-
- // no other default helper set should be returned
- $this->assertFalse($helperSet->has('dialog'));
- $this->assertFalse($helperSet->has('progress'));
- }
-
- public function testOverwritingDefaultHelperSetOverwritesDefaultValues()
- {
- $application = new CustomApplication();
- $application->setAutoExit(false);
- $application->setCatchExceptions(false);
-
- $application->setHelperSet(new HelperSet([new FormatterHelper()]));
-
- $helperSet = $application->getHelperSet();
-
- $this->assertTrue($helperSet->has('formatter'));
-
- // no other default helper set should be returned
- $this->assertFalse($helperSet->has('dialog'));
- $this->assertFalse($helperSet->has('progress'));
- }
-
- public function testGetDefaultInputDefinitionReturnsDefaultValues()
- {
- $application = new Application();
- $application->setAutoExit(false);
- $application->setCatchExceptions(false);
-
- $inputDefinition = $application->getDefinition();
-
- $this->assertTrue($inputDefinition->hasArgument('command'));
-
- $this->assertTrue($inputDefinition->hasOption('help'));
- $this->assertTrue($inputDefinition->hasOption('quiet'));
- $this->assertTrue($inputDefinition->hasOption('verbose'));
- $this->assertTrue($inputDefinition->hasOption('version'));
- $this->assertTrue($inputDefinition->hasOption('ansi'));
- $this->assertTrue($inputDefinition->hasOption('no-ansi'));
- $this->assertTrue($inputDefinition->hasOption('no-interaction'));
- }
-
- public function testOverwritingDefaultInputDefinitionOverwritesDefaultValues()
- {
- $application = new CustomApplication();
- $application->setAutoExit(false);
- $application->setCatchExceptions(false);
-
- $inputDefinition = $application->getDefinition();
-
- // check whether the default arguments and options are not returned any more
- $this->assertFalse($inputDefinition->hasArgument('command'));
-
- $this->assertFalse($inputDefinition->hasOption('help'));
- $this->assertFalse($inputDefinition->hasOption('quiet'));
- $this->assertFalse($inputDefinition->hasOption('verbose'));
- $this->assertFalse($inputDefinition->hasOption('version'));
- $this->assertFalse($inputDefinition->hasOption('ansi'));
- $this->assertFalse($inputDefinition->hasOption('no-ansi'));
- $this->assertFalse($inputDefinition->hasOption('no-interaction'));
-
- $this->assertTrue($inputDefinition->hasOption('custom'));
- }
-
- public function testSettingCustomInputDefinitionOverwritesDefaultValues()
- {
- $application = new Application();
- $application->setAutoExit(false);
- $application->setCatchExceptions(false);
-
- $application->setDefinition(new InputDefinition([new InputOption('--custom', '-c', InputOption::VALUE_NONE, 'Set the custom input definition.')]));
-
- $inputDefinition = $application->getDefinition();
-
- // check whether the default arguments and options are not returned any more
- $this->assertFalse($inputDefinition->hasArgument('command'));
-
- $this->assertFalse($inputDefinition->hasOption('help'));
- $this->assertFalse($inputDefinition->hasOption('quiet'));
- $this->assertFalse($inputDefinition->hasOption('verbose'));
- $this->assertFalse($inputDefinition->hasOption('version'));
- $this->assertFalse($inputDefinition->hasOption('ansi'));
- $this->assertFalse($inputDefinition->hasOption('no-ansi'));
- $this->assertFalse($inputDefinition->hasOption('no-interaction'));
-
- $this->assertTrue($inputDefinition->hasOption('custom'));
- }
-
- public function testRunWithDispatcher()
- {
- $application = new Application();
- $application->setAutoExit(false);
- $application->setDispatcher($this->getDispatcher());
-
- $application->register('foo')->setCode(function (InputInterface $input, OutputInterface $output) {
- $output->write('foo.');
- });
-
- $tester = new ApplicationTester($application);
- $tester->run(['command' => 'foo']);
- $this->assertEquals('before.foo.after.'.PHP_EOL, $tester->getDisplay());
- }
-
- /**
- * @expectedException \LogicException
- * @expectedExceptionMessage error
- */
- public function testRunWithExceptionAndDispatcher()
- {
- $application = new Application();
- $application->setDispatcher($this->getDispatcher());
- $application->setAutoExit(false);
- $application->setCatchExceptions(false);
-
- $application->register('foo')->setCode(function (InputInterface $input, OutputInterface $output) {
- throw new \RuntimeException('foo');
- });
-
- $tester = new ApplicationTester($application);
- $tester->run(['command' => 'foo']);
- }
-
- public function testRunDispatchesAllEventsWithException()
- {
- $application = new Application();
- $application->setDispatcher($this->getDispatcher());
- $application->setAutoExit(false);
-
- $application->register('foo')->setCode(function (InputInterface $input, OutputInterface $output) {
- $output->write('foo.');
-
- throw new \RuntimeException('foo');
- });
-
- $tester = new ApplicationTester($application);
- $tester->run(['command' => 'foo']);
- $this->assertContains('before.foo.error.after.', $tester->getDisplay());
- }
-
- public function testRunDispatchesAllEventsWithExceptionInListener()
- {
- $dispatcher = $this->getDispatcher();
- $dispatcher->addListener('console.command', function () {
- throw new \RuntimeException('foo');
- });
-
- $application = new Application();
- $application->setDispatcher($dispatcher);
- $application->setAutoExit(false);
-
- $application->register('foo')->setCode(function (InputInterface $input, OutputInterface $output) {
- $output->write('foo.');
- });
-
- $tester = new ApplicationTester($application);
- $tester->run(['command' => 'foo']);
- $this->assertContains('before.error.after.', $tester->getDisplay());
- }
-
- public function testRunWithError()
- {
- $application = new Application();
- $application->setAutoExit(false);
- $application->setCatchExceptions(false);
-
- $application->register('dym')->setCode(function (InputInterface $input, OutputInterface $output) {
- $output->write('dym.');
-
- throw new \Error('dymerr');
- });
-
- $tester = new ApplicationTester($application);
-
- try {
- $tester->run(['command' => 'dym']);
- $this->fail('Error expected.');
- } catch (\Error $e) {
- $this->assertSame('dymerr', $e->getMessage());
- }
- }
-
- public function testRunAllowsErrorListenersToSilenceTheException()
- {
- $dispatcher = $this->getDispatcher();
- $dispatcher->addListener('console.error', function (ConsoleErrorEvent $event) {
- $event->getOutput()->write('silenced.');
-
- $event->setExitCode(0);
- });
-
- $dispatcher->addListener('console.command', function () {
- throw new \RuntimeException('foo');
- });
-
- $application = new Application();
- $application->setDispatcher($dispatcher);
- $application->setAutoExit(false);
-
- $application->register('foo')->setCode(function (InputInterface $input, OutputInterface $output) {
- $output->write('foo.');
- });
-
- $tester = new ApplicationTester($application);
- $tester->run(['command' => 'foo']);
- $this->assertContains('before.error.silenced.after.', $tester->getDisplay());
- $this->assertEquals(ConsoleCommandEvent::RETURN_CODE_DISABLED, $tester->getStatusCode());
- }
-
- public function testConsoleErrorEventIsTriggeredOnCommandNotFound()
- {
- $dispatcher = new EventDispatcher();
- $dispatcher->addListener('console.error', function (ConsoleErrorEvent $event) {
- $this->assertNull($event->getCommand());
- $this->assertInstanceOf(CommandNotFoundException::class, $event->getError());
- $event->getOutput()->write('silenced command not found');
- });
-
- $application = new Application();
- $application->setDispatcher($dispatcher);
- $application->setAutoExit(false);
-
- $tester = new ApplicationTester($application);
- $tester->run(['command' => 'unknown']);
- $this->assertContains('silenced command not found', $tester->getDisplay());
- $this->assertEquals(1, $tester->getStatusCode());
- }
-
- public function testErrorIsRethrownIfNotHandledByConsoleErrorEvent()
- {
- $application = new Application();
- $application->setAutoExit(false);
- $application->setCatchExceptions(false);
- $application->setDispatcher(new EventDispatcher());
-
- $application->register('dym')->setCode(function (InputInterface $input, OutputInterface $output) {
- new \UnknownClass();
- });
-
- $tester = new ApplicationTester($application);
-
- try {
- $tester->run(['command' => 'dym']);
- $this->fail('->run() should rethrow PHP errors if not handled via ConsoleErrorEvent.');
- } catch (\Error $e) {
- $this->assertSame($e->getMessage(), 'Class \'UnknownClass\' not found');
- }
- }
-
- /**
- * @expectedException \LogicException
- * @expectedExceptionMessage error
- */
- public function testRunWithErrorAndDispatcher()
- {
- $application = new Application();
- $application->setDispatcher($this->getDispatcher());
- $application->setAutoExit(false);
- $application->setCatchExceptions(false);
-
- $application->register('dym')->setCode(function (InputInterface $input, OutputInterface $output) {
- $output->write('dym.');
-
- throw new \Error('dymerr');
- });
-
- $tester = new ApplicationTester($application);
- $tester->run(['command' => 'dym']);
- $this->assertContains('before.dym.error.after.', $tester->getDisplay(), 'The PHP Error did not dispached events');
- }
-
- public function testRunDispatchesAllEventsWithError()
- {
- $application = new Application();
- $application->setDispatcher($this->getDispatcher());
- $application->setAutoExit(false);
-
- $application->register('dym')->setCode(function (InputInterface $input, OutputInterface $output) {
- $output->write('dym.');
-
- throw new \Error('dymerr');
- });
-
- $tester = new ApplicationTester($application);
- $tester->run(['command' => 'dym']);
- $this->assertContains('before.dym.error.after.', $tester->getDisplay(), 'The PHP Error did not dispached events');
- }
-
- public function testRunWithErrorFailingStatusCode()
- {
- $application = new Application();
- $application->setDispatcher($this->getDispatcher());
- $application->setAutoExit(false);
-
- $application->register('dus')->setCode(function (InputInterface $input, OutputInterface $output) {
- $output->write('dus.');
-
- throw new \Error('duserr');
- });
-
- $tester = new ApplicationTester($application);
- $tester->run(['command' => 'dus']);
- $this->assertSame(1, $tester->getStatusCode(), 'Status code should be 1');
- }
-
- public function testRunWithDispatcherSkippingCommand()
- {
- $application = new Application();
- $application->setDispatcher($this->getDispatcher(true));
- $application->setAutoExit(false);
-
- $application->register('foo')->setCode(function (InputInterface $input, OutputInterface $output) {
- $output->write('foo.');
- });
-
- $tester = new ApplicationTester($application);
- $exitCode = $tester->run(['command' => 'foo']);
- $this->assertContains('before.after.', $tester->getDisplay());
- $this->assertEquals(ConsoleCommandEvent::RETURN_CODE_DISABLED, $exitCode);
- }
-
- public function testRunWithDispatcherAccessingInputOptions()
- {
- $noInteractionValue = null;
- $quietValue = null;
-
- $dispatcher = $this->getDispatcher();
- $dispatcher->addListener('console.command', function (ConsoleCommandEvent $event) use (&$noInteractionValue, &$quietValue) {
- $input = $event->getInput();
-
- $noInteractionValue = $input->getOption('no-interaction');
- $quietValue = $input->getOption('quiet');
- });
-
- $application = new Application();
- $application->setDispatcher($dispatcher);
- $application->setAutoExit(false);
-
- $application->register('foo')->setCode(function (InputInterface $input, OutputInterface $output) {
- $output->write('foo.');
- });
-
- $tester = new ApplicationTester($application);
- $tester->run(['command' => 'foo', '--no-interaction' => true]);
-
- $this->assertTrue($noInteractionValue);
- $this->assertFalse($quietValue);
- }
-
- public function testRunWithDispatcherAddingInputOptions()
- {
- $extraValue = null;
-
- $dispatcher = $this->getDispatcher();
- $dispatcher->addListener('console.command', function (ConsoleCommandEvent $event) use (&$extraValue) {
- $definition = $event->getCommand()->getDefinition();
- $input = $event->getInput();
-
- $definition->addOption(new InputOption('extra', null, InputOption::VALUE_REQUIRED));
- $input->bind($definition);
-
- $extraValue = $input->getOption('extra');
- });
-
- $application = new Application();
- $application->setDispatcher($dispatcher);
- $application->setAutoExit(false);
-
- $application->register('foo')->setCode(function (InputInterface $input, OutputInterface $output) {
- $output->write('foo.');
- });
-
- $tester = new ApplicationTester($application);
- $tester->run(['command' => 'foo', '--extra' => 'some test value']);
-
- $this->assertEquals('some test value', $extraValue);
- }
-
- public function testSetRunCustomDefaultCommand()
- {
- $command = new \FooCommand();
-
- $application = new Application();
- $application->setAutoExit(false);
- $application->add($command);
- $application->setDefaultCommand($command->getName());
-
- $tester = new ApplicationTester($application);
- $tester->run([], ['interactive' => false]);
- $this->assertEquals('called'.PHP_EOL, $tester->getDisplay(), 'Application runs the default set command if different from \'list\' command');
-
- $application = new CustomDefaultCommandApplication();
- $application->setAutoExit(false);
-
- $tester = new ApplicationTester($application);
- $tester->run([], ['interactive' => false]);
-
- $this->assertEquals('called'.PHP_EOL, $tester->getDisplay(), 'Application runs the default set command if different from \'list\' command');
- }
-
- public function testSetRunCustomDefaultCommandWithOption()
- {
- $command = new \FooOptCommand();
-
- $application = new Application();
- $application->setAutoExit(false);
- $application->add($command);
- $application->setDefaultCommand($command->getName());
-
- $tester = new ApplicationTester($application);
- $tester->run(['--fooopt' => 'opt'], ['interactive' => false]);
-
- $this->assertEquals('called'.PHP_EOL.'opt'.PHP_EOL, $tester->getDisplay(), 'Application runs the default set command if different from \'list\' command');
- }
-
- public function testSetRunCustomSingleCommand()
- {
- $command = new \FooCommand();
-
- $application = new Application();
- $application->setAutoExit(false);
- $application->add($command);
- $application->setDefaultCommand($command->getName(), true);
-
- $tester = new ApplicationTester($application);
-
- $tester->run([]);
- $this->assertContains('called', $tester->getDisplay());
-
- $tester->run(['--help' => true]);
- $this->assertContains('The foo:bar command', $tester->getDisplay());
- }
-
- /**
- * @requires function posix_isatty
- */
- public function testCanCheckIfTerminalIsInteractive()
- {
- $application = new CustomDefaultCommandApplication();
- $application->setAutoExit(false);
-
- $tester = new ApplicationTester($application);
- $tester->run(['command' => 'help']);
-
- $this->assertFalse($tester->getInput()->hasParameterOption(['--no-interaction', '-n']));
-
- $inputStream = $tester->getInput()->getStream();
- $this->assertEquals($tester->getInput()->isInteractive(), @posix_isatty($inputStream));
- }
-
- public function testRunLazyCommandService()
- {
- $container = new ContainerBuilder();
- $container->addCompilerPass(new AddConsoleCommandPass());
- $container
- ->register('lazy-command', LazyCommand::class)
- ->addTag('console.command', ['command' => 'lazy:command'])
- ->addTag('console.command', ['command' => 'lazy:alias'])
- ->addTag('console.command', ['command' => 'lazy:alias2']);
- $container->compile();
-
- $application = new Application();
- $application->setCommandLoader($container->get('console.command_loader'));
- $application->setAutoExit(false);
-
- $tester = new ApplicationTester($application);
-
- $tester->run(['command' => 'lazy:command']);
- $this->assertSame("lazy-command called\n", $tester->getDisplay(true));
-
- $tester->run(['command' => 'lazy:alias']);
- $this->assertSame("lazy-command called\n", $tester->getDisplay(true));
-
- $tester->run(['command' => 'lazy:alias2']);
- $this->assertSame("lazy-command called\n", $tester->getDisplay(true));
-
- $command = $application->get('lazy:command');
- $this->assertSame(['lazy:alias', 'lazy:alias2'], $command->getAliases());
- }
-
- /**
- * @expectedException \Symfony\Component\Console\Exception\CommandNotFoundException
- */
- public function testGetDisabledLazyCommand()
- {
- $application = new Application();
- $application->setCommandLoader(new FactoryCommandLoader(['disabled' => function () { return new DisabledCommand(); }]));
- $application->get('disabled');
- }
-
- public function testHasReturnsFalseForDisabledLazyCommand()
- {
- $application = new Application();
- $application->setCommandLoader(new FactoryCommandLoader(['disabled' => function () { return new DisabledCommand(); }]));
- $this->assertFalse($application->has('disabled'));
- }
-
- public function testAllExcludesDisabledLazyCommand()
- {
- $application = new Application();
- $application->setCommandLoader(new FactoryCommandLoader(['disabled' => function () { return new DisabledCommand(); }]));
- $this->assertArrayNotHasKey('disabled', $application->all());
- }
-
- protected function getDispatcher($skipCommand = false)
- {
- $dispatcher = new EventDispatcher();
- $dispatcher->addListener('console.command', function (ConsoleCommandEvent $event) use ($skipCommand) {
- $event->getOutput()->write('before.');
-
- if ($skipCommand) {
- $event->disableCommand();
- }
- });
- $dispatcher->addListener('console.terminate', function (ConsoleTerminateEvent $event) use ($skipCommand) {
- $event->getOutput()->writeln('after.');
-
- if (!$skipCommand) {
- $event->setExitCode(ConsoleCommandEvent::RETURN_CODE_DISABLED);
- }
- });
- $dispatcher->addListener('console.error', function (ConsoleErrorEvent $event) {
- $event->getOutput()->write('error.');
-
- $event->setError(new \LogicException('error.', $event->getExitCode(), $event->getError()));
- });
-
- return $dispatcher;
- }
-
- public function testErrorIsRethrownIfNotHandledByConsoleErrorEventWithCatchingEnabled()
- {
- $application = new Application();
- $application->setAutoExit(false);
- $application->setDispatcher(new EventDispatcher());
-
- $application->register('dym')->setCode(function (InputInterface $input, OutputInterface $output) {
- new \UnknownClass();
- });
-
- $tester = new ApplicationTester($application);
-
- try {
- $tester->run(['command' => 'dym']);
- $this->fail('->run() should rethrow PHP errors if not handled via ConsoleErrorEvent.');
- } catch (\Error $e) {
- $this->assertSame($e->getMessage(), 'Class \'UnknownClass\' not found');
- }
- }
-
- /**
- * @expectedException \RuntimeException
- * @expectedExceptionMessage foo
- */
- public function testThrowingErrorListener()
- {
- $dispatcher = $this->getDispatcher();
- $dispatcher->addListener('console.error', function (ConsoleErrorEvent $event) {
- throw new \RuntimeException('foo');
- });
-
- $dispatcher->addListener('console.command', function () {
- throw new \RuntimeException('bar');
- });
-
- $application = new Application();
- $application->setDispatcher($dispatcher);
- $application->setAutoExit(false);
- $application->setCatchExceptions(false);
-
- $application->register('foo')->setCode(function (InputInterface $input, OutputInterface $output) {
- $output->write('foo.');
- });
-
- $tester = new ApplicationTester($application);
- $tester->run(['command' => 'foo']);
- }
-}
-
-class CustomApplication extends Application
-{
- /**
- * Overwrites the default input definition.
- *
- * @return InputDefinition An InputDefinition instance
- */
- protected function getDefaultInputDefinition()
- {
- return new InputDefinition([new InputOption('--custom', '-c', InputOption::VALUE_NONE, 'Set the custom input definition.')]);
- }
-
- /**
- * Gets the default helper set with the helpers that should always be available.
- *
- * @return HelperSet A HelperSet instance
- */
- protected function getDefaultHelperSet()
- {
- return new HelperSet([new FormatterHelper()]);
- }
-}
-
-class CustomDefaultCommandApplication extends Application
-{
- /**
- * Overwrites the constructor in order to set a different default command.
- */
- public function __construct()
- {
- parent::__construct();
-
- $command = new \FooCommand();
- $this->add($command);
- $this->setDefaultCommand($command->getName());
- }
-}
-
-class LazyCommand extends Command
-{
- public function execute(InputInterface $input, OutputInterface $output)
- {
- $output->writeln('lazy-command called');
- }
-}
-
-class DisabledCommand extends Command
-{
- public function isEnabled()
- {
- return false;
- }
-}
diff --git a/vendor/symfony/console/Tests/Command/CommandTest.php b/vendor/symfony/console/Tests/Command/CommandTest.php
deleted file mode 100644
index 3e1673dd5..000000000
--- a/vendor/symfony/console/Tests/Command/CommandTest.php
+++ /dev/null
@@ -1,436 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Console\Tests\Command;
-
-use PHPUnit\Framework\TestCase;
-use Symfony\Component\Console\Application;
-use Symfony\Component\Console\Command\Command;
-use Symfony\Component\Console\Helper\FormatterHelper;
-use Symfony\Component\Console\Input\InputArgument;
-use Symfony\Component\Console\Input\InputDefinition;
-use Symfony\Component\Console\Input\InputInterface;
-use Symfony\Component\Console\Input\InputOption;
-use Symfony\Component\Console\Input\StringInput;
-use Symfony\Component\Console\Output\NullOutput;
-use Symfony\Component\Console\Output\OutputInterface;
-use Symfony\Component\Console\Tester\CommandTester;
-
-class CommandTest extends TestCase
-{
- protected static $fixturesPath;
-
- public static function setUpBeforeClass()
- {
- self::$fixturesPath = __DIR__.'/../Fixtures/';
- require_once self::$fixturesPath.'/TestCommand.php';
- }
-
- public function testConstructor()
- {
- $command = new Command('foo:bar');
- $this->assertEquals('foo:bar', $command->getName(), '__construct() takes the command name as its first argument');
- }
-
- /**
- * @expectedException \LogicException
- * @expectedExceptionMessage The command defined in "Symfony\Component\Console\Command\Command" cannot have an empty name.
- */
- public function testCommandNameCannotBeEmpty()
- {
- (new Application())->add(new Command());
- }
-
- public function testSetApplication()
- {
- $application = new Application();
- $command = new \TestCommand();
- $command->setApplication($application);
- $this->assertEquals($application, $command->getApplication(), '->setApplication() sets the current application');
- $this->assertEquals($application->getHelperSet(), $command->getHelperSet());
- }
-
- public function testSetApplicationNull()
- {
- $command = new \TestCommand();
- $command->setApplication(null);
- $this->assertNull($command->getHelperSet());
- }
-
- public function testSetGetDefinition()
- {
- $command = new \TestCommand();
- $ret = $command->setDefinition($definition = new InputDefinition());
- $this->assertEquals($command, $ret, '->setDefinition() implements a fluent interface');
- $this->assertEquals($definition, $command->getDefinition(), '->setDefinition() sets the current InputDefinition instance');
- $command->setDefinition([new InputArgument('foo'), new InputOption('bar')]);
- $this->assertTrue($command->getDefinition()->hasArgument('foo'), '->setDefinition() also takes an array of InputArguments and InputOptions as an argument');
- $this->assertTrue($command->getDefinition()->hasOption('bar'), '->setDefinition() also takes an array of InputArguments and InputOptions as an argument');
- $command->setDefinition(new InputDefinition());
- }
-
- public function testAddArgument()
- {
- $command = new \TestCommand();
- $ret = $command->addArgument('foo');
- $this->assertEquals($command, $ret, '->addArgument() implements a fluent interface');
- $this->assertTrue($command->getDefinition()->hasArgument('foo'), '->addArgument() adds an argument to the command');
- }
-
- public function testAddOption()
- {
- $command = new \TestCommand();
- $ret = $command->addOption('foo');
- $this->assertEquals($command, $ret, '->addOption() implements a fluent interface');
- $this->assertTrue($command->getDefinition()->hasOption('foo'), '->addOption() adds an option to the command');
- }
-
- public function testSetHidden()
- {
- $command = new \TestCommand();
- $command->setHidden(true);
- $this->assertTrue($command->isHidden());
- }
-
- public function testGetNamespaceGetNameSetName()
- {
- $command = new \TestCommand();
- $this->assertEquals('namespace:name', $command->getName(), '->getName() returns the command name');
- $command->setName('foo');
- $this->assertEquals('foo', $command->getName(), '->setName() sets the command name');
-
- $ret = $command->setName('foobar:bar');
- $this->assertEquals($command, $ret, '->setName() implements a fluent interface');
- $this->assertEquals('foobar:bar', $command->getName(), '->setName() sets the command name');
- }
-
- /**
- * @dataProvider provideInvalidCommandNames
- */
- public function testInvalidCommandNames($name)
- {
- if (method_exists($this, 'expectException')) {
- $this->expectException('InvalidArgumentException');
- $this->expectExceptionMessage(sprintf('Command name "%s" is invalid.', $name));
- } else {
- $this->setExpectedException('InvalidArgumentException', sprintf('Command name "%s" is invalid.', $name));
- }
-
- $command = new \TestCommand();
- $command->setName($name);
- }
-
- public function provideInvalidCommandNames()
- {
- return [
- [''],
- ['foo:'],
- ];
- }
-
- public function testGetSetDescription()
- {
- $command = new \TestCommand();
- $this->assertEquals('description', $command->getDescription(), '->getDescription() returns the description');
- $ret = $command->setDescription('description1');
- $this->assertEquals($command, $ret, '->setDescription() implements a fluent interface');
- $this->assertEquals('description1', $command->getDescription(), '->setDescription() sets the description');
- }
-
- public function testGetSetHelp()
- {
- $command = new \TestCommand();
- $this->assertEquals('help', $command->getHelp(), '->getHelp() returns the help');
- $ret = $command->setHelp('help1');
- $this->assertEquals($command, $ret, '->setHelp() implements a fluent interface');
- $this->assertEquals('help1', $command->getHelp(), '->setHelp() sets the help');
- $command->setHelp('');
- $this->assertEquals('', $command->getHelp(), '->getHelp() does not fall back to the description');
- }
-
- public function testGetProcessedHelp()
- {
- $command = new \TestCommand();
- $command->setHelp('The %command.name% command does... Example: php %command.full_name%.');
- $this->assertContains('The namespace:name command does...', $command->getProcessedHelp(), '->getProcessedHelp() replaces %command.name% correctly');
- $this->assertNotContains('%command.full_name%', $command->getProcessedHelp(), '->getProcessedHelp() replaces %command.full_name%');
-
- $command = new \TestCommand();
- $command->setHelp('');
- $this->assertContains('description', $command->getProcessedHelp(), '->getProcessedHelp() falls back to the description');
-
- $command = new \TestCommand();
- $command->setHelp('The %command.name% command does... Example: php %command.full_name%.');
- $application = new Application();
- $application->add($command);
- $application->setDefaultCommand('namespace:name', true);
- $this->assertContains('The namespace:name command does...', $command->getProcessedHelp(), '->getProcessedHelp() replaces %command.name% correctly in single command applications');
- $this->assertNotContains('%command.full_name%', $command->getProcessedHelp(), '->getProcessedHelp() replaces %command.full_name% in single command applications');
- }
-
- public function testGetSetAliases()
- {
- $command = new \TestCommand();
- $this->assertEquals(['name'], $command->getAliases(), '->getAliases() returns the aliases');
- $ret = $command->setAliases(['name1']);
- $this->assertEquals($command, $ret, '->setAliases() implements a fluent interface');
- $this->assertEquals(['name1'], $command->getAliases(), '->setAliases() sets the aliases');
- }
-
- public function testSetAliasesNull()
- {
- $command = new \TestCommand();
- $this->{method_exists($this, $_ = 'expectException') ? $_ : 'setExpectedException'}('InvalidArgumentException');
- $command->setAliases(null);
- }
-
- public function testGetSynopsis()
- {
- $command = new \TestCommand();
- $command->addOption('foo');
- $command->addArgument('bar');
- $this->assertEquals('namespace:name [--foo] [--] []', $command->getSynopsis(), '->getSynopsis() returns the synopsis');
- }
-
- public function testAddGetUsages()
- {
- $command = new \TestCommand();
- $command->addUsage('foo1');
- $command->addUsage('foo2');
- $this->assertContains('namespace:name foo1', $command->getUsages());
- $this->assertContains('namespace:name foo2', $command->getUsages());
- }
-
- public function testGetHelper()
- {
- $application = new Application();
- $command = new \TestCommand();
- $command->setApplication($application);
- $formatterHelper = new FormatterHelper();
- $this->assertEquals($formatterHelper->getName(), $command->getHelper('formatter')->getName(), '->getHelper() returns the correct helper');
- }
-
- /**
- * @expectedException \LogicException
- * @expectedExceptionMessage Cannot retrieve helper "formatter" because there is no HelperSet defined.
- */
- public function testGetHelperWithoutHelperSet()
- {
- $command = new \TestCommand();
- $command->getHelper('formatter');
- }
-
- public function testMergeApplicationDefinition()
- {
- $application1 = new Application();
- $application1->getDefinition()->addArguments([new InputArgument('foo')]);
- $application1->getDefinition()->addOptions([new InputOption('bar')]);
- $command = new \TestCommand();
- $command->setApplication($application1);
- $command->setDefinition($definition = new InputDefinition([new InputArgument('bar'), new InputOption('foo')]));
-
- $r = new \ReflectionObject($command);
- $m = $r->getMethod('mergeApplicationDefinition');
- $m->setAccessible(true);
- $m->invoke($command);
- $this->assertTrue($command->getDefinition()->hasArgument('foo'), '->mergeApplicationDefinition() merges the application arguments and the command arguments');
- $this->assertTrue($command->getDefinition()->hasArgument('bar'), '->mergeApplicationDefinition() merges the application arguments and the command arguments');
- $this->assertTrue($command->getDefinition()->hasOption('foo'), '->mergeApplicationDefinition() merges the application options and the command options');
- $this->assertTrue($command->getDefinition()->hasOption('bar'), '->mergeApplicationDefinition() merges the application options and the command options');
-
- $m->invoke($command);
- $this->assertEquals(3, $command->getDefinition()->getArgumentCount(), '->mergeApplicationDefinition() does not try to merge twice the application arguments and options');
- }
-
- public function testMergeApplicationDefinitionWithoutArgsThenWithArgsAddsArgs()
- {
- $application1 = new Application();
- $application1->getDefinition()->addArguments([new InputArgument('foo')]);
- $application1->getDefinition()->addOptions([new InputOption('bar')]);
- $command = new \TestCommand();
- $command->setApplication($application1);
- $command->setDefinition($definition = new InputDefinition([]));
-
- $r = new \ReflectionObject($command);
- $m = $r->getMethod('mergeApplicationDefinition');
- $m->setAccessible(true);
- $m->invoke($command, false);
- $this->assertTrue($command->getDefinition()->hasOption('bar'), '->mergeApplicationDefinition(false) merges the application and the command options');
- $this->assertFalse($command->getDefinition()->hasArgument('foo'), '->mergeApplicationDefinition(false) does not merge the application arguments');
-
- $m->invoke($command, true);
- $this->assertTrue($command->getDefinition()->hasArgument('foo'), '->mergeApplicationDefinition(true) merges the application arguments and the command arguments');
-
- $m->invoke($command);
- $this->assertEquals(2, $command->getDefinition()->getArgumentCount(), '->mergeApplicationDefinition() does not try to merge twice the application arguments');
- }
-
- public function testRunInteractive()
- {
- $tester = new CommandTester(new \TestCommand());
-
- $tester->execute([], ['interactive' => true]);
-
- $this->assertEquals('interact called'.PHP_EOL.'execute called'.PHP_EOL, $tester->getDisplay(), '->run() calls the interact() method if the input is interactive');
- }
-
- public function testRunNonInteractive()
- {
- $tester = new CommandTester(new \TestCommand());
-
- $tester->execute([], ['interactive' => false]);
-
- $this->assertEquals('execute called'.PHP_EOL, $tester->getDisplay(), '->run() does not call the interact() method if the input is not interactive');
- }
-
- /**
- * @expectedException \LogicException
- * @expectedExceptionMessage You must override the execute() method in the concrete command class.
- */
- public function testExecuteMethodNeedsToBeOverridden()
- {
- $command = new Command('foo');
- $command->run(new StringInput(''), new NullOutput());
- }
-
- /**
- * @expectedException \Symfony\Component\Console\Exception\InvalidOptionException
- * @expectedExceptionMessage The "--bar" option does not exist.
- */
- public function testRunWithInvalidOption()
- {
- $command = new \TestCommand();
- $tester = new CommandTester($command);
- $tester->execute(['--bar' => true]);
- }
-
- public function testRunReturnsIntegerExitCode()
- {
- $command = new \TestCommand();
- $exitCode = $command->run(new StringInput(''), new NullOutput());
- $this->assertSame(0, $exitCode, '->run() returns integer exit code (treats null as 0)');
-
- $command = $this->getMockBuilder('TestCommand')->setMethods(['execute'])->getMock();
- $command->expects($this->once())
- ->method('execute')
- ->willReturn('2.3');
- $exitCode = $command->run(new StringInput(''), new NullOutput());
- $this->assertSame(2, $exitCode, '->run() returns integer exit code (casts numeric to int)');
- }
-
- public function testRunWithApplication()
- {
- $command = new \TestCommand();
- $command->setApplication(new Application());
- $exitCode = $command->run(new StringInput(''), new NullOutput());
-
- $this->assertSame(0, $exitCode, '->run() returns an integer exit code');
- }
-
- public function testRunReturnsAlwaysInteger()
- {
- $command = new \TestCommand();
-
- $this->assertSame(0, $command->run(new StringInput(''), new NullOutput()));
- }
-
- public function testRunWithProcessTitle()
- {
- $command = new \TestCommand();
- $command->setApplication(new Application());
- $command->setProcessTitle('foo');
- $this->assertSame(0, $command->run(new StringInput(''), new NullOutput()));
- if (\function_exists('cli_set_process_title')) {
- if (null === @cli_get_process_title() && 'Darwin' === PHP_OS) {
- $this->markTestSkipped('Running "cli_get_process_title" as an unprivileged user is not supported on MacOS.');
- }
- $this->assertEquals('foo', cli_get_process_title());
- }
- }
-
- public function testSetCode()
- {
- $command = new \TestCommand();
- $ret = $command->setCode(function (InputInterface $input, OutputInterface $output) {
- $output->writeln('from the code...');
- });
- $this->assertEquals($command, $ret, '->setCode() implements a fluent interface');
- $tester = new CommandTester($command);
- $tester->execute([]);
- $this->assertEquals('interact called'.PHP_EOL.'from the code...'.PHP_EOL, $tester->getDisplay());
- }
-
- public function getSetCodeBindToClosureTests()
- {
- return [
- [true, 'not bound to the command'],
- [false, 'bound to the command'],
- ];
- }
-
- /**
- * @dataProvider getSetCodeBindToClosureTests
- */
- public function testSetCodeBindToClosure($previouslyBound, $expected)
- {
- $code = createClosure();
- if ($previouslyBound) {
- $code = $code->bindTo($this);
- }
-
- $command = new \TestCommand();
- $command->setCode($code);
- $tester = new CommandTester($command);
- $tester->execute([]);
- $this->assertEquals('interact called'.PHP_EOL.$expected.PHP_EOL, $tester->getDisplay());
- }
-
- public function testSetCodeWithStaticClosure()
- {
- $command = new \TestCommand();
- $command->setCode(self::createClosure());
- $tester = new CommandTester($command);
- $tester->execute([]);
-
- $this->assertEquals('interact called'.PHP_EOL.'bound'.PHP_EOL, $tester->getDisplay());
- }
-
- private static function createClosure()
- {
- return function (InputInterface $input, OutputInterface $output) {
- $output->writeln(isset($this) ? 'bound' : 'not bound');
- };
- }
-
- public function testSetCodeWithNonClosureCallable()
- {
- $command = new \TestCommand();
- $ret = $command->setCode([$this, 'callableMethodCommand']);
- $this->assertEquals($command, $ret, '->setCode() implements a fluent interface');
- $tester = new CommandTester($command);
- $tester->execute([]);
- $this->assertEquals('interact called'.PHP_EOL.'from the code...'.PHP_EOL, $tester->getDisplay());
- }
-
- public function callableMethodCommand(InputInterface $input, OutputInterface $output)
- {
- $output->writeln('from the code...');
- }
-}
-
-// In order to get an unbound closure, we should create it outside a class
-// scope.
-function createClosure()
-{
- return function (InputInterface $input, OutputInterface $output) {
- $output->writeln($this instanceof Command ? 'bound to the command' : 'not bound to the command');
- };
-}
diff --git a/vendor/symfony/console/Tests/Command/HelpCommandTest.php b/vendor/symfony/console/Tests/Command/HelpCommandTest.php
deleted file mode 100644
index ce9d8d4fe..000000000
--- a/vendor/symfony/console/Tests/Command/HelpCommandTest.php
+++ /dev/null
@@ -1,71 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Console\Tests\Command;
-
-use PHPUnit\Framework\TestCase;
-use Symfony\Component\Console\Application;
-use Symfony\Component\Console\Command\HelpCommand;
-use Symfony\Component\Console\Command\ListCommand;
-use Symfony\Component\Console\Tester\CommandTester;
-
-class HelpCommandTest extends TestCase
-{
- public function testExecuteForCommandAlias()
- {
- $command = new HelpCommand();
- $command->setApplication(new Application());
- $commandTester = new CommandTester($command);
- $commandTester->execute(['command_name' => 'li'], ['decorated' => false]);
- $this->assertContains('list [options] [--] []', $commandTester->getDisplay(), '->execute() returns a text help for the given command alias');
- $this->assertContains('format=FORMAT', $commandTester->getDisplay(), '->execute() returns a text help for the given command alias');
- $this->assertContains('raw', $commandTester->getDisplay(), '->execute() returns a text help for the given command alias');
- }
-
- public function testExecuteForCommand()
- {
- $command = new HelpCommand();
- $commandTester = new CommandTester($command);
- $command->setCommand(new ListCommand());
- $commandTester->execute([], ['decorated' => false]);
- $this->assertContains('list [options] [--] []', $commandTester->getDisplay(), '->execute() returns a text help for the given command');
- $this->assertContains('format=FORMAT', $commandTester->getDisplay(), '->execute() returns a text help for the given command');
- $this->assertContains('raw', $commandTester->getDisplay(), '->execute() returns a text help for the given command');
- }
-
- public function testExecuteForCommandWithXmlOption()
- {
- $command = new HelpCommand();
- $commandTester = new CommandTester($command);
- $command->setCommand(new ListCommand());
- $commandTester->execute(['--format' => 'xml']);
- $this->assertContains('getDisplay(), '->execute() returns an XML help text if --xml is passed');
- }
-
- public function testExecuteForApplicationCommand()
- {
- $application = new Application();
- $commandTester = new CommandTester($application->get('help'));
- $commandTester->execute(['command_name' => 'list']);
- $this->assertContains('list [options] [--] []', $commandTester->getDisplay(), '->execute() returns a text help for the given command');
- $this->assertContains('format=FORMAT', $commandTester->getDisplay(), '->execute() returns a text help for the given command');
- $this->assertContains('raw', $commandTester->getDisplay(), '->execute() returns a text help for the given command');
- }
-
- public function testExecuteForApplicationCommandWithXmlOption()
- {
- $application = new Application();
- $commandTester = new CommandTester($application->get('help'));
- $commandTester->execute(['command_name' => 'list', '--format' => 'xml']);
- $this->assertContains('list [--raw] [--format FORMAT] [--] [<namespace>]', $commandTester->getDisplay(), '->execute() returns a text help for the given command');
- $this->assertContains('getDisplay(), '->execute() returns an XML help text if --format=xml is passed');
- }
-}
diff --git a/vendor/symfony/console/Tests/Command/ListCommandTest.php b/vendor/symfony/console/Tests/Command/ListCommandTest.php
deleted file mode 100644
index 57687d4c6..000000000
--- a/vendor/symfony/console/Tests/Command/ListCommandTest.php
+++ /dev/null
@@ -1,113 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Console\Tests\Command;
-
-use PHPUnit\Framework\TestCase;
-use Symfony\Component\Console\Application;
-use Symfony\Component\Console\Tester\CommandTester;
-
-class ListCommandTest extends TestCase
-{
- public function testExecuteListsCommands()
- {
- $application = new Application();
- $commandTester = new CommandTester($command = $application->get('list'));
- $commandTester->execute(['command' => $command->getName()], ['decorated' => false]);
-
- $this->assertRegExp('/help\s{2,}Displays help for a command/', $commandTester->getDisplay(), '->execute() returns a list of available commands');
- }
-
- public function testExecuteListsCommandsWithXmlOption()
- {
- $application = new Application();
- $commandTester = new CommandTester($command = $application->get('list'));
- $commandTester->execute(['command' => $command->getName(), '--format' => 'xml']);
- $this->assertRegExp('//', $commandTester->getDisplay(), '->execute() returns a list of available commands in XML if --xml is passed');
- }
-
- public function testExecuteListsCommandsWithRawOption()
- {
- $application = new Application();
- $commandTester = new CommandTester($command = $application->get('list'));
- $commandTester->execute(['command' => $command->getName(), '--raw' => true]);
- $output = <<<'EOF'
-help Displays help for a command
-list Lists commands
-
-EOF;
-
- $this->assertEquals($output, $commandTester->getDisplay(true));
- }
-
- public function testExecuteListsCommandsWithNamespaceArgument()
- {
- require_once realpath(__DIR__.'/../Fixtures/FooCommand.php');
- $application = new Application();
- $application->add(new \FooCommand());
- $commandTester = new CommandTester($command = $application->get('list'));
- $commandTester->execute(['command' => $command->getName(), 'namespace' => 'foo', '--raw' => true]);
- $output = <<<'EOF'
-foo:bar The foo:bar command
-
-EOF;
-
- $this->assertEquals($output, $commandTester->getDisplay(true));
- }
-
- public function testExecuteListsCommandsOrder()
- {
- require_once realpath(__DIR__.'/../Fixtures/Foo6Command.php');
- $application = new Application();
- $application->add(new \Foo6Command());
- $commandTester = new CommandTester($command = $application->get('list'));
- $commandTester->execute(['command' => $command->getName()], ['decorated' => false]);
- $output = <<<'EOF'
-Console Tool
-
-Usage:
- command [options] [arguments]
-
-Options:
- -h, --help Display this help message
- -q, --quiet Do not output any message
- -V, --version Display this application version
- --ansi Force ANSI output
- --no-ansi Disable ANSI output
- -n, --no-interaction Do not ask any interactive question
- -v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
-
-Available commands:
- help Displays help for a command
- list Lists commands
- 0foo
- 0foo:bar 0foo:bar command
-EOF;
-
- $this->assertEquals($output, trim($commandTester->getDisplay(true)));
- }
-
- public function testExecuteListsCommandsOrderRaw()
- {
- require_once realpath(__DIR__.'/../Fixtures/Foo6Command.php');
- $application = new Application();
- $application->add(new \Foo6Command());
- $commandTester = new CommandTester($command = $application->get('list'));
- $commandTester->execute(['command' => $command->getName(), '--raw' => true]);
- $output = <<<'EOF'
-help Displays help for a command
-list Lists commands
-0foo:bar 0foo:bar command
-EOF;
-
- $this->assertEquals($output, trim($commandTester->getDisplay(true)));
- }
-}
diff --git a/vendor/symfony/console/Tests/Command/LockableTraitTest.php b/vendor/symfony/console/Tests/Command/LockableTraitTest.php
deleted file mode 100644
index 94b0819bb..000000000
--- a/vendor/symfony/console/Tests/Command/LockableTraitTest.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\Console\Tests\Command;
-
-use PHPUnit\Framework\TestCase;
-use Symfony\Component\Console\Tester\CommandTester;
-use Symfony\Component\Lock\Factory;
-use Symfony\Component\Lock\Store\FlockStore;
-use Symfony\Component\Lock\Store\SemaphoreStore;
-
-class LockableTraitTest extends TestCase
-{
- protected static $fixturesPath;
-
- public static function setUpBeforeClass()
- {
- self::$fixturesPath = __DIR__.'/../Fixtures/';
- require_once self::$fixturesPath.'/FooLockCommand.php';
- require_once self::$fixturesPath.'/FooLock2Command.php';
- }
-
- public function testLockIsReleased()
- {
- $command = new \FooLockCommand();
-
- $tester = new CommandTester($command);
- $this->assertSame(2, $tester->execute([]));
- $this->assertSame(2, $tester->execute([]));
- }
-
- public function testLockReturnsFalseIfAlreadyLockedByAnotherCommand()
- {
- $command = new \FooLockCommand();
-
- if (SemaphoreStore::isSupported()) {
- $store = new SemaphoreStore();
- } else {
- $store = new FlockStore();
- }
-
- $lock = (new Factory($store))->createLock($command->getName());
- $lock->acquire();
-
- $tester = new CommandTester($command);
- $this->assertSame(1, $tester->execute([]));
-
- $lock->release();
- $this->assertSame(2, $tester->execute([]));
- }
-
- public function testMultipleLockCallsThrowLogicException()
- {
- $command = new \FooLock2Command();
-
- $tester = new CommandTester($command);
- $this->assertSame(1, $tester->execute([]));
- }
-}
diff --git a/vendor/symfony/console/Tests/CommandLoader/ContainerCommandLoaderTest.php b/vendor/symfony/console/Tests/CommandLoader/ContainerCommandLoaderTest.php
deleted file mode 100644
index 18d6e77bf..000000000
--- a/vendor/symfony/console/Tests/CommandLoader/ContainerCommandLoaderTest.php
+++ /dev/null
@@ -1,61 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Console\Tests\CommandLoader;
-
-use PHPUnit\Framework\TestCase;
-use Symfony\Component\Console\Command\Command;
-use Symfony\Component\Console\CommandLoader\ContainerCommandLoader;
-use Symfony\Component\DependencyInjection\ServiceLocator;
-
-class ContainerCommandLoaderTest extends TestCase
-{
- public function testHas()
- {
- $loader = new ContainerCommandLoader(new ServiceLocator([
- 'foo-service' => function () { return new Command('foo'); },
- 'bar-service' => function () { return new Command('bar'); },
- ]), ['foo' => 'foo-service', 'bar' => 'bar-service']);
-
- $this->assertTrue($loader->has('foo'));
- $this->assertTrue($loader->has('bar'));
- $this->assertFalse($loader->has('baz'));
- }
-
- public function testGet()
- {
- $loader = new ContainerCommandLoader(new ServiceLocator([
- 'foo-service' => function () { return new Command('foo'); },
- 'bar-service' => function () { return new Command('bar'); },
- ]), ['foo' => 'foo-service', 'bar' => 'bar-service']);
-
- $this->assertInstanceOf(Command::class, $loader->get('foo'));
- $this->assertInstanceOf(Command::class, $loader->get('bar'));
- }
-
- /**
- * @expectedException \Symfony\Component\Console\Exception\CommandNotFoundException
- */
- public function testGetUnknownCommandThrows()
- {
- (new ContainerCommandLoader(new ServiceLocator([]), []))->get('unknown');
- }
-
- public function testGetCommandNames()
- {
- $loader = new ContainerCommandLoader(new ServiceLocator([
- 'foo-service' => function () { return new Command('foo'); },
- 'bar-service' => function () { return new Command('bar'); },
- ]), ['foo' => 'foo-service', 'bar' => 'bar-service']);
-
- $this->assertSame(['foo', 'bar'], $loader->getNames());
- }
-}
diff --git a/vendor/symfony/console/Tests/CommandLoader/FactoryCommandLoaderTest.php b/vendor/symfony/console/Tests/CommandLoader/FactoryCommandLoaderTest.php
deleted file mode 100644
index 7b9ec837e..000000000
--- a/vendor/symfony/console/Tests/CommandLoader/FactoryCommandLoaderTest.php
+++ /dev/null
@@ -1,60 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Console\Tests\CommandLoader;
-
-use PHPUnit\Framework\TestCase;
-use Symfony\Component\Console\Command\Command;
-use Symfony\Component\Console\CommandLoader\FactoryCommandLoader;
-
-class FactoryCommandLoaderTest extends TestCase
-{
- public function testHas()
- {
- $loader = new FactoryCommandLoader([
- 'foo' => function () { return new Command('foo'); },
- 'bar' => function () { return new Command('bar'); },
- ]);
-
- $this->assertTrue($loader->has('foo'));
- $this->assertTrue($loader->has('bar'));
- $this->assertFalse($loader->has('baz'));
- }
-
- public function testGet()
- {
- $loader = new FactoryCommandLoader([
- 'foo' => function () { return new Command('foo'); },
- 'bar' => function () { return new Command('bar'); },
- ]);
-
- $this->assertInstanceOf(Command::class, $loader->get('foo'));
- $this->assertInstanceOf(Command::class, $loader->get('bar'));
- }
-
- /**
- * @expectedException \Symfony\Component\Console\Exception\CommandNotFoundException
- */
- public function testGetUnknownCommandThrows()
- {
- (new FactoryCommandLoader([]))->get('unknown');
- }
-
- public function testGetCommandNames()
- {
- $loader = new FactoryCommandLoader([
- 'foo' => function () { return new Command('foo'); },
- 'bar' => function () { return new Command('bar'); },
- ]);
-
- $this->assertSame(['foo', 'bar'], $loader->getNames());
- }
-}
diff --git a/vendor/symfony/console/Tests/DependencyInjection/AddConsoleCommandPassTest.php b/vendor/symfony/console/Tests/DependencyInjection/AddConsoleCommandPassTest.php
deleted file mode 100644
index a0b66bc17..000000000
--- a/vendor/symfony/console/Tests/DependencyInjection/AddConsoleCommandPassTest.php
+++ /dev/null
@@ -1,258 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Console\Tests\DependencyInjection;
-
-use PHPUnit\Framework\TestCase;
-use Symfony\Component\Console\Command\Command;
-use Symfony\Component\Console\CommandLoader\ContainerCommandLoader;
-use Symfony\Component\Console\DependencyInjection\AddConsoleCommandPass;
-use Symfony\Component\DependencyInjection\Argument\ServiceClosureArgument;
-use Symfony\Component\DependencyInjection\ChildDefinition;
-use Symfony\Component\DependencyInjection\Compiler\PassConfig;
-use Symfony\Component\DependencyInjection\ContainerBuilder;
-use Symfony\Component\DependencyInjection\Definition;
-use Symfony\Component\DependencyInjection\TypedReference;
-
-class AddConsoleCommandPassTest extends TestCase
-{
- /**
- * @dataProvider visibilityProvider
- */
- public function testProcess($public)
- {
- $container = new ContainerBuilder();
- $container->addCompilerPass(new AddConsoleCommandPass(), PassConfig::TYPE_BEFORE_REMOVING);
- $container->setParameter('my-command.class', 'Symfony\Component\Console\Tests\DependencyInjection\MyCommand');
-
- $id = 'my-command';
- $definition = new Definition('%my-command.class%');
- $definition->setPublic($public);
- $definition->addTag('console.command');
- $container->setDefinition($id, $definition);
-
- $container->compile();
-
- $alias = 'console.command.public_alias.my-command';
-
- if ($public) {
- $this->assertFalse($container->hasAlias($alias));
- } else {
- // The alias is replaced by a Definition by the ReplaceAliasByActualDefinitionPass
- // in case the original service is private
- $this->assertFalse($container->hasDefinition($id));
- $this->assertTrue($container->hasDefinition($alias));
- }
-
- $this->assertTrue($container->hasParameter('console.command.ids'));
- $this->assertSame([$public ? $id : $alias], $container->getParameter('console.command.ids'));
- }
-
- public function testProcessRegistersLazyCommands()
- {
- $container = new ContainerBuilder();
- $command = $container
- ->register('my-command', MyCommand::class)
- ->setPublic(false)
- ->addTag('console.command', ['command' => 'my:command'])
- ->addTag('console.command', ['command' => 'my:alias'])
- ;
-
- (new AddConsoleCommandPass())->process($container);
-
- $commandLoader = $container->getDefinition('console.command_loader');
- $commandLocator = $container->getDefinition((string) $commandLoader->getArgument(0));
-
- $this->assertSame(ContainerCommandLoader::class, $commandLoader->getClass());
- $this->assertSame(['my:command' => 'my-command', 'my:alias' => 'my-command'], $commandLoader->getArgument(1));
- $this->assertEquals([['my-command' => new ServiceClosureArgument(new TypedReference('my-command', MyCommand::class))]], $commandLocator->getArguments());
- $this->assertSame([], $container->getParameter('console.command.ids'));
- $this->assertSame([['setName', ['my:command']], ['setAliases', [['my:alias']]]], $command->getMethodCalls());
- }
-
- public function testProcessFallsBackToDefaultName()
- {
- $container = new ContainerBuilder();
- $container
- ->register('with-default-name', NamedCommand::class)
- ->setPublic(false)
- ->addTag('console.command')
- ;
-
- $pass = new AddConsoleCommandPass();
- $pass->process($container);
-
- $commandLoader = $container->getDefinition('console.command_loader');
- $commandLocator = $container->getDefinition((string) $commandLoader->getArgument(0));
-
- $this->assertSame(ContainerCommandLoader::class, $commandLoader->getClass());
- $this->assertSame(['default' => 'with-default-name'], $commandLoader->getArgument(1));
- $this->assertEquals([['with-default-name' => new ServiceClosureArgument(new TypedReference('with-default-name', NamedCommand::class))]], $commandLocator->getArguments());
- $this->assertSame([], $container->getParameter('console.command.ids'));
-
- $container = new ContainerBuilder();
- $container
- ->register('with-default-name', NamedCommand::class)
- ->setPublic(false)
- ->addTag('console.command', ['command' => 'new-name'])
- ;
-
- $pass->process($container);
-
- $this->assertSame(['new-name' => 'with-default-name'], $container->getDefinition('console.command_loader')->getArgument(1));
- }
-
- public function visibilityProvider()
- {
- return [
- [true],
- [false],
- ];
- }
-
- /**
- * @expectedException \InvalidArgumentException
- * @expectedExceptionMessage The service "my-command" tagged "console.command" must not be abstract.
- */
- public function testProcessThrowAnExceptionIfTheServiceIsAbstract()
- {
- $container = new ContainerBuilder();
- $container->setResourceTracking(false);
- $container->addCompilerPass(new AddConsoleCommandPass(), PassConfig::TYPE_BEFORE_REMOVING);
-
- $definition = new Definition('Symfony\Component\Console\Tests\DependencyInjection\MyCommand');
- $definition->addTag('console.command');
- $definition->setAbstract(true);
- $container->setDefinition('my-command', $definition);
-
- $container->compile();
- }
-
- /**
- * @expectedException \InvalidArgumentException
- * @expectedExceptionMessage The service "my-command" tagged "console.command" must be a subclass of "Symfony\Component\Console\Command\Command".
- */
- public function testProcessThrowAnExceptionIfTheServiceIsNotASubclassOfCommand()
- {
- $container = new ContainerBuilder();
- $container->setResourceTracking(false);
- $container->addCompilerPass(new AddConsoleCommandPass(), PassConfig::TYPE_BEFORE_REMOVING);
-
- $definition = new Definition('SplObjectStorage');
- $definition->addTag('console.command');
- $container->setDefinition('my-command', $definition);
-
- $container->compile();
- }
-
- public function testProcessPrivateServicesWithSameCommand()
- {
- $container = new ContainerBuilder();
- $className = 'Symfony\Component\Console\Tests\DependencyInjection\MyCommand';
-
- $definition1 = new Definition($className);
- $definition1->addTag('console.command')->setPublic(false);
-
- $definition2 = new Definition($className);
- $definition2->addTag('console.command')->setPublic(false);
-
- $container->setDefinition('my-command1', $definition1);
- $container->setDefinition('my-command2', $definition2);
-
- (new AddConsoleCommandPass())->process($container);
-
- $aliasPrefix = 'console.command.public_alias.';
- $this->assertTrue($container->hasAlias($aliasPrefix.'my-command1'));
- $this->assertTrue($container->hasAlias($aliasPrefix.'my-command2'));
- }
-
- public function testProcessOnChildDefinitionWithClass()
- {
- $container = new ContainerBuilder();
- $container->addCompilerPass(new AddConsoleCommandPass(), PassConfig::TYPE_BEFORE_REMOVING);
- $className = 'Symfony\Component\Console\Tests\DependencyInjection\MyCommand';
-
- $parentId = 'my-parent-command';
- $childId = 'my-child-command';
-
- $parentDefinition = new Definition(/* no class */);
- $parentDefinition->setAbstract(true)->setPublic(false);
-
- $childDefinition = new ChildDefinition($parentId);
- $childDefinition->addTag('console.command')->setPublic(true);
- $childDefinition->setClass($className);
-
- $container->setDefinition($parentId, $parentDefinition);
- $container->setDefinition($childId, $childDefinition);
-
- $container->compile();
- $command = $container->get($childId);
-
- $this->assertInstanceOf($className, $command);
- }
-
- public function testProcessOnChildDefinitionWithParentClass()
- {
- $container = new ContainerBuilder();
- $container->addCompilerPass(new AddConsoleCommandPass(), PassConfig::TYPE_BEFORE_REMOVING);
- $className = 'Symfony\Component\Console\Tests\DependencyInjection\MyCommand';
-
- $parentId = 'my-parent-command';
- $childId = 'my-child-command';
-
- $parentDefinition = new Definition($className);
- $parentDefinition->setAbstract(true)->setPublic(false);
-
- $childDefinition = new ChildDefinition($parentId);
- $childDefinition->addTag('console.command')->setPublic(true);
-
- $container->setDefinition($parentId, $parentDefinition);
- $container->setDefinition($childId, $childDefinition);
-
- $container->compile();
- $command = $container->get($childId);
-
- $this->assertInstanceOf($className, $command);
- }
-
- /**
- * @expectedException \RuntimeException
- * @expectedExceptionMessage The definition for "my-child-command" has no class.
- */
- public function testProcessOnChildDefinitionWithoutClass()
- {
- $container = new ContainerBuilder();
- $container->addCompilerPass(new AddConsoleCommandPass(), PassConfig::TYPE_BEFORE_REMOVING);
-
- $parentId = 'my-parent-command';
- $childId = 'my-child-command';
-
- $parentDefinition = new Definition();
- $parentDefinition->setAbstract(true)->setPublic(false);
-
- $childDefinition = new ChildDefinition($parentId);
- $childDefinition->addTag('console.command')->setPublic(true);
-
- $container->setDefinition($parentId, $parentDefinition);
- $container->setDefinition($childId, $childDefinition);
-
- $container->compile();
- }
-}
-
-class MyCommand extends Command
-{
-}
-
-class NamedCommand extends Command
-{
- protected static $defaultName = 'default';
-}
diff --git a/vendor/symfony/console/Tests/Descriptor/AbstractDescriptorTest.php b/vendor/symfony/console/Tests/Descriptor/AbstractDescriptorTest.php
deleted file mode 100644
index 320a4fb9f..000000000
--- a/vendor/symfony/console/Tests/Descriptor/AbstractDescriptorTest.php
+++ /dev/null
@@ -1,107 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Console\Tests\Descriptor;
-
-use PHPUnit\Framework\TestCase;
-use Symfony\Component\Console\Application;
-use Symfony\Component\Console\Command\Command;
-use Symfony\Component\Console\Input\InputArgument;
-use Symfony\Component\Console\Input\InputDefinition;
-use Symfony\Component\Console\Input\InputOption;
-use Symfony\Component\Console\Output\BufferedOutput;
-
-abstract class AbstractDescriptorTest extends TestCase
-{
- /** @dataProvider getDescribeInputArgumentTestData */
- public function testDescribeInputArgument(InputArgument $argument, $expectedDescription)
- {
- $this->assertDescription($expectedDescription, $argument);
- }
-
- /** @dataProvider getDescribeInputOptionTestData */
- public function testDescribeInputOption(InputOption $option, $expectedDescription)
- {
- $this->assertDescription($expectedDescription, $option);
- }
-
- /** @dataProvider getDescribeInputDefinitionTestData */
- public function testDescribeInputDefinition(InputDefinition $definition, $expectedDescription)
- {
- $this->assertDescription($expectedDescription, $definition);
- }
-
- /** @dataProvider getDescribeCommandTestData */
- public function testDescribeCommand(Command $command, $expectedDescription)
- {
- $this->assertDescription($expectedDescription, $command);
- }
-
- /** @dataProvider getDescribeApplicationTestData */
- public function testDescribeApplication(Application $application, $expectedDescription)
- {
- // Replaces the dynamic placeholders of the command help text with a static version.
- // The placeholder %command.full_name% includes the script path that is not predictable
- // and can not be tested against.
- foreach ($application->all() as $command) {
- $command->setHelp(str_replace('%command.full_name%', 'app/console %command.name%', $command->getHelp()));
- }
-
- $this->assertDescription($expectedDescription, $application);
- }
-
- public function getDescribeInputArgumentTestData()
- {
- return $this->getDescriptionTestData(ObjectsProvider::getInputArguments());
- }
-
- public function getDescribeInputOptionTestData()
- {
- return $this->getDescriptionTestData(ObjectsProvider::getInputOptions());
- }
-
- public function getDescribeInputDefinitionTestData()
- {
- return $this->getDescriptionTestData(ObjectsProvider::getInputDefinitions());
- }
-
- public function getDescribeCommandTestData()
- {
- return $this->getDescriptionTestData(ObjectsProvider::getCommands());
- }
-
- public function getDescribeApplicationTestData()
- {
- return $this->getDescriptionTestData(ObjectsProvider::getApplications());
- }
-
- abstract protected function getDescriptor();
-
- abstract protected function getFormat();
-
- protected function getDescriptionTestData(array $objects)
- {
- $data = [];
- foreach ($objects as $name => $object) {
- $description = file_get_contents(sprintf('%s/../Fixtures/%s.%s', __DIR__, $name, $this->getFormat()));
- $data[] = [$object, $description];
- }
-
- return $data;
- }
-
- protected function assertDescription($expectedDescription, $describedObject, array $options = [])
- {
- $output = new BufferedOutput(BufferedOutput::VERBOSITY_NORMAL, true);
- $this->getDescriptor()->describe($output, $describedObject, $options + ['raw_output' => true]);
- $this->assertEquals(trim($expectedDescription), trim(str_replace(PHP_EOL, "\n", $output->fetch())));
- }
-}
diff --git a/vendor/symfony/console/Tests/Descriptor/JsonDescriptorTest.php b/vendor/symfony/console/Tests/Descriptor/JsonDescriptorTest.php
deleted file mode 100644
index fb596b8d7..000000000
--- a/vendor/symfony/console/Tests/Descriptor/JsonDescriptorTest.php
+++ /dev/null
@@ -1,35 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Console\Tests\Descriptor;
-
-use Symfony\Component\Console\Descriptor\JsonDescriptor;
-use Symfony\Component\Console\Output\BufferedOutput;
-
-class JsonDescriptorTest extends AbstractDescriptorTest
-{
- protected function getDescriptor()
- {
- return new JsonDescriptor();
- }
-
- protected function getFormat()
- {
- return 'json';
- }
-
- protected function assertDescription($expectedDescription, $describedObject, array $options = [])
- {
- $output = new BufferedOutput(BufferedOutput::VERBOSITY_NORMAL, true);
- $this->getDescriptor()->describe($output, $describedObject, $options + ['raw_output' => true]);
- $this->assertEquals(json_decode(trim($expectedDescription), true), json_decode(trim(str_replace(PHP_EOL, "\n", $output->fetch())), true));
- }
-}
diff --git a/vendor/symfony/console/Tests/Descriptor/MarkdownDescriptorTest.php b/vendor/symfony/console/Tests/Descriptor/MarkdownDescriptorTest.php
deleted file mode 100644
index a8f11cb4a..000000000
--- a/vendor/symfony/console/Tests/Descriptor/MarkdownDescriptorTest.php
+++ /dev/null
@@ -1,45 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Console\Tests\Descriptor;
-
-use Symfony\Component\Console\Descriptor\MarkdownDescriptor;
-use Symfony\Component\Console\Tests\Fixtures\DescriptorApplicationMbString;
-use Symfony\Component\Console\Tests\Fixtures\DescriptorCommandMbString;
-
-class MarkdownDescriptorTest extends AbstractDescriptorTest
-{
- public function getDescribeCommandTestData()
- {
- return $this->getDescriptionTestData(array_merge(
- ObjectsProvider::getCommands(),
- ['command_mbstring' => new DescriptorCommandMbString()]
- ));
- }
-
- public function getDescribeApplicationTestData()
- {
- return $this->getDescriptionTestData(array_merge(
- ObjectsProvider::getApplications(),
- ['application_mbstring' => new DescriptorApplicationMbString()]
- ));
- }
-
- protected function getDescriptor()
- {
- return new MarkdownDescriptor();
- }
-
- protected function getFormat()
- {
- return 'md';
- }
-}
diff --git a/vendor/symfony/console/Tests/Descriptor/ObjectsProvider.php b/vendor/symfony/console/Tests/Descriptor/ObjectsProvider.php
deleted file mode 100644
index d46d6f18b..000000000
--- a/vendor/symfony/console/Tests/Descriptor/ObjectsProvider.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\Console\Tests\Descriptor;
-
-use Symfony\Component\Console\Input\InputArgument;
-use Symfony\Component\Console\Input\InputDefinition;
-use Symfony\Component\Console\Input\InputOption;
-use Symfony\Component\Console\Tests\Fixtures\DescriptorApplication1;
-use Symfony\Component\Console\Tests\Fixtures\DescriptorApplication2;
-use Symfony\Component\Console\Tests\Fixtures\DescriptorCommand1;
-use Symfony\Component\Console\Tests\Fixtures\DescriptorCommand2;
-
-/**
- * @author Jean-François Simon
- */
-class ObjectsProvider
-{
- public static function getInputArguments()
- {
- return [
- 'input_argument_1' => new InputArgument('argument_name', InputArgument::REQUIRED),
- 'input_argument_2' => new InputArgument('argument_name', InputArgument::IS_ARRAY, 'argument description'),
- 'input_argument_3' => new InputArgument('argument_name', InputArgument::OPTIONAL, 'argument description', 'default_value'),
- 'input_argument_4' => new InputArgument('argument_name', InputArgument::REQUIRED, "multiline\nargument description"),
- 'input_argument_with_style' => new InputArgument('argument_name', InputArgument::OPTIONAL, 'argument description', 'style>'),
- 'input_argument_with_default_inf_value' => new InputArgument('argument_name', InputArgument::OPTIONAL, 'argument description', INF),
- ];
- }
-
- public static function getInputOptions()
- {
- return [
- 'input_option_1' => new InputOption('option_name', 'o', InputOption::VALUE_NONE),
- 'input_option_2' => new InputOption('option_name', 'o', InputOption::VALUE_OPTIONAL, 'option description', 'default_value'),
- 'input_option_3' => new InputOption('option_name', 'o', InputOption::VALUE_REQUIRED, 'option description'),
- 'input_option_4' => new InputOption('option_name', 'o', InputOption::VALUE_IS_ARRAY | InputOption::VALUE_OPTIONAL, 'option description', []),
- 'input_option_5' => new InputOption('option_name', 'o', InputOption::VALUE_REQUIRED, "multiline\noption description"),
- 'input_option_6' => new InputOption('option_name', ['o', 'O'], InputOption::VALUE_REQUIRED, 'option with multiple shortcuts'),
- 'input_option_with_style' => new InputOption('option_name', 'o', InputOption::VALUE_REQUIRED, 'option description', 'style>'),
- 'input_option_with_style_array' => new InputOption('option_name', 'o', InputOption::VALUE_IS_ARRAY | InputOption::VALUE_REQUIRED, 'option description', ['Hello', 'world']),
- 'input_option_with_default_inf_value' => new InputOption('option_name', 'o', InputOption::VALUE_OPTIONAL, 'option description', INF),
- ];
- }
-
- public static function getInputDefinitions()
- {
- return [
- 'input_definition_1' => new InputDefinition(),
- 'input_definition_2' => new InputDefinition([new InputArgument('argument_name', InputArgument::REQUIRED)]),
- 'input_definition_3' => new InputDefinition([new InputOption('option_name', 'o', InputOption::VALUE_NONE)]),
- 'input_definition_4' => new InputDefinition([
- new InputArgument('argument_name', InputArgument::REQUIRED),
- new InputOption('option_name', 'o', InputOption::VALUE_NONE),
- ]),
- ];
- }
-
- public static function getCommands()
- {
- return [
- 'command_1' => new DescriptorCommand1(),
- 'command_2' => new DescriptorCommand2(),
- ];
- }
-
- public static function getApplications()
- {
- return [
- 'application_1' => new DescriptorApplication1(),
- 'application_2' => new DescriptorApplication2(),
- ];
- }
-}
diff --git a/vendor/symfony/console/Tests/Descriptor/TextDescriptorTest.php b/vendor/symfony/console/Tests/Descriptor/TextDescriptorTest.php
deleted file mode 100644
index 26bbd907a..000000000
--- a/vendor/symfony/console/Tests/Descriptor/TextDescriptorTest.php
+++ /dev/null
@@ -1,53 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Console\Tests\Descriptor;
-
-use Symfony\Component\Console\Descriptor\TextDescriptor;
-use Symfony\Component\Console\Tests\Fixtures\DescriptorApplication2;
-use Symfony\Component\Console\Tests\Fixtures\DescriptorApplicationMbString;
-use Symfony\Component\Console\Tests\Fixtures\DescriptorCommandMbString;
-
-class TextDescriptorTest extends AbstractDescriptorTest
-{
- public function getDescribeCommandTestData()
- {
- return $this->getDescriptionTestData(array_merge(
- ObjectsProvider::getCommands(),
- ['command_mbstring' => new DescriptorCommandMbString()]
- ));
- }
-
- public function getDescribeApplicationTestData()
- {
- return $this->getDescriptionTestData(array_merge(
- ObjectsProvider::getApplications(),
- ['application_mbstring' => new DescriptorApplicationMbString()]
- ));
- }
-
- public function testDescribeApplicationWithFilteredNamespace()
- {
- $application = new DescriptorApplication2();
-
- $this->assertDescription(file_get_contents(__DIR__.'/../Fixtures/application_filtered_namespace.txt'), $application, ['namespace' => 'command4']);
- }
-
- protected function getDescriptor()
- {
- return new TextDescriptor();
- }
-
- protected function getFormat()
- {
- return 'txt';
- }
-}
diff --git a/vendor/symfony/console/Tests/Descriptor/XmlDescriptorTest.php b/vendor/symfony/console/Tests/Descriptor/XmlDescriptorTest.php
deleted file mode 100644
index 59a5d1ed8..000000000
--- a/vendor/symfony/console/Tests/Descriptor/XmlDescriptorTest.php
+++ /dev/null
@@ -1,27 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Console\Tests\Descriptor;
-
-use Symfony\Component\Console\Descriptor\XmlDescriptor;
-
-class XmlDescriptorTest extends AbstractDescriptorTest
-{
- protected function getDescriptor()
- {
- return new XmlDescriptor();
- }
-
- protected function getFormat()
- {
- return 'xml';
- }
-}
diff --git a/vendor/symfony/console/Tests/EventListener/ErrorListenerTest.php b/vendor/symfony/console/Tests/EventListener/ErrorListenerTest.php
deleted file mode 100644
index 39766db3d..000000000
--- a/vendor/symfony/console/Tests/EventListener/ErrorListenerTest.php
+++ /dev/null
@@ -1,156 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Console\Tests\EventListener;
-
-use PHPUnit\Framework\TestCase;
-use Psr\Log\LoggerInterface;
-use Symfony\Component\Console\Command\Command;
-use Symfony\Component\Console\Event\ConsoleErrorEvent;
-use Symfony\Component\Console\Event\ConsoleTerminateEvent;
-use Symfony\Component\Console\EventListener\ErrorListener;
-use Symfony\Component\Console\Input\ArgvInput;
-use Symfony\Component\Console\Input\ArrayInput;
-use Symfony\Component\Console\Input\Input;
-use Symfony\Component\Console\Input\InputInterface;
-use Symfony\Component\Console\Input\StringInput;
-use Symfony\Component\Console\Output\OutputInterface;
-
-class ErrorListenerTest extends TestCase
-{
- public function testOnConsoleError()
- {
- $error = new \TypeError('An error occurred');
-
- $logger = $this->getLogger();
- $logger
- ->expects($this->once())
- ->method('error')
- ->with('Error thrown while running command "{command}". Message: "{message}"', ['exception' => $error, 'command' => 'test:run --foo=baz buzz', 'message' => 'An error occurred'])
- ;
-
- $listener = new ErrorListener($logger);
- $listener->onConsoleError(new ConsoleErrorEvent(new ArgvInput(['console.php', 'test:run', '--foo=baz', 'buzz']), $this->getOutput(), $error, new Command('test:run')));
- }
-
- public function testOnConsoleErrorWithNoCommandAndNoInputString()
- {
- $error = new \RuntimeException('An error occurred');
-
- $logger = $this->getLogger();
- $logger
- ->expects($this->once())
- ->method('error')
- ->with('An error occurred while using the console. Message: "{message}"', ['exception' => $error, 'message' => 'An error occurred'])
- ;
-
- $listener = new ErrorListener($logger);
- $listener->onConsoleError(new ConsoleErrorEvent(new NonStringInput(), $this->getOutput(), $error));
- }
-
- public function testOnConsoleTerminateForNonZeroExitCodeWritesToLog()
- {
- $logger = $this->getLogger();
- $logger
- ->expects($this->once())
- ->method('debug')
- ->with('Command "{command}" exited with code "{code}"', ['command' => 'test:run', 'code' => 255])
- ;
-
- $listener = new ErrorListener($logger);
- $listener->onConsoleTerminate($this->getConsoleTerminateEvent(new ArgvInput(['console.php', 'test:run']), 255));
- }
-
- public function testOnConsoleTerminateForZeroExitCodeDoesNotWriteToLog()
- {
- $logger = $this->getLogger();
- $logger
- ->expects($this->never())
- ->method('debug')
- ;
-
- $listener = new ErrorListener($logger);
- $listener->onConsoleTerminate($this->getConsoleTerminateEvent(new ArgvInput(['console.php', 'test:run']), 0));
- }
-
- public function testGetSubscribedEvents()
- {
- $this->assertEquals(
- [
- 'console.error' => ['onConsoleError', -128],
- 'console.terminate' => ['onConsoleTerminate', -128],
- ],
- ErrorListener::getSubscribedEvents()
- );
- }
-
- public function testAllKindsOfInputCanBeLogged()
- {
- $logger = $this->getLogger();
- $logger
- ->expects($this->exactly(3))
- ->method('debug')
- ->with('Command "{command}" exited with code "{code}"', ['command' => 'test:run --foo=bar', 'code' => 255])
- ;
-
- $listener = new ErrorListener($logger);
- $listener->onConsoleTerminate($this->getConsoleTerminateEvent(new ArgvInput(['console.php', 'test:run', '--foo=bar']), 255));
- $listener->onConsoleTerminate($this->getConsoleTerminateEvent(new ArrayInput(['name' => 'test:run', '--foo' => 'bar']), 255));
- $listener->onConsoleTerminate($this->getConsoleTerminateEvent(new StringInput('test:run --foo=bar'), 255));
- }
-
- public function testCommandNameIsDisplayedForNonStringableInput()
- {
- $logger = $this->getLogger();
- $logger
- ->expects($this->once())
- ->method('debug')
- ->with('Command "{command}" exited with code "{code}"', ['command' => 'test:run', 'code' => 255])
- ;
-
- $listener = new ErrorListener($logger);
- $listener->onConsoleTerminate($this->getConsoleTerminateEvent($this->getMockBuilder(InputInterface::class)->getMock(), 255));
- }
-
- private function getLogger()
- {
- return $this->getMockForAbstractClass(LoggerInterface::class);
- }
-
- private function getConsoleTerminateEvent(InputInterface $input, $exitCode)
- {
- return new ConsoleTerminateEvent(new Command('test:run'), $input, $this->getOutput(), $exitCode);
- }
-
- private function getOutput()
- {
- return $this->getMockBuilder(OutputInterface::class)->getMock();
- }
-}
-
-class NonStringInput extends Input
-{
- public function getFirstArgument()
- {
- }
-
- public function hasParameterOption($values, $onlyParams = false)
- {
- }
-
- public function getParameterOption($values, $default = false, $onlyParams = false)
- {
- }
-
- public function parse()
- {
- }
-}
diff --git a/vendor/symfony/console/Tests/Fixtures/BarBucCommand.php b/vendor/symfony/console/Tests/Fixtures/BarBucCommand.php
deleted file mode 100644
index 52b619e82..000000000
--- a/vendor/symfony/console/Tests/Fixtures/BarBucCommand.php
+++ /dev/null
@@ -1,11 +0,0 @@
-setName('bar:buc');
- }
-}
diff --git a/vendor/symfony/console/Tests/Fixtures/DescriptorApplication2.php b/vendor/symfony/console/Tests/Fixtures/DescriptorApplication2.php
deleted file mode 100644
index 7bb02fa54..000000000
--- a/vendor/symfony/console/Tests/Fixtures/DescriptorApplication2.php
+++ /dev/null
@@ -1,26 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Console\Tests\Fixtures;
-
-use Symfony\Component\Console\Application;
-
-class DescriptorApplication2 extends Application
-{
- public function __construct()
- {
- parent::__construct('My Symfony application', 'v1.0');
- $this->add(new DescriptorCommand1());
- $this->add(new DescriptorCommand2());
- $this->add(new DescriptorCommand3());
- $this->add(new DescriptorCommand4());
- }
-}
diff --git a/vendor/symfony/console/Tests/Fixtures/DescriptorApplicationMbString.php b/vendor/symfony/console/Tests/Fixtures/DescriptorApplicationMbString.php
deleted file mode 100644
index bf170c449..000000000
--- a/vendor/symfony/console/Tests/Fixtures/DescriptorApplicationMbString.php
+++ /dev/null
@@ -1,24 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Console\Tests\Fixtures;
-
-use Symfony\Component\Console\Application;
-
-class DescriptorApplicationMbString extends Application
-{
- public function __construct()
- {
- parent::__construct('MbString åpplicätion');
-
- $this->add(new DescriptorCommandMbString());
- }
-}
diff --git a/vendor/symfony/console/Tests/Fixtures/DescriptorCommand1.php b/vendor/symfony/console/Tests/Fixtures/DescriptorCommand1.php
deleted file mode 100644
index 14bb20486..000000000
--- a/vendor/symfony/console/Tests/Fixtures/DescriptorCommand1.php
+++ /dev/null
@@ -1,27 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Console\Tests\Fixtures;
-
-use Symfony\Component\Console\Command\Command;
-
-class DescriptorCommand1 extends Command
-{
- protected function configure()
- {
- $this
- ->setName('descriptor:command1')
- ->setAliases(['alias1', 'alias2'])
- ->setDescription('command 1 description')
- ->setHelp('command 1 help')
- ;
- }
-}
diff --git a/vendor/symfony/console/Tests/Fixtures/DescriptorCommand2.php b/vendor/symfony/console/Tests/Fixtures/DescriptorCommand2.php
deleted file mode 100644
index 51106b961..000000000
--- a/vendor/symfony/console/Tests/Fixtures/DescriptorCommand2.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\Console\Tests\Fixtures;
-
-use Symfony\Component\Console\Command\Command;
-use Symfony\Component\Console\Input\InputArgument;
-use Symfony\Component\Console\Input\InputOption;
-
-class DescriptorCommand2 extends Command
-{
- protected function configure()
- {
- $this
- ->setName('descriptor:command2')
- ->setDescription('command 2 description')
- ->setHelp('command 2 help')
- ->addUsage('-o|--option_name ')
- ->addUsage('')
- ->addArgument('argument_name', InputArgument::REQUIRED)
- ->addOption('option_name', 'o', InputOption::VALUE_NONE)
- ;
- }
-}
diff --git a/vendor/symfony/console/Tests/Fixtures/DescriptorCommand3.php b/vendor/symfony/console/Tests/Fixtures/DescriptorCommand3.php
deleted file mode 100644
index 77f92e233..000000000
--- a/vendor/symfony/console/Tests/Fixtures/DescriptorCommand3.php
+++ /dev/null
@@ -1,27 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Console\Tests\Fixtures;
-
-use Symfony\Component\Console\Command\Command;
-
-class DescriptorCommand3 extends Command
-{
- protected function configure()
- {
- $this
- ->setName('descriptor:command3')
- ->setDescription('command 3 description')
- ->setHelp('command 3 help')
- ->setHidden(true)
- ;
- }
-}
diff --git a/vendor/symfony/console/Tests/Fixtures/DescriptorCommand4.php b/vendor/symfony/console/Tests/Fixtures/DescriptorCommand4.php
deleted file mode 100644
index 22dcae0e3..000000000
--- a/vendor/symfony/console/Tests/Fixtures/DescriptorCommand4.php
+++ /dev/null
@@ -1,25 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Console\Tests\Fixtures;
-
-use Symfony\Component\Console\Command\Command;
-
-class DescriptorCommand4 extends Command
-{
- protected function configure()
- {
- $this
- ->setName('descriptor:command4')
- ->setAliases(['descriptor:alias_command4', 'command4:descriptor'])
- ;
- }
-}
diff --git a/vendor/symfony/console/Tests/Fixtures/DescriptorCommandMbString.php b/vendor/symfony/console/Tests/Fixtures/DescriptorCommandMbString.php
deleted file mode 100644
index 66de917e2..000000000
--- a/vendor/symfony/console/Tests/Fixtures/DescriptorCommandMbString.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\Console\Tests\Fixtures;
-
-use Symfony\Component\Console\Command\Command;
-use Symfony\Component\Console\Input\InputArgument;
-use Symfony\Component\Console\Input\InputOption;
-
-class DescriptorCommandMbString extends Command
-{
- protected function configure()
- {
- $this
- ->setName('descriptor:åèä')
- ->setDescription('command åèä description')
- ->setHelp('command åèä help')
- ->addUsage('-o|--option_name ')
- ->addUsage('')
- ->addArgument('argument_åèä', InputArgument::REQUIRED)
- ->addOption('option_åèä', 'o', InputOption::VALUE_NONE)
- ;
- }
-}
diff --git a/vendor/symfony/console/Tests/Fixtures/DummyOutput.php b/vendor/symfony/console/Tests/Fixtures/DummyOutput.php
deleted file mode 100644
index e9cf6ce7d..000000000
--- a/vendor/symfony/console/Tests/Fixtures/DummyOutput.php
+++ /dev/null
@@ -1,36 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Console\Tests\Fixtures;
-
-use Symfony\Component\Console\Output\BufferedOutput;
-
-/**
- * Dummy output.
- *
- * @author Kévin Dunglas
- */
-class DummyOutput extends BufferedOutput
-{
- /**
- * @return array
- */
- public function getLogs()
- {
- $logs = [];
- foreach (explode(PHP_EOL, trim($this->fetch())) as $message) {
- preg_match('/^\[(.*)\] (.*)/', $message, $matches);
- $logs[] = sprintf('%s %s', $matches[1], $matches[2]);
- }
-
- return $logs;
- }
-}
diff --git a/vendor/symfony/console/Tests/Fixtures/Foo1Command.php b/vendor/symfony/console/Tests/Fixtures/Foo1Command.php
deleted file mode 100644
index 6069576d1..000000000
--- a/vendor/symfony/console/Tests/Fixtures/Foo1Command.php
+++ /dev/null
@@ -1,26 +0,0 @@
-setName('foo:bar1')
- ->setDescription('The foo:bar1 command')
- ->setAliases(['afoobar1'])
- ;
- }
-
- protected function execute(InputInterface $input, OutputInterface $output)
- {
- $this->input = $input;
- $this->output = $output;
- }
-}
diff --git a/vendor/symfony/console/Tests/Fixtures/Foo2Command.php b/vendor/symfony/console/Tests/Fixtures/Foo2Command.php
deleted file mode 100644
index 0d9884013..000000000
--- a/vendor/symfony/console/Tests/Fixtures/Foo2Command.php
+++ /dev/null
@@ -1,21 +0,0 @@
-setName('foo1:bar')
- ->setDescription('The foo1:bar command')
- ->setAliases(['afoobar2'])
- ;
- }
-
- protected function execute(InputInterface $input, OutputInterface $output)
- {
- }
-}
diff --git a/vendor/symfony/console/Tests/Fixtures/Foo3Command.php b/vendor/symfony/console/Tests/Fixtures/Foo3Command.php
deleted file mode 100644
index adb3a2d80..000000000
--- a/vendor/symfony/console/Tests/Fixtures/Foo3Command.php
+++ /dev/null
@@ -1,29 +0,0 @@
-setName('foo3:bar')
- ->setDescription('The foo3:bar command')
- ;
- }
-
- protected function execute(InputInterface $input, OutputInterface $output)
- {
- try {
- try {
- throw new \Exception('First exception this is html
');
- } catch (\Exception $e) {
- throw new \Exception('Second exception comment', 0, $e);
- }
- } catch (\Exception $e) {
- throw new \Exception('Third exception comment>', 404, $e);
- }
- }
-}
diff --git a/vendor/symfony/console/Tests/Fixtures/Foo4Command.php b/vendor/symfony/console/Tests/Fixtures/Foo4Command.php
deleted file mode 100644
index 1c5463995..000000000
--- a/vendor/symfony/console/Tests/Fixtures/Foo4Command.php
+++ /dev/null
@@ -1,11 +0,0 @@
-setName('foo3:bar:toh');
- }
-}
diff --git a/vendor/symfony/console/Tests/Fixtures/Foo5Command.php b/vendor/symfony/console/Tests/Fixtures/Foo5Command.php
deleted file mode 100644
index a1c60827a..000000000
--- a/vendor/symfony/console/Tests/Fixtures/Foo5Command.php
+++ /dev/null
@@ -1,10 +0,0 @@
-setName('0foo:bar')->setDescription('0foo:bar command');
- }
-}
diff --git a/vendor/symfony/console/Tests/Fixtures/FooCommand.php b/vendor/symfony/console/Tests/Fixtures/FooCommand.php
deleted file mode 100644
index 314460044..000000000
--- a/vendor/symfony/console/Tests/Fixtures/FooCommand.php
+++ /dev/null
@@ -1,33 +0,0 @@
-setName('foo:bar')
- ->setDescription('The foo:bar command')
- ->setAliases(['afoobar'])
- ;
- }
-
- protected function interact(InputInterface $input, OutputInterface $output)
- {
- $output->writeln('interact called');
- }
-
- protected function execute(InputInterface $input, OutputInterface $output)
- {
- $this->input = $input;
- $this->output = $output;
-
- $output->writeln('called');
- }
-}
diff --git a/vendor/symfony/console/Tests/Fixtures/FooLock2Command.php b/vendor/symfony/console/Tests/Fixtures/FooLock2Command.php
deleted file mode 100644
index 4e4656f20..000000000
--- a/vendor/symfony/console/Tests/Fixtures/FooLock2Command.php
+++ /dev/null
@@ -1,28 +0,0 @@
-setName('foo:lock2');
- }
-
- protected function execute(InputInterface $input, OutputInterface $output)
- {
- try {
- $this->lock();
- $this->lock();
- } catch (LogicException $e) {
- return 1;
- }
-
- return 2;
- }
-}
diff --git a/vendor/symfony/console/Tests/Fixtures/FooLockCommand.php b/vendor/symfony/console/Tests/Fixtures/FooLockCommand.php
deleted file mode 100644
index dfa28a6be..000000000
--- a/vendor/symfony/console/Tests/Fixtures/FooLockCommand.php
+++ /dev/null
@@ -1,27 +0,0 @@
-setName('foo:lock');
- }
-
- protected function execute(InputInterface $input, OutputInterface $output)
- {
- if (!$this->lock()) {
- return 1;
- }
-
- $this->release();
-
- return 2;
- }
-}
diff --git a/vendor/symfony/console/Tests/Fixtures/FooOptCommand.php b/vendor/symfony/console/Tests/Fixtures/FooOptCommand.php
deleted file mode 100644
index c9054671f..000000000
--- a/vendor/symfony/console/Tests/Fixtures/FooOptCommand.php
+++ /dev/null
@@ -1,36 +0,0 @@
-setName('foo:bar')
- ->setDescription('The foo:bar command')
- ->setAliases(['afoobar'])
- ->addOption('fooopt', 'fo', InputOption::VALUE_OPTIONAL, 'fooopt description')
- ;
- }
-
- protected function interact(InputInterface $input, OutputInterface $output)
- {
- $output->writeln('interact called');
- }
-
- protected function execute(InputInterface $input, OutputInterface $output)
- {
- $this->input = $input;
- $this->output = $output;
-
- $output->writeln('called');
- $output->writeln($this->input->getOption('fooopt'));
- }
-}
diff --git a/vendor/symfony/console/Tests/Fixtures/FooSameCaseLowercaseCommand.php b/vendor/symfony/console/Tests/Fixtures/FooSameCaseLowercaseCommand.php
deleted file mode 100644
index c875be0cd..000000000
--- a/vendor/symfony/console/Tests/Fixtures/FooSameCaseLowercaseCommand.php
+++ /dev/null
@@ -1,11 +0,0 @@
-setName('foo:bar')->setDescription('foo:bar command');
- }
-}
diff --git a/vendor/symfony/console/Tests/Fixtures/FooSameCaseUppercaseCommand.php b/vendor/symfony/console/Tests/Fixtures/FooSameCaseUppercaseCommand.php
deleted file mode 100644
index 75c8d0024..000000000
--- a/vendor/symfony/console/Tests/Fixtures/FooSameCaseUppercaseCommand.php
+++ /dev/null
@@ -1,11 +0,0 @@
-setName('foo:BAR')->setDescription('foo:BAR command');
- }
-}
diff --git a/vendor/symfony/console/Tests/Fixtures/FooSubnamespaced1Command.php b/vendor/symfony/console/Tests/Fixtures/FooSubnamespaced1Command.php
deleted file mode 100644
index 95a4e6152..000000000
--- a/vendor/symfony/console/Tests/Fixtures/FooSubnamespaced1Command.php
+++ /dev/null
@@ -1,26 +0,0 @@
-setName('foo:bar:baz')
- ->setDescription('The foo:bar:baz command')
- ->setAliases(['foobarbaz'])
- ;
- }
-
- protected function execute(InputInterface $input, OutputInterface $output)
- {
- $this->input = $input;
- $this->output = $output;
- }
-}
diff --git a/vendor/symfony/console/Tests/Fixtures/FooSubnamespaced2Command.php b/vendor/symfony/console/Tests/Fixtures/FooSubnamespaced2Command.php
deleted file mode 100644
index 08c5ff725..000000000
--- a/vendor/symfony/console/Tests/Fixtures/FooSubnamespaced2Command.php
+++ /dev/null
@@ -1,26 +0,0 @@
-setName('foo:go:bret')
- ->setDescription('The foo:bar:go command')
- ->setAliases(['foobargo'])
- ;
- }
-
- protected function execute(InputInterface $input, OutputInterface $output)
- {
- $this->input = $input;
- $this->output = $output;
- }
-}
diff --git a/vendor/symfony/console/Tests/Fixtures/FooWithoutAliasCommand.php b/vendor/symfony/console/Tests/Fixtures/FooWithoutAliasCommand.php
deleted file mode 100644
index e301cc5f5..000000000
--- a/vendor/symfony/console/Tests/Fixtures/FooWithoutAliasCommand.php
+++ /dev/null
@@ -1,21 +0,0 @@
-setName('foo')
- ->setDescription('The foo command')
- ;
- }
-
- protected function execute(InputInterface $input, OutputInterface $output)
- {
- $output->writeln('called');
- }
-}
diff --git a/vendor/symfony/console/Tests/Fixtures/FoobarCommand.php b/vendor/symfony/console/Tests/Fixtures/FoobarCommand.php
deleted file mode 100644
index 968162804..000000000
--- a/vendor/symfony/console/Tests/Fixtures/FoobarCommand.php
+++ /dev/null
@@ -1,25 +0,0 @@
-setName('foobar:foo')
- ->setDescription('The foobar:foo command')
- ;
- }
-
- protected function execute(InputInterface $input, OutputInterface $output)
- {
- $this->input = $input;
- $this->output = $output;
- }
-}
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_0.php b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_0.php
deleted file mode 100644
index 8fe7c0771..000000000
--- a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_0.php
+++ /dev/null
@@ -1,11 +0,0 @@
-caution('Lorem ipsum dolor sit amet');
-};
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_1.php b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_1.php
deleted file mode 100644
index e5c700d60..000000000
--- a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_1.php
+++ /dev/null
@@ -1,13 +0,0 @@
-title('Title');
- $output->warning('Lorem ipsum dolor sit amet');
- $output->title('Title');
-};
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_10.php b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_10.php
deleted file mode 100644
index 3111873dd..000000000
--- a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_10.php
+++ /dev/null
@@ -1,17 +0,0 @@
-block(
- 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum',
- 'CUSTOM',
- 'fg=white;bg=green',
- 'X ',
- true
- );
-};
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_11.php b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_11.php
deleted file mode 100644
index 3ed897def..000000000
--- a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_11.php
+++ /dev/null
@@ -1,12 +0,0 @@
-block($word, 'CUSTOM', 'fg=white;bg=blue', ' § ', false);
-};
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_12.php b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_12.php
deleted file mode 100644
index 8c458ae76..000000000
--- a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_12.php
+++ /dev/null
@@ -1,13 +0,0 @@
-comment(
- 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum'
- );
-};
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_13.php b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_13.php
deleted file mode 100644
index 827cbad1d..000000000
--- a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_13.php
+++ /dev/null
@@ -1,14 +0,0 @@
-setDecorated(true);
- $output = new SymfonyStyle($input, $output);
- $output->comment(
- 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum'
- );
-};
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_14.php b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_14.php
deleted file mode 100644
index a893a48bf..000000000
--- a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_14.php
+++ /dev/null
@@ -1,17 +0,0 @@
-block(
- 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum',
- null,
- null,
- '$ ',
- true
- );
-};
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_15.php b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_15.php
deleted file mode 100644
index 68402cd40..000000000
--- a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_15.php
+++ /dev/null
@@ -1,14 +0,0 @@
-block(
- 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum',
- 'TEST'
- );
-};
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_16.php b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_16.php
deleted file mode 100644
index 66e817963..000000000
--- a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_16.php
+++ /dev/null
@@ -1,15 +0,0 @@
-setDecorated(true);
- $output = new SymfonyStyle($input, $output);
- $output->success(
- 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum',
- 'TEST'
- );
-};
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_17.php b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_17.php
deleted file mode 100644
index 311e6b392..000000000
--- a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_17.php
+++ /dev/null
@@ -1,13 +0,0 @@
-title('Title ending with \\');
- $output->section('Section ending with \\');
-};
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_2.php b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_2.php
deleted file mode 100644
index 791b626f2..000000000
--- a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_2.php
+++ /dev/null
@@ -1,16 +0,0 @@
-warning('Warning');
- $output->caution('Caution');
- $output->error('Error');
- $output->success('Success');
- $output->note('Note');
- $output->block('Custom block', 'CUSTOM', 'fg=white;bg=green', 'X ', true);
-};
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_3.php b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_3.php
deleted file mode 100644
index 99253a6c0..000000000
--- a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_3.php
+++ /dev/null
@@ -1,12 +0,0 @@
-title('First title');
- $output->title('Second title');
-};
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_4.php b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_4.php
deleted file mode 100644
index b2f3d9954..000000000
--- a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_4.php
+++ /dev/null
@@ -1,34 +0,0 @@
-write('Lorem ipsum dolor sit amet');
- $output->title('First title');
-
- $output->writeln('Lorem ipsum dolor sit amet');
- $output->title('Second title');
-
- $output->write('Lorem ipsum dolor sit amet');
- $output->write('');
- $output->title('Third title');
-
- //Ensure edge case by appending empty strings to history:
- $output->write('Lorem ipsum dolor sit amet');
- $output->write(['', '', '']);
- $output->title('Fourth title');
-
- //Ensure have manual control over number of blank lines:
- $output->writeln('Lorem ipsum dolor sit amet');
- $output->writeln(['', '']); //Should append an extra blank line
- $output->title('Fifth title');
-
- $output->writeln('Lorem ipsum dolor sit amet');
- $output->newLine(2); //Should append an extra blank line
- $output->title('Fifth title');
-};
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_4_with_iterators.php b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_4_with_iterators.php
deleted file mode 100644
index 3b215c7f2..000000000
--- a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_4_with_iterators.php
+++ /dev/null
@@ -1,34 +0,0 @@
-write('Lorem ipsum dolor sit amet');
- $output->title('First title');
-
- $output->writeln('Lorem ipsum dolor sit amet');
- $output->title('Second title');
-
- $output->write('Lorem ipsum dolor sit amet');
- $output->write('');
- $output->title('Third title');
-
- //Ensure edge case by appending empty strings to history:
- $output->write('Lorem ipsum dolor sit amet');
- $output->write(new \ArrayIterator(['', '', '']));
- $output->title('Fourth title');
-
- //Ensure have manual control over number of blank lines:
- $output->writeln('Lorem ipsum dolor sit amet');
- $output->writeln(new \ArrayIterator(['', ''])); //Should append an extra blank line
- $output->title('Fifth title');
-
- $output->writeln('Lorem ipsum dolor sit amet');
- $output->newLine(2); //Should append an extra blank line
- $output->title('Fifth title');
-};
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_5.php b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_5.php
deleted file mode 100644
index 6fba5737f..000000000
--- a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_5.php
+++ /dev/null
@@ -1,37 +0,0 @@
-writeln('Lorem ipsum dolor sit amet');
- $output->listing([
- 'Lorem ipsum dolor sit amet',
- 'consectetur adipiscing elit',
- ]);
-
- //Even using write:
- $output->write('Lorem ipsum dolor sit amet');
- $output->listing([
- 'Lorem ipsum dolor sit amet',
- 'consectetur adipiscing elit',
- ]);
-
- $output->write('Lorem ipsum dolor sit amet');
- $output->text([
- 'Lorem ipsum dolor sit amet',
- 'consectetur adipiscing elit',
- ]);
-
- $output->newLine();
-
- $output->write('Lorem ipsum dolor sit amet');
- $output->comment([
- 'Lorem ipsum dolor sit amet',
- 'consectetur adipiscing elit',
- ]);
-};
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_6.php b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_6.php
deleted file mode 100644
index 3278f6ea0..000000000
--- a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_6.php
+++ /dev/null
@@ -1,16 +0,0 @@
-listing([
- 'Lorem ipsum dolor sit amet',
- 'consectetur adipiscing elit',
- ]);
- $output->success('Lorem ipsum dolor sit amet');
-};
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_7.php b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_7.php
deleted file mode 100644
index 037c6ab6b..000000000
--- a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_7.php
+++ /dev/null
@@ -1,15 +0,0 @@
-title('Title');
- $output->askHidden('Hidden question');
- $output->choice('Choice question with default', ['choice1', 'choice2'], 'choice1');
- $output->confirm('Confirmation with yes default', true);
- $output->text('Duis aute irure dolor in reprehenderit in voluptate velit esse');
-};
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_8.php b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_8.php
deleted file mode 100644
index fe9d484d2..000000000
--- a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_8.php
+++ /dev/null
@@ -1,26 +0,0 @@
- 3])],
- ['ISBN', 'Title', 'Author'],
- ];
-
- $rows = [
- [
- '978-0521567817',
- 'De Monarchia',
- new TableCell("Dante Alighieri\nspans multiple rows", ['rowspan' => 2]),
- ],
- ['978-0804169127', 'Divine Comedy'],
- ];
-
- $output = new SymfonyStyle($input, $output);
- $output->table($headers, $rows);
-};
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_9.php b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_9.php
deleted file mode 100644
index 73af4ae1e..000000000
--- a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_9.php
+++ /dev/null
@@ -1,11 +0,0 @@
-block(['Custom block', 'Second custom block line'], 'CUSTOM', 'fg=white;bg=green', 'X ', true);
-};
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/interactive_command_1.php b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/interactive_command_1.php
deleted file mode 100644
index 3c9c74405..000000000
--- a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/interactive_command_1.php
+++ /dev/null
@@ -1,19 +0,0 @@
-setStream($stream);
-
- $output->ask('What\'s your name?');
- $output->ask('How are you?');
- $output->ask('Where do you come from?');
-};
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/interactive_output_1.txt b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/interactive_output_1.txt
deleted file mode 100644
index 6fc7d7eb4..000000000
--- a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/interactive_output_1.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-
- What's your name?:
- >
- How are you?:
- >
- Where do you come from?:
- >
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_0.txt b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_0.txt
deleted file mode 100644
index a42e0f792..000000000
--- a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_0.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-
- ! [CAUTION] Lorem ipsum dolor sit amet
-
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_1.txt b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_1.txt
deleted file mode 100644
index 334875f78..000000000
--- a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_1.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-
-Title
-=====
-
- [WARNING] Lorem ipsum dolor sit amet
-
-Title
-=====
-
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_10.txt b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_10.txt
deleted file mode 100644
index 385c6a283..000000000
--- a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_10.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-
-X [CUSTOM] Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et
-X dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
-X commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat
-X nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit
-X anim id est laborum
-
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_11.txt b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_11.txt
deleted file mode 100644
index 190d78403..000000000
--- a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_11.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-
- § [CUSTOM] Lopadotemachoselachogaleokranioleipsanodrimhypotrimmatosilphioparaomelitokatakechymenokichlepikossyphophatto
- § peristeralektryonoptekephalliokigklopeleiolagoiosiraiobaphetraganopterygon
-
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_12.txt b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_12.txt
deleted file mode 100644
index 9983af832..000000000
--- a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_12.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-
- // Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna
- // aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
- // Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur
- // sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum
-
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_13.txt b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_13.txt
deleted file mode 100644
index 0f3704b74..000000000
--- a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_13.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-
-[39;49m // [39;49mLorem ipsum dolor sit [33mamet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et [39m
-[39;49m // [39;49m[33mdolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea [39m
-[39;49m // [39;49m[33mcommodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla [39m
-[39;49m // [39;49m[33mpariatur.[39m Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim
-[39;49m // [39;49mid est laborum
-
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_14.txt b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_14.txt
deleted file mode 100644
index 1d0d37e7f..000000000
--- a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_14.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-
-$ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna
-$ aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
-$ Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint
-$ occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum
-
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_15.txt b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_15.txt
deleted file mode 100644
index 66404b815..000000000
--- a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_15.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-
- [TEST] Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore
- magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
- consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
- pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est
- laborum
-
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_16.txt b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_16.txt
deleted file mode 100644
index a0d180165..000000000
--- a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_16.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-
-[30;42m [39;49m
-[30;42m [OK] Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore [39;49m
-[30;42m magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo [39;49m
-[30;42m consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. [39;49m
-[30;42m Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum [39;49m
-[30;42m [39;49m
-
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_17.txt b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_17.txt
deleted file mode 100644
index 59d00e04a..000000000
--- a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_17.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-
-Title ending with \
-===================
-
-Section ending with \
----------------------
-
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_2.txt b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_2.txt
deleted file mode 100644
index ca609760c..000000000
--- a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_2.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-
- [WARNING] Warning
-
- ! [CAUTION] Caution
-
- [ERROR] Error
-
- [OK] Success
-
- ! [NOTE] Note
-
-X [CUSTOM] Custom block
-
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_3.txt b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_3.txt
deleted file mode 100644
index f4b6d5827..000000000
--- a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_3.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-
-First title
-===========
-
-Second title
-============
-
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_4.txt b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_4.txt
deleted file mode 100644
index 2646d858e..000000000
--- a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_4.txt
+++ /dev/null
@@ -1,32 +0,0 @@
-Lorem ipsum dolor sit amet
-
-First title
-===========
-
-Lorem ipsum dolor sit amet
-
-Second title
-============
-
-Lorem ipsum dolor sit amet
-
-Third title
-===========
-
-Lorem ipsum dolor sit amet
-
-Fourth title
-============
-
-Lorem ipsum dolor sit amet
-
-
-Fifth title
-===========
-
-Lorem ipsum dolor sit amet
-
-
-Fifth title
-===========
-
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_4_with_iterators.txt b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_4_with_iterators.txt
deleted file mode 100644
index 2646d858e..000000000
--- a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_4_with_iterators.txt
+++ /dev/null
@@ -1,32 +0,0 @@
-Lorem ipsum dolor sit amet
-
-First title
-===========
-
-Lorem ipsum dolor sit amet
-
-Second title
-============
-
-Lorem ipsum dolor sit amet
-
-Third title
-===========
-
-Lorem ipsum dolor sit amet
-
-Fourth title
-============
-
-Lorem ipsum dolor sit amet
-
-
-Fifth title
-===========
-
-Lorem ipsum dolor sit amet
-
-
-Fifth title
-===========
-
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_5.txt b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_5.txt
deleted file mode 100644
index be4a2db60..000000000
--- a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_5.txt
+++ /dev/null
@@ -1,18 +0,0 @@
-Lorem ipsum dolor sit amet
- * Lorem ipsum dolor sit amet
- * consectetur adipiscing elit
-
-Lorem ipsum dolor sit amet
- * Lorem ipsum dolor sit amet
- * consectetur adipiscing elit
-
-Lorem ipsum dolor sit amet
- Lorem ipsum dolor sit amet
- consectetur adipiscing elit
-
-Lorem ipsum dolor sit amet
-
- // Lorem ipsum dolor sit amet
- //
- // consectetur adipiscing elit
-
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_6.txt b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_6.txt
deleted file mode 100644
index 5f2d33c14..000000000
--- a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_6.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-
- * Lorem ipsum dolor sit amet
- * consectetur adipiscing elit
-
- [OK] Lorem ipsum dolor sit amet
-
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_7.txt b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_7.txt
deleted file mode 100644
index ecea9778b..000000000
--- a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_7.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-
-Title
-=====
-
- Duis aute irure dolor in reprehenderit in voluptate velit esse
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_8.txt b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_8.txt
deleted file mode 100644
index 005b846ea..000000000
--- a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_8.txt
+++ /dev/null
@@ -1,9 +0,0 @@
- ---------------- --------------- ---------------------
- Main table title
- ---------------- --------------- ---------------------
- ISBN Title Author
- ---------------- --------------- ---------------------
- 978-0521567817 De Monarchia Dante Alighieri
- 978-0804169127 Divine Comedy spans multiple rows
- ---------------- --------------- ---------------------
-
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_9.txt b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_9.txt
deleted file mode 100644
index 069c0d511..000000000
--- a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_9.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-
-X [CUSTOM] Custom block
-X
-X Second custom block line
-
diff --git a/vendor/symfony/console/Tests/Fixtures/TestAmbiguousCommandRegistering.php b/vendor/symfony/console/Tests/Fixtures/TestAmbiguousCommandRegistering.php
deleted file mode 100644
index bece09fcd..000000000
--- a/vendor/symfony/console/Tests/Fixtures/TestAmbiguousCommandRegistering.php
+++ /dev/null
@@ -1,22 +0,0 @@
-setName('test-ambiguous')
- ->setDescription('The test-ambiguous command')
- ->setAliases(['test'])
- ;
- }
-
- protected function execute(InputInterface $input, OutputInterface $output)
- {
- $output->write('test-ambiguous');
- }
-}
diff --git a/vendor/symfony/console/Tests/Fixtures/TestAmbiguousCommandRegistering2.php b/vendor/symfony/console/Tests/Fixtures/TestAmbiguousCommandRegistering2.php
deleted file mode 100644
index 9dde48624..000000000
--- a/vendor/symfony/console/Tests/Fixtures/TestAmbiguousCommandRegistering2.php
+++ /dev/null
@@ -1,21 +0,0 @@
-setName('test-ambiguous2')
- ->setDescription('The test-ambiguous2 command')
- ;
- }
-
- protected function execute(InputInterface $input, OutputInterface $output)
- {
- $output->write('test-ambiguous2');
- }
-}
diff --git a/vendor/symfony/console/Tests/Fixtures/TestCommand.php b/vendor/symfony/console/Tests/Fixtures/TestCommand.php
deleted file mode 100644
index eb7ccb33f..000000000
--- a/vendor/symfony/console/Tests/Fixtures/TestCommand.php
+++ /dev/null
@@ -1,28 +0,0 @@
-setName('namespace:name')
- ->setAliases(['name'])
- ->setDescription('description')
- ->setHelp('help')
- ;
- }
-
- protected function execute(InputInterface $input, OutputInterface $output)
- {
- $output->writeln('execute called');
- }
-
- protected function interact(InputInterface $input, OutputInterface $output)
- {
- $output->writeln('interact called');
- }
-}
diff --git a/vendor/symfony/console/Tests/Fixtures/application_1.json b/vendor/symfony/console/Tests/Fixtures/application_1.json
deleted file mode 100644
index 29faa8262..000000000
--- a/vendor/symfony/console/Tests/Fixtures/application_1.json
+++ /dev/null
@@ -1,156 +0,0 @@
-{
- "commands": [
- {
- "name": "help",
- "hidden": false,
- "usage": [
- "help [--format FORMAT] [--raw] [--] []"
- ],
- "description": "Displays help for a command",
- "help": "The help<\/info> command displays help for a given command:\n\n php app\/console help list<\/info>\n\nYou can also output the help in other formats by using the --format<\/comment> option:\n\n php app\/console help --format=xml list<\/info>\n\nTo display the list of available commands, please use the list<\/info> command.",
- "definition": {
- "arguments": {
- "command_name": {
- "name": "command_name",
- "is_required": false,
- "is_array": false,
- "description": "The command name",
- "default": "help"
- }
- },
- "options": {
- "format": {
- "name": "--format",
- "shortcut": "",
- "accept_value": true,
- "is_value_required": true,
- "is_multiple": false,
- "description": "The output format (txt, xml, json, or md)",
- "default": "txt"
- },
- "raw": {
- "name": "--raw",
- "shortcut": "",
- "accept_value": false,
- "is_value_required": false,
- "is_multiple": false,
- "description": "To output raw command help",
- "default": false
- },
- "help": {
- "name": "--help",
- "shortcut": "-h",
- "accept_value": false,
- "is_value_required": false,
- "is_multiple": false,
- "description": "Display this help message",
- "default": false
- },
- "quiet": {
- "name": "--quiet",
- "shortcut": "-q",
- "accept_value": false,
- "is_value_required": false,
- "is_multiple": false,
- "description": "Do not output any message",
- "default": false
- },
- "verbose": {
- "name": "--verbose",
- "shortcut": "-v|-vv|-vvv",
- "accept_value": false,
- "is_value_required": false,
- "is_multiple": false,
- "description": "Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug",
- "default": false
- },
- "version": {
- "name": "--version",
- "shortcut": "-V",
- "accept_value": false,
- "is_value_required": false,
- "is_multiple": false,
- "description": "Display this application version",
- "default": false
- },
- "ansi": {
- "name": "--ansi",
- "shortcut": "",
- "accept_value": false,
- "is_value_required": false,
- "is_multiple": false,
- "description": "Force ANSI output",
- "default": false
- },
- "no-ansi": {
- "name": "--no-ansi",
- "shortcut": "",
- "accept_value": false,
- "is_value_required": false,
- "is_multiple": false,
- "description": "Disable ANSI output",
- "default": false
- },
- "no-interaction": {
- "name": "--no-interaction",
- "shortcut": "-n",
- "accept_value": false,
- "is_value_required": false,
- "is_multiple": false,
- "description": "Do not ask any interactive question",
- "default": false
- }
- }
- }
- },
- {
- "name": "list",
- "hidden": false,
- "usage": [
- "list [--raw] [--format FORMAT] [--] []"
- ],
- "description": "Lists commands",
- "help": "The list<\/info> command lists all commands:\n\n php app\/console list<\/info>\n\nYou can also display the commands for a specific namespace:\n\n php app\/console list test<\/info>\n\nYou can also output the information in other formats by using the --format<\/comment> option:\n\n php app\/console list --format=xml<\/info>\n\nIt's also possible to get raw list of commands (useful for embedding command runner):\n\n php app\/console list --raw<\/info>",
- "definition": {
- "arguments": {
- "namespace": {
- "name": "namespace",
- "is_required": false,
- "is_array": false,
- "description": "The namespace name",
- "default": null
- }
- },
- "options": {
- "raw": {
- "name": "--raw",
- "shortcut": "",
- "accept_value": false,
- "is_value_required": false,
- "is_multiple": false,
- "description": "To output raw command list",
- "default": false
- },
- "format": {
- "name": "--format",
- "shortcut": "",
- "accept_value": true,
- "is_value_required": true,
- "is_multiple": false,
- "description": "The output format (txt, xml, json, or md)",
- "default": "txt"
- }
- }
- }
- }
- ],
- "namespaces": [
- {
- "id": "_global",
- "commands": [
- "help",
- "list"
- ]
- }
- ]
-}
diff --git a/vendor/symfony/console/Tests/Fixtures/application_1.md b/vendor/symfony/console/Tests/Fixtures/application_1.md
deleted file mode 100644
index b46c975a7..000000000
--- a/vendor/symfony/console/Tests/Fixtures/application_1.md
+++ /dev/null
@@ -1,172 +0,0 @@
-Console Tool
-============
-
-* [`help`](#help)
-* [`list`](#list)
-
-`help`
-------
-
-Displays help for a command
-
-### Usage
-
-* `help [--format FORMAT] [--raw] [--] []`
-
-The help command displays help for a given command:
-
- php app/console help list
-
-You can also output the help in other formats by using the --format option:
-
- php app/console help --format=xml list
-
-To display the list of available commands, please use the list command.
-
-### Arguments
-
-#### `command_name`
-
-The command name
-
-* Is required: no
-* Is array: no
-* Default: `'help'`
-
-### Options
-
-#### `--format`
-
-The output format (txt, xml, json, or md)
-
-* Accept value: yes
-* Is value required: yes
-* Is multiple: no
-* Default: `'txt'`
-
-#### `--raw`
-
-To output raw command help
-
-* Accept value: no
-* Is value required: no
-* Is multiple: no
-* Default: `false`
-
-#### `--help|-h`
-
-Display this help message
-
-* Accept value: no
-* Is value required: no
-* Is multiple: no
-* Default: `false`
-
-#### `--quiet|-q`
-
-Do not output any message
-
-* Accept value: no
-* Is value required: no
-* Is multiple: no
-* Default: `false`
-
-#### `--verbose|-v|-vv|-vvv`
-
-Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
-
-* Accept value: no
-* Is value required: no
-* Is multiple: no
-* Default: `false`
-
-#### `--version|-V`
-
-Display this application version
-
-* Accept value: no
-* Is value required: no
-* Is multiple: no
-* Default: `false`
-
-#### `--ansi`
-
-Force ANSI output
-
-* Accept value: no
-* Is value required: no
-* Is multiple: no
-* Default: `false`
-
-#### `--no-ansi`
-
-Disable ANSI output
-
-* Accept value: no
-* Is value required: no
-* Is multiple: no
-* Default: `false`
-
-#### `--no-interaction|-n`
-
-Do not ask any interactive question
-
-* Accept value: no
-* Is value required: no
-* Is multiple: no
-* Default: `false`
-
-`list`
-------
-
-Lists commands
-
-### Usage
-
-* `list [--raw] [--format FORMAT] [--] []`
-
-The list command lists all commands:
-
- php app/console list
-
-You can also display the commands for a specific namespace:
-
- php app/console list test
-
-You can also output the information in other formats by using the --format option:
-
- php app/console list --format=xml
-
-It's also possible to get raw list of commands (useful for embedding command runner):
-
- php app/console list --raw
-
-### Arguments
-
-#### `namespace`
-
-The namespace name
-
-* Is required: no
-* Is array: no
-* Default: `NULL`
-
-### Options
-
-#### `--raw`
-
-To output raw command list
-
-* Accept value: no
-* Is value required: no
-* Is multiple: no
-* Default: `false`
-
-#### `--format`
-
-The output format (txt, xml, json, or md)
-
-* Accept value: yes
-* Is value required: yes
-* Is multiple: no
-* Default: `'txt'`
diff --git a/vendor/symfony/console/Tests/Fixtures/application_1.txt b/vendor/symfony/console/Tests/Fixtures/application_1.txt
deleted file mode 100644
index 8a7b47e0c..000000000
--- a/vendor/symfony/console/Tests/Fixtures/application_1.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-Console Tool
-
-Usage:
- command [options] [arguments]
-
-Options:
- -h, --help Display this help message
- -q, --quiet Do not output any message
- -V, --version Display this application version
- --ansi Force ANSI output
- --no-ansi Disable ANSI output
- -n, --no-interaction Do not ask any interactive question
- -v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
-
-Available commands:
- help Displays help for a command
- list Lists commands
diff --git a/vendor/symfony/console/Tests/Fixtures/application_1.xml b/vendor/symfony/console/Tests/Fixtures/application_1.xml
deleted file mode 100644
index a0bd076c5..000000000
--- a/vendor/symfony/console/Tests/Fixtures/application_1.xml
+++ /dev/null
@@ -1,104 +0,0 @@
-
-
-
-
-
- help [--format FORMAT] [--raw] [--] [<command_name>]
-
- Displays help for a command
- The <info>help</info> command displays help for a given command:
-
- <info>php app/console help list</info>
-
- You can also output the help in other formats by using the <comment>--format</comment> option:
-
- <info>php app/console help --format=xml list</info>
-
- To display the list of available commands, please use the <info>list</info> command.
-
-
- The command name
-
- help
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- list [--raw] [--format FORMAT] [--] [<namespace>]
-
- Lists commands
- The <info>list</info> command lists all commands:
-
- <info>php app/console list</info>
-
- You can also display the commands for a specific namespace:
-
- <info>php app/console list test</info>
-
- You can also output the information in other formats by using the <comment>--format</comment> option:
-
- <info>php app/console list --format=xml</info>
-
- It's also possible to get raw list of commands (useful for embedding command runner):
-
- <info>php app/console list --raw</info>
-
-
- The namespace name
-
-
-
-
-
-
-
-
-
-
-
- help
- list
-
-
-
diff --git a/vendor/symfony/console/Tests/Fixtures/application_2.json b/vendor/symfony/console/Tests/Fixtures/application_2.json
deleted file mode 100644
index 4777a60b5..000000000
--- a/vendor/symfony/console/Tests/Fixtures/application_2.json
+++ /dev/null
@@ -1,509 +0,0 @@
-{
- "application": {
- "name": "My Symfony application",
- "version": "v1.0"
- },
- "commands": [
- {
- "name": "help",
- "hidden": false,
- "usage": [
- "help [--format FORMAT] [--raw] [--] []"
- ],
- "description": "Displays help for a command",
- "help": "The help<\/info> command displays help for a given command:\n\n php app\/console help list<\/info>\n\nYou can also output the help in other formats by using the --format<\/comment> option:\n\n php app\/console help --format=xml list<\/info>\n\nTo display the list of available commands, please use the list<\/info> command.",
- "definition": {
- "arguments": {
- "command_name": {
- "name": "command_name",
- "is_required": false,
- "is_array": false,
- "description": "The command name",
- "default": "help"
- }
- },
- "options": {
- "format": {
- "name": "--format",
- "shortcut": "",
- "accept_value": true,
- "is_value_required": true,
- "is_multiple": false,
- "description": "The output format (txt, xml, json, or md)",
- "default": "txt"
- },
- "raw": {
- "name": "--raw",
- "shortcut": "",
- "accept_value": false,
- "is_value_required": false,
- "is_multiple": false,
- "description": "To output raw command help",
- "default": false
- },
- "help": {
- "name": "--help",
- "shortcut": "-h",
- "accept_value": false,
- "is_value_required": false,
- "is_multiple": false,
- "description": "Display this help message",
- "default": false
- },
- "quiet": {
- "name": "--quiet",
- "shortcut": "-q",
- "accept_value": false,
- "is_value_required": false,
- "is_multiple": false,
- "description": "Do not output any message",
- "default": false
- },
- "verbose": {
- "name": "--verbose",
- "shortcut": "-v|-vv|-vvv",
- "accept_value": false,
- "is_value_required": false,
- "is_multiple": false,
- "description": "Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug",
- "default": false
- },
- "version": {
- "name": "--version",
- "shortcut": "-V",
- "accept_value": false,
- "is_value_required": false,
- "is_multiple": false,
- "description": "Display this application version",
- "default": false
- },
- "ansi": {
- "name": "--ansi",
- "shortcut": "",
- "accept_value": false,
- "is_value_required": false,
- "is_multiple": false,
- "description": "Force ANSI output",
- "default": false
- },
- "no-ansi": {
- "name": "--no-ansi",
- "shortcut": "",
- "accept_value": false,
- "is_value_required": false,
- "is_multiple": false,
- "description": "Disable ANSI output",
- "default": false
- },
- "no-interaction": {
- "name": "--no-interaction",
- "shortcut": "-n",
- "accept_value": false,
- "is_value_required": false,
- "is_multiple": false,
- "description": "Do not ask any interactive question",
- "default": false
- }
- }
- }
- },
- {
- "name": "list",
- "hidden": false,
- "usage": [
- "list [--raw] [--format FORMAT] [--] []"
- ],
- "description": "Lists commands",
- "help": "The list<\/info> command lists all commands:\n\n php app\/console list<\/info>\n\nYou can also display the commands for a specific namespace:\n\n php app\/console list test<\/info>\n\nYou can also output the information in other formats by using the --format<\/comment> option:\n\n php app\/console list --format=xml<\/info>\n\nIt's also possible to get raw list of commands (useful for embedding command runner):\n\n php app\/console list --raw<\/info>",
- "definition": {
- "arguments": {
- "namespace": {
- "name": "namespace",
- "is_required": false,
- "is_array": false,
- "description": "The namespace name",
- "default": null
- }
- },
- "options": {
- "raw": {
- "name": "--raw",
- "shortcut": "",
- "accept_value": false,
- "is_value_required": false,
- "is_multiple": false,
- "description": "To output raw command list",
- "default": false
- },
- "format": {
- "name": "--format",
- "shortcut": "",
- "accept_value": true,
- "is_value_required": true,
- "is_multiple": false,
- "description": "The output format (txt, xml, json, or md)",
- "default": "txt"
- }
- }
- }
- },
- {
- "name": "descriptor:command1",
- "hidden": false,
- "usage": [
- "descriptor:command1",
- "alias1",
- "alias2"
- ],
- "description": "command 1 description",
- "help": "command 1 help",
- "definition": {
- "arguments": [],
- "options": {
- "help": {
- "name": "--help",
- "shortcut": "-h",
- "accept_value": false,
- "is_value_required": false,
- "is_multiple": false,
- "description": "Display this help message",
- "default": false
- },
- "quiet": {
- "name": "--quiet",
- "shortcut": "-q",
- "accept_value": false,
- "is_value_required": false,
- "is_multiple": false,
- "description": "Do not output any message",
- "default": false
- },
- "verbose": {
- "name": "--verbose",
- "shortcut": "-v|-vv|-vvv",
- "accept_value": false,
- "is_value_required": false,
- "is_multiple": false,
- "description": "Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug",
- "default": false
- },
- "version": {
- "name": "--version",
- "shortcut": "-V",
- "accept_value": false,
- "is_value_required": false,
- "is_multiple": false,
- "description": "Display this application version",
- "default": false
- },
- "ansi": {
- "name": "--ansi",
- "shortcut": "",
- "accept_value": false,
- "is_value_required": false,
- "is_multiple": false,
- "description": "Force ANSI output",
- "default": false
- },
- "no-ansi": {
- "name": "--no-ansi",
- "shortcut": "",
- "accept_value": false,
- "is_value_required": false,
- "is_multiple": false,
- "description": "Disable ANSI output",
- "default": false
- },
- "no-interaction": {
- "name": "--no-interaction",
- "shortcut": "-n",
- "accept_value": false,
- "is_value_required": false,
- "is_multiple": false,
- "description": "Do not ask any interactive question",
- "default": false
- }
- }
- }
- },
- {
- "name": "descriptor:command2",
- "hidden": false,
- "usage": [
- "descriptor:command2 [-o|--option_name] [--] ",
- "descriptor:command2 -o|--option_name ",
- "descriptor:command2 "
- ],
- "description": "command 2 description",
- "help": "command 2 help",
- "definition": {
- "arguments": {
- "argument_name": {
- "name": "argument_name",
- "is_required": true,
- "is_array": false,
- "description": "",
- "default": null
- }
- },
- "options": {
- "option_name": {
- "name": "--option_name",
- "shortcut": "-o",
- "accept_value": false,
- "is_value_required": false,
- "is_multiple": false,
- "description": "",
- "default": false
- },
- "help": {
- "name": "--help",
- "shortcut": "-h",
- "accept_value": false,
- "is_value_required": false,
- "is_multiple": false,
- "description": "Display this help message",
- "default": false
- },
- "quiet": {
- "name": "--quiet",
- "shortcut": "-q",
- "accept_value": false,
- "is_value_required": false,
- "is_multiple": false,
- "description": "Do not output any message",
- "default": false
- },
- "verbose": {
- "name": "--verbose",
- "shortcut": "-v|-vv|-vvv",
- "accept_value": false,
- "is_value_required": false,
- "is_multiple": false,
- "description": "Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug",
- "default": false
- },
- "version": {
- "name": "--version",
- "shortcut": "-V",
- "accept_value": false,
- "is_value_required": false,
- "is_multiple": false,
- "description": "Display this application version",
- "default": false
- },
- "ansi": {
- "name": "--ansi",
- "shortcut": "",
- "accept_value": false,
- "is_value_required": false,
- "is_multiple": false,
- "description": "Force ANSI output",
- "default": false
- },
- "no-ansi": {
- "name": "--no-ansi",
- "shortcut": "",
- "accept_value": false,
- "is_value_required": false,
- "is_multiple": false,
- "description": "Disable ANSI output",
- "default": false
- },
- "no-interaction": {
- "name": "--no-interaction",
- "shortcut": "-n",
- "accept_value": false,
- "is_value_required": false,
- "is_multiple": false,
- "description": "Do not ask any interactive question",
- "default": false
- }
- }
- }
- },
- {
- "name": "descriptor:command3",
- "hidden": true,
- "usage": [
- "descriptor:command3"
- ],
- "description": "command 3 description",
- "help": "command 3 help",
- "definition": {
- "arguments": {},
- "options": {
- "help": {
- "name": "--help",
- "shortcut": "-h",
- "accept_value": false,
- "is_value_required": false,
- "is_multiple": false,
- "description": "Display this help message",
- "default": false
- },
- "quiet": {
- "name": "--quiet",
- "shortcut": "-q",
- "accept_value": false,
- "is_value_required": false,
- "is_multiple": false,
- "description": "Do not output any message",
- "default": false
- },
- "verbose": {
- "name": "--verbose",
- "shortcut": "-v|-vv|-vvv",
- "accept_value": false,
- "is_value_required": false,
- "is_multiple": false,
- "description": "Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug",
- "default": false
- },
- "version": {
- "name": "--version",
- "shortcut": "-V",
- "accept_value": false,
- "is_value_required": false,
- "is_multiple": false,
- "description": "Display this application version",
- "default": false
- },
- "ansi": {
- "name": "--ansi",
- "shortcut": "",
- "accept_value": false,
- "is_value_required": false,
- "is_multiple": false,
- "description": "Force ANSI output",
- "default": false
- },
- "no-ansi": {
- "name": "--no-ansi",
- "shortcut": "",
- "accept_value": false,
- "is_value_required": false,
- "is_multiple": false,
- "description": "Disable ANSI output",
- "default": false
- },
- "no-interaction": {
- "name": "--no-interaction",
- "shortcut": "-n",
- "accept_value": false,
- "is_value_required": false,
- "is_multiple": false,
- "description": "Do not ask any interactive question",
- "default": false
- }
- }
- }
- },
- {
- "name": "descriptor:command4",
- "hidden": false,
- "usage": [
- "descriptor:command4",
- "descriptor:alias_command4",
- "command4:descriptor"
- ],
- "description": null,
- "help": "",
- "definition": {
- "arguments": {},
- "options": {
- "help": {
- "name": "--help",
- "shortcut": "-h",
- "accept_value": false,
- "is_value_required": false,
- "is_multiple": false,
- "description": "Display this help message",
- "default": false
- },
- "quiet": {
- "name": "--quiet",
- "shortcut": "-q",
- "accept_value": false,
- "is_value_required": false,
- "is_multiple": false,
- "description": "Do not output any message",
- "default": false
- },
- "verbose": {
- "name": "--verbose",
- "shortcut": "-v|-vv|-vvv",
- "accept_value": false,
- "is_value_required": false,
- "is_multiple": false,
- "description": "Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug",
- "default": false
- },
- "version": {
- "name": "--version",
- "shortcut": "-V",
- "accept_value": false,
- "is_value_required": false,
- "is_multiple": false,
- "description": "Display this application version",
- "default": false
- },
- "ansi": {
- "name": "--ansi",
- "shortcut": "",
- "accept_value": false,
- "is_value_required": false,
- "is_multiple": false,
- "description": "Force ANSI output",
- "default": false
- },
- "no-ansi": {
- "name": "--no-ansi",
- "shortcut": "",
- "accept_value": false,
- "is_value_required": false,
- "is_multiple": false,
- "description": "Disable ANSI output",
- "default": false
- },
- "no-interaction": {
- "name": "--no-interaction",
- "shortcut": "-n",
- "accept_value": false,
- "is_value_required": false,
- "is_multiple": false,
- "description": "Do not ask any interactive question",
- "default": false
- }
- }
- }
- }
- ],
- "namespaces": [
- {
- "id": "_global",
- "commands": [
- "alias1",
- "alias2",
- "help",
- "list"
- ]
- },
- {
- "id": "command4",
- "commands": [
- "command4:descriptor"
- ]
- },
- {
- "id": "descriptor",
- "commands": [
- "descriptor:alias_command4",
- "descriptor:command1",
- "descriptor:command2",
- "descriptor:command3",
- "descriptor:command4"
- ]
- }
- ]
-}
diff --git a/vendor/symfony/console/Tests/Fixtures/application_2.md b/vendor/symfony/console/Tests/Fixtures/application_2.md
deleted file mode 100644
index 5b4896c08..000000000
--- a/vendor/symfony/console/Tests/Fixtures/application_2.md
+++ /dev/null
@@ -1,431 +0,0 @@
-My Symfony application v1.0
-===========================
-
-* [`alias1`](#descriptorcommand1)
-* [`alias2`](#descriptorcommand1)
-* [`help`](#help)
-* [`list`](#list)
-
-**command4:**
-
-* [`command4:descriptor`](#descriptorcommand4)
-
-**descriptor:**
-
-* [`descriptor:alias_command4`](#descriptorcommand4)
-* [`descriptor:command1`](#descriptorcommand1)
-* [`descriptor:command2`](#descriptorcommand2)
-* [`descriptor:command4`](#descriptorcommand4)
-
-`help`
-------
-
-Displays help for a command
-
-### Usage
-
-* `help [--format FORMAT] [--raw] [--] []`
-
-The help command displays help for a given command:
-
- php app/console help list
-
-You can also output the help in other formats by using the --format option:
-
- php app/console help --format=xml list
-
-To display the list of available commands, please use the list command.
-
-### Arguments
-
-#### `command_name`
-
-The command name
-
-* Is required: no
-* Is array: no
-* Default: `'help'`
-
-### Options
-
-#### `--format`
-
-The output format (txt, xml, json, or md)
-
-* Accept value: yes
-* Is value required: yes
-* Is multiple: no
-* Default: `'txt'`
-
-#### `--raw`
-
-To output raw command help
-
-* Accept value: no
-* Is value required: no
-* Is multiple: no
-* Default: `false`
-
-#### `--help|-h`
-
-Display this help message
-
-* Accept value: no
-* Is value required: no
-* Is multiple: no
-* Default: `false`
-
-#### `--quiet|-q`
-
-Do not output any message
-
-* Accept value: no
-* Is value required: no
-* Is multiple: no
-* Default: `false`
-
-#### `--verbose|-v|-vv|-vvv`
-
-Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
-
-* Accept value: no
-* Is value required: no
-* Is multiple: no
-* Default: `false`
-
-#### `--version|-V`
-
-Display this application version
-
-* Accept value: no
-* Is value required: no
-* Is multiple: no
-* Default: `false`
-
-#### `--ansi`
-
-Force ANSI output
-
-* Accept value: no
-* Is value required: no
-* Is multiple: no
-* Default: `false`
-
-#### `--no-ansi`
-
-Disable ANSI output
-
-* Accept value: no
-* Is value required: no
-* Is multiple: no
-* Default: `false`
-
-#### `--no-interaction|-n`
-
-Do not ask any interactive question
-
-* Accept value: no
-* Is value required: no
-* Is multiple: no
-* Default: `false`
-
-`list`
-------
-
-Lists commands
-
-### Usage
-
-* `list [--raw] [--format FORMAT] [--] []`
-
-The list command lists all commands:
-
- php app/console list
-
-You can also display the commands for a specific namespace:
-
- php app/console list test
-
-You can also output the information in other formats by using the --format option:
-
- php app/console list --format=xml
-
-It's also possible to get raw list of commands (useful for embedding command runner):
-
- php app/console list --raw
-
-### Arguments
-
-#### `namespace`
-
-The namespace name
-
-* Is required: no
-* Is array: no
-* Default: `NULL`
-
-### Options
-
-#### `--raw`
-
-To output raw command list
-
-* Accept value: no
-* Is value required: no
-* Is multiple: no
-* Default: `false`
-
-#### `--format`
-
-The output format (txt, xml, json, or md)
-
-* Accept value: yes
-* Is value required: yes
-* Is multiple: no
-* Default: `'txt'`
-
-`descriptor:command1`
----------------------
-
-command 1 description
-
-### Usage
-
-* `descriptor:command1`
-* `alias1`
-* `alias2`
-
-command 1 help
-
-### Options
-
-#### `--help|-h`
-
-Display this help message
-
-* Accept value: no
-* Is value required: no
-* Is multiple: no
-* Default: `false`
-
-#### `--quiet|-q`
-
-Do not output any message
-
-* Accept value: no
-* Is value required: no
-* Is multiple: no
-* Default: `false`
-
-#### `--verbose|-v|-vv|-vvv`
-
-Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
-
-* Accept value: no
-* Is value required: no
-* Is multiple: no
-* Default: `false`
-
-#### `--version|-V`
-
-Display this application version
-
-* Accept value: no
-* Is value required: no
-* Is multiple: no
-* Default: `false`
-
-#### `--ansi`
-
-Force ANSI output
-
-* Accept value: no
-* Is value required: no
-* Is multiple: no
-* Default: `false`
-
-#### `--no-ansi`
-
-Disable ANSI output
-
-* Accept value: no
-* Is value required: no
-* Is multiple: no
-* Default: `false`
-
-#### `--no-interaction|-n`
-
-Do not ask any interactive question
-
-* Accept value: no
-* Is value required: no
-* Is multiple: no
-* Default: `false`
-
-`descriptor:command2`
----------------------
-
-command 2 description
-
-### Usage
-
-* `descriptor:command2 [-o|--option_name] [--] `
-* `descriptor:command2 -o|--option_name `
-* `descriptor:command2 `
-
-command 2 help
-
-### Arguments
-
-#### `argument_name`
-
-* Is required: yes
-* Is array: no
-* Default: `NULL`
-
-### Options
-
-#### `--option_name|-o`
-
-* Accept value: no
-* Is value required: no
-* Is multiple: no
-* Default: `false`
-
-#### `--help|-h`
-
-Display this help message
-
-* Accept value: no
-* Is value required: no
-* Is multiple: no
-* Default: `false`
-
-#### `--quiet|-q`
-
-Do not output any message
-
-* Accept value: no
-* Is value required: no
-* Is multiple: no
-* Default: `false`
-
-#### `--verbose|-v|-vv|-vvv`
-
-Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
-
-* Accept value: no
-* Is value required: no
-* Is multiple: no
-* Default: `false`
-
-#### `--version|-V`
-
-Display this application version
-
-* Accept value: no
-* Is value required: no
-* Is multiple: no
-* Default: `false`
-
-#### `--ansi`
-
-Force ANSI output
-
-* Accept value: no
-* Is value required: no
-* Is multiple: no
-* Default: `false`
-
-#### `--no-ansi`
-
-Disable ANSI output
-
-* Accept value: no
-* Is value required: no
-* Is multiple: no
-* Default: `false`
-
-#### `--no-interaction|-n`
-
-Do not ask any interactive question
-
-* Accept value: no
-* Is value required: no
-* Is multiple: no
-* Default: `false`
-
-`descriptor:command4`
----------------------
-
-### Usage
-
-* `descriptor:command4`
-* `descriptor:alias_command4`
-* `command4:descriptor`
-
-
-### Options
-
-#### `--help|-h`
-
-Display this help message
-
-* Accept value: no
-* Is value required: no
-* Is multiple: no
-* Default: `false`
-
-#### `--quiet|-q`
-
-Do not output any message
-
-* Accept value: no
-* Is value required: no
-* Is multiple: no
-* Default: `false`
-
-#### `--verbose|-v|-vv|-vvv`
-
-Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
-
-* Accept value: no
-* Is value required: no
-* Is multiple: no
-* Default: `false`
-
-#### `--version|-V`
-
-Display this application version
-
-* Accept value: no
-* Is value required: no
-* Is multiple: no
-* Default: `false`
-
-#### `--ansi`
-
-Force ANSI output
-
-* Accept value: no
-* Is value required: no
-* Is multiple: no
-* Default: `false`
-
-#### `--no-ansi`
-
-Disable ANSI output
-
-* Accept value: no
-* Is value required: no
-* Is multiple: no
-* Default: `false`
-
-#### `--no-interaction|-n`
-
-Do not ask any interactive question
-
-* Accept value: no
-* Is value required: no
-* Is multiple: no
-* Default: `false`
diff --git a/vendor/symfony/console/Tests/Fixtures/application_2.txt b/vendor/symfony/console/Tests/Fixtures/application_2.txt
deleted file mode 100644
index d624f1946..000000000
--- a/vendor/symfony/console/Tests/Fixtures/application_2.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-My Symfony application v1.0
-
-Usage:
- command [options] [arguments]
-
-Options:
- -h, --help Display this help message
- -q, --quiet Do not output any message
- -V, --version Display this application version
- --ansi Force ANSI output
- --no-ansi Disable ANSI output
- -n, --no-interaction Do not ask any interactive question
- -v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
-
-Available commands:
- help Displays help for a command
- list Lists commands
- descriptor
- descriptor:command1 [alias1|alias2] command 1 description
- descriptor:command2 command 2 description
- descriptor:command4 [descriptor:alias_command4|command4:descriptor]
diff --git a/vendor/symfony/console/Tests/Fixtures/application_2.xml b/vendor/symfony/console/Tests/Fixtures/application_2.xml
deleted file mode 100644
index 5f0f98bd9..000000000
--- a/vendor/symfony/console/Tests/Fixtures/application_2.xml
+++ /dev/null
@@ -1,254 +0,0 @@
-
-
-
-
-
- help [--format FORMAT] [--raw] [--] [<command_name>]
-
- Displays help for a command
- The <info>help</info> command displays help for a given command:
-
- <info>php app/console help list</info>
-
- You can also output the help in other formats by using the <comment>--format</comment> option:
-
- <info>php app/console help --format=xml list</info>
-
- To display the list of available commands, please use the <info>list</info> command.
-
-
- The command name
-
- help
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- list [--raw] [--format FORMAT] [--] [<namespace>]
-
- Lists commands
- The <info>list</info> command lists all commands:
-
- <info>php app/console list</info>
-
- You can also display the commands for a specific namespace:
-
- <info>php app/console list test</info>
-
- You can also output the information in other formats by using the <comment>--format</comment> option:
-
- <info>php app/console list --format=xml</info>
-
- It's also possible to get raw list of commands (useful for embedding command runner):
-
- <info>php app/console list --raw</info>
-
-
- The namespace name
-
-
-
-
-
-
-
-
-
-
- descriptor:command1
- alias1
- alias2
-
- command 1 description
- command 1 help
-
-
-
-
-
-
-
-
-
-
-
-
-
- descriptor:command2 [-o|--option_name] [--] <argument_name>
- descriptor:command2 -o|--option_name <argument_name>
- descriptor:command2 <argument_name>
-
- command 2 description
- command 2 help
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- descriptor:command3
-
- command 3 description
- command 3 help
-
-
-
-
-
-
-
-
-
-
-
-
-
- descriptor:command4
- descriptor:alias_command4
- command4:descriptor
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- alias1
- alias2
- help
- list
-
-
- command4:descriptor
-
-
- descriptor:alias_command4
- descriptor:command1
- descriptor:command2
- descriptor:command3
- descriptor:command4
-
-
-
diff --git a/vendor/symfony/console/Tests/Fixtures/application_filtered_namespace.txt b/vendor/symfony/console/Tests/Fixtures/application_filtered_namespace.txt
deleted file mode 100644
index 3bca27006..000000000
--- a/vendor/symfony/console/Tests/Fixtures/application_filtered_namespace.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-My Symfony application v1.0
-
-Usage:
- command [options] [arguments]
-
-Options:
- -h, --help Display this help message
- -q, --quiet Do not output any message
- -V, --version Display this application version
- --ansi Force ANSI output
- --no-ansi Disable ANSI output
- -n, --no-interaction Do not ask any interactive question
- -v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
-
-Available commands for the "command4" namespace:
- command4:descriptor
diff --git a/vendor/symfony/console/Tests/Fixtures/application_gethelp.txt b/vendor/symfony/console/Tests/Fixtures/application_gethelp.txt
deleted file mode 100644
index 5a5920d0e..000000000
--- a/vendor/symfony/console/Tests/Fixtures/application_gethelp.txt
+++ /dev/null
@@ -1 +0,0 @@
-Console Tool
\ No newline at end of file
diff --git a/vendor/symfony/console/Tests/Fixtures/application_mbstring.md b/vendor/symfony/console/Tests/Fixtures/application_mbstring.md
deleted file mode 100644
index f34e5585c..000000000
--- a/vendor/symfony/console/Tests/Fixtures/application_mbstring.md
+++ /dev/null
@@ -1,269 +0,0 @@
-MbString åpplicätion
-====================
-
-* [`help`](#help)
-* [`list`](#list)
-
-**descriptor:**
-
-* [`descriptor:åèä`](#descriptoråèä)
-
-`help`
-------
-
-Displays help for a command
-
-### Usage
-
-* `help [--format FORMAT] [--raw] [--] []`
-
-The help command displays help for a given command:
-
- php app/console help list
-
-You can also output the help in other formats by using the --format option:
-
- php app/console help --format=xml list
-
-To display the list of available commands, please use the list command.
-
-### Arguments
-
-#### `command_name`
-
-The command name
-
-* Is required: no
-* Is array: no
-* Default: `'help'`
-
-### Options
-
-#### `--format`
-
-The output format (txt, xml, json, or md)
-
-* Accept value: yes
-* Is value required: yes
-* Is multiple: no
-* Default: `'txt'`
-
-#### `--raw`
-
-To output raw command help
-
-* Accept value: no
-* Is value required: no
-* Is multiple: no
-* Default: `false`
-
-#### `--help|-h`
-
-Display this help message
-
-* Accept value: no
-* Is value required: no
-* Is multiple: no
-* Default: `false`
-
-#### `--quiet|-q`
-
-Do not output any message
-
-* Accept value: no
-* Is value required: no
-* Is multiple: no
-* Default: `false`
-
-#### `--verbose|-v|-vv|-vvv`
-
-Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
-
-* Accept value: no
-* Is value required: no
-* Is multiple: no
-* Default: `false`
-
-#### `--version|-V`
-
-Display this application version
-
-* Accept value: no
-* Is value required: no
-* Is multiple: no
-* Default: `false`
-
-#### `--ansi`
-
-Force ANSI output
-
-* Accept value: no
-* Is value required: no
-* Is multiple: no
-* Default: `false`
-
-#### `--no-ansi`
-
-Disable ANSI output
-
-* Accept value: no
-* Is value required: no
-* Is multiple: no
-* Default: `false`
-
-#### `--no-interaction|-n`
-
-Do not ask any interactive question
-
-* Accept value: no
-* Is value required: no
-* Is multiple: no
-* Default: `false`
-
-`list`
-------
-
-Lists commands
-
-### Usage
-
-* `list [--raw] [--format FORMAT] [--] []`
-
-The list command lists all commands:
-
- php app/console list
-
-You can also display the commands for a specific namespace:
-
- php app/console list test
-
-You can also output the information in other formats by using the --format option:
-
- php app/console list --format=xml
-
-It's also possible to get raw list of commands (useful for embedding command runner):
-
- php app/console list --raw
-
-### Arguments
-
-#### `namespace`
-
-The namespace name
-
-* Is required: no
-* Is array: no
-* Default: `NULL`
-
-### Options
-
-#### `--raw`
-
-To output raw command list
-
-* Accept value: no
-* Is value required: no
-* Is multiple: no
-* Default: `false`
-
-#### `--format`
-
-The output format (txt, xml, json, or md)
-
-* Accept value: yes
-* Is value required: yes
-* Is multiple: no
-* Default: `'txt'`
-
-`descriptor:åèä`
-----------------
-
-command åèä description
-
-### Usage
-
-* `descriptor:åèä [-o|--option_åèä] [--] `
-* `descriptor:åèä -o|--option_name `
-* `descriptor:åèä `
-
-command åèä help
-
-### Arguments
-
-#### `argument_åèä`
-
-* Is required: yes
-* Is array: no
-* Default: `NULL`
-
-### Options
-
-#### `--option_åèä|-o`
-
-* Accept value: no
-* Is value required: no
-* Is multiple: no
-* Default: `false`
-
-#### `--help|-h`
-
-Display this help message
-
-* Accept value: no
-* Is value required: no
-* Is multiple: no
-* Default: `false`
-
-#### `--quiet|-q`
-
-Do not output any message
-
-* Accept value: no
-* Is value required: no
-* Is multiple: no
-* Default: `false`
-
-#### `--verbose|-v|-vv|-vvv`
-
-Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
-
-* Accept value: no
-* Is value required: no
-* Is multiple: no
-* Default: `false`
-
-#### `--version|-V`
-
-Display this application version
-
-* Accept value: no
-* Is value required: no
-* Is multiple: no
-* Default: `false`
-
-#### `--ansi`
-
-Force ANSI output
-
-* Accept value: no
-* Is value required: no
-* Is multiple: no
-* Default: `false`
-
-#### `--no-ansi`
-
-Disable ANSI output
-
-* Accept value: no
-* Is value required: no
-* Is multiple: no
-* Default: `false`
-
-#### `--no-interaction|-n`
-
-Do not ask any interactive question
-
-* Accept value: no
-* Is value required: no
-* Is multiple: no
-* Default: `false`
diff --git a/vendor/symfony/console/Tests/Fixtures/application_mbstring.txt b/vendor/symfony/console/Tests/Fixtures/application_mbstring.txt
deleted file mode 100644
index b409d1881..000000000
--- a/vendor/symfony/console/Tests/Fixtures/application_mbstring.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-MbString åpplicätion
-
-Usage:
- command [options] [arguments]
-
-Options:
- -h, --help Display this help message
- -q, --quiet Do not output any message
- -V, --version Display this application version
- --ansi Force ANSI output
- --no-ansi Disable ANSI output
- -n, --no-interaction Do not ask any interactive question
- -v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
-
-Available commands:
- help Displays help for a command
- list Lists commands
- descriptor
- descriptor:åèä command åèä description
diff --git a/vendor/symfony/console/Tests/Fixtures/application_renderexception1.txt b/vendor/symfony/console/Tests/Fixtures/application_renderexception1.txt
deleted file mode 100644
index 1df5bd649..000000000
--- a/vendor/symfony/console/Tests/Fixtures/application_renderexception1.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
- Command "foo" is not defined.
-
-
diff --git a/vendor/symfony/console/Tests/Fixtures/application_renderexception2.txt b/vendor/symfony/console/Tests/Fixtures/application_renderexception2.txt
deleted file mode 100644
index 932063d73..000000000
--- a/vendor/symfony/console/Tests/Fixtures/application_renderexception2.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
- The "--foo" option does not exist.
-
-
-list [--raw] [--format FORMAT] [--] []
-
diff --git a/vendor/symfony/console/Tests/Fixtures/application_renderexception3.txt b/vendor/symfony/console/Tests/Fixtures/application_renderexception3.txt
deleted file mode 100644
index 5366b84f8..000000000
--- a/vendor/symfony/console/Tests/Fixtures/application_renderexception3.txt
+++ /dev/null
@@ -1,18 +0,0 @@
-
-In Foo3Command.php line 26:
-
- Third exception comment>
-
-
-In Foo3Command.php line 23:
-
- Second exception comment
-
-
-In Foo3Command.php line 21:
-
- First exception this is html
-
-
-foo3:bar
-
diff --git a/vendor/symfony/console/Tests/Fixtures/application_renderexception3decorated.txt b/vendor/symfony/console/Tests/Fixtures/application_renderexception3decorated.txt
deleted file mode 100644
index 59937092e..000000000
--- a/vendor/symfony/console/Tests/Fixtures/application_renderexception3decorated.txt
+++ /dev/null
@@ -1,18 +0,0 @@
-
-[33mIn Foo3Command.php line 26:[39m
-[37;41m [39;49m
-[37;41m Third exception comment> [39;49m
-[37;41m [39;49m
-
-[33mIn Foo3Command.php line 23:[39m
-[37;41m [39;49m
-[37;41m Second exception comment [39;49m
-[37;41m [39;49m
-
-[33mIn Foo3Command.php line 21:[39m
-[37;41m [39;49m
-[37;41m First exception this is html
[39;49m
-[37;41m [39;49m
-
-[32mfoo3:bar[39m
-
diff --git a/vendor/symfony/console/Tests/Fixtures/application_renderexception4.txt b/vendor/symfony/console/Tests/Fixtures/application_renderexception4.txt
deleted file mode 100644
index 548a13e56..000000000
--- a/vendor/symfony/console/Tests/Fixtures/application_renderexception4.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
- Command "foo" is not define
- d.
-
-
diff --git a/vendor/symfony/console/Tests/Fixtures/application_renderexception_doublewidth1.txt b/vendor/symfony/console/Tests/Fixtures/application_renderexception_doublewidth1.txt
deleted file mode 100644
index 4677c18e3..000000000
--- a/vendor/symfony/console/Tests/Fixtures/application_renderexception_doublewidth1.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-
-In ApplicationTest.php line %d:
-
- エラーメッセージ
-
-
-foo
-
diff --git a/vendor/symfony/console/Tests/Fixtures/application_renderexception_doublewidth1decorated.txt b/vendor/symfony/console/Tests/Fixtures/application_renderexception_doublewidth1decorated.txt
deleted file mode 100644
index 33d326556..000000000
--- a/vendor/symfony/console/Tests/Fixtures/application_renderexception_doublewidth1decorated.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-
-[33mIn ApplicationTest.php line %d:[39m
-[37;41m [39;49m
-[37;41m エラーメッセージ [39;49m
-[37;41m [39;49m
-
-[32mfoo[39m
-
diff --git a/vendor/symfony/console/Tests/Fixtures/application_renderexception_doublewidth2.txt b/vendor/symfony/console/Tests/Fixtures/application_renderexception_doublewidth2.txt
deleted file mode 100644
index 2ee72e22c..000000000
--- a/vendor/symfony/console/Tests/Fixtures/application_renderexception_doublewidth2.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-
-In ApplicationTest.php line %d:
-
- コマンドの実行中にエラーが
- 発生しました。
-
-
-foo
-
diff --git a/vendor/symfony/console/Tests/Fixtures/application_renderexception_escapeslines.txt b/vendor/symfony/console/Tests/Fixtures/application_renderexception_escapeslines.txt
deleted file mode 100644
index ff7b7b39c..000000000
--- a/vendor/symfony/console/Tests/Fixtures/application_renderexception_escapeslines.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-
-In ApplicationTest.php line %d:
-
- dont break here <
- info>!
-
-
-foo
-
diff --git a/vendor/symfony/console/Tests/Fixtures/application_renderexception_linebreaks.txt b/vendor/symfony/console/Tests/Fixtures/application_renderexception_linebreaks.txt
deleted file mode 100644
index 0e5c4b166..000000000
--- a/vendor/symfony/console/Tests/Fixtures/application_renderexception_linebreaks.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-
-In ApplicationTest.php line %d:
-
- line 1 with extra spaces
- line 2
-
- line 4
-
-
-foo
-
diff --git a/vendor/symfony/console/Tests/Fixtures/application_run1.txt b/vendor/symfony/console/Tests/Fixtures/application_run1.txt
deleted file mode 100644
index 0dc273098..000000000
--- a/vendor/symfony/console/Tests/Fixtures/application_run1.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-Console Tool
-
-Usage:
- command [options] [arguments]
-
-Options:
- -h, --help Display this help message
- -q, --quiet Do not output any message
- -V, --version Display this application version
- --ansi Force ANSI output
- --no-ansi Disable ANSI output
- -n, --no-interaction Do not ask any interactive question
- -v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
-
-Available commands:
- help Displays help for a command
- list Lists commands
diff --git a/vendor/symfony/console/Tests/Fixtures/application_run2.txt b/vendor/symfony/console/Tests/Fixtures/application_run2.txt
deleted file mode 100644
index 90050b054..000000000
--- a/vendor/symfony/console/Tests/Fixtures/application_run2.txt
+++ /dev/null
@@ -1,29 +0,0 @@
-Description:
- Lists commands
-
-Usage:
- list [options] [--] []
-
-Arguments:
- namespace The namespace name
-
-Options:
- --raw To output raw command list
- --format=FORMAT The output format (txt, xml, json, or md) [default: "txt"]
-
-Help:
- The list command lists all commands:
-
- php app/console list
-
- You can also display the commands for a specific namespace:
-
- php app/console list test
-
- You can also output the information in other formats by using the --format option:
-
- php app/console list --format=xml
-
- It's also possible to get raw list of commands (useful for embedding command runner):
-
- php app/console list --raw
diff --git a/vendor/symfony/console/Tests/Fixtures/application_run3.txt b/vendor/symfony/console/Tests/Fixtures/application_run3.txt
deleted file mode 100644
index 90050b054..000000000
--- a/vendor/symfony/console/Tests/Fixtures/application_run3.txt
+++ /dev/null
@@ -1,29 +0,0 @@
-Description:
- Lists commands
-
-Usage:
- list [options] [--] []
-
-Arguments:
- namespace The namespace name
-
-Options:
- --raw To output raw command list
- --format=FORMAT The output format (txt, xml, json, or md) [default: "txt"]
-
-Help:
- The list command lists all commands:
-
- php app/console list
-
- You can also display the commands for a specific namespace:
-
- php app/console list test
-
- You can also output the information in other formats by using the --format option:
-
- php app/console list --format=xml
-
- It's also possible to get raw list of commands (useful for embedding command runner):
-
- php app/console list --raw
diff --git a/vendor/symfony/console/Tests/Fixtures/application_run4.txt b/vendor/symfony/console/Tests/Fixtures/application_run4.txt
deleted file mode 100644
index 47187fc26..000000000
--- a/vendor/symfony/console/Tests/Fixtures/application_run4.txt
+++ /dev/null
@@ -1 +0,0 @@
-Console Tool
diff --git a/vendor/symfony/console/Tests/Fixtures/command_1.json b/vendor/symfony/console/Tests/Fixtures/command_1.json
deleted file mode 100644
index 09087900c..000000000
--- a/vendor/symfony/console/Tests/Fixtures/command_1.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "name": "descriptor:command1",
- "hidden": false,
- "usage": [
- "descriptor:command1",
- "alias1",
- "alias2"
- ],
- "description": "command 1 description",
- "help": "command 1 help",
- "definition": {
- "arguments": [],
- "options": []
- }
-}
diff --git a/vendor/symfony/console/Tests/Fixtures/command_1.md b/vendor/symfony/console/Tests/Fixtures/command_1.md
deleted file mode 100644
index e9a0180b0..000000000
--- a/vendor/symfony/console/Tests/Fixtures/command_1.md
+++ /dev/null
@@ -1,12 +0,0 @@
-`descriptor:command1`
----------------------
-
-command 1 description
-
-### Usage
-
-* `descriptor:command1`
-* `alias1`
-* `alias2`
-
-command 1 help
diff --git a/vendor/symfony/console/Tests/Fixtures/command_1.txt b/vendor/symfony/console/Tests/Fixtures/command_1.txt
deleted file mode 100644
index bf5fa3c07..000000000
--- a/vendor/symfony/console/Tests/Fixtures/command_1.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-Description:
- command 1 description
-
-Usage:
- descriptor:command1
- alias1
- alias2
-
-Help:
- command 1 help
diff --git a/vendor/symfony/console/Tests/Fixtures/command_1.xml b/vendor/symfony/console/Tests/Fixtures/command_1.xml
deleted file mode 100644
index fa0cca087..000000000
--- a/vendor/symfony/console/Tests/Fixtures/command_1.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
- descriptor:command1
- alias1
- alias2
-
- command 1 description
- command 1 help
-
-
-
diff --git a/vendor/symfony/console/Tests/Fixtures/command_2.json b/vendor/symfony/console/Tests/Fixtures/command_2.json
deleted file mode 100644
index 8a1ec0235..000000000
--- a/vendor/symfony/console/Tests/Fixtures/command_2.json
+++ /dev/null
@@ -1,33 +0,0 @@
-{
- "name": "descriptor:command2",
- "hidden": false,
- "usage": [
- "descriptor:command2 [-o|--option_name] [--] ",
- "descriptor:command2 -o|--option_name ",
- "descriptor:command2 "
- ],
- "description": "command 2 description",
- "help": "command 2 help",
- "definition": {
- "arguments": {
- "argument_name": {
- "name": "argument_name",
- "is_required": true,
- "is_array": false,
- "description": "",
- "default": null
- }
- },
- "options": {
- "option_name": {
- "name": "--option_name",
- "shortcut": "-o",
- "accept_value": false,
- "is_value_required": false,
- "is_multiple": false,
- "description": "",
- "default": false
- }
- }
- }
-}
diff --git a/vendor/symfony/console/Tests/Fixtures/command_2.md b/vendor/symfony/console/Tests/Fixtures/command_2.md
deleted file mode 100644
index 41f51f019..000000000
--- a/vendor/symfony/console/Tests/Fixtures/command_2.md
+++ /dev/null
@@ -1,29 +0,0 @@
-`descriptor:command2`
----------------------
-
-command 2 description
-
-### Usage
-
-* `descriptor:command2 [-o|--option_name] [--] `
-* `descriptor:command2 -o|--option_name `
-* `descriptor:command2 `
-
-command 2 help
-
-### Arguments
-
-#### `argument_name`
-
-* Is required: yes
-* Is array: no
-* Default: `NULL`
-
-### Options
-
-#### `--option_name|-o`
-
-* Accept value: no
-* Is value required: no
-* Is multiple: no
-* Default: `false`
diff --git a/vendor/symfony/console/Tests/Fixtures/command_2.txt b/vendor/symfony/console/Tests/Fixtures/command_2.txt
deleted file mode 100644
index 45e7bec4d..000000000
--- a/vendor/symfony/console/Tests/Fixtures/command_2.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-Description:
- command 2 description
-
-Usage:
- descriptor:command2 [options] [--] \
- descriptor:command2 -o|--option_name \
- descriptor:command2 \
-
-Arguments:
- argument_name
-
-Options:
- -o, --option_name
-
-Help:
- command 2 help
diff --git a/vendor/symfony/console/Tests/Fixtures/command_2.xml b/vendor/symfony/console/Tests/Fixtures/command_2.xml
deleted file mode 100644
index ae69e2f49..000000000
--- a/vendor/symfony/console/Tests/Fixtures/command_2.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
- descriptor:command2 [-o|--option_name] [--] <argument_name>
- descriptor:command2 -o|--option_name <argument_name>
- descriptor:command2 <argument_name>
-
- command 2 description
- command 2 help
-
-
-
-
-
-
-
-
-
-
diff --git a/vendor/symfony/console/Tests/Fixtures/command_mbstring.md b/vendor/symfony/console/Tests/Fixtures/command_mbstring.md
deleted file mode 100644
index 7ef40d7b3..000000000
--- a/vendor/symfony/console/Tests/Fixtures/command_mbstring.md
+++ /dev/null
@@ -1,29 +0,0 @@
-`descriptor:åèä`
-----------------
-
-command åèä description
-
-### Usage
-
-* `descriptor:åèä [-o|--option_åèä] [--] `
-* `descriptor:åèä -o|--option_name `
-* `descriptor:åèä `
-
-command åèä help
-
-### Arguments
-
-#### `argument_åèä`
-
-* Is required: yes
-* Is array: no
-* Default: `NULL`
-
-### Options
-
-#### `--option_åèä|-o`
-
-* Accept value: no
-* Is value required: no
-* Is multiple: no
-* Default: `false`
diff --git a/vendor/symfony/console/Tests/Fixtures/command_mbstring.txt b/vendor/symfony/console/Tests/Fixtures/command_mbstring.txt
deleted file mode 100644
index 2fd51d057..000000000
--- a/vendor/symfony/console/Tests/Fixtures/command_mbstring.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-Description:
- command åèä description
-
-Usage:
- descriptor:åèä [options] [--] \
- descriptor:åèä -o|--option_name \
- descriptor:åèä \
-
-Arguments:
- argument_åèä
-
-Options:
- -o, --option_åèä
-
-Help:
- command åèä help
diff --git a/vendor/symfony/console/Tests/Fixtures/input_argument_1.json b/vendor/symfony/console/Tests/Fixtures/input_argument_1.json
deleted file mode 100644
index 0ab932960..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_argument_1.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "name": "argument_name",
- "is_required": true,
- "is_array": false,
- "description": "",
- "default": null
-}
diff --git a/vendor/symfony/console/Tests/Fixtures/input_argument_1.md b/vendor/symfony/console/Tests/Fixtures/input_argument_1.md
deleted file mode 100644
index 7516cbd4c..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_argument_1.md
+++ /dev/null
@@ -1,5 +0,0 @@
-#### `argument_name`
-
-* Is required: yes
-* Is array: no
-* Default: `NULL`
diff --git a/vendor/symfony/console/Tests/Fixtures/input_argument_1.txt b/vendor/symfony/console/Tests/Fixtures/input_argument_1.txt
deleted file mode 100644
index 55035183f..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_argument_1.txt
+++ /dev/null
@@ -1 +0,0 @@
- argument_name
diff --git a/vendor/symfony/console/Tests/Fixtures/input_argument_1.xml b/vendor/symfony/console/Tests/Fixtures/input_argument_1.xml
deleted file mode 100644
index cb37f812c..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_argument_1.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
diff --git a/vendor/symfony/console/Tests/Fixtures/input_argument_2.json b/vendor/symfony/console/Tests/Fixtures/input_argument_2.json
deleted file mode 100644
index 7450016ff..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_argument_2.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "name": "argument_name",
- "is_required": false,
- "is_array": true,
- "description": "argument description",
- "default": []
-}
diff --git a/vendor/symfony/console/Tests/Fixtures/input_argument_2.md b/vendor/symfony/console/Tests/Fixtures/input_argument_2.md
deleted file mode 100644
index 2e7e7580c..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_argument_2.md
+++ /dev/null
@@ -1,7 +0,0 @@
-#### `argument_name`
-
-argument description
-
-* Is required: no
-* Is array: yes
-* Default: `array ()`
diff --git a/vendor/symfony/console/Tests/Fixtures/input_argument_2.txt b/vendor/symfony/console/Tests/Fixtures/input_argument_2.txt
deleted file mode 100644
index e71366074..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_argument_2.txt
+++ /dev/null
@@ -1 +0,0 @@
- argument_name argument description
diff --git a/vendor/symfony/console/Tests/Fixtures/input_argument_2.xml b/vendor/symfony/console/Tests/Fixtures/input_argument_2.xml
deleted file mode 100644
index 629da5a98..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_argument_2.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
- argument description
-
-
diff --git a/vendor/symfony/console/Tests/Fixtures/input_argument_3.json b/vendor/symfony/console/Tests/Fixtures/input_argument_3.json
deleted file mode 100644
index 9a83c5a54..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_argument_3.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "name": "argument_name",
- "is_required": false,
- "is_array": false,
- "description": "argument description",
- "default": "default_value"
-}
diff --git a/vendor/symfony/console/Tests/Fixtures/input_argument_3.md b/vendor/symfony/console/Tests/Fixtures/input_argument_3.md
deleted file mode 100644
index b0dd87852..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_argument_3.md
+++ /dev/null
@@ -1,7 +0,0 @@
-#### `argument_name`
-
-argument description
-
-* Is required: no
-* Is array: no
-* Default: `'default_value'`
diff --git a/vendor/symfony/console/Tests/Fixtures/input_argument_3.txt b/vendor/symfony/console/Tests/Fixtures/input_argument_3.txt
deleted file mode 100644
index 6b76639e0..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_argument_3.txt
+++ /dev/null
@@ -1 +0,0 @@
- argument_name argument description [default: "default_value"]
diff --git a/vendor/symfony/console/Tests/Fixtures/input_argument_3.xml b/vendor/symfony/console/Tests/Fixtures/input_argument_3.xml
deleted file mode 100644
index 399a5c864..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_argument_3.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
- argument description
-
- default_value
-
-
diff --git a/vendor/symfony/console/Tests/Fixtures/input_argument_4.json b/vendor/symfony/console/Tests/Fixtures/input_argument_4.json
deleted file mode 100644
index cbcb19b39..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_argument_4.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "name": "argument_name",
- "is_required": true,
- "is_array": false,
- "description": "multiline argument description",
- "default": null
-}
diff --git a/vendor/symfony/console/Tests/Fixtures/input_argument_4.md b/vendor/symfony/console/Tests/Fixtures/input_argument_4.md
deleted file mode 100644
index b9bb7edc4..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_argument_4.md
+++ /dev/null
@@ -1,8 +0,0 @@
-#### `argument_name`
-
-multiline
-argument description
-
-* Is required: yes
-* Is array: no
-* Default: `NULL`
diff --git a/vendor/symfony/console/Tests/Fixtures/input_argument_4.txt b/vendor/symfony/console/Tests/Fixtures/input_argument_4.txt
deleted file mode 100644
index fc7d669a1..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_argument_4.txt
+++ /dev/null
@@ -1,2 +0,0 @@
- argument_name multiline
- argument description
diff --git a/vendor/symfony/console/Tests/Fixtures/input_argument_4.xml b/vendor/symfony/console/Tests/Fixtures/input_argument_4.xml
deleted file mode 100644
index 5ca135ec2..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_argument_4.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
- multiline
-argument description
-
-
diff --git a/vendor/symfony/console/Tests/Fixtures/input_argument_with_default_inf_value.json b/vendor/symfony/console/Tests/Fixtures/input_argument_with_default_inf_value.json
deleted file mode 100644
index b61ecf7b8..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_argument_with_default_inf_value.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "name": "argument_name",
- "is_required": false,
- "is_array": false,
- "description": "argument description",
- "default": "INF"
-}
diff --git a/vendor/symfony/console/Tests/Fixtures/input_argument_with_default_inf_value.md b/vendor/symfony/console/Tests/Fixtures/input_argument_with_default_inf_value.md
deleted file mode 100644
index 4f4d9b164..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_argument_with_default_inf_value.md
+++ /dev/null
@@ -1,7 +0,0 @@
-#### `argument_name`
-
-argument description
-
-* Is required: no
-* Is array: no
-* Default: `INF`
diff --git a/vendor/symfony/console/Tests/Fixtures/input_argument_with_default_inf_value.txt b/vendor/symfony/console/Tests/Fixtures/input_argument_with_default_inf_value.txt
deleted file mode 100644
index c32d768c6..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_argument_with_default_inf_value.txt
+++ /dev/null
@@ -1 +0,0 @@
- argument_name argument description [default: INF]
diff --git a/vendor/symfony/console/Tests/Fixtures/input_argument_with_default_inf_value.xml b/vendor/symfony/console/Tests/Fixtures/input_argument_with_default_inf_value.xml
deleted file mode 100644
index d45726007..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_argument_with_default_inf_value.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
- argument description
-
- INF
-
-
diff --git a/vendor/symfony/console/Tests/Fixtures/input_argument_with_style.json b/vendor/symfony/console/Tests/Fixtures/input_argument_with_style.json
deleted file mode 100644
index 933423510..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_argument_with_style.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "name": "argument_name",
- "is_required": false,
- "is_array": false,
- "description": "argument description",
- "default": "style>"
-}
diff --git a/vendor/symfony/console/Tests/Fixtures/input_argument_with_style.md b/vendor/symfony/console/Tests/Fixtures/input_argument_with_style.md
deleted file mode 100644
index a2be96721..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_argument_with_style.md
+++ /dev/null
@@ -1,7 +0,0 @@
-#### `argument_name`
-
-argument description
-
-* Is required: no
-* Is array: no
-* Default: `'style'`
diff --git a/vendor/symfony/console/Tests/Fixtures/input_argument_with_style.txt b/vendor/symfony/console/Tests/Fixtures/input_argument_with_style.txt
deleted file mode 100644
index 35384a6be..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_argument_with_style.txt
+++ /dev/null
@@ -1 +0,0 @@
- argument_name argument description [default: "\style\>"]
diff --git a/vendor/symfony/console/Tests/Fixtures/input_argument_with_style.xml b/vendor/symfony/console/Tests/Fixtures/input_argument_with_style.xml
deleted file mode 100644
index 73332c796..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_argument_with_style.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
- argument description
-
- <comment>style</>
-
-
diff --git a/vendor/symfony/console/Tests/Fixtures/input_definition_1.json b/vendor/symfony/console/Tests/Fixtures/input_definition_1.json
deleted file mode 100644
index 44aa2c2e1..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_definition_1.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "arguments": [],
- "options": []
-}
diff --git a/vendor/symfony/console/Tests/Fixtures/input_definition_1.md b/vendor/symfony/console/Tests/Fixtures/input_definition_1.md
deleted file mode 100644
index e69de29bb..000000000
diff --git a/vendor/symfony/console/Tests/Fixtures/input_definition_1.txt b/vendor/symfony/console/Tests/Fixtures/input_definition_1.txt
deleted file mode 100644
index e69de29bb..000000000
diff --git a/vendor/symfony/console/Tests/Fixtures/input_definition_1.xml b/vendor/symfony/console/Tests/Fixtures/input_definition_1.xml
deleted file mode 100644
index b5481ce12..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_definition_1.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
diff --git a/vendor/symfony/console/Tests/Fixtures/input_definition_2.json b/vendor/symfony/console/Tests/Fixtures/input_definition_2.json
deleted file mode 100644
index 7cfd57e56..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_definition_2.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "arguments": {
- "argument_name": {
- "name": "argument_name",
- "is_required": true,
- "is_array": false,
- "description": "",
- "default": null
- }
- },
- "options": []
-}
diff --git a/vendor/symfony/console/Tests/Fixtures/input_definition_2.md b/vendor/symfony/console/Tests/Fixtures/input_definition_2.md
deleted file mode 100644
index ffc2bbbe8..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_definition_2.md
+++ /dev/null
@@ -1,7 +0,0 @@
-### Arguments
-
-#### `argument_name`
-
-* Is required: yes
-* Is array: no
-* Default: `NULL`
diff --git a/vendor/symfony/console/Tests/Fixtures/input_definition_2.txt b/vendor/symfony/console/Tests/Fixtures/input_definition_2.txt
deleted file mode 100644
index 73b0f308a..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_definition_2.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-Arguments:
- argument_name
diff --git a/vendor/symfony/console/Tests/Fixtures/input_definition_2.xml b/vendor/symfony/console/Tests/Fixtures/input_definition_2.xml
deleted file mode 100644
index 102efc148..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_definition_2.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/vendor/symfony/console/Tests/Fixtures/input_definition_3.json b/vendor/symfony/console/Tests/Fixtures/input_definition_3.json
deleted file mode 100644
index 3b3cf73c5..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_definition_3.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "arguments": [],
- "options": {
- "option_name": {
- "name": "--option_name",
- "shortcut": "-o",
- "accept_value": false,
- "is_value_required": false,
- "is_multiple": false,
- "description": "",
- "default": false
- }
- }
-}
diff --git a/vendor/symfony/console/Tests/Fixtures/input_definition_3.md b/vendor/symfony/console/Tests/Fixtures/input_definition_3.md
deleted file mode 100644
index 11f7cd6b7..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_definition_3.md
+++ /dev/null
@@ -1,8 +0,0 @@
-### Options
-
-#### `--option_name|-o`
-
-* Accept value: no
-* Is value required: no
-* Is multiple: no
-* Default: `false`
diff --git a/vendor/symfony/console/Tests/Fixtures/input_definition_3.txt b/vendor/symfony/console/Tests/Fixtures/input_definition_3.txt
deleted file mode 100644
index c02766fd3..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_definition_3.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-Options:
- -o, --option_name
diff --git a/vendor/symfony/console/Tests/Fixtures/input_definition_3.xml b/vendor/symfony/console/Tests/Fixtures/input_definition_3.xml
deleted file mode 100644
index bc9515154..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_definition_3.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
diff --git a/vendor/symfony/console/Tests/Fixtures/input_definition_4.json b/vendor/symfony/console/Tests/Fixtures/input_definition_4.json
deleted file mode 100644
index d4a51e82e..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_definition_4.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "arguments": {
- "argument_name": {
- "name": "argument_name",
- "is_required": true,
- "is_array": false,
- "description": "",
- "default": null
- }
- },
- "options": {
- "option_name": {
- "name": "--option_name",
- "shortcut": "-o",
- "accept_value": false,
- "is_value_required": false,
- "is_multiple": false,
- "description": "",
- "default": false
- }
- }
-}
diff --git a/vendor/symfony/console/Tests/Fixtures/input_definition_4.md b/vendor/symfony/console/Tests/Fixtures/input_definition_4.md
deleted file mode 100644
index c4f947f5c..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_definition_4.md
+++ /dev/null
@@ -1,16 +0,0 @@
-### Arguments
-
-#### `argument_name`
-
-* Is required: yes
-* Is array: no
-* Default: `NULL`
-
-### Options
-
-#### `--option_name|-o`
-
-* Accept value: no
-* Is value required: no
-* Is multiple: no
-* Default: `false`
diff --git a/vendor/symfony/console/Tests/Fixtures/input_definition_4.txt b/vendor/symfony/console/Tests/Fixtures/input_definition_4.txt
deleted file mode 100644
index 63aa81d2d..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_definition_4.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-Arguments:
- argument_name
-
-Options:
- -o, --option_name
diff --git a/vendor/symfony/console/Tests/Fixtures/input_definition_4.xml b/vendor/symfony/console/Tests/Fixtures/input_definition_4.xml
deleted file mode 100644
index cffceecef..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_definition_4.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_1.json b/vendor/symfony/console/Tests/Fixtures/input_option_1.json
deleted file mode 100644
index f86bf9671..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_option_1.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "name": "--option_name",
- "shortcut": "-o",
- "accept_value": false,
- "is_value_required": false,
- "is_multiple": false,
- "description": "",
- "default": false
-}
diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_1.md b/vendor/symfony/console/Tests/Fixtures/input_option_1.md
deleted file mode 100644
index c544a4e60..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_option_1.md
+++ /dev/null
@@ -1,6 +0,0 @@
-#### `--option_name|-o`
-
-* Accept value: no
-* Is value required: no
-* Is multiple: no
-* Default: `false`
diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_1.txt b/vendor/symfony/console/Tests/Fixtures/input_option_1.txt
deleted file mode 100644
index 3a5e4eede..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_option_1.txt
+++ /dev/null
@@ -1 +0,0 @@
- -o, --option_name
diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_1.xml b/vendor/symfony/console/Tests/Fixtures/input_option_1.xml
deleted file mode 100644
index 8a64ea652..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_option_1.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_2.json b/vendor/symfony/console/Tests/Fixtures/input_option_2.json
deleted file mode 100644
index 32dbab21a..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_option_2.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "name": "--option_name",
- "shortcut": "-o",
- "accept_value": true,
- "is_value_required": false,
- "is_multiple": false,
- "description": "option description",
- "default": "default_value"
-}
diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_2.md b/vendor/symfony/console/Tests/Fixtures/input_option_2.md
deleted file mode 100644
index 293e61795..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_option_2.md
+++ /dev/null
@@ -1,8 +0,0 @@
-#### `--option_name|-o`
-
-option description
-
-* Accept value: yes
-* Is value required: no
-* Is multiple: no
-* Default: `'default_value'`
diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_2.txt b/vendor/symfony/console/Tests/Fixtures/input_option_2.txt
deleted file mode 100644
index 1009eff16..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_option_2.txt
+++ /dev/null
@@ -1 +0,0 @@
- -o, --option_name[=OPTION_NAME] option description [default: "default_value"]
diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_2.xml b/vendor/symfony/console/Tests/Fixtures/input_option_2.xml
deleted file mode 100644
index 4afac5b04..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_option_2.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_3.json b/vendor/symfony/console/Tests/Fixtures/input_option_3.json
deleted file mode 100644
index 6d55a6efe..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_option_3.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "name": "--option_name",
- "shortcut": "-o",
- "accept_value": true,
- "is_value_required": true,
- "is_multiple": false,
- "description": "option description",
- "default": null
-}
diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_3.md b/vendor/symfony/console/Tests/Fixtures/input_option_3.md
deleted file mode 100644
index 7e89d697c..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_option_3.md
+++ /dev/null
@@ -1,8 +0,0 @@
-#### `--option_name|-o`
-
-option description
-
-* Accept value: yes
-* Is value required: yes
-* Is multiple: no
-* Default: `NULL`
diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_3.txt b/vendor/symfony/console/Tests/Fixtures/input_option_3.txt
deleted file mode 100644
index 947bb6527..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_option_3.txt
+++ /dev/null
@@ -1 +0,0 @@
- -o, --option_name=OPTION_NAME option description
diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_3.xml b/vendor/symfony/console/Tests/Fixtures/input_option_3.xml
deleted file mode 100644
index dcc0631cf..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_option_3.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_4.json b/vendor/symfony/console/Tests/Fixtures/input_option_4.json
deleted file mode 100644
index 788a8ed43..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_option_4.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "name": "--option_name",
- "shortcut": "-o",
- "accept_value": true,
- "is_value_required": false,
- "is_multiple": true,
- "description": "option description",
- "default": []
-}
diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_4.md b/vendor/symfony/console/Tests/Fixtures/input_option_4.md
deleted file mode 100644
index 7eb2d2ae3..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_option_4.md
+++ /dev/null
@@ -1,8 +0,0 @@
-#### `--option_name|-o`
-
-option description
-
-* Accept value: yes
-* Is value required: no
-* Is multiple: yes
-* Default: `array ()`
diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_4.txt b/vendor/symfony/console/Tests/Fixtures/input_option_4.txt
deleted file mode 100644
index 27edf77b4..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_option_4.txt
+++ /dev/null
@@ -1 +0,0 @@
- -o, --option_name[=OPTION_NAME] option description (multiple values allowed)
diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_4.xml b/vendor/symfony/console/Tests/Fixtures/input_option_4.xml
deleted file mode 100644
index 5e2418b14..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_option_4.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_5.json b/vendor/symfony/console/Tests/Fixtures/input_option_5.json
deleted file mode 100644
index 9f34d8321..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_option_5.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "name": "--option_name",
- "shortcut": "-o",
- "accept_value": true,
- "is_value_required": true,
- "is_multiple": false,
- "description": "multiline option description",
- "default": null
-}
diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_5.md b/vendor/symfony/console/Tests/Fixtures/input_option_5.md
deleted file mode 100644
index 72ca43914..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_option_5.md
+++ /dev/null
@@ -1,9 +0,0 @@
-#### `--option_name|-o`
-
-multiline
-option description
-
-* Accept value: yes
-* Is value required: yes
-* Is multiple: no
-* Default: `NULL`
diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_5.txt b/vendor/symfony/console/Tests/Fixtures/input_option_5.txt
deleted file mode 100644
index 9563b4cab..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_option_5.txt
+++ /dev/null
@@ -1,2 +0,0 @@
- -o, --option_name=OPTION_NAME multiline
- option description
diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_5.xml b/vendor/symfony/console/Tests/Fixtures/input_option_5.xml
deleted file mode 100644
index 90040ccd0..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_option_5.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_6.json b/vendor/symfony/console/Tests/Fixtures/input_option_6.json
deleted file mode 100644
index 0638de03e..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_option_6.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "name": "--option_name",
- "shortcut": "-o|-O",
- "accept_value": true,
- "is_value_required": true,
- "is_multiple": false,
- "description": "option with multiple shortcuts",
- "default": null
-}
diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_6.md b/vendor/symfony/console/Tests/Fixtures/input_option_6.md
deleted file mode 100644
index 87acd8b99..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_option_6.md
+++ /dev/null
@@ -1,8 +0,0 @@
-#### `--option_name|-o|-O`
-
-option with multiple shortcuts
-
-* Accept value: yes
-* Is value required: yes
-* Is multiple: no
-* Default: `NULL`
diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_6.txt b/vendor/symfony/console/Tests/Fixtures/input_option_6.txt
deleted file mode 100644
index 0e6c9759b..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_option_6.txt
+++ /dev/null
@@ -1 +0,0 @@
- -o|O, --option_name=OPTION_NAME option with multiple shortcuts
diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_6.xml b/vendor/symfony/console/Tests/Fixtures/input_option_6.xml
deleted file mode 100644
index 06126a2f5..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_option_6.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_with_default_inf_value.json b/vendor/symfony/console/Tests/Fixtures/input_option_with_default_inf_value.json
deleted file mode 100644
index 7c96ad304..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_option_with_default_inf_value.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "name": "--option_name",
- "shortcut": "-o",
- "accept_value": true,
- "is_value_required": false,
- "is_multiple": false,
- "description": "option description",
- "default": "INF"
-}
diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_with_default_inf_value.md b/vendor/symfony/console/Tests/Fixtures/input_option_with_default_inf_value.md
deleted file mode 100644
index c27e30a0a..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_option_with_default_inf_value.md
+++ /dev/null
@@ -1,8 +0,0 @@
-#### `--option_name|-o`
-
-option description
-
-* Accept value: yes
-* Is value required: no
-* Is multiple: no
-* Default: `INF`
diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_with_default_inf_value.txt b/vendor/symfony/console/Tests/Fixtures/input_option_with_default_inf_value.txt
deleted file mode 100644
index d467dcf42..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_option_with_default_inf_value.txt
+++ /dev/null
@@ -1 +0,0 @@
- -o, --option_name[=OPTION_NAME] option description [default: INF]
diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_with_default_inf_value.xml b/vendor/symfony/console/Tests/Fixtures/input_option_with_default_inf_value.xml
deleted file mode 100644
index 5d1d21753..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_option_with_default_inf_value.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_with_style.json b/vendor/symfony/console/Tests/Fixtures/input_option_with_style.json
deleted file mode 100644
index df328bf82..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_option_with_style.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "name": "--option_name",
- "shortcut": "-o",
- "accept_value": true,
- "is_value_required": true,
- "is_multiple": false,
- "description": "option description",
- "default": "style>"
-}
diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_with_style.md b/vendor/symfony/console/Tests/Fixtures/input_option_with_style.md
deleted file mode 100644
index e07a5643a..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_option_with_style.md
+++ /dev/null
@@ -1,8 +0,0 @@
-#### `--option_name|-o`
-
-option description
-
-* Accept value: yes
-* Is value required: yes
-* Is multiple: no
-* Default: `'style'`
diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_with_style.txt b/vendor/symfony/console/Tests/Fixtures/input_option_with_style.txt
deleted file mode 100644
index 880a53518..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_option_with_style.txt
+++ /dev/null
@@ -1 +0,0 @@
- -o, --option_name=OPTION_NAME option description [default: "\style\>"]
diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_with_style.xml b/vendor/symfony/console/Tests/Fixtures/input_option_with_style.xml
deleted file mode 100644
index 764b9e652..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_option_with_style.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_with_style_array.json b/vendor/symfony/console/Tests/Fixtures/input_option_with_style_array.json
deleted file mode 100644
index b1754550b..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_option_with_style_array.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "name": "--option_name",
- "shortcut": "-o",
- "accept_value": true,
- "is_value_required": true,
- "is_multiple": true,
- "description": "option description",
- "default": [
- "Hello",
- "world"
- ]
-}
diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_with_style_array.md b/vendor/symfony/console/Tests/Fixtures/input_option_with_style_array.md
deleted file mode 100644
index 16a045bcf..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_option_with_style_array.md
+++ /dev/null
@@ -1,8 +0,0 @@
-#### `--option_name|-o`
-
-option description
-
-* Accept value: yes
-* Is value required: yes
-* Is multiple: yes
-* Default: `array ( 0 => 'Hello', 1 => 'world',)`
diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_with_style_array.txt b/vendor/symfony/console/Tests/Fixtures/input_option_with_style_array.txt
deleted file mode 100644
index 265c18c5a..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_option_with_style_array.txt
+++ /dev/null
@@ -1 +0,0 @@
- -o, --option_name=OPTION_NAME option description [default: ["\Hello\","\world\"]] (multiple values allowed)
diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_with_style_array.xml b/vendor/symfony/console/Tests/Fixtures/input_option_with_style_array.xml
deleted file mode 100644
index 09dc86583..000000000
--- a/vendor/symfony/console/Tests/Fixtures/input_option_with_style_array.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
diff --git a/vendor/symfony/console/Tests/Formatter/OutputFormatterStyleStackTest.php b/vendor/symfony/console/Tests/Formatter/OutputFormatterStyleStackTest.php
deleted file mode 100644
index e212bf25e..000000000
--- a/vendor/symfony/console/Tests/Formatter/OutputFormatterStyleStackTest.php
+++ /dev/null
@@ -1,71 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Console\Tests\Formatter;
-
-use PHPUnit\Framework\TestCase;
-use Symfony\Component\Console\Formatter\OutputFormatterStyle;
-use Symfony\Component\Console\Formatter\OutputFormatterStyleStack;
-
-class OutputFormatterStyleStackTest extends TestCase
-{
- public function testPush()
- {
- $stack = new OutputFormatterStyleStack();
- $stack->push($s1 = new OutputFormatterStyle('white', 'black'));
- $stack->push($s2 = new OutputFormatterStyle('yellow', 'blue'));
-
- $this->assertEquals($s2, $stack->getCurrent());
-
- $stack->push($s3 = new OutputFormatterStyle('green', 'red'));
-
- $this->assertEquals($s3, $stack->getCurrent());
- }
-
- public function testPop()
- {
- $stack = new OutputFormatterStyleStack();
- $stack->push($s1 = new OutputFormatterStyle('white', 'black'));
- $stack->push($s2 = new OutputFormatterStyle('yellow', 'blue'));
-
- $this->assertEquals($s2, $stack->pop());
- $this->assertEquals($s1, $stack->pop());
- }
-
- public function testPopEmpty()
- {
- $stack = new OutputFormatterStyleStack();
- $style = new OutputFormatterStyle();
-
- $this->assertEquals($style, $stack->pop());
- }
-
- public function testPopNotLast()
- {
- $stack = new OutputFormatterStyleStack();
- $stack->push($s1 = new OutputFormatterStyle('white', 'black'));
- $stack->push($s2 = new OutputFormatterStyle('yellow', 'blue'));
- $stack->push($s3 = new OutputFormatterStyle('green', 'red'));
-
- $this->assertEquals($s2, $stack->pop($s2));
- $this->assertEquals($s1, $stack->pop());
- }
-
- /**
- * @expectedException \InvalidArgumentException
- */
- public function testInvalidPop()
- {
- $stack = new OutputFormatterStyleStack();
- $stack->push(new OutputFormatterStyle('white', 'black'));
- $stack->pop(new OutputFormatterStyle('yellow', 'blue'));
- }
-}
diff --git a/vendor/symfony/console/Tests/Formatter/OutputFormatterStyleTest.php b/vendor/symfony/console/Tests/Formatter/OutputFormatterStyleTest.php
deleted file mode 100644
index d47760fe4..000000000
--- a/vendor/symfony/console/Tests/Formatter/OutputFormatterStyleTest.php
+++ /dev/null
@@ -1,100 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Console\Tests\Formatter;
-
-use PHPUnit\Framework\TestCase;
-use Symfony\Component\Console\Formatter\OutputFormatterStyle;
-
-class OutputFormatterStyleTest extends TestCase
-{
- public function testConstructor()
- {
- $style = new OutputFormatterStyle('green', 'black', ['bold', 'underscore']);
- $this->assertEquals("\033[32;40;1;4mfoo\033[39;49;22;24m", $style->apply('foo'));
-
- $style = new OutputFormatterStyle('red', null, ['blink']);
- $this->assertEquals("\033[31;5mfoo\033[39;25m", $style->apply('foo'));
-
- $style = new OutputFormatterStyle(null, 'white');
- $this->assertEquals("\033[47mfoo\033[49m", $style->apply('foo'));
- }
-
- public function testForeground()
- {
- $style = new OutputFormatterStyle();
-
- $style->setForeground('black');
- $this->assertEquals("\033[30mfoo\033[39m", $style->apply('foo'));
-
- $style->setForeground('blue');
- $this->assertEquals("\033[34mfoo\033[39m", $style->apply('foo'));
-
- $style->setForeground('default');
- $this->assertEquals("\033[39mfoo\033[39m", $style->apply('foo'));
-
- $this->{method_exists($this, $_ = 'expectException') ? $_ : 'setExpectedException'}('InvalidArgumentException');
- $style->setForeground('undefined-color');
- }
-
- public function testBackground()
- {
- $style = new OutputFormatterStyle();
-
- $style->setBackground('black');
- $this->assertEquals("\033[40mfoo\033[49m", $style->apply('foo'));
-
- $style->setBackground('yellow');
- $this->assertEquals("\033[43mfoo\033[49m", $style->apply('foo'));
-
- $style->setBackground('default');
- $this->assertEquals("\033[49mfoo\033[49m", $style->apply('foo'));
-
- $this->{method_exists($this, $_ = 'expectException') ? $_ : 'setExpectedException'}('InvalidArgumentException');
- $style->setBackground('undefined-color');
- }
-
- public function testOptions()
- {
- $style = new OutputFormatterStyle();
-
- $style->setOptions(['reverse', 'conceal']);
- $this->assertEquals("\033[7;8mfoo\033[27;28m", $style->apply('foo'));
-
- $style->setOption('bold');
- $this->assertEquals("\033[7;8;1mfoo\033[27;28;22m", $style->apply('foo'));
-
- $style->unsetOption('reverse');
- $this->assertEquals("\033[8;1mfoo\033[28;22m", $style->apply('foo'));
-
- $style->setOption('bold');
- $this->assertEquals("\033[8;1mfoo\033[28;22m", $style->apply('foo'));
-
- $style->setOptions(['bold']);
- $this->assertEquals("\033[1mfoo\033[22m", $style->apply('foo'));
-
- try {
- $style->setOption('foo');
- $this->fail('->setOption() throws an \InvalidArgumentException when the option does not exist in the available options');
- } catch (\Exception $e) {
- $this->assertInstanceOf('\InvalidArgumentException', $e, '->setOption() throws an \InvalidArgumentException when the option does not exist in the available options');
- $this->assertContains('Invalid option specified: "foo"', $e->getMessage(), '->setOption() throws an \InvalidArgumentException when the option does not exist in the available options');
- }
-
- try {
- $style->unsetOption('foo');
- $this->fail('->unsetOption() throws an \InvalidArgumentException when the option does not exist in the available options');
- } catch (\Exception $e) {
- $this->assertInstanceOf('\InvalidArgumentException', $e, '->unsetOption() throws an \InvalidArgumentException when the option does not exist in the available options');
- $this->assertContains('Invalid option specified: "foo"', $e->getMessage(), '->unsetOption() throws an \InvalidArgumentException when the option does not exist in the available options');
- }
- }
-}
diff --git a/vendor/symfony/console/Tests/Formatter/OutputFormatterTest.php b/vendor/symfony/console/Tests/Formatter/OutputFormatterTest.php
deleted file mode 100644
index ce81c353f..000000000
--- a/vendor/symfony/console/Tests/Formatter/OutputFormatterTest.php
+++ /dev/null
@@ -1,355 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Console\Tests\Formatter;
-
-use PHPUnit\Framework\TestCase;
-use Symfony\Component\Console\Formatter\OutputFormatter;
-use Symfony\Component\Console\Formatter\OutputFormatterStyle;
-
-class OutputFormatterTest extends TestCase
-{
- public function testEmptyTag()
- {
- $formatter = new OutputFormatter(true);
- $this->assertEquals('foo<>bar', $formatter->format('foo<>bar'));
- }
-
- public function testLGCharEscaping()
- {
- $formatter = new OutputFormatter(true);
-
- $this->assertEquals('fooformat('foo\\assertEquals('foo << bar', $formatter->format('foo << bar'));
- $this->assertEquals('foo << bar \\', $formatter->format('foo << bar \\'));
- $this->assertEquals("foo << \033[32mbar \\ baz\033[39m \\", $formatter->format('foo << bar \\ baz \\'));
- $this->assertEquals('some info', $formatter->format('\\some info\\'));
- $this->assertEquals('\\some info\\', OutputFormatter::escape('some info'));
-
- $this->assertEquals(
- "\033[33mSymfony\\Component\\Console does work very well!\033[39m",
- $formatter->format('Symfony\Component\Console does work very well!')
- );
- }
-
- public function testBundledStyles()
- {
- $formatter = new OutputFormatter(true);
-
- $this->assertTrue($formatter->hasStyle('error'));
- $this->assertTrue($formatter->hasStyle('info'));
- $this->assertTrue($formatter->hasStyle('comment'));
- $this->assertTrue($formatter->hasStyle('question'));
-
- $this->assertEquals(
- "\033[37;41msome error\033[39;49m",
- $formatter->format('some error')
- );
- $this->assertEquals(
- "\033[32msome info\033[39m",
- $formatter->format('some info')
- );
- $this->assertEquals(
- "\033[33msome comment\033[39m",
- $formatter->format('some comment')
- );
- $this->assertEquals(
- "\033[30;46msome question\033[39;49m",
- $formatter->format('some question')
- );
- }
-
- public function testNestedStyles()
- {
- $formatter = new OutputFormatter(true);
-
- $this->assertEquals(
- "\033[37;41msome \033[39;49m\033[32msome info\033[39m\033[37;41m error\033[39;49m",
- $formatter->format('some some info error')
- );
- }
-
- public function testAdjacentStyles()
- {
- $formatter = new OutputFormatter(true);
-
- $this->assertEquals(
- "\033[37;41msome error\033[39;49m\033[32msome info\033[39m",
- $formatter->format('some errorsome info')
- );
- }
-
- public function testStyleMatchingNotGreedy()
- {
- $formatter = new OutputFormatter(true);
-
- $this->assertEquals(
- "(\033[32m>=2.0,<2.3\033[39m)",
- $formatter->format('(>=2.0,<2.3)')
- );
- }
-
- public function testStyleEscaping()
- {
- $formatter = new OutputFormatter(true);
-
- $this->assertEquals(
- "(\033[32mz>=2.0,<<format('('.$formatter->escape('z>=2.0,<\\<)')
- );
-
- $this->assertEquals(
- "\033[32msome error\033[39m",
- $formatter->format(''.$formatter->escape('some error').'')
- );
- }
-
- public function testDeepNestedStyles()
- {
- $formatter = new OutputFormatter(true);
-
- $this->assertEquals(
- "\033[37;41merror\033[39;49m\033[32minfo\033[39m\033[33mcomment\033[39m\033[37;41merror\033[39;49m",
- $formatter->format('errorinfocommenterror')
- );
- }
-
- public function testNewStyle()
- {
- $formatter = new OutputFormatter(true);
-
- $style = new OutputFormatterStyle('blue', 'white');
- $formatter->setStyle('test', $style);
-
- $this->assertEquals($style, $formatter->getStyle('test'));
- $this->assertNotEquals($style, $formatter->getStyle('info'));
-
- $style = new OutputFormatterStyle('blue', 'white');
- $formatter->setStyle('b', $style);
-
- $this->assertEquals("\033[34;47msome \033[39;49m\033[34;47mcustom\033[39;49m\033[34;47m msg\033[39;49m", $formatter->format('some custom msg'));
- }
-
- public function testRedefineStyle()
- {
- $formatter = new OutputFormatter(true);
-
- $style = new OutputFormatterStyle('blue', 'white');
- $formatter->setStyle('info', $style);
-
- $this->assertEquals("\033[34;47msome custom msg\033[39;49m", $formatter->format('some custom msg'));
- }
-
- public function testInlineStyle()
- {
- $formatter = new OutputFormatter(true);
-
- $this->assertEquals("\033[34;41msome text\033[39;49m", $formatter->format('some text>'));
- $this->assertEquals("\033[34;41msome text\033[39;49m", $formatter->format('some text'));
- }
-
- /**
- * @param string $tag
- * @param string|null $expected
- * @param string|null $input
- *
- * @dataProvider provideInlineStyleOptionsCases
- */
- public function testInlineStyleOptions($tag, $expected = null, $input = null)
- {
- $styleString = substr($tag, 1, -1);
- $formatter = new OutputFormatter(true);
- $method = new \ReflectionMethod($formatter, 'createStyleFromString');
- $method->setAccessible(true);
- $result = $method->invoke($formatter, $styleString);
- if (null === $expected) {
- $this->assertFalse($result);
- $expected = $tag.$input.''.$styleString.'>';
- $this->assertSame($expected, $formatter->format($expected));
- } else {
- /* @var OutputFormatterStyle $result */
- $this->assertInstanceOf(OutputFormatterStyle::class, $result);
- $this->assertSame($expected, $formatter->format($tag.$input.'>'));
- $this->assertSame($expected, $formatter->format($tag.$input.''.$styleString.'>'));
- }
- }
-
- public function provideInlineStyleOptionsCases()
- {
- return [
- [''],
- [''],
- ['', "\033[32m[test]\033[39m", '[test]'],
- ['', "\033[32;44ma\033[39;49m", 'a'],
- ['', "\033[32;1mb\033[39;22m", 'b'],
- ['', "\033[32;7m\033[39;27m", ''],
- ['', "\033[32;1;4mz\033[39;22;24m", 'z'],
- ['', "\033[32;1;4;7md\033[39;22;24;27m", 'd'],
- ];
- }
-
- public function provideInlineStyleTagsWithUnknownOptions()
- {
- return [
- ['', 'abc'],
- ['', 'abc'],
- ['', 'xyz'],
- ['', 'efg'],
- ];
- }
-
- public function testNonStyleTag()
- {
- $formatter = new OutputFormatter(true);
-
- $this->assertEquals("\033[32msome \033[39m\033[32m\033[39m\033[32m \033[39m\033[32m\033[39m\033[32m styled \033[39m\033[32m\033[39m\033[32msingle-char tag\033[39m\033[32m
\033[39m", $formatter->format('some styled single-char tag
'));
- }
-
- public function testFormatLongString()
- {
- $formatter = new OutputFormatter(true);
- $long = str_repeat('\\', 14000);
- $this->assertEquals("\033[37;41msome error\033[39;49m".$long, $formatter->format('some error'.$long));
- }
-
- public function testFormatToStringObject()
- {
- $formatter = new OutputFormatter(false);
- $this->assertEquals(
- 'some info', $formatter->format(new TableCell())
- );
- }
-
- public function testNotDecoratedFormatter()
- {
- $formatter = new OutputFormatter(false);
-
- $this->assertTrue($formatter->hasStyle('error'));
- $this->assertTrue($formatter->hasStyle('info'));
- $this->assertTrue($formatter->hasStyle('comment'));
- $this->assertTrue($formatter->hasStyle('question'));
-
- $this->assertEquals(
- 'some error', $formatter->format('some error')
- );
- $this->assertEquals(
- 'some info', $formatter->format('some info')
- );
- $this->assertEquals(
- 'some comment', $formatter->format('some comment')
- );
- $this->assertEquals(
- 'some question', $formatter->format('some question')
- );
- $this->assertEquals(
- 'some text with inline style', $formatter->format('some text with inline style>')
- );
-
- $formatter->setDecorated(true);
-
- $this->assertEquals(
- "\033[37;41msome error\033[39;49m", $formatter->format('some error')
- );
- $this->assertEquals(
- "\033[32msome info\033[39m", $formatter->format('some info')
- );
- $this->assertEquals(
- "\033[33msome comment\033[39m", $formatter->format('some comment')
- );
- $this->assertEquals(
- "\033[30;46msome question\033[39;49m", $formatter->format('some question')
- );
- $this->assertEquals(
- "\033[31msome text with inline style\033[39m", $formatter->format('some text with inline style>')
- );
- }
-
- public function testContentWithLineBreaks()
- {
- $formatter = new OutputFormatter(true);
-
- $this->assertEquals(<<format(<<<'EOF'
-
-some text
-EOF
- ));
-
- $this->assertEquals(<<format(<<<'EOF'
-some text
-
-EOF
- ));
-
- $this->assertEquals(<<format(<<<'EOF'
-
-some text
-
-EOF
- ));
-
- $this->assertEquals(<<format(<<<'EOF'
-
-some text
-more text
-
-EOF
- ));
- }
-
- public function testFormatAndWrap()
- {
- $formatter = new OutputFormatter(true);
-
- $this->assertSame("fo\no\e[37;41mb\e[39;49m\n\e[37;41mar\e[39;49m\nba\nz", $formatter->formatAndWrap('foobar baz', 2));
- $this->assertSame("pr\ne \e[37;41m\e[39;49m\n\e[37;41mfo\e[39;49m\n\e[37;41mo \e[39;49m\n\e[37;41mba\e[39;49m\n\e[37;41mr \e[39;49m\n\e[37;41mba\e[39;49m\n\e[37;41mz\e[39;49m \npo\nst", $formatter->formatAndWrap('pre foo bar baz post', 2));
- $this->assertSame("pre\e[37;41m\e[39;49m\n\e[37;41mfoo\e[39;49m\n\e[37;41mbar\e[39;49m\n\e[37;41mbaz\e[39;49m\npos\nt", $formatter->formatAndWrap('pre foo bar baz post', 3));
- $this->assertSame("pre \e[37;41m\e[39;49m\n\e[37;41mfoo \e[39;49m\n\e[37;41mbar \e[39;49m\n\e[37;41mbaz\e[39;49m \npost", $formatter->formatAndWrap('pre foo bar baz post', 4));
- $this->assertSame("pre \e[37;41mf\e[39;49m\n\e[37;41moo ba\e[39;49m\n\e[37;41mr baz\e[39;49m\npost", $formatter->formatAndWrap('pre foo bar baz post', 5));
- $this->assertSame("Lore\nm \e[37;41mip\e[39;49m\n\e[37;41msum\e[39;49m \ndolo\nr \e[32msi\e[39m\n\e[32mt\e[39m am\net", $formatter->formatAndWrap('Lorem ipsum dolor sit amet', 4));
- $this->assertSame("Lorem \e[37;41mip\e[39;49m\n\e[37;41msum\e[39;49m dolo\nr \e[32msit\e[39m am\net", $formatter->formatAndWrap('Lorem ipsum dolor sit amet', 8));
- $this->assertSame("Lorem \e[37;41mipsum\e[39;49m dolor \e[32m\e[39m\n\e[32msit\e[39m, \e[37;41mamet\e[39;49m et \e[32mlauda\e[39m\n\e[32mntium\e[39m architecto", $formatter->formatAndWrap('Lorem ipsum dolor sit, amet et laudantium architecto', 18));
-
- $formatter = new OutputFormatter();
-
- $this->assertSame("fo\nob\nar\nba\nz", $formatter->formatAndWrap('foobar baz', 2));
- $this->assertSame("pr\ne \nfo\no \nba\nr \nba\nz \npo\nst", $formatter->formatAndWrap('pre foo bar baz post', 2));
- $this->assertSame("pre\nfoo\nbar\nbaz\npos\nt", $formatter->formatAndWrap('pre foo bar baz post', 3));
- $this->assertSame("pre \nfoo \nbar \nbaz \npost", $formatter->formatAndWrap('pre foo bar baz post', 4));
- $this->assertSame("pre f\noo ba\nr baz\npost", $formatter->formatAndWrap('pre foo bar baz post', 5));
- }
-}
-
-class TableCell
-{
- public function __toString()
- {
- return 'some info';
- }
-}
diff --git a/vendor/symfony/console/Tests/Helper/AbstractQuestionHelperTest.php b/vendor/symfony/console/Tests/Helper/AbstractQuestionHelperTest.php
deleted file mode 100644
index f12566ded..000000000
--- a/vendor/symfony/console/Tests/Helper/AbstractQuestionHelperTest.php
+++ /dev/null
@@ -1,34 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Console\Tests\Helper;
-
-use PHPUnit\Framework\TestCase;
-use Symfony\Component\Console\Input\StreamableInputInterface;
-
-abstract class AbstractQuestionHelperTest extends TestCase
-{
- protected function createStreamableInputInterfaceMock($stream = null, $interactive = true)
- {
- $mock = $this->getMockBuilder(StreamableInputInterface::class)->getMock();
- $mock->expects($this->any())
- ->method('isInteractive')
- ->willReturn($interactive);
-
- if ($stream) {
- $mock->expects($this->any())
- ->method('getStream')
- ->willReturn($stream);
- }
-
- return $mock;
- }
-}
diff --git a/vendor/symfony/console/Tests/Helper/FormatterHelperTest.php b/vendor/symfony/console/Tests/Helper/FormatterHelperTest.php
deleted file mode 100644
index 934e11ac1..000000000
--- a/vendor/symfony/console/Tests/Helper/FormatterHelperTest.php
+++ /dev/null
@@ -1,129 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Console\Tests\Helper;
-
-use PHPUnit\Framework\TestCase;
-use Symfony\Component\Console\Helper\FormatterHelper;
-
-class FormatterHelperTest extends TestCase
-{
- public function testFormatSection()
- {
- $formatter = new FormatterHelper();
-
- $this->assertEquals(
- '[cli] Some text to display',
- $formatter->formatSection('cli', 'Some text to display'),
- '::formatSection() formats a message in a section'
- );
- }
-
- public function testFormatBlock()
- {
- $formatter = new FormatterHelper();
-
- $this->assertEquals(
- ' Some text to display ',
- $formatter->formatBlock('Some text to display', 'error'),
- '::formatBlock() formats a message in a block'
- );
-
- $this->assertEquals(
- ' Some text to display '."\n".
- ' foo bar ',
- $formatter->formatBlock(['Some text to display', 'foo bar'], 'error'),
- '::formatBlock() formats a message in a block'
- );
-
- $this->assertEquals(
- ' '."\n".
- ' Some text to display '."\n".
- ' ',
- $formatter->formatBlock('Some text to display', 'error', true),
- '::formatBlock() formats a message in a block'
- );
- }
-
- public function testFormatBlockWithDiacriticLetters()
- {
- $formatter = new FormatterHelper();
-
- $this->assertEquals(
- ' '."\n".
- ' Du texte à afficher '."\n".
- ' ',
- $formatter->formatBlock('Du texte à afficher', 'error', true),
- '::formatBlock() formats a message in a block'
- );
- }
-
- public function testFormatBlockWithDoubleWidthDiacriticLetters()
- {
- $formatter = new FormatterHelper();
- $this->assertEquals(
- ' '."\n".
- ' 表示するテキスト '."\n".
- ' ',
- $formatter->formatBlock('表示するテキスト', 'error', true),
- '::formatBlock() formats a message in a block'
- );
- }
-
- public function testFormatBlockLGEscaping()
- {
- $formatter = new FormatterHelper();
-
- $this->assertEquals(
- ' '."\n".
- ' \some info\ '."\n".
- ' ',
- $formatter->formatBlock('some info', 'error', true),
- '::formatBlock() escapes \'<\' chars'
- );
- }
-
- public function testTruncatingWithShorterLengthThanMessageWithSuffix()
- {
- $formatter = new FormatterHelper();
- $message = 'testing truncate';
-
- $this->assertSame('test...', $formatter->truncate($message, 4));
- $this->assertSame('testing truncat...', $formatter->truncate($message, 15));
- $this->assertSame('testing truncate...', $formatter->truncate($message, 16));
- $this->assertSame('zażółć gęślą...', $formatter->truncate('zażółć gęślą jaźń', 12));
- }
-
- public function testTruncatingMessageWithCustomSuffix()
- {
- $formatter = new FormatterHelper();
- $message = 'testing truncate';
-
- $this->assertSame('test!', $formatter->truncate($message, 4, '!'));
- }
-
- public function testTruncatingWithLongerLengthThanMessageWithSuffix()
- {
- $formatter = new FormatterHelper();
- $message = 'test';
-
- $this->assertSame($message, $formatter->truncate($message, 10));
- }
-
- public function testTruncatingWithNegativeLength()
- {
- $formatter = new FormatterHelper();
- $message = 'testing truncate';
-
- $this->assertSame('testing tru...', $formatter->truncate($message, -5));
- $this->assertSame('...', $formatter->truncate($message, -100));
- }
-}
diff --git a/vendor/symfony/console/Tests/Helper/HelperSetTest.php b/vendor/symfony/console/Tests/Helper/HelperSetTest.php
deleted file mode 100644
index ffb12b342..000000000
--- a/vendor/symfony/console/Tests/Helper/HelperSetTest.php
+++ /dev/null
@@ -1,127 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Console\Tests\Helper;
-
-use PHPUnit\Framework\TestCase;
-use Symfony\Component\Console\Command\Command;
-use Symfony\Component\Console\Helper\HelperSet;
-
-class HelperSetTest extends TestCase
-{
- public function testConstructor()
- {
- $mock_helper = $this->getGenericMockHelper('fake_helper');
- $helperset = new HelperSet(['fake_helper_alias' => $mock_helper]);
-
- $this->assertEquals($mock_helper, $helperset->get('fake_helper_alias'), '__construct sets given helper to helpers');
- $this->assertTrue($helperset->has('fake_helper_alias'), '__construct sets helper alias for given helper');
- }
-
- public function testSet()
- {
- $helperset = new HelperSet();
- $helperset->set($this->getGenericMockHelper('fake_helper', $helperset));
- $this->assertTrue($helperset->has('fake_helper'), '->set() adds helper to helpers');
-
- $helperset = new HelperSet();
- $helperset->set($this->getGenericMockHelper('fake_helper_01', $helperset));
- $helperset->set($this->getGenericMockHelper('fake_helper_02', $helperset));
- $this->assertTrue($helperset->has('fake_helper_01'), '->set() will set multiple helpers on consecutive calls');
- $this->assertTrue($helperset->has('fake_helper_02'), '->set() will set multiple helpers on consecutive calls');
-
- $helperset = new HelperSet();
- $helperset->set($this->getGenericMockHelper('fake_helper', $helperset), 'fake_helper_alias');
- $this->assertTrue($helperset->has('fake_helper'), '->set() adds helper alias when set');
- $this->assertTrue($helperset->has('fake_helper_alias'), '->set() adds helper alias when set');
- }
-
- public function testHas()
- {
- $helperset = new HelperSet(['fake_helper_alias' => $this->getGenericMockHelper('fake_helper')]);
- $this->assertTrue($helperset->has('fake_helper'), '->has() finds set helper');
- $this->assertTrue($helperset->has('fake_helper_alias'), '->has() finds set helper by alias');
- }
-
- public function testGet()
- {
- $helper_01 = $this->getGenericMockHelper('fake_helper_01');
- $helper_02 = $this->getGenericMockHelper('fake_helper_02');
- $helperset = new HelperSet(['fake_helper_01_alias' => $helper_01, 'fake_helper_02_alias' => $helper_02]);
- $this->assertEquals($helper_01, $helperset->get('fake_helper_01'), '->get() returns correct helper by name');
- $this->assertEquals($helper_01, $helperset->get('fake_helper_01_alias'), '->get() returns correct helper by alias');
- $this->assertEquals($helper_02, $helperset->get('fake_helper_02'), '->get() returns correct helper by name');
- $this->assertEquals($helper_02, $helperset->get('fake_helper_02_alias'), '->get() returns correct helper by alias');
-
- $helperset = new HelperSet();
- try {
- $helperset->get('foo');
- $this->fail('->get() throws InvalidArgumentException when helper not found');
- } catch (\Exception $e) {
- $this->assertInstanceOf('\InvalidArgumentException', $e, '->get() throws InvalidArgumentException when helper not found');
- $this->assertInstanceOf('Symfony\Component\Console\Exception\ExceptionInterface', $e, '->get() throws domain specific exception when helper not found');
- $this->assertContains('The helper "foo" is not defined.', $e->getMessage(), '->get() throws InvalidArgumentException when helper not found');
- }
- }
-
- public function testSetCommand()
- {
- $cmd_01 = new Command('foo');
- $cmd_02 = new Command('bar');
-
- $helperset = new HelperSet();
- $helperset->setCommand($cmd_01);
- $this->assertEquals($cmd_01, $helperset->getCommand(), '->setCommand() stores given command');
-
- $helperset = new HelperSet();
- $helperset->setCommand($cmd_01);
- $helperset->setCommand($cmd_02);
- $this->assertEquals($cmd_02, $helperset->getCommand(), '->setCommand() overwrites stored command with consecutive calls');
- }
-
- public function testGetCommand()
- {
- $cmd = new Command('foo');
- $helperset = new HelperSet();
- $helperset->setCommand($cmd);
- $this->assertEquals($cmd, $helperset->getCommand(), '->getCommand() retrieves stored command');
- }
-
- public function testIteration()
- {
- $helperset = new HelperSet();
- $helperset->set($this->getGenericMockHelper('fake_helper_01', $helperset));
- $helperset->set($this->getGenericMockHelper('fake_helper_02', $helperset));
-
- $helpers = ['fake_helper_01', 'fake_helper_02'];
- $i = 0;
-
- foreach ($helperset as $helper) {
- $this->assertEquals($helpers[$i++], $helper->getName());
- }
- }
-
- private function getGenericMockHelper($name, HelperSet $helperset = null)
- {
- $mock_helper = $this->getMockBuilder('\Symfony\Component\Console\Helper\HelperInterface')->getMock();
- $mock_helper->expects($this->any())
- ->method('getName')
- ->willReturn($name);
-
- if ($helperset) {
- $mock_helper->expects($this->any())
- ->method('setHelperSet')
- ->with($this->equalTo($helperset));
- }
-
- return $mock_helper;
- }
-}
diff --git a/vendor/symfony/console/Tests/Helper/HelperTest.php b/vendor/symfony/console/Tests/Helper/HelperTest.php
deleted file mode 100644
index 184d86e09..000000000
--- a/vendor/symfony/console/Tests/Helper/HelperTest.php
+++ /dev/null
@@ -1,55 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Console\Tests\Helper;
-
-use PHPUnit\Framework\TestCase;
-use Symfony\Component\Console\Helper\Helper;
-
-class HelperTest extends TestCase
-{
- public function formatTimeProvider()
- {
- return [
- [0, '< 1 sec'],
- [1, '1 sec'],
- [2, '2 secs'],
- [59, '59 secs'],
- [60, '1 min'],
- [61, '1 min'],
- [119, '1 min'],
- [120, '2 mins'],
- [121, '2 mins'],
- [3599, '59 mins'],
- [3600, '1 hr'],
- [7199, '1 hr'],
- [7200, '2 hrs'],
- [7201, '2 hrs'],
- [86399, '23 hrs'],
- [86400, '1 day'],
- [86401, '1 day'],
- [172799, '1 day'],
- [172800, '2 days'],
- [172801, '2 days'],
- ];
- }
-
- /**
- * @dataProvider formatTimeProvider
- *
- * @param int $secs
- * @param string $expectedFormat
- */
- public function testFormatTime($secs, $expectedFormat)
- {
- $this->assertEquals($expectedFormat, Helper::formatTime($secs));
- }
-}
diff --git a/vendor/symfony/console/Tests/Helper/ProcessHelperTest.php b/vendor/symfony/console/Tests/Helper/ProcessHelperTest.php
deleted file mode 100644
index 82c6b4451..000000000
--- a/vendor/symfony/console/Tests/Helper/ProcessHelperTest.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\Console\Tests\Helper;
-
-use PHPUnit\Framework\TestCase;
-use Symfony\Component\Console\Helper\DebugFormatterHelper;
-use Symfony\Component\Console\Helper\HelperSet;
-use Symfony\Component\Console\Helper\ProcessHelper;
-use Symfony\Component\Console\Output\StreamOutput;
-use Symfony\Component\Process\Process;
-
-class ProcessHelperTest extends TestCase
-{
- /**
- * @dataProvider provideCommandsAndOutput
- */
- public function testVariousProcessRuns($expected, $cmd, $verbosity, $error)
- {
- if (\is_string($cmd)) {
- $cmd = method_exists(Process::class, 'fromShellCommandline') ? Process::fromShellCommandline($cmd) : new Process($cmd);
- }
-
- $helper = new ProcessHelper();
- $helper->setHelperSet(new HelperSet([new DebugFormatterHelper()]));
- $output = $this->getOutputStream($verbosity);
- $helper->run($output, $cmd, $error);
- $this->assertEquals($expected, $this->getOutput($output));
- }
-
- public function testPassedCallbackIsExecuted()
- {
- $helper = new ProcessHelper();
- $helper->setHelperSet(new HelperSet([new DebugFormatterHelper()]));
- $output = $this->getOutputStream(StreamOutput::VERBOSITY_NORMAL);
-
- $executed = false;
- $callback = function () use (&$executed) { $executed = true; };
-
- $helper->run($output, ['php', '-r', 'echo 42;'], null, $callback);
- $this->assertTrue($executed);
- }
-
- public function provideCommandsAndOutput()
- {
- $successOutputVerbose = <<<'EOT'
- RUN php -r "echo 42;"
- RES Command ran successfully
-
-EOT;
- $successOutputDebug = <<<'EOT'
- RUN php -r "echo 42;"
- OUT 42
- RES Command ran successfully
-
-EOT;
- $successOutputDebugWithTags = <<<'EOT'
- RUN php -r "echo '42';"
- OUT 42
- RES Command ran successfully
-
-EOT;
- $successOutputProcessDebug = <<<'EOT'
- RUN 'php' '-r' 'echo 42;'
- OUT 42
- RES Command ran successfully
-
-EOT;
- $syntaxErrorOutputVerbose = <<<'EOT'
- RUN php -r "fwrite(STDERR, 'error message');usleep(50000);fwrite(STDOUT, 'out message');exit(252);"
- RES 252 Command did not run successfully
-
-EOT;
- $syntaxErrorOutputDebug = <<<'EOT'
- RUN php -r "fwrite(STDERR, 'error message');usleep(500000);fwrite(STDOUT, 'out message');exit(252);"
- ERR error message
- OUT out message
- RES 252 Command did not run successfully
-
-EOT;
-
- $PHP = '\\' === \DIRECTORY_SEPARATOR ? '"!PHP!"' : '"$PHP"';
- $successOutputPhp = <<getCommandLine();
- $successOutputProcessDebug = str_replace("'php' '-r' 'echo 42;'", $args, $successOutputProcessDebug);
- $fromShellCommandline = method_exists(Process::class, 'fromShellCommandline') ? [Process::class, 'fromShellCommandline'] : function ($cmd) { return new Process($cmd); };
-
- return [
- ['', 'php -r "echo 42;"', StreamOutput::VERBOSITY_VERBOSE, null],
- [$successOutputVerbose, 'php -r "echo 42;"', StreamOutput::VERBOSITY_VERY_VERBOSE, null],
- [$successOutputDebug, 'php -r "echo 42;"', StreamOutput::VERBOSITY_DEBUG, null],
- [$successOutputDebugWithTags, 'php -r "echo \'42\';"', StreamOutput::VERBOSITY_DEBUG, null],
- ['', 'php -r "syntax error"', StreamOutput::VERBOSITY_VERBOSE, null],
- [$syntaxErrorOutputVerbose, 'php -r "fwrite(STDERR, \'error message\');usleep(50000);fwrite(STDOUT, \'out message\');exit(252);"', StreamOutput::VERBOSITY_VERY_VERBOSE, null],
- [$syntaxErrorOutputDebug, 'php -r "fwrite(STDERR, \'error message\');usleep(500000);fwrite(STDOUT, \'out message\');exit(252);"', StreamOutput::VERBOSITY_DEBUG, null],
- [$errorMessage.PHP_EOL, 'php -r "fwrite(STDERR, \'error message\');usleep(50000);fwrite(STDOUT, \'out message\');exit(252);"', StreamOutput::VERBOSITY_VERBOSE, $errorMessage],
- [$syntaxErrorOutputVerbose.$errorMessage.PHP_EOL, 'php -r "fwrite(STDERR, \'error message\');usleep(50000);fwrite(STDOUT, \'out message\');exit(252);"', StreamOutput::VERBOSITY_VERY_VERBOSE, $errorMessage],
- [$syntaxErrorOutputDebug.$errorMessage.PHP_EOL, 'php -r "fwrite(STDERR, \'error message\');usleep(500000);fwrite(STDOUT, \'out message\');exit(252);"', StreamOutput::VERBOSITY_DEBUG, $errorMessage],
- [$successOutputProcessDebug, ['php', '-r', 'echo 42;'], StreamOutput::VERBOSITY_DEBUG, null],
- [$successOutputDebug, $fromShellCommandline('php -r "echo 42;"'), StreamOutput::VERBOSITY_DEBUG, null],
- [$successOutputProcessDebug, [new Process(['php', '-r', 'echo 42;'])], StreamOutput::VERBOSITY_DEBUG, null],
- [$successOutputPhp, [$fromShellCommandline('php -r '.$PHP), 'PHP' => 'echo 42;'], StreamOutput::VERBOSITY_DEBUG, null],
- ];
- }
-
- private function getOutputStream($verbosity)
- {
- return new StreamOutput(fopen('php://memory', 'r+', false), $verbosity, false);
- }
-
- private function getOutput(StreamOutput $output)
- {
- rewind($output->getStream());
-
- return stream_get_contents($output->getStream());
- }
-}
diff --git a/vendor/symfony/console/Tests/Helper/ProgressBarTest.php b/vendor/symfony/console/Tests/Helper/ProgressBarTest.php
deleted file mode 100644
index b0c834cc4..000000000
--- a/vendor/symfony/console/Tests/Helper/ProgressBarTest.php
+++ /dev/null
@@ -1,912 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Console\Tests\Helper;
-
-use PHPUnit\Framework\TestCase;
-use Symfony\Component\Console\Formatter\OutputFormatter;
-use Symfony\Component\Console\Helper\Helper;
-use Symfony\Component\Console\Helper\ProgressBar;
-use Symfony\Component\Console\Output\ConsoleSectionOutput;
-use Symfony\Component\Console\Output\StreamOutput;
-
-/**
- * @group time-sensitive
- */
-class ProgressBarTest extends TestCase
-{
- private $colSize;
-
- protected function setUp()
- {
- $this->colSize = getenv('COLUMNS');
- putenv('COLUMNS=120');
- }
-
- protected function tearDown()
- {
- putenv($this->colSize ? 'COLUMNS='.$this->colSize : 'COLUMNS');
- }
-
- public function testMultipleStart()
- {
- $bar = new ProgressBar($output = $this->getOutputStream());
- $bar->start();
- $bar->advance();
- $bar->start();
-
- rewind($output->getStream());
- $this->assertEquals(
- ' 0 [>---------------------------]'.
- $this->generateOutput(' 1 [->--------------------------]').
- $this->generateOutput(' 0 [>---------------------------]'),
- stream_get_contents($output->getStream())
- );
- }
-
- public function testAdvance()
- {
- $bar = new ProgressBar($output = $this->getOutputStream());
- $bar->start();
- $bar->advance();
-
- rewind($output->getStream());
- $this->assertEquals(
- ' 0 [>---------------------------]'.
- $this->generateOutput(' 1 [->--------------------------]'),
- stream_get_contents($output->getStream())
- );
- }
-
- public function testAdvanceWithStep()
- {
- $bar = new ProgressBar($output = $this->getOutputStream());
- $bar->start();
- $bar->advance(5);
-
- rewind($output->getStream());
- $this->assertEquals(
- ' 0 [>---------------------------]'.
- $this->generateOutput(' 5 [----->----------------------]'),
- stream_get_contents($output->getStream())
- );
- }
-
- public function testAdvanceMultipleTimes()
- {
- $bar = new ProgressBar($output = $this->getOutputStream());
- $bar->start();
- $bar->advance(3);
- $bar->advance(2);
-
- rewind($output->getStream());
- $this->assertEquals(
- ' 0 [>---------------------------]'.
- $this->generateOutput(' 3 [--->------------------------]').
- $this->generateOutput(' 5 [----->----------------------]'),
- stream_get_contents($output->getStream())
- );
- }
-
- public function testAdvanceOverMax()
- {
- $bar = new ProgressBar($output = $this->getOutputStream(), 10);
- $bar->setProgress(9);
- $bar->advance();
- $bar->advance();
-
- rewind($output->getStream());
- $this->assertEquals(
- ' 9/10 [=========================>--] 90%'.
- $this->generateOutput(' 10/10 [============================] 100%').
- $this->generateOutput(' 11/11 [============================] 100%'),
- stream_get_contents($output->getStream())
- );
- }
-
- public function testRegress()
- {
- $bar = new ProgressBar($output = $this->getOutputStream());
- $bar->start();
- $bar->advance();
- $bar->advance();
- $bar->advance(-1);
-
- rewind($output->getStream());
- $this->assertEquals(
- ' 0 [>---------------------------]'.
- $this->generateOutput(' 1 [->--------------------------]').
- $this->generateOutput(' 2 [-->-------------------------]').
- $this->generateOutput(' 1 [->--------------------------]'),
- stream_get_contents($output->getStream())
- );
- }
-
- public function testRegressWithStep()
- {
- $bar = new ProgressBar($output = $this->getOutputStream());
- $bar->start();
- $bar->advance(4);
- $bar->advance(4);
- $bar->advance(-2);
-
- rewind($output->getStream());
- $this->assertEquals(
- ' 0 [>---------------------------]'.
- $this->generateOutput(' 4 [---->-----------------------]').
- $this->generateOutput(' 8 [-------->-------------------]').
- $this->generateOutput(' 6 [------>---------------------]'),
- stream_get_contents($output->getStream())
- );
- }
-
- public function testRegressMultipleTimes()
- {
- $bar = new ProgressBar($output = $this->getOutputStream());
- $bar->start();
- $bar->advance(3);
- $bar->advance(3);
- $bar->advance(-1);
- $bar->advance(-2);
-
- rewind($output->getStream());
- $this->assertEquals(
- ' 0 [>---------------------------]'.
- $this->generateOutput(' 3 [--->------------------------]').
- $this->generateOutput(' 6 [------>---------------------]').
- $this->generateOutput(' 5 [----->----------------------]').
- $this->generateOutput(' 3 [--->------------------------]'),
- stream_get_contents($output->getStream())
- );
- }
-
- public function testRegressBelowMin()
- {
- $bar = new ProgressBar($output = $this->getOutputStream(), 10);
- $bar->setProgress(1);
- $bar->advance(-1);
- $bar->advance(-1);
-
- rewind($output->getStream());
- $this->assertEquals(
- ' 1/10 [==>-------------------------] 10%'.
- $this->generateOutput(' 0/10 [>---------------------------] 0%'),
- stream_get_contents($output->getStream())
- );
- }
-
- public function testFormat()
- {
- $expected =
- ' 0/10 [>---------------------------] 0%'.
- $this->generateOutput(' 10/10 [============================] 100%').
- $this->generateOutput(' 10/10 [============================] 100%')
- ;
-
- // max in construct, no format
- $bar = new ProgressBar($output = $this->getOutputStream(), 10);
- $bar->start();
- $bar->advance(10);
- $bar->finish();
-
- rewind($output->getStream());
- $this->assertEquals($expected, stream_get_contents($output->getStream()));
-
- // max in start, no format
- $bar = new ProgressBar($output = $this->getOutputStream());
- $bar->start(10);
- $bar->advance(10);
- $bar->finish();
-
- rewind($output->getStream());
- $this->assertEquals($expected, stream_get_contents($output->getStream()));
-
- // max in construct, explicit format before
- $bar = new ProgressBar($output = $this->getOutputStream(), 10);
- $bar->setFormat('normal');
- $bar->start();
- $bar->advance(10);
- $bar->finish();
-
- rewind($output->getStream());
- $this->assertEquals($expected, stream_get_contents($output->getStream()));
-
- // max in start, explicit format before
- $bar = new ProgressBar($output = $this->getOutputStream());
- $bar->setFormat('normal');
- $bar->start(10);
- $bar->advance(10);
- $bar->finish();
-
- rewind($output->getStream());
- $this->assertEquals($expected, stream_get_contents($output->getStream()));
- }
-
- public function testCustomizations()
- {
- $bar = new ProgressBar($output = $this->getOutputStream(), 10);
- $bar->setBarWidth(10);
- $bar->setBarCharacter('_');
- $bar->setEmptyBarCharacter(' ');
- $bar->setProgressCharacter('/');
- $bar->setFormat(' %current%/%max% [%bar%] %percent:3s%%');
- $bar->start();
- $bar->advance();
-
- rewind($output->getStream());
- $this->assertEquals(
- ' 0/10 [/ ] 0%'.
- $this->generateOutput(' 1/10 [_/ ] 10%'),
- stream_get_contents($output->getStream())
- );
- }
-
- public function testDisplayWithoutStart()
- {
- $bar = new ProgressBar($output = $this->getOutputStream(), 50);
- $bar->display();
-
- rewind($output->getStream());
- $this->assertEquals(
- ' 0/50 [>---------------------------] 0%',
- stream_get_contents($output->getStream())
- );
- }
-
- public function testDisplayWithQuietVerbosity()
- {
- $bar = new ProgressBar($output = $this->getOutputStream(true, StreamOutput::VERBOSITY_QUIET), 50);
- $bar->display();
-
- rewind($output->getStream());
- $this->assertEquals(
- '',
- stream_get_contents($output->getStream())
- );
- }
-
- public function testFinishWithoutStart()
- {
- $bar = new ProgressBar($output = $this->getOutputStream(), 50);
- $bar->finish();
-
- rewind($output->getStream());
- $this->assertEquals(
- ' 50/50 [============================] 100%',
- stream_get_contents($output->getStream())
- );
- }
-
- public function testPercent()
- {
- $bar = new ProgressBar($output = $this->getOutputStream(), 50);
- $bar->start();
- $bar->display();
- $bar->advance();
- $bar->advance();
-
- rewind($output->getStream());
- $this->assertEquals(
- ' 0/50 [>---------------------------] 0%'.
- $this->generateOutput(' 0/50 [>---------------------------] 0%').
- $this->generateOutput(' 1/50 [>---------------------------] 2%').
- $this->generateOutput(' 2/50 [=>--------------------------] 4%'),
- stream_get_contents($output->getStream())
- );
- }
-
- public function testOverwriteWithShorterLine()
- {
- $bar = new ProgressBar($output = $this->getOutputStream(), 50);
- $bar->setFormat(' %current%/%max% [%bar%] %percent:3s%%');
- $bar->start();
- $bar->display();
- $bar->advance();
-
- // set shorter format
- $bar->setFormat(' %current%/%max% [%bar%]');
- $bar->advance();
-
- rewind($output->getStream());
- $this->assertEquals(
- ' 0/50 [>---------------------------] 0%'.
- $this->generateOutput(' 0/50 [>---------------------------] 0%').
- $this->generateOutput(' 1/50 [>---------------------------] 2%').
- $this->generateOutput(' 2/50 [=>--------------------------]'),
- stream_get_contents($output->getStream())
- );
- }
-
- public function testOverwriteWithSectionOutput()
- {
- $sections = [];
- $stream = $this->getOutputStream(true);
- $output = new ConsoleSectionOutput($stream->getStream(), $sections, $stream->getVerbosity(), $stream->isDecorated(), new OutputFormatter());
-
- $bar = new ProgressBar($output, 50);
- $bar->start();
- $bar->display();
- $bar->advance();
- $bar->advance();
-
- rewind($output->getStream());
- $this->assertEquals(
- ' 0/50 [>---------------------------] 0%'.PHP_EOL.
- "\x1b[1A\x1b[0J".' 0/50 [>---------------------------] 0%'.PHP_EOL.
- "\x1b[1A\x1b[0J".' 1/50 [>---------------------------] 2%'.PHP_EOL.
- "\x1b[1A\x1b[0J".' 2/50 [=>--------------------------] 4%'.PHP_EOL,
- stream_get_contents($output->getStream())
- );
- }
-
- public function testOverwriteMultipleProgressBarsWithSectionOutputs()
- {
- $sections = [];
- $stream = $this->getOutputStream(true);
- $output1 = new ConsoleSectionOutput($stream->getStream(), $sections, $stream->getVerbosity(), $stream->isDecorated(), new OutputFormatter());
- $output2 = new ConsoleSectionOutput($stream->getStream(), $sections, $stream->getVerbosity(), $stream->isDecorated(), new OutputFormatter());
-
- $progress = new ProgressBar($output1, 50);
- $progress2 = new ProgressBar($output2, 50);
-
- $progress->start();
- $progress2->start();
-
- $progress2->advance();
- $progress->advance();
-
- rewind($stream->getStream());
-
- $this->assertEquals(
- ' 0/50 [>---------------------------] 0%'.PHP_EOL.
- ' 0/50 [>---------------------------] 0%'.PHP_EOL.
- "\x1b[1A\x1b[0J".' 1/50 [>---------------------------] 2%'.PHP_EOL.
- "\x1b[2A\x1b[0J".' 1/50 [>---------------------------] 2%'.PHP_EOL.
- "\x1b[1A\x1b[0J".' 1/50 [>---------------------------] 2%'.PHP_EOL.
- ' 1/50 [>---------------------------] 2%'.PHP_EOL,
- stream_get_contents($stream->getStream())
- );
- }
-
- public function testMultipleSectionsWithCustomFormat()
- {
- $sections = [];
- $stream = $this->getOutputStream(true);
- $output1 = new ConsoleSectionOutput($stream->getStream(), $sections, $stream->getVerbosity(), $stream->isDecorated(), new OutputFormatter());
- $output2 = new ConsoleSectionOutput($stream->getStream(), $sections, $stream->getVerbosity(), $stream->isDecorated(), new OutputFormatter());
-
- ProgressBar::setFormatDefinition('test', '%current%/%max% [%bar%] %percent:3s%% Fruitcake marzipan toffee. Cupcake gummi bears tart dessert ice cream chupa chups cupcake chocolate bar sesame snaps. Croissant halvah cookie jujubes powder macaroon. Fruitcake bear claw bonbon jelly beans oat cake pie muffin Fruitcake marzipan toffee.');
-
- $progress = new ProgressBar($output1, 50);
- $progress2 = new ProgressBar($output2, 50);
- $progress2->setFormat('test');
-
- $progress->start();
- $progress2->start();
-
- $progress->advance();
- $progress2->advance();
-
- rewind($stream->getStream());
-
- $this->assertEquals(' 0/50 [>---------------------------] 0%'.PHP_EOL.
- ' 0/50 [>] 0% Fruitcake marzipan toffee. Cupcake gummi bears tart dessert ice cream chupa chups cupcake chocolate bar sesame snaps. Croissant halvah cookie jujubes powder macaroon. Fruitcake bear claw bonbon jelly beans oat cake pie muffin Fruitcake marzipan toffee.'.PHP_EOL.
- "\x1b[4A\x1b[0J".' 0/50 [>] 0% Fruitcake marzipan toffee. Cupcake gummi bears tart dessert ice cream chupa chups cupcake chocolate bar sesame snaps. Croissant halvah cookie jujubes powder macaroon. Fruitcake bear claw bonbon jelly beans oat cake pie muffin Fruitcake marzipan toffee.'.PHP_EOL.
- "\x1b[3A\x1b[0J".' 1/50 [>---------------------------] 2%'.PHP_EOL.
- ' 0/50 [>] 0% Fruitcake marzipan toffee. Cupcake gummi bears tart dessert ice cream chupa chups cupcake chocolate bar sesame snaps. Croissant halvah cookie jujubes powder macaroon. Fruitcake bear claw bonbon jelly beans oat cake pie muffin Fruitcake marzipan toffee.'.PHP_EOL.
- "\x1b[3A\x1b[0J".' 1/50 [>] 2% Fruitcake marzipan toffee. Cupcake gummi bears tart dessert ice cream chupa chups cupcake chocolate bar sesame snaps. Croissant halvah cookie jujubes powder macaroon. Fruitcake bear claw bonbon jelly beans oat cake pie muffin Fruitcake marzipan toffee.'.PHP_EOL,
- stream_get_contents($stream->getStream())
- );
- }
-
- public function testStartWithMax()
- {
- $bar = new ProgressBar($output = $this->getOutputStream());
- $bar->setFormat('%current%/%max% [%bar%]');
- $bar->start(50);
- $bar->advance();
-
- rewind($output->getStream());
- $this->assertEquals(
- ' 0/50 [>---------------------------]'.
- $this->generateOutput(' 1/50 [>---------------------------]'),
- stream_get_contents($output->getStream())
- );
- }
-
- public function testSetCurrentProgress()
- {
- $bar = new ProgressBar($output = $this->getOutputStream(), 50);
- $bar->start();
- $bar->display();
- $bar->advance();
- $bar->setProgress(15);
- $bar->setProgress(25);
-
- rewind($output->getStream());
- $this->assertEquals(
- ' 0/50 [>---------------------------] 0%'.
- $this->generateOutput(' 0/50 [>---------------------------] 0%').
- $this->generateOutput(' 1/50 [>---------------------------] 2%').
- $this->generateOutput(' 15/50 [========>-------------------] 30%').
- $this->generateOutput(' 25/50 [==============>-------------] 50%'),
- stream_get_contents($output->getStream())
- );
- }
-
- public function testSetCurrentBeforeStarting()
- {
- $bar = new ProgressBar($this->getOutputStream());
- $bar->setProgress(15);
- $this->assertNotNull($bar->getStartTime());
- }
-
- public function testRedrawFrequency()
- {
- $bar = new ProgressBar($output = $this->getOutputStream(), 6);
- $bar->setRedrawFrequency(2);
- $bar->start();
- $bar->setProgress(1);
- $bar->advance(2);
- $bar->advance(2);
- $bar->advance(1);
-
- rewind($output->getStream());
- $this->assertEquals(
- ' 0/6 [>---------------------------] 0%'.
- $this->generateOutput(' 3/6 [==============>-------------] 50%').
- $this->generateOutput(' 5/6 [=======================>----] 83%').
- $this->generateOutput(' 6/6 [============================] 100%'),
- stream_get_contents($output->getStream())
- );
- }
-
- public function testRedrawFrequencyIsAtLeastOneIfZeroGiven()
- {
- $bar = new ProgressBar($output = $this->getOutputStream());
- $bar->setRedrawFrequency(0);
- $bar->start();
- $bar->advance();
-
- rewind($output->getStream());
- $this->assertEquals(
- ' 0 [>---------------------------]'.
- $this->generateOutput(' 1 [->--------------------------]'),
- stream_get_contents($output->getStream())
- );
- }
-
- public function testRedrawFrequencyIsAtLeastOneIfSmallerOneGiven()
- {
- $bar = new ProgressBar($output = $this->getOutputStream());
- $bar->setRedrawFrequency(0.9);
- $bar->start();
- $bar->advance();
-
- rewind($output->getStream());
- $this->assertEquals(
- ' 0 [>---------------------------]'.
- $this->generateOutput(' 1 [->--------------------------]'),
- stream_get_contents($output->getStream())
- );
- }
-
- public function testMultiByteSupport()
- {
- $bar = new ProgressBar($output = $this->getOutputStream());
- $bar->start();
- $bar->setBarCharacter('■');
- $bar->advance(3);
-
- rewind($output->getStream());
- $this->assertEquals(
- ' 0 [>---------------------------]'.
- $this->generateOutput(' 3 [■■■>------------------------]'),
- stream_get_contents($output->getStream())
- );
- }
-
- public function testClear()
- {
- $bar = new ProgressBar($output = $this->getOutputStream(), 50);
- $bar->start();
- $bar->setProgress(25);
- $bar->clear();
-
- rewind($output->getStream());
- $this->assertEquals(
- ' 0/50 [>---------------------------] 0%'.
- $this->generateOutput(' 25/50 [==============>-------------] 50%').
- $this->generateOutput(''),
- stream_get_contents($output->getStream())
- );
- }
-
- public function testPercentNotHundredBeforeComplete()
- {
- $bar = new ProgressBar($output = $this->getOutputStream(), 200);
- $bar->start();
- $bar->display();
- $bar->advance(199);
- $bar->advance();
-
- rewind($output->getStream());
- $this->assertEquals(
- ' 0/200 [>---------------------------] 0%'.
- $this->generateOutput(' 0/200 [>---------------------------] 0%').
- $this->generateOutput(' 199/200 [===========================>] 99%').
- $this->generateOutput(' 200/200 [============================] 100%'),
- stream_get_contents($output->getStream())
- );
- }
-
- public function testNonDecoratedOutput()
- {
- $bar = new ProgressBar($output = $this->getOutputStream(false), 200);
- $bar->start();
-
- for ($i = 0; $i < 200; ++$i) {
- $bar->advance();
- }
-
- $bar->finish();
-
- rewind($output->getStream());
- $this->assertEquals(
- ' 0/200 [>---------------------------] 0%'.PHP_EOL.
- ' 20/200 [==>-------------------------] 10%'.PHP_EOL.
- ' 40/200 [=====>----------------------] 20%'.PHP_EOL.
- ' 60/200 [========>-------------------] 30%'.PHP_EOL.
- ' 80/200 [===========>----------------] 40%'.PHP_EOL.
- ' 100/200 [==============>-------------] 50%'.PHP_EOL.
- ' 120/200 [================>-----------] 60%'.PHP_EOL.
- ' 140/200 [===================>--------] 70%'.PHP_EOL.
- ' 160/200 [======================>-----] 80%'.PHP_EOL.
- ' 180/200 [=========================>--] 90%'.PHP_EOL.
- ' 200/200 [============================] 100%',
- stream_get_contents($output->getStream())
- );
- }
-
- public function testNonDecoratedOutputWithClear()
- {
- $bar = new ProgressBar($output = $this->getOutputStream(false), 50);
- $bar->start();
- $bar->setProgress(25);
- $bar->clear();
- $bar->setProgress(50);
- $bar->finish();
-
- rewind($output->getStream());
- $this->assertEquals(
- ' 0/50 [>---------------------------] 0%'.PHP_EOL.
- ' 25/50 [==============>-------------] 50%'.PHP_EOL.
- ' 50/50 [============================] 100%',
- stream_get_contents($output->getStream())
- );
- }
-
- public function testNonDecoratedOutputWithoutMax()
- {
- $bar = new ProgressBar($output = $this->getOutputStream(false));
- $bar->start();
- $bar->advance();
-
- rewind($output->getStream());
- $this->assertEquals(
- ' 0 [>---------------------------]'.PHP_EOL.
- ' 1 [->--------------------------]',
- stream_get_contents($output->getStream())
- );
- }
-
- public function testParallelBars()
- {
- $output = $this->getOutputStream();
- $bar1 = new ProgressBar($output, 2);
- $bar2 = new ProgressBar($output, 3);
- $bar2->setProgressCharacter('#');
- $bar3 = new ProgressBar($output);
-
- $bar1->start();
- $output->write("\n");
- $bar2->start();
- $output->write("\n");
- $bar3->start();
-
- for ($i = 1; $i <= 3; ++$i) {
- // up two lines
- $output->write("\033[2A");
- if ($i <= 2) {
- $bar1->advance();
- }
- $output->write("\n");
- $bar2->advance();
- $output->write("\n");
- $bar3->advance();
- }
- $output->write("\033[2A");
- $output->write("\n");
- $output->write("\n");
- $bar3->finish();
-
- rewind($output->getStream());
- $this->assertEquals(
- ' 0/2 [>---------------------------] 0%'."\n".
- ' 0/3 [#---------------------------] 0%'."\n".
- rtrim(' 0 [>---------------------------]').
-
- "\033[2A".
- $this->generateOutput(' 1/2 [==============>-------------] 50%')."\n".
- $this->generateOutput(' 1/3 [=========#------------------] 33%')."\n".
- rtrim($this->generateOutput(' 1 [->--------------------------]')).
-
- "\033[2A".
- $this->generateOutput(' 2/2 [============================] 100%')."\n".
- $this->generateOutput(' 2/3 [==================#---------] 66%')."\n".
- rtrim($this->generateOutput(' 2 [-->-------------------------]')).
-
- "\033[2A".
- "\n".
- $this->generateOutput(' 3/3 [============================] 100%')."\n".
- rtrim($this->generateOutput(' 3 [--->------------------------]')).
-
- "\033[2A".
- "\n".
- "\n".
- rtrim($this->generateOutput(' 3 [============================]')),
- stream_get_contents($output->getStream())
- );
- }
-
- public function testWithoutMax()
- {
- $output = $this->getOutputStream();
-
- $bar = new ProgressBar($output);
- $bar->start();
- $bar->advance();
- $bar->advance();
- $bar->advance();
- $bar->finish();
-
- rewind($output->getStream());
- $this->assertEquals(
- rtrim(' 0 [>---------------------------]').
- rtrim($this->generateOutput(' 1 [->--------------------------]')).
- rtrim($this->generateOutput(' 2 [-->-------------------------]')).
- rtrim($this->generateOutput(' 3 [--->------------------------]')).
- rtrim($this->generateOutput(' 3 [============================]')),
- stream_get_contents($output->getStream())
- );
- }
-
- public function testSettingMaxStepsDuringProgressing()
- {
- $output = $this->getOutputStream();
- $bar = new ProgressBar($output);
- $bar->start();
- $bar->setProgress(2);
- $bar->setMaxSteps(10);
- $bar->setProgress(5);
- $bar->setMaxSteps(100);
- $bar->setProgress(10);
- $bar->finish();
-
- rewind($output->getStream());
- $this->assertEquals(
- rtrim(' 0 [>---------------------------]').
- rtrim($this->generateOutput(' 2 [-->-------------------------]')).
- rtrim($this->generateOutput(' 5/10 [==============>-------------] 50%')).
- rtrim($this->generateOutput(' 10/100 [==>-------------------------] 10%')).
- rtrim($this->generateOutput(' 100/100 [============================] 100%')),
- stream_get_contents($output->getStream())
- );
- }
-
- public function testWithSmallScreen()
- {
- $output = $this->getOutputStream();
-
- $bar = new ProgressBar($output);
- putenv('COLUMNS=12');
- $bar->start();
- $bar->advance();
- putenv('COLUMNS=120');
-
- rewind($output->getStream());
- $this->assertEquals(
- ' 0 [>---]'.
- $this->generateOutput(' 1 [->--]'),
- stream_get_contents($output->getStream())
- );
- }
-
- public function testAddingPlaceholderFormatter()
- {
- ProgressBar::setPlaceholderFormatterDefinition('remaining_steps', function (ProgressBar $bar) {
- return $bar->getMaxSteps() - $bar->getProgress();
- });
- $bar = new ProgressBar($output = $this->getOutputStream(), 3);
- $bar->setFormat(' %remaining_steps% [%bar%]');
-
- $bar->start();
- $bar->advance();
- $bar->finish();
-
- rewind($output->getStream());
- $this->assertEquals(
- ' 3 [>---------------------------]'.
- $this->generateOutput(' 2 [=========>------------------]').
- $this->generateOutput(' 0 [============================]'),
- stream_get_contents($output->getStream())
- );
- }
-
- public function testMultilineFormat()
- {
- $bar = new ProgressBar($output = $this->getOutputStream(), 3);
- $bar->setFormat("%bar%\nfoobar");
-
- $bar->start();
- $bar->advance();
- $bar->clear();
- $bar->finish();
-
- rewind($output->getStream());
- $this->assertEquals(
- ">---------------------------\nfoobar".
- $this->generateOutput("=========>------------------\nfoobar").
- "\x0D\x1B[2K\x1B[1A\x1B[2K".
- $this->generateOutput("============================\nfoobar"),
- stream_get_contents($output->getStream())
- );
- }
-
- public function testAnsiColorsAndEmojis()
- {
- putenv('COLUMNS=156');
-
- $bar = new ProgressBar($output = $this->getOutputStream(), 15);
- ProgressBar::setPlaceholderFormatterDefinition('memory', function (ProgressBar $bar) {
- static $i = 0;
- $mem = 100000 * $i;
- $colors = $i++ ? '41;37' : '44;37';
-
- return "\033[".$colors.'m '.Helper::formatMemory($mem)." \033[0m";
- });
- $bar->setFormat(" \033[44;37m %title:-37s% \033[0m\n %current%/%max% %bar% %percent:3s%%\n 🏁 %remaining:-10s% %memory:37s%");
- $bar->setBarCharacter($done = "\033[32m●\033[0m");
- $bar->setEmptyBarCharacter($empty = "\033[31m●\033[0m");
- $bar->setProgressCharacter($progress = "\033[32m➤ \033[0m");
-
- $bar->setMessage('Starting the demo... fingers crossed', 'title');
- $bar->start();
-
- rewind($output->getStream());
- $this->assertEquals(
- " \033[44;37m Starting the demo... fingers crossed \033[0m\n".
- ' 0/15 '.$progress.str_repeat($empty, 26)." 0%\n".
- " \xf0\x9f\x8f\x81 < 1 sec \033[44;37m 0 B \033[0m",
- stream_get_contents($output->getStream())
- );
- ftruncate($output->getStream(), 0);
- rewind($output->getStream());
-
- $bar->setMessage('Looks good to me...', 'title');
- $bar->advance(4);
-
- rewind($output->getStream());
- $this->assertEquals(
- $this->generateOutput(
- " \033[44;37m Looks good to me... \033[0m\n".
- ' 4/15 '.str_repeat($done, 7).$progress.str_repeat($empty, 19)." 26%\n".
- " \xf0\x9f\x8f\x81 < 1 sec \033[41;37m 97 KiB \033[0m"
- ),
- stream_get_contents($output->getStream())
- );
- ftruncate($output->getStream(), 0);
- rewind($output->getStream());
-
- $bar->setMessage('Thanks, bye', 'title');
- $bar->finish();
-
- rewind($output->getStream());
- $this->assertEquals(
- $this->generateOutput(
- " \033[44;37m Thanks, bye \033[0m\n".
- ' 15/15 '.str_repeat($done, 28)." 100%\n".
- " \xf0\x9f\x8f\x81 < 1 sec \033[41;37m 195 KiB \033[0m"
- ),
- stream_get_contents($output->getStream())
- );
- putenv('COLUMNS=120');
- }
-
- public function testSetFormat()
- {
- $bar = new ProgressBar($output = $this->getOutputStream());
- $bar->setFormat('normal');
- $bar->start();
- rewind($output->getStream());
- $this->assertEquals(
- ' 0 [>---------------------------]',
- stream_get_contents($output->getStream())
- );
-
- $bar = new ProgressBar($output = $this->getOutputStream(), 10);
- $bar->setFormat('normal');
- $bar->start();
- rewind($output->getStream());
- $this->assertEquals(
- ' 0/10 [>---------------------------] 0%',
- stream_get_contents($output->getStream())
- );
- }
-
- /**
- * @dataProvider provideFormat
- */
- public function testFormatsWithoutMax($format)
- {
- $bar = new ProgressBar($output = $this->getOutputStream());
- $bar->setFormat($format);
- $bar->start();
-
- rewind($output->getStream());
- $this->assertNotEmpty(stream_get_contents($output->getStream()));
- }
-
- /**
- * Provides each defined format.
- *
- * @return array
- */
- public function provideFormat()
- {
- return [
- ['normal'],
- ['verbose'],
- ['very_verbose'],
- ['debug'],
- ];
- }
-
- protected function getOutputStream($decorated = true, $verbosity = StreamOutput::VERBOSITY_NORMAL)
- {
- return new StreamOutput(fopen('php://memory', 'r+', false), $verbosity, $decorated);
- }
-
- protected function generateOutput($expected)
- {
- $count = substr_count($expected, "\n");
-
- return "\x0D\x1B[2K".($count ? str_repeat("\x1B[1A\x1B[2K", $count) : '').$expected;
- }
-
- public function testBarWidthWithMultilineFormat()
- {
- putenv('COLUMNS=10');
-
- $bar = new ProgressBar($output = $this->getOutputStream());
- $bar->setFormat("%bar%\n0123456789");
-
- // before starting
- $bar->setBarWidth(5);
- $this->assertEquals(5, $bar->getBarWidth());
-
- // after starting
- $bar->start();
- rewind($output->getStream());
- $this->assertEquals(5, $bar->getBarWidth(), stream_get_contents($output->getStream()));
- putenv('COLUMNS=120');
- }
-}
diff --git a/vendor/symfony/console/Tests/Helper/ProgressIndicatorTest.php b/vendor/symfony/console/Tests/Helper/ProgressIndicatorTest.php
deleted file mode 100644
index 6c6f86f36..000000000
--- a/vendor/symfony/console/Tests/Helper/ProgressIndicatorTest.php
+++ /dev/null
@@ -1,183 +0,0 @@
-getOutputStream());
- $bar->start('Starting...');
- usleep(101000);
- $bar->advance();
- usleep(101000);
- $bar->advance();
- usleep(101000);
- $bar->advance();
- usleep(101000);
- $bar->advance();
- usleep(101000);
- $bar->advance();
- usleep(101000);
- $bar->setMessage('Advancing...');
- $bar->advance();
- $bar->finish('Done...');
- $bar->start('Starting Again...');
- usleep(101000);
- $bar->advance();
- $bar->finish('Done Again...');
-
- rewind($output->getStream());
-
- $this->assertEquals(
- $this->generateOutput(' - Starting...').
- $this->generateOutput(' \\ Starting...').
- $this->generateOutput(' | Starting...').
- $this->generateOutput(' / Starting...').
- $this->generateOutput(' - Starting...').
- $this->generateOutput(' \\ Starting...').
- $this->generateOutput(' \\ Advancing...').
- $this->generateOutput(' | Advancing...').
- $this->generateOutput(' | Done...').
- PHP_EOL.
- $this->generateOutput(' - Starting Again...').
- $this->generateOutput(' \\ Starting Again...').
- $this->generateOutput(' \\ Done Again...').
- PHP_EOL,
- stream_get_contents($output->getStream())
- );
- }
-
- public function testNonDecoratedOutput()
- {
- $bar = new ProgressIndicator($output = $this->getOutputStream(false));
-
- $bar->start('Starting...');
- $bar->advance();
- $bar->advance();
- $bar->setMessage('Midway...');
- $bar->advance();
- $bar->advance();
- $bar->finish('Done...');
-
- rewind($output->getStream());
-
- $this->assertEquals(
- ' Starting...'.PHP_EOL.
- ' Midway...'.PHP_EOL.
- ' Done...'.PHP_EOL.PHP_EOL,
- stream_get_contents($output->getStream())
- );
- }
-
- public function testCustomIndicatorValues()
- {
- $bar = new ProgressIndicator($output = $this->getOutputStream(), null, 100, ['a', 'b', 'c']);
-
- $bar->start('Starting...');
- usleep(101000);
- $bar->advance();
- usleep(101000);
- $bar->advance();
- usleep(101000);
- $bar->advance();
-
- rewind($output->getStream());
-
- $this->assertEquals(
- $this->generateOutput(' a Starting...').
- $this->generateOutput(' b Starting...').
- $this->generateOutput(' c Starting...').
- $this->generateOutput(' a Starting...'),
- stream_get_contents($output->getStream())
- );
- }
-
- /**
- * @expectedException \InvalidArgumentException
- * @expectedExceptionMessage Must have at least 2 indicator value characters.
- */
- public function testCannotSetInvalidIndicatorCharacters()
- {
- $bar = new ProgressIndicator($this->getOutputStream(), null, 100, ['1']);
- }
-
- /**
- * @expectedException \LogicException
- * @expectedExceptionMessage Progress indicator already started.
- */
- public function testCannotStartAlreadyStartedIndicator()
- {
- $bar = new ProgressIndicator($this->getOutputStream());
- $bar->start('Starting...');
- $bar->start('Starting Again.');
- }
-
- /**
- * @expectedException \LogicException
- * @expectedExceptionMessage Progress indicator has not yet been started.
- */
- public function testCannotAdvanceUnstartedIndicator()
- {
- $bar = new ProgressIndicator($this->getOutputStream());
- $bar->advance();
- }
-
- /**
- * @expectedException \LogicException
- * @expectedExceptionMessage Progress indicator has not yet been started.
- */
- public function testCannotFinishUnstartedIndicator()
- {
- $bar = new ProgressIndicator($this->getOutputStream());
- $bar->finish('Finished');
- }
-
- /**
- * @dataProvider provideFormat
- */
- public function testFormats($format)
- {
- $bar = new ProgressIndicator($output = $this->getOutputStream(), $format);
- $bar->start('Starting...');
- $bar->advance();
-
- rewind($output->getStream());
-
- $this->assertNotEmpty(stream_get_contents($output->getStream()));
- }
-
- /**
- * Provides each defined format.
- *
- * @return array
- */
- public function provideFormat()
- {
- return [
- ['normal'],
- ['verbose'],
- ['very_verbose'],
- ['debug'],
- ];
- }
-
- protected function getOutputStream($decorated = true, $verbosity = StreamOutput::VERBOSITY_NORMAL)
- {
- return new StreamOutput(fopen('php://memory', 'r+', false), $verbosity, $decorated);
- }
-
- protected function generateOutput($expected)
- {
- $count = substr_count($expected, "\n");
-
- return "\x0D\x1B[2K".($count ? sprintf("\033[%dA", $count) : '').$expected;
- }
-}
diff --git a/vendor/symfony/console/Tests/Helper/QuestionHelperTest.php b/vendor/symfony/console/Tests/Helper/QuestionHelperTest.php
deleted file mode 100644
index 1ffd41c9c..000000000
--- a/vendor/symfony/console/Tests/Helper/QuestionHelperTest.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\Console\Tests\Helper;
-
-use Symfony\Component\Console\Formatter\OutputFormatter;
-use Symfony\Component\Console\Helper\FormatterHelper;
-use Symfony\Component\Console\Helper\HelperSet;
-use Symfony\Component\Console\Helper\QuestionHelper;
-use Symfony\Component\Console\Output\StreamOutput;
-use Symfony\Component\Console\Question\ChoiceQuestion;
-use Symfony\Component\Console\Question\ConfirmationQuestion;
-use Symfony\Component\Console\Question\Question;
-
-/**
- * @group tty
- */
-class QuestionHelperTest extends AbstractQuestionHelperTest
-{
- public function testAskChoice()
- {
- $questionHelper = new QuestionHelper();
-
- $helperSet = new HelperSet([new FormatterHelper()]);
- $questionHelper->setHelperSet($helperSet);
-
- $heroes = ['Superman', 'Batman', 'Spiderman'];
-
- $inputStream = $this->getInputStream("\n1\n 1 \nFabien\n1\nFabien\n1\n0,2\n 0 , 2 \n\n\n");
-
- $question = new ChoiceQuestion('What is your favorite superhero?', $heroes, '2');
- $question->setMaxAttempts(1);
- // first answer is an empty answer, we're supposed to receive the default value
- $this->assertEquals('Spiderman', $questionHelper->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
-
- $question = new ChoiceQuestion('What is your favorite superhero?', $heroes);
- $question->setMaxAttempts(1);
- $this->assertEquals('Batman', $questionHelper->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
- $this->assertEquals('Batman', $questionHelper->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
-
- $question = new ChoiceQuestion('What is your favorite superhero?', $heroes);
- $question->setErrorMessage('Input "%s" is not a superhero!');
- $question->setMaxAttempts(2);
- $this->assertEquals('Batman', $questionHelper->ask($this->createStreamableInputInterfaceMock($inputStream), $output = $this->createOutputInterface(), $question));
-
- rewind($output->getStream());
- $stream = stream_get_contents($output->getStream());
- $this->assertContains('Input "Fabien" is not a superhero!', $stream);
-
- try {
- $question = new ChoiceQuestion('What is your favorite superhero?', $heroes, '1');
- $question->setMaxAttempts(1);
- $questionHelper->ask($this->createStreamableInputInterfaceMock($inputStream), $output = $this->createOutputInterface(), $question);
- $this->fail();
- } catch (\InvalidArgumentException $e) {
- $this->assertEquals('Value "Fabien" is invalid', $e->getMessage());
- }
-
- $question = new ChoiceQuestion('What is your favorite superhero?', $heroes, null);
- $question->setMaxAttempts(1);
- $question->setMultiselect(true);
-
- $this->assertEquals(['Batman'], $questionHelper->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
- $this->assertEquals(['Superman', 'Spiderman'], $questionHelper->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
- $this->assertEquals(['Superman', 'Spiderman'], $questionHelper->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
-
- $question = new ChoiceQuestion('What is your favorite superhero?', $heroes, '0,1');
- $question->setMaxAttempts(1);
- $question->setMultiselect(true);
-
- $this->assertEquals(['Superman', 'Batman'], $questionHelper->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
-
- $question = new ChoiceQuestion('What is your favorite superhero?', $heroes, ' 0 , 1 ');
- $question->setMaxAttempts(1);
- $question->setMultiselect(true);
-
- $this->assertEquals(['Superman', 'Batman'], $questionHelper->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
-
- $question = new ChoiceQuestion('What is your favorite superhero?', $heroes, 0);
- // We are supposed to get the default value since we are not in interactive mode
- $this->assertEquals('Superman', $questionHelper->ask($this->createStreamableInputInterfaceMock($inputStream, true), $this->createOutputInterface(), $question));
- }
-
- public function testAskChoiceNonInteractive()
- {
- $questionHelper = new QuestionHelper();
-
- $helperSet = new HelperSet([new FormatterHelper()]);
- $questionHelper->setHelperSet($helperSet);
- $inputStream = $this->getInputStream("\n1\n 1 \nFabien\n1\nFabien\n1\n0,2\n 0 , 2 \n\n\n");
-
- $heroes = ['Superman', 'Batman', 'Spiderman'];
-
- $question = new ChoiceQuestion('What is your favorite superhero?', $heroes, '0');
-
- $this->assertSame('Superman', $questionHelper->ask($this->createStreamableInputInterfaceMock($inputStream, false), $this->createOutputInterface(), $question));
-
- $question = new ChoiceQuestion('What is your favorite superhero?', $heroes, 'Batman');
- $this->assertSame('Batman', $questionHelper->ask($this->createStreamableInputInterfaceMock($inputStream, false), $this->createOutputInterface(), $question));
-
- $question = new ChoiceQuestion('What is your favorite superhero?', $heroes, null);
- $this->assertNull($questionHelper->ask($this->createStreamableInputInterfaceMock($inputStream, false), $this->createOutputInterface(), $question));
-
- $question = new ChoiceQuestion('What is your favorite superhero?', $heroes, '0');
- $question->setValidator(null);
- $this->assertSame('Superman', $questionHelper->ask($this->createStreamableInputInterfaceMock($inputStream, false), $this->createOutputInterface(), $question));
-
- try {
- $question = new ChoiceQuestion('What is your favorite superhero?', $heroes, null);
- $questionHelper->ask($this->createStreamableInputInterfaceMock($inputStream, false), $this->createOutputInterface(), $question);
- } catch (\InvalidArgumentException $e) {
- $this->assertSame('Value "" is invalid', $e->getMessage());
- }
-
- $question = new ChoiceQuestion('Who are your favorite superheros?', $heroes, '0, 1');
- $question->setMultiselect(true);
- $this->assertSame(['Superman', 'Batman'], $questionHelper->ask($this->createStreamableInputInterfaceMock($inputStream, false), $this->createOutputInterface(), $question));
-
- $question = new ChoiceQuestion('Who are your favorite superheros?', $heroes, '0, 1');
- $question->setMultiselect(true);
- $question->setValidator(null);
- $this->assertSame(['Superman', 'Batman'], $questionHelper->ask($this->createStreamableInputInterfaceMock($inputStream, false), $this->createOutputInterface(), $question));
-
- $question = new ChoiceQuestion('Who are your favorite superheros?', $heroes, '0, Batman');
- $question->setMultiselect(true);
- $this->assertSame(['Superman', 'Batman'], $questionHelper->ask($this->createStreamableInputInterfaceMock($inputStream, false), $this->createOutputInterface(), $question));
-
- $question = new ChoiceQuestion('Who are your favorite superheros?', $heroes, null);
- $question->setMultiselect(true);
- $this->assertNull($questionHelper->ask($this->createStreamableInputInterfaceMock($inputStream, false), $this->createOutputInterface(), $question));
-
- $question = new ChoiceQuestion('Who are your favorite superheros?', ['a' => 'Batman', 'b' => 'Superman'], 'a');
- $this->assertSame('a', $questionHelper->ask($this->createStreamableInputInterfaceMock('', false), $this->createOutputInterface(), $question), 'ChoiceQuestion validator returns the key if it\'s a string');
-
- try {
- $question = new ChoiceQuestion('Who are your favorite superheros?', $heroes, '');
- $question->setMultiselect(true);
- $questionHelper->ask($this->createStreamableInputInterfaceMock($inputStream, false), $this->createOutputInterface(), $question);
- } catch (\InvalidArgumentException $e) {
- $this->assertSame('Value "" is invalid', $e->getMessage());
- }
- }
-
- public function testAsk()
- {
- $dialog = new QuestionHelper();
-
- $inputStream = $this->getInputStream("\n8AM\n");
-
- $question = new Question('What time is it?', '2PM');
- $this->assertEquals('2PM', $dialog->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
-
- $question = new Question('What time is it?', '2PM');
- $this->assertEquals('8AM', $dialog->ask($this->createStreamableInputInterfaceMock($inputStream), $output = $this->createOutputInterface(), $question));
-
- rewind($output->getStream());
- $this->assertEquals('What time is it?', stream_get_contents($output->getStream()));
- }
-
- public function testAskWithAutocomplete()
- {
- if (!$this->hasSttyAvailable()) {
- $this->markTestSkipped('`stty` is required to test autocomplete functionality');
- }
-
- // Acm
- // AcsTest
- //
- //
- // Test
- //
- // S
- // F00oo
- $inputStream = $this->getInputStream("Acm\nAc\177\177s\tTest\n\n\033[A\033[A\n\033[A\033[A\033[A\033[A\033[A\tTest\n\033[B\nS\177\177\033[B\033[B\nF00\177\177oo\t\n");
-
- $dialog = new QuestionHelper();
- $helperSet = new HelperSet([new FormatterHelper()]);
- $dialog->setHelperSet($helperSet);
-
- $question = new Question('Please select a bundle', 'FrameworkBundle');
- $question->setAutocompleterValues(['AcmeDemoBundle', 'AsseticBundle', 'SecurityBundle', 'FooBundle']);
-
- $this->assertEquals('AcmeDemoBundle', $dialog->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
- $this->assertEquals('AsseticBundleTest', $dialog->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
- $this->assertEquals('FrameworkBundle', $dialog->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
- $this->assertEquals('SecurityBundle', $dialog->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
- $this->assertEquals('FooBundleTest', $dialog->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
- $this->assertEquals('AcmeDemoBundle', $dialog->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
- $this->assertEquals('AsseticBundle', $dialog->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
- $this->assertEquals('FooBundle', $dialog->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
- }
-
- public function testAskWithAutocompleteWithNonSequentialKeys()
- {
- if (!$this->hasSttyAvailable()) {
- $this->markTestSkipped('`stty` is required to test autocomplete functionality');
- }
-
- //
- $inputStream = $this->getInputStream("\033[A\033[A\n\033[B\033[B\n");
-
- $dialog = new QuestionHelper();
- $dialog->setHelperSet(new HelperSet([new FormatterHelper()]));
-
- $question = new ChoiceQuestion('Please select a bundle', [1 => 'AcmeDemoBundle', 4 => 'AsseticBundle']);
- $question->setMaxAttempts(1);
-
- $this->assertEquals('AcmeDemoBundle', $dialog->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
- $this->assertEquals('AsseticBundle', $dialog->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
- }
-
- public function testAskWithAutocompleteWithExactMatch()
- {
- if (!$this->hasSttyAvailable()) {
- $this->markTestSkipped('`stty` is required to test autocomplete functionality');
- }
-
- $inputStream = $this->getInputStream("b\n");
-
- $possibleChoices = [
- 'a' => 'berlin',
- 'b' => 'copenhagen',
- 'c' => 'amsterdam',
- ];
-
- $dialog = new QuestionHelper();
- $dialog->setHelperSet(new HelperSet([new FormatterHelper()]));
-
- $question = new ChoiceQuestion('Please select a city', $possibleChoices);
- $question->setMaxAttempts(1);
-
- $this->assertSame('b', $dialog->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
- }
-
- public function getInputs()
- {
- return [
- ['$'], // 1 byte character
- ['¢'], // 2 bytes character
- ['€'], // 3 bytes character
- ['𐍈'], // 4 bytes character
- ];
- }
-
- /**
- * @dataProvider getInputs
- */
- public function testAskWithAutocompleteWithMultiByteCharacter($character)
- {
- if (!$this->hasSttyAvailable()) {
- $this->markTestSkipped('`stty` is required to test autocomplete functionality');
- }
-
- $inputStream = $this->getInputStream("$character\n");
-
- $possibleChoices = [
- '$' => '1 byte character',
- '¢' => '2 bytes character',
- '€' => '3 bytes character',
- '𐍈' => '4 bytes character',
- ];
-
- $dialog = new QuestionHelper();
- $dialog->setHelperSet(new HelperSet([new FormatterHelper()]));
-
- $question = new ChoiceQuestion('Please select a character', $possibleChoices);
- $question->setMaxAttempts(1);
-
- $this->assertSame($character, $dialog->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
- }
-
- public function testAutocompleteWithTrailingBackslash()
- {
- if (!$this->hasSttyAvailable()) {
- $this->markTestSkipped('`stty` is required to test autocomplete functionality');
- }
-
- $inputStream = $this->getInputStream('E');
-
- $dialog = new QuestionHelper();
- $helperSet = new HelperSet([new FormatterHelper()]);
- $dialog->setHelperSet($helperSet);
-
- $question = new Question('');
- $expectedCompletion = 'ExampleNamespace\\';
- $question->setAutocompleterValues([$expectedCompletion]);
-
- $output = $this->createOutputInterface();
- $dialog->ask($this->createStreamableInputInterfaceMock($inputStream), $output, $question);
-
- $outputStream = $output->getStream();
- rewind($outputStream);
- $actualOutput = stream_get_contents($outputStream);
-
- // Shell control (esc) sequences are not so important: we only care that
- // tag is interpreted correctly and replaced
- $irrelevantEscSequences = [
- "\0337" => '', // Save cursor position
- "\0338" => '', // Restore cursor position
- "\033[K" => '', // Clear line from cursor till the end
- ];
-
- $importantActualOutput = strtr($actualOutput, $irrelevantEscSequences);
-
- // Remove colors (e.g. "\033[30m", "\033[31;41m")
- $importantActualOutput = preg_replace('/\033\[\d+(;\d+)?m/', '', $importantActualOutput);
-
- $this->assertEquals($expectedCompletion, $importantActualOutput);
- }
-
- public function testAskHiddenResponse()
- {
- if ('\\' === \DIRECTORY_SEPARATOR) {
- $this->markTestSkipped('This test is not supported on Windows');
- }
-
- $dialog = new QuestionHelper();
-
- $question = new Question('What time is it?');
- $question->setHidden(true);
-
- $this->assertEquals('8AM', $dialog->ask($this->createStreamableInputInterfaceMock($this->getInputStream("8AM\n")), $this->createOutputInterface(), $question));
- }
-
- /**
- * @dataProvider getAskConfirmationData
- */
- public function testAskConfirmation($question, $expected, $default = true)
- {
- $dialog = new QuestionHelper();
-
- $inputStream = $this->getInputStream($question."\n");
- $question = new ConfirmationQuestion('Do you like French fries?', $default);
- $this->assertEquals($expected, $dialog->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question), 'confirmation question should '.($expected ? 'pass' : 'cancel'));
- }
-
- public function getAskConfirmationData()
- {
- return [
- ['', true],
- ['', false, false],
- ['y', true],
- ['yes', true],
- ['n', false],
- ['no', false],
- ];
- }
-
- public function testAskConfirmationWithCustomTrueAnswer()
- {
- $dialog = new QuestionHelper();
-
- $inputStream = $this->getInputStream("j\ny\n");
- $question = new ConfirmationQuestion('Do you like French fries?', false, '/^(j|y)/i');
- $this->assertTrue($dialog->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
- $question = new ConfirmationQuestion('Do you like French fries?', false, '/^(j|y)/i');
- $this->assertTrue($dialog->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
- }
-
- public function testAskAndValidate()
- {
- $dialog = new QuestionHelper();
- $helperSet = new HelperSet([new FormatterHelper()]);
- $dialog->setHelperSet($helperSet);
-
- $error = 'This is not a color!';
- $validator = function ($color) use ($error) {
- if (!\in_array($color, ['white', 'black'])) {
- throw new \InvalidArgumentException($error);
- }
-
- return $color;
- };
-
- $question = new Question('What color was the white horse of Henry IV?', 'white');
- $question->setValidator($validator);
- $question->setMaxAttempts(2);
-
- $inputStream = $this->getInputStream("\nblack\n");
- $this->assertEquals('white', $dialog->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
- $this->assertEquals('black', $dialog->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
-
- try {
- $dialog->ask($this->createStreamableInputInterfaceMock($this->getInputStream("green\nyellow\norange\n")), $this->createOutputInterface(), $question);
- $this->fail();
- } catch (\InvalidArgumentException $e) {
- $this->assertEquals($error, $e->getMessage());
- }
- }
-
- /**
- * @dataProvider simpleAnswerProvider
- */
- public function testSelectChoiceFromSimpleChoices($providedAnswer, $expectedValue)
- {
- $possibleChoices = [
- 'My environment 1',
- 'My environment 2',
- 'My environment 3',
- ];
-
- $dialog = new QuestionHelper();
- $helperSet = new HelperSet([new FormatterHelper()]);
- $dialog->setHelperSet($helperSet);
-
- $question = new ChoiceQuestion('Please select the environment to load', $possibleChoices);
- $question->setMaxAttempts(1);
- $answer = $dialog->ask($this->createStreamableInputInterfaceMock($this->getInputStream($providedAnswer."\n")), $this->createOutputInterface(), $question);
-
- $this->assertSame($expectedValue, $answer);
- }
-
- public function simpleAnswerProvider()
- {
- return [
- [0, 'My environment 1'],
- [1, 'My environment 2'],
- [2, 'My environment 3'],
- ['My environment 1', 'My environment 1'],
- ['My environment 2', 'My environment 2'],
- ['My environment 3', 'My environment 3'],
- ];
- }
-
- /**
- * @dataProvider specialCharacterInMultipleChoice
- */
- public function testSpecialCharacterChoiceFromMultipleChoiceList($providedAnswer, $expectedValue)
- {
- $possibleChoices = [
- '.',
- 'src',
- ];
-
- $dialog = new QuestionHelper();
- $inputStream = $this->getInputStream($providedAnswer."\n");
- $helperSet = new HelperSet([new FormatterHelper()]);
- $dialog->setHelperSet($helperSet);
-
- $question = new ChoiceQuestion('Please select the directory', $possibleChoices);
- $question->setMaxAttempts(1);
- $question->setMultiselect(true);
- $answer = $dialog->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question);
-
- $this->assertSame($expectedValue, $answer);
- }
-
- public function specialCharacterInMultipleChoice()
- {
- return [
- ['.', ['.']],
- ['., src', ['.', 'src']],
- ];
- }
-
- /**
- * @dataProvider mixedKeysChoiceListAnswerProvider
- */
- public function testChoiceFromChoicelistWithMixedKeys($providedAnswer, $expectedValue)
- {
- $possibleChoices = [
- '0' => 'No environment',
- '1' => 'My environment 1',
- 'env_2' => 'My environment 2',
- 3 => 'My environment 3',
- ];
-
- $dialog = new QuestionHelper();
- $helperSet = new HelperSet([new FormatterHelper()]);
- $dialog->setHelperSet($helperSet);
-
- $question = new ChoiceQuestion('Please select the environment to load', $possibleChoices);
- $question->setMaxAttempts(1);
- $answer = $dialog->ask($this->createStreamableInputInterfaceMock($this->getInputStream($providedAnswer."\n")), $this->createOutputInterface(), $question);
-
- $this->assertSame($expectedValue, $answer);
- }
-
- public function mixedKeysChoiceListAnswerProvider()
- {
- return [
- ['0', '0'],
- ['No environment', '0'],
- ['1', '1'],
- ['env_2', 'env_2'],
- [3, '3'],
- ['My environment 1', '1'],
- ];
- }
-
- /**
- * @dataProvider answerProvider
- */
- public function testSelectChoiceFromChoiceList($providedAnswer, $expectedValue)
- {
- $possibleChoices = [
- 'env_1' => 'My environment 1',
- 'env_2' => 'My environment',
- 'env_3' => 'My environment',
- ];
-
- $dialog = new QuestionHelper();
- $helperSet = new HelperSet([new FormatterHelper()]);
- $dialog->setHelperSet($helperSet);
-
- $question = new ChoiceQuestion('Please select the environment to load', $possibleChoices);
- $question->setMaxAttempts(1);
- $answer = $dialog->ask($this->createStreamableInputInterfaceMock($this->getInputStream($providedAnswer."\n")), $this->createOutputInterface(), $question);
-
- $this->assertSame($expectedValue, $answer);
- }
-
- /**
- * @expectedException \InvalidArgumentException
- * @expectedExceptionMessage The provided answer is ambiguous. Value should be one of env_2 or env_3.
- */
- public function testAmbiguousChoiceFromChoicelist()
- {
- $possibleChoices = [
- 'env_1' => 'My first environment',
- 'env_2' => 'My environment',
- 'env_3' => 'My environment',
- ];
-
- $dialog = new QuestionHelper();
- $helperSet = new HelperSet([new FormatterHelper()]);
- $dialog->setHelperSet($helperSet);
-
- $question = new ChoiceQuestion('Please select the environment to load', $possibleChoices);
- $question->setMaxAttempts(1);
-
- $dialog->ask($this->createStreamableInputInterfaceMock($this->getInputStream("My environment\n")), $this->createOutputInterface(), $question);
- }
-
- public function answerProvider()
- {
- return [
- ['env_1', 'env_1'],
- ['env_2', 'env_2'],
- ['env_3', 'env_3'],
- ['My environment 1', 'env_1'],
- ];
- }
-
- public function testNoInteraction()
- {
- $dialog = new QuestionHelper();
- $question = new Question('Do you have a job?', 'not yet');
- $this->assertEquals('not yet', $dialog->ask($this->createStreamableInputInterfaceMock(null, false), $this->createOutputInterface(), $question));
- }
-
- /**
- * @requires function mb_strwidth
- */
- public function testChoiceOutputFormattingQuestionForUtf8Keys()
- {
- $question = 'Lorem ipsum?';
- $possibleChoices = [
- 'foo' => 'foo',
- 'żółw' => 'bar',
- 'łabądź' => 'baz',
- ];
- $outputShown = [
- $question,
- ' [foo ] foo',
- ' [żółw ] bar',
- ' [łabądź] baz',
- ];
- $output = $this->getMockBuilder('\Symfony\Component\Console\Output\OutputInterface')->getMock();
- $output->method('getFormatter')->willReturn(new OutputFormatter());
-
- $dialog = new QuestionHelper();
- $helperSet = new HelperSet([new FormatterHelper()]);
- $dialog->setHelperSet($helperSet);
-
- $output->expects($this->once())->method('writeln')->with($this->equalTo($outputShown));
-
- $question = new ChoiceQuestion($question, $possibleChoices, 'foo');
- $dialog->ask($this->createStreamableInputInterfaceMock($this->getInputStream("\n")), $output, $question);
- }
-
- /**
- * @expectedException \Symfony\Component\Console\Exception\RuntimeException
- * @expectedExceptionMessage Aborted.
- */
- public function testAskThrowsExceptionOnMissingInput()
- {
- $dialog = new QuestionHelper();
- $dialog->ask($this->createStreamableInputInterfaceMock($this->getInputStream('')), $this->createOutputInterface(), new Question('What\'s your name?'));
- }
-
- /**
- * @expectedException \Symfony\Component\Console\Exception\RuntimeException
- * @expectedExceptionMessage Aborted.
- */
- public function testAskThrowsExceptionOnMissingInputForChoiceQuestion()
- {
- $dialog = new QuestionHelper();
- $dialog->ask($this->createStreamableInputInterfaceMock($this->getInputStream('')), $this->createOutputInterface(), new ChoiceQuestion('Choice', ['a', 'b']));
- }
-
- /**
- * @expectedException \Symfony\Component\Console\Exception\RuntimeException
- * @expectedExceptionMessage Aborted.
- */
- public function testAskThrowsExceptionOnMissingInputWithValidator()
- {
- $dialog = new QuestionHelper();
-
- $question = new Question('What\'s your name?');
- $question->setValidator(function () {
- if (!$value) {
- throw new \Exception('A value is required.');
- }
- });
-
- $dialog->ask($this->createStreamableInputInterfaceMock($this->getInputStream('')), $this->createOutputInterface(), $question);
- }
-
- /**
- * @expectedException \LogicException
- * @expectedExceptionMessage Choice question must have at least 1 choice available.
- */
- public function testEmptyChoices()
- {
- new ChoiceQuestion('Question', [], 'irrelevant');
- }
-
- public function testTraversableAutocomplete()
- {
- if (!$this->hasSttyAvailable()) {
- $this->markTestSkipped('`stty` is required to test autocomplete functionality');
- }
-
- // Acm
- // AcsTest
- //
- //
- // Test
- //
- // S
- // F00oo
- $inputStream = $this->getInputStream("Acm\nAc\177\177s\tTest\n\n\033[A\033[A\n\033[A\033[A\033[A\033[A\033[A\tTest\n\033[B\nS\177\177\033[B\033[B\nF00\177\177oo\t\n");
-
- $dialog = new QuestionHelper();
- $helperSet = new HelperSet([new FormatterHelper()]);
- $dialog->setHelperSet($helperSet);
-
- $question = new Question('Please select a bundle', 'FrameworkBundle');
- $question->setAutocompleterValues(new AutocompleteValues(['irrelevant' => 'AcmeDemoBundle', 'AsseticBundle', 'SecurityBundle', 'FooBundle']));
-
- $this->assertEquals('AcmeDemoBundle', $dialog->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
- $this->assertEquals('AsseticBundleTest', $dialog->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
- $this->assertEquals('FrameworkBundle', $dialog->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
- $this->assertEquals('SecurityBundle', $dialog->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
- $this->assertEquals('FooBundleTest', $dialog->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
- $this->assertEquals('AcmeDemoBundle', $dialog->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
- $this->assertEquals('AsseticBundle', $dialog->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
- $this->assertEquals('FooBundle', $dialog->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
- }
-
- public function testTraversableMultiselectAutocomplete()
- {
- //
- // F
- // A<3x UP ARROW>,F
- // F00o,A,SecurityBundle
- // Acme,As<29x BACKSPACE>S
- // Ac,As<3x BACKSPACE>d
- $inputStream = $this->getInputStream("\nF\t\nA\033[A\033[A\033[A\t,F\t\nF00\177\177o\t,A\033[B\t, SecurityBundle\nAcme\t, As\t\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177S\t\nAc\t,As\t\177\177\177d\t\n");
-
- $dialog = new QuestionHelper();
- $helperSet = new HelperSet([new FormatterHelper()]);
- $dialog->setHelperSet($helperSet);
-
- $question = new ChoiceQuestion(
- 'Please select a bundle (defaults to AcmeDemoBundle and AsseticBundle)',
- ['AcmeDemoBundle', 'AsseticBundle', 'SecurityBundle', 'FooBundle'],
- '0,1'
- );
-
- // This tests that autocomplete works for all multiselect choices entered by the user
- $question->setMultiselect(true);
-
- $this->assertEquals(['AcmeDemoBundle', 'AsseticBundle'], $dialog->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
- $this->assertEquals(['FooBundle'], $dialog->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
- $this->assertEquals(['AsseticBundle', 'FooBundle'], $dialog->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
- $this->assertEquals(['FooBundle', 'AsseticBundle', 'SecurityBundle'], $dialog->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
- $this->assertEquals(['SecurityBundle'], $dialog->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
- $this->assertEquals(['AcmeDemoBundle', 'AsseticBundle'], $dialog->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
- }
-
- protected function getInputStream($input)
- {
- $stream = fopen('php://memory', 'r+', false);
- fwrite($stream, $input);
- rewind($stream);
-
- return $stream;
- }
-
- protected function createOutputInterface()
- {
- return new StreamOutput(fopen('php://memory', 'r+', false));
- }
-
- protected function createInputInterfaceMock($interactive = true)
- {
- $mock = $this->getMockBuilder('Symfony\Component\Console\Input\InputInterface')->getMock();
- $mock->expects($this->any())
- ->method('isInteractive')
- ->willReturn($interactive);
-
- return $mock;
- }
-
- private function hasSttyAvailable()
- {
- exec('stty 2>&1', $output, $exitcode);
-
- return 0 === $exitcode;
- }
-}
-
-class AutocompleteValues implements \IteratorAggregate
-{
- private $values;
-
- public function __construct(array $values)
- {
- $this->values = $values;
- }
-
- public function getIterator()
- {
- return new \ArrayIterator($this->values);
- }
-}
diff --git a/vendor/symfony/console/Tests/Helper/SymfonyQuestionHelperTest.php b/vendor/symfony/console/Tests/Helper/SymfonyQuestionHelperTest.php
deleted file mode 100644
index 6f621db95..000000000
--- a/vendor/symfony/console/Tests/Helper/SymfonyQuestionHelperTest.php
+++ /dev/null
@@ -1,168 +0,0 @@
-setHelperSet($helperSet);
-
- $heroes = ['Superman', 'Batman', 'Spiderman'];
-
- $inputStream = $this->getInputStream("\n1\n 1 \nFabien\n1\nFabien\n1\n0,2\n 0 , 2 \n\n\n");
-
- $question = new ChoiceQuestion('What is your favorite superhero?', $heroes, '2');
- $question->setMaxAttempts(1);
- // first answer is an empty answer, we're supposed to receive the default value
- $this->assertEquals('Spiderman', $questionHelper->ask($this->createStreamableInputInterfaceMock($inputStream), $output = $this->createOutputInterface(), $question));
- $this->assertOutputContains('What is your favorite superhero? [Spiderman]', $output);
-
- $question = new ChoiceQuestion('What is your favorite superhero?', $heroes);
- $question->setMaxAttempts(1);
- $this->assertEquals('Batman', $questionHelper->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
- $this->assertEquals('Batman', $questionHelper->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
-
- $question = new ChoiceQuestion('What is your favorite superhero?', $heroes);
- $question->setErrorMessage('Input "%s" is not a superhero!');
- $question->setMaxAttempts(2);
- $this->assertEquals('Batman', $questionHelper->ask($this->createStreamableInputInterfaceMock($inputStream), $output = $this->createOutputInterface(), $question));
- $this->assertOutputContains('Input "Fabien" is not a superhero!', $output);
-
- try {
- $question = new ChoiceQuestion('What is your favorite superhero?', $heroes, '1');
- $question->setMaxAttempts(1);
- $questionHelper->ask($this->createStreamableInputInterfaceMock($inputStream), $output = $this->createOutputInterface(), $question);
- $this->fail();
- } catch (\InvalidArgumentException $e) {
- $this->assertEquals('Value "Fabien" is invalid', $e->getMessage());
- }
-
- $question = new ChoiceQuestion('What is your favorite superhero?', $heroes, null);
- $question->setMaxAttempts(1);
- $question->setMultiselect(true);
-
- $this->assertEquals(['Batman'], $questionHelper->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
- $this->assertEquals(['Superman', 'Spiderman'], $questionHelper->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
- $this->assertEquals(['Superman', 'Spiderman'], $questionHelper->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
-
- $question = new ChoiceQuestion('What is your favorite superhero?', $heroes, '0,1');
- $question->setMaxAttempts(1);
- $question->setMultiselect(true);
-
- $this->assertEquals(['Superman', 'Batman'], $questionHelper->ask($this->createStreamableInputInterfaceMock($inputStream), $output = $this->createOutputInterface(), $question));
- $this->assertOutputContains('What is your favorite superhero? [Superman, Batman]', $output);
-
- $question = new ChoiceQuestion('What is your favorite superhero?', $heroes, ' 0 , 1 ');
- $question->setMaxAttempts(1);
- $question->setMultiselect(true);
-
- $this->assertEquals(['Superman', 'Batman'], $questionHelper->ask($this->createStreamableInputInterfaceMock($inputStream), $output = $this->createOutputInterface(), $question));
- $this->assertOutputContains('What is your favorite superhero? [Superman, Batman]', $output);
- }
-
- public function testAskChoiceWithChoiceValueAsDefault()
- {
- $questionHelper = new SymfonyQuestionHelper();
- $helperSet = new HelperSet([new FormatterHelper()]);
- $questionHelper->setHelperSet($helperSet);
- $question = new ChoiceQuestion('What is your favorite superhero?', ['Superman', 'Batman', 'Spiderman'], 'Batman');
- $question->setMaxAttempts(1);
-
- $this->assertSame('Batman', $questionHelper->ask($this->createStreamableInputInterfaceMock($this->getInputStream("Batman\n")), $output = $this->createOutputInterface(), $question));
- $this->assertOutputContains('What is your favorite superhero? [Batman]', $output);
- }
-
- public function testAskReturnsNullIfValidatorAllowsIt()
- {
- $questionHelper = new SymfonyQuestionHelper();
- $question = new Question('What is your favorite superhero?');
- $question->setValidator(function ($value) { return $value; });
- $input = $this->createStreamableInputInterfaceMock($this->getInputStream("\n"));
- $this->assertNull($questionHelper->ask($input, $this->createOutputInterface(), $question));
- }
-
- public function testAskEscapeDefaultValue()
- {
- $helper = new SymfonyQuestionHelper();
- $input = $this->createStreamableInputInterfaceMock($this->getInputStream('\\'));
- $helper->ask($input, $output = $this->createOutputInterface(), new Question('Can I have a backslash?', '\\'));
-
- $this->assertOutputContains('Can I have a backslash? [\]', $output);
- }
-
- public function testAskEscapeAndFormatLabel()
- {
- $helper = new SymfonyQuestionHelper();
- $input = $this->createStreamableInputInterfaceMock($this->getInputStream('Foo\\Bar'));
- $helper->ask($input, $output = $this->createOutputInterface(), new Question('Do you want to use Foo\\Bar or Foo\\Baz\\?', 'Foo\\Baz'));
-
- $this->assertOutputContains('Do you want to use Foo\\Bar or Foo\\Baz\\? [Foo\\Baz]:', $output);
- }
-
- public function testLabelTrailingBackslash()
- {
- $helper = new SymfonyQuestionHelper();
- $input = $this->createStreamableInputInterfaceMock($this->getInputStream('sure'));
- $helper->ask($input, $output = $this->createOutputInterface(), new Question('Question with a trailing \\'));
-
- $this->assertOutputContains('Question with a trailing \\', $output);
- }
-
- /**
- * @expectedException \Symfony\Component\Console\Exception\RuntimeException
- * @expectedExceptionMessage Aborted.
- */
- public function testAskThrowsExceptionOnMissingInput()
- {
- $dialog = new SymfonyQuestionHelper();
- $dialog->ask($this->createStreamableInputInterfaceMock($this->getInputStream('')), $this->createOutputInterface(), new Question('What\'s your name?'));
- }
-
- protected function getInputStream($input)
- {
- $stream = fopen('php://memory', 'r+', false);
- fwrite($stream, $input);
- rewind($stream);
-
- return $stream;
- }
-
- protected function createOutputInterface()
- {
- $output = new StreamOutput(fopen('php://memory', 'r+', false));
- $output->setDecorated(false);
-
- return $output;
- }
-
- protected function createInputInterfaceMock($interactive = true)
- {
- $mock = $this->getMockBuilder('Symfony\Component\Console\Input\InputInterface')->getMock();
- $mock->expects($this->any())
- ->method('isInteractive')
- ->willReturn($interactive);
-
- return $mock;
- }
-
- private function assertOutputContains($expected, StreamOutput $output)
- {
- rewind($output->getStream());
- $stream = stream_get_contents($output->getStream());
- $this->assertContains($expected, $stream);
- }
-}
diff --git a/vendor/symfony/console/Tests/Helper/TableStyleTest.php b/vendor/symfony/console/Tests/Helper/TableStyleTest.php
deleted file mode 100644
index 13e918b3a..000000000
--- a/vendor/symfony/console/Tests/Helper/TableStyleTest.php
+++ /dev/null
@@ -1,28 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Console\Tests\Helper;
-
-use PHPUnit\Framework\TestCase;
-use Symfony\Component\Console\Helper\TableStyle;
-
-class TableStyleTest extends TestCase
-{
- /**
- * @expectedException \InvalidArgumentException
- * @expectedExceptionMessage Invalid padding type. Expected one of (STR_PAD_LEFT, STR_PAD_RIGHT, STR_PAD_BOTH).
- */
- public function testSetPadTypeWithInvalidType()
- {
- $style = new TableStyle();
- $style->setPadType('TEST');
- }
-}
diff --git a/vendor/symfony/console/Tests/Helper/TableTest.php b/vendor/symfony/console/Tests/Helper/TableTest.php
deleted file mode 100644
index 5eef8d60e..000000000
--- a/vendor/symfony/console/Tests/Helper/TableTest.php
+++ /dev/null
@@ -1,1199 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Console\Tests\Helper;
-
-use PHPUnit\Framework\TestCase;
-use Symfony\Component\Console\Formatter\OutputFormatter;
-use Symfony\Component\Console\Helper\Table;
-use Symfony\Component\Console\Helper\TableCell;
-use Symfony\Component\Console\Helper\TableSeparator;
-use Symfony\Component\Console\Helper\TableStyle;
-use Symfony\Component\Console\Output\ConsoleSectionOutput;
-use Symfony\Component\Console\Output\StreamOutput;
-
-class TableTest extends TestCase
-{
- protected $stream;
-
- protected function setUp()
- {
- $this->stream = fopen('php://memory', 'r+');
- }
-
- protected function tearDown()
- {
- fclose($this->stream);
- $this->stream = null;
- }
-
- /**
- * @dataProvider renderProvider
- */
- public function testRender($headers, $rows, $style, $expected, $decorated = false)
- {
- $table = new Table($output = $this->getOutputStream($decorated));
- $table
- ->setHeaders($headers)
- ->setRows($rows)
- ->setStyle($style)
- ;
- $table->render();
-
- $this->assertEquals($expected, $this->getOutputContent($output));
- }
-
- /**
- * @dataProvider renderProvider
- */
- public function testRenderAddRows($headers, $rows, $style, $expected, $decorated = false)
- {
- $table = new Table($output = $this->getOutputStream($decorated));
- $table
- ->setHeaders($headers)
- ->addRows($rows)
- ->setStyle($style)
- ;
- $table->render();
-
- $this->assertEquals($expected, $this->getOutputContent($output));
- }
-
- /**
- * @dataProvider renderProvider
- */
- public function testRenderAddRowsOneByOne($headers, $rows, $style, $expected, $decorated = false)
- {
- $table = new Table($output = $this->getOutputStream($decorated));
- $table
- ->setHeaders($headers)
- ->setStyle($style)
- ;
- foreach ($rows as $row) {
- $table->addRow($row);
- }
- $table->render();
-
- $this->assertEquals($expected, $this->getOutputContent($output));
- }
-
- public function renderProvider()
- {
- $books = [
- ['99921-58-10-7', 'Divine Comedy', 'Dante Alighieri'],
- ['9971-5-0210-0', 'A Tale of Two Cities', 'Charles Dickens'],
- ['960-425-059-0', 'The Lord of the Rings', 'J. R. R. Tolkien'],
- ['80-902734-1-6', 'And Then There Were None', 'Agatha Christie'],
- ];
-
- return [
- [
- ['ISBN', 'Title', 'Author'],
- $books,
- 'default',
-<<<'TABLE'
-+---------------+--------------------------+------------------+
-| ISBN | Title | Author |
-+---------------+--------------------------+------------------+
-| 99921-58-10-7 | Divine Comedy | Dante Alighieri |
-| 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens |
-| 960-425-059-0 | The Lord of the Rings | J. R. R. Tolkien |
-| 80-902734-1-6 | And Then There Were None | Agatha Christie |
-+---------------+--------------------------+------------------+
-
-TABLE
- ],
- [
- ['ISBN', 'Title', 'Author'],
- $books,
- 'compact',
-<<<'TABLE'
- ISBN Title Author
- 99921-58-10-7 Divine Comedy Dante Alighieri
- 9971-5-0210-0 A Tale of Two Cities Charles Dickens
- 960-425-059-0 The Lord of the Rings J. R. R. Tolkien
- 80-902734-1-6 And Then There Were None Agatha Christie
-
-TABLE
- ],
- [
- ['ISBN', 'Title', 'Author'],
- $books,
- 'borderless',
-<<<'TABLE'
- =============== ========================== ==================
- ISBN Title Author
- =============== ========================== ==================
- 99921-58-10-7 Divine Comedy Dante Alighieri
- 9971-5-0210-0 A Tale of Two Cities Charles Dickens
- 960-425-059-0 The Lord of the Rings J. R. R. Tolkien
- 80-902734-1-6 And Then There Were None Agatha Christie
- =============== ========================== ==================
-
-TABLE
- ],
- [
- ['ISBN', 'Title', 'Author'],
- $books,
- 'box',
- <<<'TABLE'
-┌───────────────┬──────────────────────────┬──────────────────┐
-│ ISBN │ Title │ Author │
-├───────────────┼──────────────────────────┼──────────────────┤
-│ 99921-58-10-7 │ Divine Comedy │ Dante Alighieri │
-│ 9971-5-0210-0 │ A Tale of Two Cities │ Charles Dickens │
-│ 960-425-059-0 │ The Lord of the Rings │ J. R. R. Tolkien │
-│ 80-902734-1-6 │ And Then There Were None │ Agatha Christie │
-└───────────────┴──────────────────────────┴──────────────────┘
-
-TABLE
- ],
- [
- ['ISBN', 'Title', 'Author'],
- [
- ['99921-58-10-7', 'Divine Comedy', 'Dante Alighieri'],
- ['9971-5-0210-0', 'A Tale of Two Cities', 'Charles Dickens'],
- new TableSeparator(),
- ['960-425-059-0', 'The Lord of the Rings', 'J. R. R. Tolkien'],
- ['80-902734-1-6', 'And Then There Were None', 'Agatha Christie'],
- ],
- 'box-double',
- <<<'TABLE'
-╔═══════════════╤══════════════════════════╤══════════════════╗
-║ ISBN │ Title │ Author ║
-╠═══════════════╪══════════════════════════╪══════════════════╣
-║ 99921-58-10-7 │ Divine Comedy │ Dante Alighieri ║
-║ 9971-5-0210-0 │ A Tale of Two Cities │ Charles Dickens ║
-╟───────────────┼──────────────────────────┼──────────────────╢
-║ 960-425-059-0 │ The Lord of the Rings │ J. R. R. Tolkien ║
-║ 80-902734-1-6 │ And Then There Were None │ Agatha Christie ║
-╚═══════════════╧══════════════════════════╧══════════════════╝
-
-TABLE
- ],
- [
- ['ISBN', 'Title'],
- [
- ['99921-58-10-7', 'Divine Comedy', 'Dante Alighieri'],
- ['9971-5-0210-0'],
- ['960-425-059-0', 'The Lord of the Rings', 'J. R. R. Tolkien'],
- ['80-902734-1-6', 'And Then There Were None', 'Agatha Christie'],
- ],
- 'default',
-<<<'TABLE'
-+---------------+--------------------------+------------------+
-| ISBN | Title | |
-+---------------+--------------------------+------------------+
-| 99921-58-10-7 | Divine Comedy | Dante Alighieri |
-| 9971-5-0210-0 | | |
-| 960-425-059-0 | The Lord of the Rings | J. R. R. Tolkien |
-| 80-902734-1-6 | And Then There Were None | Agatha Christie |
-+---------------+--------------------------+------------------+
-
-TABLE
- ],
- [
- [],
- [
- ['99921-58-10-7', 'Divine Comedy', 'Dante Alighieri'],
- ['9971-5-0210-0'],
- ['960-425-059-0', 'The Lord of the Rings', 'J. R. R. Tolkien'],
- ['80-902734-1-6', 'And Then There Were None', 'Agatha Christie'],
- ],
- 'default',
-<<<'TABLE'
-+---------------+--------------------------+------------------+
-| 99921-58-10-7 | Divine Comedy | Dante Alighieri |
-| 9971-5-0210-0 | | |
-| 960-425-059-0 | The Lord of the Rings | J. R. R. Tolkien |
-| 80-902734-1-6 | And Then There Were None | Agatha Christie |
-+---------------+--------------------------+------------------+
-
-TABLE
- ],
- [
- ['ISBN', 'Title', 'Author'],
- [
- ['99921-58-10-7', "Divine\nComedy", 'Dante Alighieri'],
- ['9971-5-0210-2', "Harry Potter\nand the Chamber of Secrets", "Rowling\nJoanne K."],
- ['9971-5-0210-2', "Harry Potter\nand the Chamber of Secrets", "Rowling\nJoanne K."],
- ['960-425-059-0', 'The Lord of the Rings', "J. R. R.\nTolkien"],
- ],
- 'default',
-<<<'TABLE'
-+---------------+----------------------------+-----------------+
-| ISBN | Title | Author |
-+---------------+----------------------------+-----------------+
-| 99921-58-10-7 | Divine | Dante Alighieri |
-| | Comedy | |
-| 9971-5-0210-2 | Harry Potter | Rowling |
-| | and the Chamber of Secrets | Joanne K. |
-| 9971-5-0210-2 | Harry Potter | Rowling |
-| | and the Chamber of Secrets | Joanne K. |
-| 960-425-059-0 | The Lord of the Rings | J. R. R. |
-| | | Tolkien |
-+---------------+----------------------------+-----------------+
-
-TABLE
- ],
- [
- ['ISBN', 'Title'],
- [],
- 'default',
-<<<'TABLE'
-+------+-------+
-| ISBN | Title |
-+------+-------+
-
-TABLE
- ],
- [
- [],
- [],
- 'default',
- '',
- ],
- 'Cell text with tags used for Output styling' => [
- ['ISBN', 'Title', 'Author'],
- [
- ['99921-58-10-7', 'Divine Comedy', 'Dante Alighieri'],
- ['9971-5-0210-0', 'A Tale of Two Cities', 'Charles Dickens>'],
- ],
- 'default',
-<<<'TABLE'
-+---------------+----------------------+-----------------+
-| ISBN | Title | Author |
-+---------------+----------------------+-----------------+
-| 99921-58-10-7 | Divine Comedy | Dante Alighieri |
-| 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens |
-+---------------+----------------------+-----------------+
-
-TABLE
- ],
- 'Cell text with tags not used for Output styling' => [
- ['ISBN', 'Title', 'Author'],
- [
- ['99921-58-10-700', 'Divine Com', 'Dante Alighieri'],
- ['9971-5-0210-0', 'A Tale of Two Cities', 'Charles Dickens'],
- ],
- 'default',
-<<<'TABLE'
-+----------------------------------+----------------------+-----------------+
-| ISBN | Title | Author |
-+----------------------------------+----------------------+-----------------+
-| 99921-58-10-700 | Divine Com | Dante Alighieri |
-| 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens |
-+----------------------------------+----------------------+-----------------+
-
-TABLE
- ],
- 'Cell with colspan' => [
- ['ISBN', 'Title', 'Author'],
- [
- ['99921-58-10-7', 'Divine Comedy', 'Dante Alighieri'],
- new TableSeparator(),
- [new TableCell('Divine Comedy(Dante Alighieri)', ['colspan' => 3])],
- new TableSeparator(),
- [
- new TableCell('Arduino: A Quick-Start Guide', ['colspan' => 2]),
- 'Mark Schmidt',
- ],
- new TableSeparator(),
- [
- '9971-5-0210-0',
- new TableCell("A Tale of \nTwo Cities", ['colspan' => 2]),
- ],
- new TableSeparator(),
- [
- new TableCell('Cupiditate dicta atque porro, tempora exercitationem modi animi nulla nemo vel nihil!', ['colspan' => 3]),
- ],
- ],
- 'default',
-<<<'TABLE'
-+-------------------------------+-------------------------------+-----------------------------+
-| ISBN | Title | Author |
-+-------------------------------+-------------------------------+-----------------------------+
-| 99921-58-10-7 | Divine Comedy | Dante Alighieri |
-+-------------------------------+-------------------------------+-----------------------------+
-| Divine Comedy(Dante Alighieri) |
-+-------------------------------+-------------------------------+-----------------------------+
-| Arduino: A Quick-Start Guide | Mark Schmidt |
-+-------------------------------+-------------------------------+-----------------------------+
-| 9971-5-0210-0 | A Tale of |
-| | Two Cities |
-+-------------------------------+-------------------------------+-----------------------------+
-| Cupiditate dicta atque porro, tempora exercitationem modi animi nulla nemo vel nihil! |
-+-------------------------------+-------------------------------+-----------------------------+
-
-TABLE
- ],
- 'Cell with rowspan' => [
- ['ISBN', 'Title', 'Author'],
- [
- [
- new TableCell('9971-5-0210-0', ['rowspan' => 3]),
- new TableCell('Divine Comedy', ['rowspan' => 2]),
- 'Dante Alighieri',
- ],
- [],
- ["The Lord of \nthe Rings", "J. R. \nR. Tolkien"],
- new TableSeparator(),
- ['80-902734-1-6', new TableCell("And Then \nThere \nWere None", ['rowspan' => 3]), 'Agatha Christie'],
- ['80-902734-1-7', 'Test'],
- ],
- 'default',
-<<<'TABLE'
-+---------------+---------------+-----------------+
-| ISBN | Title | Author |
-+---------------+---------------+-----------------+
-| 9971-5-0210-0 | Divine Comedy | Dante Alighieri |
-| | | |
-| | The Lord of | J. R. |
-| | the Rings | R. Tolkien |
-+---------------+---------------+-----------------+
-| 80-902734-1-6 | And Then | Agatha Christie |
-| 80-902734-1-7 | There | Test |
-| | Were None | |
-+---------------+---------------+-----------------+
-
-TABLE
- ],
- 'Cell with rowspan and colspan' => [
- ['ISBN', 'Title', 'Author'],
- [
- [
- new TableCell('9971-5-0210-0', ['rowspan' => 2, 'colspan' => 2]),
- 'Dante Alighieri',
- ],
- ['Charles Dickens'],
- new TableSeparator(),
- [
- 'Dante Alighieri',
- new TableCell('9971-5-0210-0', ['rowspan' => 3, 'colspan' => 2]),
- ],
- ['J. R. R. Tolkien'],
- ['J. R. R'],
- ],
- 'default',
-<<<'TABLE'
-+------------------+---------+-----------------+
-| ISBN | Title | Author |
-+------------------+---------+-----------------+
-| 9971-5-0210-0 | Dante Alighieri |
-| | Charles Dickens |
-+------------------+---------+-----------------+
-| Dante Alighieri | 9971-5-0210-0 |
-| J. R. R. Tolkien | |
-| J. R. R | |
-+------------------+---------+-----------------+
-
-TABLE
- ],
- 'Cell with rowspan and colspan contains new line break' => [
- ['ISBN', 'Title', 'Author'],
- [
- [
- new TableCell("9971\n-5-\n021\n0-0", ['rowspan' => 2, 'colspan' => 2]),
- 'Dante Alighieri',
- ],
- ['Charles Dickens'],
- new TableSeparator(),
- [
- 'Dante Alighieri',
- new TableCell("9971\n-5-\n021\n0-0", ['rowspan' => 2, 'colspan' => 2]),
- ],
- ['Charles Dickens'],
- new TableSeparator(),
- [
- new TableCell("9971\n-5-\n021\n0-0", ['rowspan' => 2, 'colspan' => 2]),
- new TableCell("Dante \nAlighieri", ['rowspan' => 2, 'colspan' => 1]),
- ],
- ],
- 'default',
-<<<'TABLE'
-+-----------------+-------+-----------------+
-| ISBN | Title | Author |
-+-----------------+-------+-----------------+
-| 9971 | Dante Alighieri |
-| -5- | Charles Dickens |
-| 021 | |
-| 0-0 | |
-+-----------------+-------+-----------------+
-| Dante Alighieri | 9971 |
-| Charles Dickens | -5- |
-| | 021 |
-| | 0-0 |
-+-----------------+-------+-----------------+
-| 9971 | Dante |
-| -5- | Alighieri |
-| 021 | |
-| 0-0 | |
-+-----------------+-------+-----------------+
-
-TABLE
- ],
- 'Cell with rowspan and colspan without using TableSeparator' => [
- ['ISBN', 'Title', 'Author'],
- [
- [
- new TableCell("9971\n-5-\n021\n0-0", ['rowspan' => 2, 'colspan' => 2]),
- 'Dante Alighieri',
- ],
- ['Charles Dickens'],
- [
- 'Dante Alighieri',
- new TableCell("9971\n-5-\n021\n0-0", ['rowspan' => 2, 'colspan' => 2]),
- ],
- ['Charles Dickens'],
- ],
- 'default',
-<<<'TABLE'
-+-----------------+-------+-----------------+
-| ISBN | Title | Author |
-+-----------------+-------+-----------------+
-| 9971 | Dante Alighieri |
-| -5- | Charles Dickens |
-| 021 | |
-| 0-0 | |
-| Dante Alighieri | 9971 |
-| Charles Dickens | -5- |
-| | 021 |
-| | 0-0 |
-+-----------------+-------+-----------------+
-
-TABLE
- ],
- 'Cell with rowspan and colspan with separator inside a rowspan' => [
- ['ISBN', 'Author'],
- [
- [
- new TableCell('9971-5-0210-0', ['rowspan' => 3, 'colspan' => 1]),
- 'Dante Alighieri',
- ],
- [new TableSeparator()],
- ['Charles Dickens'],
- ],
- 'default',
-<<<'TABLE'
-+---------------+-----------------+
-| ISBN | Author |
-+---------------+-----------------+
-| 9971-5-0210-0 | Dante Alighieri |
-| |-----------------|
-| | Charles Dickens |
-+---------------+-----------------+
-
-TABLE
- ],
- 'Multiple header lines' => [
- [
- [new TableCell('Main title', ['colspan' => 3])],
- ['ISBN', 'Title', 'Author'],
- ],
- [],
- 'default',
-<<<'TABLE'
-+------+-------+--------+
-| Main title |
-+------+-------+--------+
-| ISBN | Title | Author |
-+------+-------+--------+
-
-TABLE
- ],
- 'Row with multiple cells' => [
- [],
- [
- [
- new TableCell('1', ['colspan' => 3]),
- new TableCell('2', ['colspan' => 2]),
- new TableCell('3', ['colspan' => 2]),
- new TableCell('4', ['colspan' => 2]),
- ],
- ],
- 'default',
-<<<'TABLE'
-+---+--+--+---+--+---+--+---+--+
-| 1 | 2 | 3 | 4 |
-+---+--+--+---+--+---+--+---+--+
-
-TABLE
- ],
- 'Coslpan and table cells with comment style' => [
- [
- new TableCell('Long Title', ['colspan' => 3]),
- ],
- [
- [
- new TableCell('9971-5-0210-0', ['colspan' => 3]),
- ],
- new TableSeparator(),
- [
- 'Dante Alighieri',
- 'J. R. R. Tolkien',
- 'J. R. R',
- ],
- ],
- 'default',
- << [
- [],
- [
- [
- new TableCell('Dont break'."\n".'here', ['colspan' => 2]),
- ],
- new TableSeparator(),
- [
- 'foo',
- new TableCell('Dont break'."\n".'here', ['rowspan' => 2]),
- ],
- [
- 'bar',
- ],
- ],
- 'default',
- <<<'TABLE'
-+-------+------------+
-[39;49m| [39;49m[37;41mDont break[39;49m[39;49m |[39;49m
-[39;49m| [39;49m[37;41mhere[39;49m |
-+-------+------------+
-[39;49m| foo | [39;49m[37;41mDont break[39;49m[39;49m |[39;49m
-[39;49m| bar | [39;49m[37;41mhere[39;49m |
-+-------+------------+
-
-TABLE
- ,
- true,
- ],
- ];
- }
-
- public function testRenderMultiByte()
- {
- $table = new Table($output = $this->getOutputStream());
- $table
- ->setHeaders(['■■'])
- ->setRows([[1234]])
- ->setStyle('default')
- ;
- $table->render();
-
- $expected =
-<<<'TABLE'
-+------+
-| ■■ |
-+------+
-| 1234 |
-+------+
-
-TABLE;
-
- $this->assertEquals($expected, $this->getOutputContent($output));
- }
-
- public function testTableCellWithNumericIntValue()
- {
- $table = new Table($output = $this->getOutputStream());
-
- $table->setRows([[new TableCell(12345)]]);
- $table->render();
-
- $expected =
-<<<'TABLE'
-+-------+
-| 12345 |
-+-------+
-
-TABLE;
-
- $this->assertEquals($expected, $this->getOutputContent($output));
- }
-
- public function testTableCellWithNumericFloatValue()
- {
- $table = new Table($output = $this->getOutputStream());
-
- $table->setRows([[new TableCell(12345.01)]]);
- $table->render();
-
- $expected =
-<<<'TABLE'
-+----------+
-| 12345.01 |
-+----------+
-
-TABLE;
-
- $this->assertEquals($expected, $this->getOutputContent($output));
- }
-
- public function testStyle()
- {
- $style = new TableStyle();
- $style
- ->setHorizontalBorderChars('.')
- ->setVerticalBorderChars('.')
- ->setDefaultCrossingChar('.')
- ;
-
- Table::setStyleDefinition('dotfull', $style);
- $table = new Table($output = $this->getOutputStream());
- $table
- ->setHeaders(['Foo'])
- ->setRows([['Bar']])
- ->setStyle('dotfull');
- $table->render();
-
- $expected =
-<<<'TABLE'
-.......
-. Foo .
-.......
-. Bar .
-.......
-
-TABLE;
-
- $this->assertEquals($expected, $this->getOutputContent($output));
- }
-
- public function testRowSeparator()
- {
- $table = new Table($output = $this->getOutputStream());
- $table
- ->setHeaders(['Foo'])
- ->setRows([
- ['Bar1'],
- new TableSeparator(),
- ['Bar2'],
- new TableSeparator(),
- ['Bar3'],
- ]);
- $table->render();
-
- $expected =
-<<<'TABLE'
-+------+
-| Foo |
-+------+
-| Bar1 |
-+------+
-| Bar2 |
-+------+
-| Bar3 |
-+------+
-
-TABLE;
-
- $this->assertEquals($expected, $this->getOutputContent($output));
-
- $this->assertEquals($table, $table->addRow(new TableSeparator()), 'fluent interface on addRow() with a single TableSeparator() works');
- }
-
- public function testRenderMultiCalls()
- {
- $table = new Table($output = $this->getOutputStream());
- $table->setRows([
- [new TableCell('foo', ['colspan' => 2])],
- ]);
- $table->render();
- $table->render();
- $table->render();
-
- $expected =
-<<assertEquals($expected, $this->getOutputContent($output));
- }
-
- public function testColumnStyle()
- {
- $table = new Table($output = $this->getOutputStream());
- $table
- ->setHeaders(['ISBN', 'Title', 'Author', 'Price'])
- ->setRows([
- ['99921-58-10-7', 'Divine Comedy', 'Dante Alighieri', '9.95'],
- ['9971-5-0210-0', 'A Tale of Two Cities', 'Charles Dickens', '139.25'],
- ]);
-
- $style = new TableStyle();
- $style->setPadType(STR_PAD_LEFT);
- $table->setColumnStyle(3, $style);
-
- $table->render();
-
- $expected =
- <<assertEquals($expected, $this->getOutputContent($output));
- }
-
- /**
- * @expectedException \Symfony\Component\Console\Exception\InvalidArgumentException
- * @expectedExceptionMessage A cell must be a TableCell, a scalar or an object implementing __toString, array given.
- */
- public function testThrowsWhenTheCellInAnArray()
- {
- $table = new Table($output = $this->getOutputStream());
- $table
- ->setHeaders(['ISBN', 'Title', 'Author', 'Price'])
- ->setRows([
- ['99921-58-10-7', [], 'Dante Alighieri', '9.95'],
- ]);
-
- $table->render();
- }
-
- public function testColumnWidth()
- {
- $table = new Table($output = $this->getOutputStream());
- $table
- ->setHeaders(['ISBN', 'Title', 'Author', 'Price'])
- ->setRows([
- ['99921-58-10-7', 'Divine Comedy', 'Dante Alighieri', '9.95'],
- ['9971-5-0210-0', 'A Tale of Two Cities', 'Charles Dickens', '139.25'],
- ])
- ->setColumnWidth(0, 15)
- ->setColumnWidth(3, 10);
-
- $style = new TableStyle();
- $style->setPadType(STR_PAD_LEFT);
- $table->setColumnStyle(3, $style);
-
- $table->render();
-
- $expected =
- <<assertEquals($expected, $this->getOutputContent($output));
- }
-
- public function testColumnWidths()
- {
- $table = new Table($output = $this->getOutputStream());
- $table
- ->setHeaders(['ISBN', 'Title', 'Author', 'Price'])
- ->setRows([
- ['99921-58-10-7', 'Divine Comedy', 'Dante Alighieri', '9.95'],
- ['9971-5-0210-0', 'A Tale of Two Cities', 'Charles Dickens', '139.25'],
- ])
- ->setColumnWidths([15, 0, -1, 10]);
-
- $style = new TableStyle();
- $style->setPadType(STR_PAD_LEFT);
- $table->setColumnStyle(3, $style);
-
- $table->render();
-
- $expected =
- <<assertEquals($expected, $this->getOutputContent($output));
- }
-
- public function testSectionOutput()
- {
- $sections = [];
- $stream = $this->getOutputStream(true);
- $output = new ConsoleSectionOutput($stream->getStream(), $sections, $stream->getVerbosity(), $stream->isDecorated(), new OutputFormatter());
- $table = new Table($output);
- $table
- ->setHeaders(['ISBN', 'Title', 'Author', 'Price'])
- ->setRows([
- ['99921-58-10-7', 'Divine Comedy', 'Dante Alighieri', '9.95'],
- ]);
-
- $table->render();
-
- $table->appendRow(['9971-5-0210-0', 'A Tale of Two Cities', 'Charles Dickens', '139.25']);
-
- $expected =
- <<assertEquals($expected, $this->getOutputContent($output));
- }
-
- public function testSectionOutputDoesntClearIfTableIsntRendered()
- {
- $sections = [];
- $stream = $this->getOutputStream(true);
- $output = new ConsoleSectionOutput($stream->getStream(), $sections, $stream->getVerbosity(), $stream->isDecorated(), new OutputFormatter());
- $table = new Table($output);
- $table
- ->setHeaders(['ISBN', 'Title', 'Author', 'Price'])
- ->setRows([
- ['99921-58-10-7', 'Divine Comedy', 'Dante Alighieri', '9.95'],
- ]);
-
- $table->appendRow(['9971-5-0210-0', 'A Tale of Two Cities', 'Charles Dickens', '139.25']);
-
- $expected =
- <<assertEquals($expected, $this->getOutputContent($output));
- }
-
- public function testSectionOutputWithoutDecoration()
- {
- $sections = [];
- $stream = $this->getOutputStream();
- $output = new ConsoleSectionOutput($stream->getStream(), $sections, $stream->getVerbosity(), $stream->isDecorated(), new OutputFormatter());
- $table = new Table($output);
- $table
- ->setHeaders(['ISBN', 'Title', 'Author', 'Price'])
- ->setRows([
- ['99921-58-10-7', 'Divine Comedy', 'Dante Alighieri', '9.95'],
- ]);
-
- $table->render();
-
- $table->appendRow(['9971-5-0210-0', 'A Tale of Two Cities', 'Charles Dickens', '139.25']);
-
- $expected =
- <<assertEquals($expected, $this->getOutputContent($output));
- }
-
- /**
- * @expectedException \Symfony\Component\Console\Exception\RuntimeException
- * @expectedExceptionMessage Output should be an instance of "Symfony\Component\Console\Output\ConsoleSectionOutput" when calling "Symfony\Component\Console\Helper\Table::appendRow".
- */
- public function testAppendRowWithoutSectionOutput()
- {
- $table = new Table($this->getOutputStream());
-
- $table->appendRow(['9971-5-0210-0', 'A Tale of Two Cities', 'Charles Dickens', '139.25']);
- }
-
- /**
- * @expectedException \Symfony\Component\Console\Exception\InvalidArgumentException
- * @expectedExceptionMessage Style "absent" is not defined.
- */
- public function testIsNotDefinedStyleException()
- {
- $table = new Table($this->getOutputStream());
- $table->setStyle('absent');
- }
-
- /**
- * @expectedException \Symfony\Component\Console\Exception\InvalidArgumentException
- * @expectedExceptionMessage Style "absent" is not defined.
- */
- public function testGetStyleDefinition()
- {
- Table::getStyleDefinition('absent');
- }
-
- /**
- * @dataProvider renderSetTitle
- */
- public function testSetTitle($headerTitle, $footerTitle, $style, $expected)
- {
- (new Table($output = $this->getOutputStream()))
- ->setHeaderTitle($headerTitle)
- ->setFooterTitle($footerTitle)
- ->setHeaders(['ISBN', 'Title', 'Author'])
- ->setRows([
- ['99921-58-10-7', 'Divine Comedy', 'Dante Alighieri'],
- ['9971-5-0210-0', 'A Tale of Two Cities', 'Charles Dickens'],
- ['960-425-059-0', 'The Lord of the Rings', 'J. R. R. Tolkien'],
- ['80-902734-1-6', 'And Then There Were None', 'Agatha Christie'],
- ])
- ->setStyle($style)
- ->render()
- ;
-
- $this->assertEquals($expected, $this->getOutputContent($output));
- }
-
- public function renderSetTitle()
- {
- return [
- [
- 'Books',
- 'Page 1/2',
- 'default',
- <<<'TABLE'
-+---------------+----------- Books --------+------------------+
-| ISBN | Title | Author |
-+---------------+--------------------------+------------------+
-| 99921-58-10-7 | Divine Comedy | Dante Alighieri |
-| 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens |
-| 960-425-059-0 | The Lord of the Rings | J. R. R. Tolkien |
-| 80-902734-1-6 | And Then There Were None | Agatha Christie |
-+---------------+--------- Page 1/2 -------+------------------+
-
-TABLE
- ],
- [
- 'Books',
- 'Page 1/2',
- 'box',
- <<<'TABLE'
-┌───────────────┬─────────── Books ────────┬──────────────────┐
-│ ISBN │ Title │ Author │
-├───────────────┼──────────────────────────┼──────────────────┤
-│ 99921-58-10-7 │ Divine Comedy │ Dante Alighieri │
-│ 9971-5-0210-0 │ A Tale of Two Cities │ Charles Dickens │
-│ 960-425-059-0 │ The Lord of the Rings │ J. R. R. Tolkien │
-│ 80-902734-1-6 │ And Then There Were None │ Agatha Christie │
-└───────────────┴───────── Page 1/2 ───────┴──────────────────┘
-
-TABLE
- ],
- [
- 'Boooooooooooooooooooooooooooooooooooooooooooooooooooooooks',
- 'Page 1/999999999999999999999999999999999999999999999999999',
- 'default',
- <<<'TABLE'
-+- Booooooooooooooooooooooooooooooooooooooooooooooooooooo... -+
-| ISBN | Title | Author |
-+---------------+--------------------------+------------------+
-| 99921-58-10-7 | Divine Comedy | Dante Alighieri |
-| 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens |
-| 960-425-059-0 | The Lord of the Rings | J. R. R. Tolkien |
-| 80-902734-1-6 | And Then There Were None | Agatha Christie |
-+- Page 1/99999999999999999999999999999999999999999999999... -+
-
-TABLE
- ],
- ];
- }
-
- public function testColumnMaxWidths()
- {
- $table = new Table($output = $this->getOutputStream());
- $table
- ->setRows([
- ['Divine Comedy', 'A Tale of Two Cities', 'The Lord of the Rings', 'And Then There Were None'],
- ])
- ->setColumnMaxWidth(1, 5)
- ->setColumnMaxWidth(2, 10)
- ->setColumnMaxWidth(3, 15);
-
- $table->render();
-
- $expected =
- <<assertEquals($expected, $this->getOutputContent($output));
- }
-
- public function testColumnMaxWidthsWithTrailingBackslash()
- {
- (new Table($output = $this->getOutputStream()))
- ->setColumnMaxWidth(0, 5)
- ->setRows([['1234\6']])
- ->render()
- ;
-
- $expected =
- <<<'TABLE'
-+-------+
-| 1234\ |
-| 6 |
-+-------+
-
-TABLE;
-
- $this->assertEquals($expected, $this->getOutputContent($output));
- }
-
- public function testBoxedStyleWithColspan()
- {
- $boxed = new TableStyle();
- $boxed
- ->setHorizontalBorderChars('─')
- ->setVerticalBorderChars('│')
- ->setCrossingChars('┼', '┌', '┬', '┐', '┤', '┘', '┴', '└', '├')
- ;
-
- $table = new Table($output = $this->getOutputStream());
- $table->setStyle($boxed);
- $table
- ->setHeaders(['ISBN', 'Title', 'Author'])
- ->setRows([
- ['99921-58-10-7', 'Divine Comedy', 'Dante Alighieri'],
- new TableSeparator(),
- [new TableCell('This value spans 3 columns.', ['colspan' => 3])],
- ])
- ;
- $table->render();
-
- $expected =
- <<assertSame($expected, $this->getOutputContent($output));
- }
-
- protected function getOutputStream($decorated = false)
- {
- return new StreamOutput($this->stream, StreamOutput::VERBOSITY_NORMAL, $decorated);
- }
-
- protected function getOutputContent(StreamOutput $output)
- {
- rewind($output->getStream());
-
- return str_replace(PHP_EOL, "\n", stream_get_contents($output->getStream()));
- }
-
- public function testWithColspanAndMaxWith(): void
- {
- $table = new Table($output = $this->getOutputStream());
-
- $table->setColumnMaxWidth(0, 15);
- $table->setColumnMaxWidth(1, 15);
- $table->setColumnMaxWidth(2, 15);
- $table->setRows([
- [new TableCell('Lorem ipsum dolor sit amet, consectetur> adipiscing elit, sed> do eiusmod> tempor', ['colspan' => 3])],
- new TableSeparator(),
- [new TableCell('Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor', ['colspan' => 3])],
- new TableSeparator(),
- [new TableCell('Lorem ipsum dolor> sit amet, consectetur ', ['colspan' => 2]), 'hello world'],
- new TableSeparator(),
- ['hello world>', new TableCell('Lorem ipsum dolor sit amet, consectetur> adipiscing elit', ['colspan' => 2])],
- new TableSeparator(),
- ['hello ', new TableCell('world', ['colspan' => 1]), 'Lorem ipsum dolor sit amet, consectetur'],
- new TableSeparator(),
- ['Symfony ', new TableCell('Test', ['colspan' => 1]), 'Lorem ipsum> dolor sit amet, consectetur'],
- ])
- ;
- $table->render();
-
- $expected =
- <<assertSame($expected, $this->getOutputContent($output));
- }
-}
diff --git a/vendor/symfony/console/Tests/Input/ArgvInputTest.php b/vendor/symfony/console/Tests/Input/ArgvInputTest.php
deleted file mode 100644
index e20bcdd21..000000000
--- a/vendor/symfony/console/Tests/Input/ArgvInputTest.php
+++ /dev/null
@@ -1,466 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Console\Tests\Input;
-
-use PHPUnit\Framework\TestCase;
-use Symfony\Component\Console\Input\ArgvInput;
-use Symfony\Component\Console\Input\InputArgument;
-use Symfony\Component\Console\Input\InputDefinition;
-use Symfony\Component\Console\Input\InputOption;
-
-class ArgvInputTest extends TestCase
-{
- public function testConstructor()
- {
- $_SERVER['argv'] = ['cli.php', 'foo'];
- $input = new ArgvInput();
- $r = new \ReflectionObject($input);
- $p = $r->getProperty('tokens');
- $p->setAccessible(true);
-
- $this->assertEquals(['foo'], $p->getValue($input), '__construct() automatically get its input from the argv server variable');
- }
-
- public function testParseArguments()
- {
- $input = new ArgvInput(['cli.php', 'foo']);
- $input->bind(new InputDefinition([new InputArgument('name')]));
- $this->assertEquals(['name' => 'foo'], $input->getArguments(), '->parse() parses required arguments');
-
- $input->bind(new InputDefinition([new InputArgument('name')]));
- $this->assertEquals(['name' => 'foo'], $input->getArguments(), '->parse() is stateless');
- }
-
- /**
- * @dataProvider provideOptions
- */
- public function testParseOptions($input, $options, $expectedOptions, $message)
- {
- $input = new ArgvInput($input);
- $input->bind(new InputDefinition($options));
-
- $this->assertSame($expectedOptions, $input->getOptions(), $message);
- }
-
- public function provideOptions()
- {
- return [
- [
- ['cli.php', '--foo'],
- [new InputOption('foo')],
- ['foo' => true],
- '->parse() parses long options without a value',
- ],
- [
- ['cli.php', '--foo=bar'],
- [new InputOption('foo', 'f', InputOption::VALUE_REQUIRED)],
- ['foo' => 'bar'],
- '->parse() parses long options with a required value (with a = separator)',
- ],
- [
- ['cli.php', '--foo', 'bar'],
- [new InputOption('foo', 'f', InputOption::VALUE_REQUIRED)],
- ['foo' => 'bar'],
- '->parse() parses long options with a required value (with a space separator)',
- ],
- [
- ['cli.php', '--foo='],
- [new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL)],
- ['foo' => ''],
- '->parse() parses long options with optional value which is empty (with a = separator) as empty string',
- ],
- [
- ['cli.php', '--foo=', 'bar'],
- [new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL), new InputArgument('name', InputArgument::REQUIRED)],
- ['foo' => ''],
- '->parse() parses long options with optional value without value specified or an empty string (with a = separator) followed by an argument as empty string',
- ],
- [
- ['cli.php', 'bar', '--foo'],
- [new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL), new InputArgument('name', InputArgument::REQUIRED)],
- ['foo' => null],
- '->parse() parses long options with optional value which is empty (with a = separator) preceded by an argument',
- ],
- [
- ['cli.php', '--foo', '', 'bar'],
- [new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL), new InputArgument('name', InputArgument::REQUIRED)],
- ['foo' => ''],
- '->parse() parses long options with optional value which is empty as empty string even followed by an argument',
- ],
- [
- ['cli.php', '--foo'],
- [new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL)],
- ['foo' => null],
- '->parse() parses long options with optional value specified with no separator and no value as null',
- ],
- [
- ['cli.php', '-f'],
- [new InputOption('foo', 'f')],
- ['foo' => true],
- '->parse() parses short options without a value',
- ],
- [
- ['cli.php', '-fbar'],
- [new InputOption('foo', 'f', InputOption::VALUE_REQUIRED)],
- ['foo' => 'bar'],
- '->parse() parses short options with a required value (with no separator)',
- ],
- [
- ['cli.php', '-f', 'bar'],
- [new InputOption('foo', 'f', InputOption::VALUE_REQUIRED)],
- ['foo' => 'bar'],
- '->parse() parses short options with a required value (with a space separator)',
- ],
- [
- ['cli.php', '-f', ''],
- [new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL)],
- ['foo' => ''],
- '->parse() parses short options with an optional empty value',
- ],
- [
- ['cli.php', '-f', '', 'foo'],
- [new InputArgument('name'), new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL)],
- ['foo' => ''],
- '->parse() parses short options with an optional empty value followed by an argument',
- ],
- [
- ['cli.php', '-f', '', '-b'],
- [new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL), new InputOption('bar', 'b')],
- ['foo' => '', 'bar' => true],
- '->parse() parses short options with an optional empty value followed by an option',
- ],
- [
- ['cli.php', '-f', '-b', 'foo'],
- [new InputArgument('name'), new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL), new InputOption('bar', 'b')],
- ['foo' => null, 'bar' => true],
- '->parse() parses short options with an optional value which is not present',
- ],
- [
- ['cli.php', '-fb'],
- [new InputOption('foo', 'f'), new InputOption('bar', 'b')],
- ['foo' => true, 'bar' => true],
- '->parse() parses short options when they are aggregated as a single one',
- ],
- [
- ['cli.php', '-fb', 'bar'],
- [new InputOption('foo', 'f'), new InputOption('bar', 'b', InputOption::VALUE_REQUIRED)],
- ['foo' => true, 'bar' => 'bar'],
- '->parse() parses short options when they are aggregated as a single one and the last one has a required value',
- ],
- [
- ['cli.php', '-fb', 'bar'],
- [new InputOption('foo', 'f'), new InputOption('bar', 'b', InputOption::VALUE_OPTIONAL)],
- ['foo' => true, 'bar' => 'bar'],
- '->parse() parses short options when they are aggregated as a single one and the last one has an optional value',
- ],
- [
- ['cli.php', '-fbbar'],
- [new InputOption('foo', 'f'), new InputOption('bar', 'b', InputOption::VALUE_OPTIONAL)],
- ['foo' => true, 'bar' => 'bar'],
- '->parse() parses short options when they are aggregated as a single one and the last one has an optional value with no separator',
- ],
- [
- ['cli.php', '-fbbar'],
- [new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL), new InputOption('bar', 'b', InputOption::VALUE_OPTIONAL)],
- ['foo' => 'bbar', 'bar' => null],
- '->parse() parses short options when they are aggregated as a single one and one of them takes a value',
- ],
- ];
- }
-
- /**
- * @dataProvider provideInvalidInput
- */
- public function testInvalidInput($argv, $definition, $expectedExceptionMessage)
- {
- if (method_exists($this, 'expectException')) {
- $this->expectException('RuntimeException');
- $this->expectExceptionMessage($expectedExceptionMessage);
- } else {
- $this->setExpectedException('RuntimeException', $expectedExceptionMessage);
- }
-
- $input = new ArgvInput($argv);
- $input->bind($definition);
- }
-
- public function provideInvalidInput()
- {
- return [
- [
- ['cli.php', '--foo'],
- new InputDefinition([new InputOption('foo', 'f', InputOption::VALUE_REQUIRED)]),
- 'The "--foo" option requires a value.',
- ],
- [
- ['cli.php', '-f'],
- new InputDefinition([new InputOption('foo', 'f', InputOption::VALUE_REQUIRED)]),
- 'The "--foo" option requires a value.',
- ],
- [
- ['cli.php', '-ffoo'],
- new InputDefinition([new InputOption('foo', 'f', InputOption::VALUE_NONE)]),
- 'The "-o" option does not exist.',
- ],
- [
- ['cli.php', '--foo=bar'],
- new InputDefinition([new InputOption('foo', 'f', InputOption::VALUE_NONE)]),
- 'The "--foo" option does not accept a value.',
- ],
- [
- ['cli.php', 'foo', 'bar'],
- new InputDefinition(),
- 'No arguments expected, got "foo".',
- ],
- [
- ['cli.php', 'foo', 'bar'],
- new InputDefinition([new InputArgument('number')]),
- 'Too many arguments, expected arguments "number".',
- ],
- [
- ['cli.php', 'foo', 'bar', 'zzz'],
- new InputDefinition([new InputArgument('number'), new InputArgument('county')]),
- 'Too many arguments, expected arguments "number" "county".',
- ],
- [
- ['cli.php', '--foo'],
- new InputDefinition(),
- 'The "--foo" option does not exist.',
- ],
- [
- ['cli.php', '-f'],
- new InputDefinition(),
- 'The "-f" option does not exist.',
- ],
- [
- ['cli.php', '-1'],
- new InputDefinition([new InputArgument('number')]),
- 'The "-1" option does not exist.',
- ],
- [
- ['cli.php', '-fЩ'],
- new InputDefinition([new InputOption('foo', 'f', InputOption::VALUE_NONE)]),
- 'The "-Щ" option does not exist.',
- ],
- ];
- }
-
- public function testParseArrayArgument()
- {
- $input = new ArgvInput(['cli.php', 'foo', 'bar', 'baz', 'bat']);
- $input->bind(new InputDefinition([new InputArgument('name', InputArgument::IS_ARRAY)]));
-
- $this->assertEquals(['name' => ['foo', 'bar', 'baz', 'bat']], $input->getArguments(), '->parse() parses array arguments');
- }
-
- public function testParseArrayOption()
- {
- $input = new ArgvInput(['cli.php', '--name=foo', '--name=bar', '--name=baz']);
- $input->bind(new InputDefinition([new InputOption('name', null, InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY)]));
-
- $this->assertEquals(['name' => ['foo', 'bar', 'baz']], $input->getOptions(), '->parse() parses array options ("--option=value" syntax)');
-
- $input = new ArgvInput(['cli.php', '--name', 'foo', '--name', 'bar', '--name', 'baz']);
- $input->bind(new InputDefinition([new InputOption('name', null, InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY)]));
- $this->assertEquals(['name' => ['foo', 'bar', 'baz']], $input->getOptions(), '->parse() parses array options ("--option value" syntax)');
-
- $input = new ArgvInput(['cli.php', '--name=foo', '--name=bar', '--name=']);
- $input->bind(new InputDefinition([new InputOption('name', null, InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY)]));
- $this->assertSame(['name' => ['foo', 'bar', '']], $input->getOptions(), '->parse() parses empty array options as null ("--option=value" syntax)');
-
- $input = new ArgvInput(['cli.php', '--name', 'foo', '--name', 'bar', '--name', '--anotherOption']);
- $input->bind(new InputDefinition([
- new InputOption('name', null, InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY),
- new InputOption('anotherOption', null, InputOption::VALUE_NONE),
- ]));
- $this->assertSame(['name' => ['foo', 'bar', null], 'anotherOption' => true], $input->getOptions(), '->parse() parses empty array options ("--option value" syntax)');
- }
-
- public function testParseNegativeNumberAfterDoubleDash()
- {
- $input = new ArgvInput(['cli.php', '--', '-1']);
- $input->bind(new InputDefinition([new InputArgument('number')]));
- $this->assertEquals(['number' => '-1'], $input->getArguments(), '->parse() parses arguments with leading dashes as arguments after having encountered a double-dash sequence');
-
- $input = new ArgvInput(['cli.php', '-f', 'bar', '--', '-1']);
- $input->bind(new InputDefinition([new InputArgument('number'), new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL)]));
- $this->assertEquals(['foo' => 'bar'], $input->getOptions(), '->parse() parses arguments with leading dashes as options before having encountered a double-dash sequence');
- $this->assertEquals(['number' => '-1'], $input->getArguments(), '->parse() parses arguments with leading dashes as arguments after having encountered a double-dash sequence');
- }
-
- public function testParseEmptyStringArgument()
- {
- $input = new ArgvInput(['cli.php', '-f', 'bar', '']);
- $input->bind(new InputDefinition([new InputArgument('empty'), new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL)]));
-
- $this->assertEquals(['empty' => ''], $input->getArguments(), '->parse() parses empty string arguments');
- }
-
- public function testGetFirstArgument()
- {
- $input = new ArgvInput(['cli.php', '-fbbar']);
- $this->assertNull($input->getFirstArgument(), '->getFirstArgument() returns null when there is no arguments');
-
- $input = new ArgvInput(['cli.php', '-fbbar', 'foo']);
- $this->assertEquals('foo', $input->getFirstArgument(), '->getFirstArgument() returns the first argument from the raw input');
-
- $input = new ArgvInput(['cli.php', '--foo', 'fooval', 'bar']);
- $input->bind(new InputDefinition([new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL), new InputArgument('arg')]));
- $this->assertSame('bar', $input->getFirstArgument());
-
- $input = new ArgvInput(['cli.php', '-bf', 'fooval', 'argval']);
- $input->bind(new InputDefinition([new InputOption('bar', 'b', InputOption::VALUE_NONE), new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL), new InputArgument('arg')]));
- $this->assertSame('argval', $input->getFirstArgument());
- }
-
- public function testHasParameterOption()
- {
- $input = new ArgvInput(['cli.php', '-f', 'foo']);
- $this->assertTrue($input->hasParameterOption('-f'), '->hasParameterOption() returns true if the given short option is in the raw input');
-
- $input = new ArgvInput(['cli.php', '-etest']);
- $this->assertTrue($input->hasParameterOption('-e'), '->hasParameterOption() returns true if the given short option is in the raw input');
- $this->assertFalse($input->hasParameterOption('-s'), '->hasParameterOption() returns true if the given short option is in the raw input');
-
- $input = new ArgvInput(['cli.php', '--foo', 'foo']);
- $this->assertTrue($input->hasParameterOption('--foo'), '->hasParameterOption() returns true if the given short option is in the raw input');
-
- $input = new ArgvInput(['cli.php', 'foo']);
- $this->assertFalse($input->hasParameterOption('--foo'), '->hasParameterOption() returns false if the given short option is not in the raw input');
-
- $input = new ArgvInput(['cli.php', '--foo=bar']);
- $this->assertTrue($input->hasParameterOption('--foo'), '->hasParameterOption() returns true if the given option with provided value is in the raw input');
- }
-
- public function testHasParameterOptionOnlyOptions()
- {
- $input = new ArgvInput(['cli.php', '-f', 'foo']);
- $this->assertTrue($input->hasParameterOption('-f', true), '->hasParameterOption() returns true if the given short option is in the raw input');
-
- $input = new ArgvInput(['cli.php', '--foo', '--', 'foo']);
- $this->assertTrue($input->hasParameterOption('--foo', true), '->hasParameterOption() returns true if the given long option is in the raw input');
-
- $input = new ArgvInput(['cli.php', '--foo=bar', 'foo']);
- $this->assertTrue($input->hasParameterOption('--foo', true), '->hasParameterOption() returns true if the given long option with provided value is in the raw input');
-
- $input = new ArgvInput(['cli.php', '--', '--foo']);
- $this->assertFalse($input->hasParameterOption('--foo', true), '->hasParameterOption() returns false if the given option is in the raw input but after an end of options signal');
- }
-
- public function testHasParameterOptionEdgeCasesAndLimitations()
- {
- $input = new ArgvInput(['cli.php', '-fh']);
- // hasParameterOption does not know if the previous short option, -f,
- // takes a value or not. If -f takes a value, then -fh does NOT include
- // -h; Otherwise it does. Since we do not know which short options take
- // values, hasParameterOption does not support this use-case.
- $this->assertFalse($input->hasParameterOption('-h'), '->hasParameterOption() returns true if the given short option is in the raw input');
- // hasParameterOption does detect that `-fh` contains `-f`, since
- // `-f` is the first short option in the set.
- $this->assertTrue($input->hasParameterOption('-f'), '->hasParameterOption() returns true if the given short option is in the raw input');
- // The test below happens to pass, although it might make more sense
- // to disallow it, and require the use of
- // $input->hasParameterOption('-f') && $input->hasParameterOption('-h')
- // instead.
- $this->assertTrue($input->hasParameterOption('-fh'), '->hasParameterOption() returns true if the given short option is in the raw input');
- // In theory, if -fh is supported, then -hf should also work.
- // However, this is not supported.
- $this->assertFalse($input->hasParameterOption('-hf'), '->hasParameterOption() returns true if the given short option is in the raw input');
-
- $input = new ArgvInput(['cli.php', '-f', '-h']);
- // If hasParameterOption('-fh') is supported for 'cli.php -fh', then
- // one might also expect that it should also be supported for
- // 'cli.php -f -h'. However, this is not supported.
- $this->assertFalse($input->hasParameterOption('-fh'), '->hasParameterOption() returns true if the given short option is in the raw input');
- }
-
- public function testNoWarningOnInvalidParameterOption()
- {
- $input = new ArgvInput(['cli.php', '-edev']);
-
- $this->assertTrue($input->hasParameterOption(['-e', '']));
- // No warning thrown
- $this->assertFalse($input->hasParameterOption(['-m', '']));
-
- $this->assertEquals('dev', $input->getParameterOption(['-e', '']));
- // No warning thrown
- $this->assertFalse($input->getParameterOption(['-m', '']));
- }
-
- public function testToString()
- {
- $input = new ArgvInput(['cli.php', '-f', 'foo']);
- $this->assertEquals('-f foo', (string) $input);
-
- $input = new ArgvInput(['cli.php', '-f', '--bar=foo', 'a b c d', "A\nB'C"]);
- $this->assertEquals('-f --bar=foo '.escapeshellarg('a b c d').' '.escapeshellarg("A\nB'C"), (string) $input);
- }
-
- /**
- * @dataProvider provideGetParameterOptionValues
- */
- public function testGetParameterOptionEqualSign($argv, $key, $default, $onlyParams, $expected)
- {
- $input = new ArgvInput($argv);
- $this->assertEquals($expected, $input->getParameterOption($key, $default, $onlyParams), '->getParameterOption() returns the expected value');
- }
-
- public function provideGetParameterOptionValues()
- {
- return [
- [['app/console', 'foo:bar'], '-e', 'default', false, 'default'],
- [['app/console', 'foo:bar', '-e', 'dev'], '-e', 'default', false, 'dev'],
- [['app/console', 'foo:bar', '--env=dev'], '--env', 'default', false, 'dev'],
- [['app/console', 'foo:bar', '-e', 'dev'], ['-e', '--env'], 'default', false, 'dev'],
- [['app/console', 'foo:bar', '--env=dev'], ['-e', '--env'], 'default', false, 'dev'],
- [['app/console', 'foo:bar', '--env=dev', '--en=1'], ['--en'], 'default', false, '1'],
- [['app/console', 'foo:bar', '--env=dev', '', '--en=1'], ['--en'], 'default', false, '1'],
- [['app/console', 'foo:bar', '--env', 'val'], '--env', 'default', false, 'val'],
- [['app/console', 'foo:bar', '--env', 'val', '--dummy'], '--env', 'default', false, 'val'],
- [['app/console', 'foo:bar', '--', '--env=dev'], '--env', 'default', false, 'dev'],
- [['app/console', 'foo:bar', '--', '--env=dev'], '--env', 'default', true, 'default'],
- ];
- }
-
- public function testParseSingleDashAsArgument()
- {
- $input = new ArgvInput(['cli.php', '-']);
- $input->bind(new InputDefinition([new InputArgument('file')]));
- $this->assertEquals(['file' => '-'], $input->getArguments(), '->parse() parses single dash as an argument');
- }
-
- public function testParseOptionWithValueOptionalGivenEmptyAndRequiredArgument()
- {
- $input = new ArgvInput(['cli.php', '--foo=', 'bar']);
- $input->bind(new InputDefinition([new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL), new InputArgument('name', InputArgument::REQUIRED)]));
- $this->assertEquals(['foo' => null], $input->getOptions(), '->parse() parses optional options with empty value as null');
- $this->assertEquals(['name' => 'bar'], $input->getArguments(), '->parse() parses required arguments');
-
- $input = new ArgvInput(['cli.php', '--foo=0', 'bar']);
- $input->bind(new InputDefinition([new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL), new InputArgument('name', InputArgument::REQUIRED)]));
- $this->assertEquals(['foo' => '0'], $input->getOptions(), '->parse() parses optional options with empty value as null');
- $this->assertEquals(['name' => 'bar'], $input->getArguments(), '->parse() parses required arguments');
- }
-
- public function testParseOptionWithValueOptionalGivenEmptyAndOptionalArgument()
- {
- $input = new ArgvInput(['cli.php', '--foo=', 'bar']);
- $input->bind(new InputDefinition([new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL), new InputArgument('name', InputArgument::OPTIONAL)]));
- $this->assertEquals(['foo' => null], $input->getOptions(), '->parse() parses optional options with empty value as null');
- $this->assertEquals(['name' => 'bar'], $input->getArguments(), '->parse() parses optional arguments');
-
- $input = new ArgvInput(['cli.php', '--foo=0', 'bar']);
- $input->bind(new InputDefinition([new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL), new InputArgument('name', InputArgument::OPTIONAL)]));
- $this->assertEquals(['foo' => '0'], $input->getOptions(), '->parse() parses optional options with empty value as null');
- $this->assertEquals(['name' => 'bar'], $input->getArguments(), '->parse() parses optional arguments');
- }
-}
diff --git a/vendor/symfony/console/Tests/Input/ArrayInputTest.php b/vendor/symfony/console/Tests/Input/ArrayInputTest.php
deleted file mode 100644
index afe74831e..000000000
--- a/vendor/symfony/console/Tests/Input/ArrayInputTest.php
+++ /dev/null
@@ -1,177 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Console\Tests\Input;
-
-use PHPUnit\Framework\TestCase;
-use Symfony\Component\Console\Input\ArrayInput;
-use Symfony\Component\Console\Input\InputArgument;
-use Symfony\Component\Console\Input\InputDefinition;
-use Symfony\Component\Console\Input\InputOption;
-
-class ArrayInputTest extends TestCase
-{
- public function testGetFirstArgument()
- {
- $input = new ArrayInput([]);
- $this->assertNull($input->getFirstArgument(), '->getFirstArgument() returns null if no argument were passed');
- $input = new ArrayInput(['name' => 'Fabien']);
- $this->assertEquals('Fabien', $input->getFirstArgument(), '->getFirstArgument() returns the first passed argument');
- $input = new ArrayInput(['--foo' => 'bar', 'name' => 'Fabien']);
- $this->assertEquals('Fabien', $input->getFirstArgument(), '->getFirstArgument() returns the first passed argument');
- }
-
- public function testHasParameterOption()
- {
- $input = new ArrayInput(['name' => 'Fabien', '--foo' => 'bar']);
- $this->assertTrue($input->hasParameterOption('--foo'), '->hasParameterOption() returns true if an option is present in the passed parameters');
- $this->assertFalse($input->hasParameterOption('--bar'), '->hasParameterOption() returns false if an option is not present in the passed parameters');
-
- $input = new ArrayInput(['--foo']);
- $this->assertTrue($input->hasParameterOption('--foo'), '->hasParameterOption() returns true if an option is present in the passed parameters');
-
- $input = new ArrayInput(['--foo', '--', '--bar']);
- $this->assertTrue($input->hasParameterOption('--bar'), '->hasParameterOption() returns true if an option is present in the passed parameters');
- $this->assertFalse($input->hasParameterOption('--bar', true), '->hasParameterOption() returns false if an option is present in the passed parameters after an end of options signal');
- }
-
- public function testGetParameterOption()
- {
- $input = new ArrayInput(['name' => 'Fabien', '--foo' => 'bar']);
- $this->assertEquals('bar', $input->getParameterOption('--foo'), '->getParameterOption() returns the option of specified name');
- $this->assertEquals('default', $input->getParameterOption('--bar', 'default'), '->getParameterOption() returns the default value if an option is not present in the passed parameters');
-
- $input = new ArrayInput(['Fabien', '--foo' => 'bar']);
- $this->assertEquals('bar', $input->getParameterOption('--foo'), '->getParameterOption() returns the option of specified name');
-
- $input = new ArrayInput(['--foo', '--', '--bar' => 'woop']);
- $this->assertEquals('woop', $input->getParameterOption('--bar'), '->getParameterOption() returns the correct value if an option is present in the passed parameters');
- $this->assertEquals('default', $input->getParameterOption('--bar', 'default', true), '->getParameterOption() returns the default value if an option is present in the passed parameters after an end of options signal');
- }
-
- public function testParseArguments()
- {
- $input = new ArrayInput(['name' => 'foo'], new InputDefinition([new InputArgument('name')]));
-
- $this->assertEquals(['name' => 'foo'], $input->getArguments(), '->parse() parses required arguments');
- }
-
- /**
- * @dataProvider provideOptions
- */
- public function testParseOptions($input, $options, $expectedOptions, $message)
- {
- $input = new ArrayInput($input, new InputDefinition($options));
-
- $this->assertEquals($expectedOptions, $input->getOptions(), $message);
- }
-
- public function provideOptions()
- {
- return [
- [
- ['--foo' => 'bar'],
- [new InputOption('foo')],
- ['foo' => 'bar'],
- '->parse() parses long options',
- ],
- [
- ['--foo' => 'bar'],
- [new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL, '', 'default')],
- ['foo' => 'bar'],
- '->parse() parses long options with a default value',
- ],
- [
- [],
- [new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL, '', 'default')],
- ['foo' => 'default'],
- '->parse() uses the default value for long options with value optional which are not passed',
- ],
- [
- ['--foo' => null],
- [new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL, '', 'default')],
- ['foo' => null],
- '->parse() parses long options with a default value',
- ],
- [
- ['-f' => 'bar'],
- [new InputOption('foo', 'f')],
- ['foo' => 'bar'],
- '->parse() parses short options',
- ],
- [
- ['--' => null, '-f' => 'bar'],
- [new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL, '', 'default')],
- ['foo' => 'default'],
- '->parse() does not parse opts after an end of options signal',
- ],
- [
- ['--' => null],
- [],
- [],
- '->parse() does not choke on end of options signal',
- ],
- ];
- }
-
- /**
- * @dataProvider provideInvalidInput
- */
- public function testParseInvalidInput($parameters, $definition, $expectedExceptionMessage)
- {
- if (method_exists($this, 'expectException')) {
- $this->expectException('InvalidArgumentException');
- $this->expectExceptionMessage($expectedExceptionMessage);
- } else {
- $this->setExpectedException('InvalidArgumentException', $expectedExceptionMessage);
- }
-
- new ArrayInput($parameters, $definition);
- }
-
- public function provideInvalidInput()
- {
- return [
- [
- ['foo' => 'foo'],
- new InputDefinition([new InputArgument('name')]),
- 'The "foo" argument does not exist.',
- ],
- [
- ['--foo' => null],
- new InputDefinition([new InputOption('foo', 'f', InputOption::VALUE_REQUIRED)]),
- 'The "--foo" option requires a value.',
- ],
- [
- ['--foo' => 'foo'],
- new InputDefinition(),
- 'The "--foo" option does not exist.',
- ],
- [
- ['-o' => 'foo'],
- new InputDefinition(),
- 'The "-o" option does not exist.',
- ],
- ];
- }
-
- public function testToString()
- {
- $input = new ArrayInput(['-f' => null, '-b' => 'bar', '--foo' => 'b a z', '--lala' => null, 'test' => 'Foo', 'test2' => "A\nB'C"]);
- $this->assertEquals('-f -b=bar --foo='.escapeshellarg('b a z').' --lala Foo '.escapeshellarg("A\nB'C"), (string) $input);
-
- $input = new ArrayInput(['-b' => ['bval_1', 'bval_2'], '--f' => ['fval_1', 'fval_2']]);
- $this->assertSame('-b=bval_1 -b=bval_2 --f=fval_1 --f=fval_2', (string) $input);
-
- $input = new ArrayInput(['array_arg' => ['val_1', 'val_2']]);
- $this->assertSame('val_1 val_2', (string) $input);
- }
-}
diff --git a/vendor/symfony/console/Tests/Input/InputArgumentTest.php b/vendor/symfony/console/Tests/Input/InputArgumentTest.php
deleted file mode 100644
index 8b809d6f1..000000000
--- a/vendor/symfony/console/Tests/Input/InputArgumentTest.php
+++ /dev/null
@@ -1,103 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Console\Tests\Input;
-
-use PHPUnit\Framework\TestCase;
-use Symfony\Component\Console\Input\InputArgument;
-
-class InputArgumentTest extends TestCase
-{
- public function testConstructor()
- {
- $argument = new InputArgument('foo');
- $this->assertEquals('foo', $argument->getName(), '__construct() takes a name as its first argument');
- }
-
- public function testModes()
- {
- $argument = new InputArgument('foo');
- $this->assertFalse($argument->isRequired(), '__construct() gives a "InputArgument::OPTIONAL" mode by default');
-
- $argument = new InputArgument('foo', null);
- $this->assertFalse($argument->isRequired(), '__construct() can take "InputArgument::OPTIONAL" as its mode');
-
- $argument = new InputArgument('foo', InputArgument::OPTIONAL);
- $this->assertFalse($argument->isRequired(), '__construct() can take "InputArgument::OPTIONAL" as its mode');
-
- $argument = new InputArgument('foo', InputArgument::REQUIRED);
- $this->assertTrue($argument->isRequired(), '__construct() can take "InputArgument::REQUIRED" as its mode');
- }
-
- /**
- * @expectedException \InvalidArgumentException
- * @expectedExceptionMessage Argument mode "-1" is not valid.
- */
- public function testInvalidModes()
- {
- new InputArgument('foo', '-1');
- }
-
- public function testIsArray()
- {
- $argument = new InputArgument('foo', InputArgument::IS_ARRAY);
- $this->assertTrue($argument->isArray(), '->isArray() returns true if the argument can be an array');
- $argument = new InputArgument('foo', InputArgument::OPTIONAL | InputArgument::IS_ARRAY);
- $this->assertTrue($argument->isArray(), '->isArray() returns true if the argument can be an array');
- $argument = new InputArgument('foo', InputArgument::OPTIONAL);
- $this->assertFalse($argument->isArray(), '->isArray() returns false if the argument can not be an array');
- }
-
- public function testGetDescription()
- {
- $argument = new InputArgument('foo', null, 'Some description');
- $this->assertEquals('Some description', $argument->getDescription(), '->getDescription() return the message description');
- }
-
- public function testGetDefault()
- {
- $argument = new InputArgument('foo', InputArgument::OPTIONAL, '', 'default');
- $this->assertEquals('default', $argument->getDefault(), '->getDefault() return the default value');
- }
-
- public function testSetDefault()
- {
- $argument = new InputArgument('foo', InputArgument::OPTIONAL, '', 'default');
- $argument->setDefault(null);
- $this->assertNull($argument->getDefault(), '->setDefault() can reset the default value by passing null');
- $argument->setDefault('another');
- $this->assertEquals('another', $argument->getDefault(), '->setDefault() changes the default value');
-
- $argument = new InputArgument('foo', InputArgument::OPTIONAL | InputArgument::IS_ARRAY);
- $argument->setDefault([1, 2]);
- $this->assertEquals([1, 2], $argument->getDefault(), '->setDefault() changes the default value');
- }
-
- /**
- * @expectedException \LogicException
- * @expectedExceptionMessage Cannot set a default value except for InputArgument::OPTIONAL mode.
- */
- public function testSetDefaultWithRequiredArgument()
- {
- $argument = new InputArgument('foo', InputArgument::REQUIRED);
- $argument->setDefault('default');
- }
-
- /**
- * @expectedException \LogicException
- * @expectedExceptionMessage A default value for an array argument must be an array.
- */
- public function testSetDefaultWithArrayArgument()
- {
- $argument = new InputArgument('foo', InputArgument::IS_ARRAY);
- $argument->setDefault('default');
- }
-}
diff --git a/vendor/symfony/console/Tests/Input/InputDefinitionTest.php b/vendor/symfony/console/Tests/Input/InputDefinitionTest.php
deleted file mode 100644
index aca004d53..000000000
--- a/vendor/symfony/console/Tests/Input/InputDefinitionTest.php
+++ /dev/null
@@ -1,407 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Console\Tests\Input;
-
-use PHPUnit\Framework\TestCase;
-use Symfony\Component\Console\Input\InputArgument;
-use Symfony\Component\Console\Input\InputDefinition;
-use Symfony\Component\Console\Input\InputOption;
-
-class InputDefinitionTest extends TestCase
-{
- protected static $fixtures;
-
- protected $foo;
- protected $bar;
- protected $foo1;
- protected $foo2;
-
- public static function setUpBeforeClass()
- {
- self::$fixtures = __DIR__.'/../Fixtures/';
- }
-
- public function testConstructorArguments()
- {
- $this->initializeArguments();
-
- $definition = new InputDefinition();
- $this->assertEquals([], $definition->getArguments(), '__construct() creates a new InputDefinition object');
-
- $definition = new InputDefinition([$this->foo, $this->bar]);
- $this->assertEquals(['foo' => $this->foo, 'bar' => $this->bar], $definition->getArguments(), '__construct() takes an array of InputArgument objects as its first argument');
- }
-
- public function testConstructorOptions()
- {
- $this->initializeOptions();
-
- $definition = new InputDefinition();
- $this->assertEquals([], $definition->getOptions(), '__construct() creates a new InputDefinition object');
-
- $definition = new InputDefinition([$this->foo, $this->bar]);
- $this->assertEquals(['foo' => $this->foo, 'bar' => $this->bar], $definition->getOptions(), '__construct() takes an array of InputOption objects as its first argument');
- }
-
- public function testSetArguments()
- {
- $this->initializeArguments();
-
- $definition = new InputDefinition();
- $definition->setArguments([$this->foo]);
- $this->assertEquals(['foo' => $this->foo], $definition->getArguments(), '->setArguments() sets the array of InputArgument objects');
- $definition->setArguments([$this->bar]);
-
- $this->assertEquals(['bar' => $this->bar], $definition->getArguments(), '->setArguments() clears all InputArgument objects');
- }
-
- public function testAddArguments()
- {
- $this->initializeArguments();
-
- $definition = new InputDefinition();
- $definition->addArguments([$this->foo]);
- $this->assertEquals(['foo' => $this->foo], $definition->getArguments(), '->addArguments() adds an array of InputArgument objects');
- $definition->addArguments([$this->bar]);
- $this->assertEquals(['foo' => $this->foo, 'bar' => $this->bar], $definition->getArguments(), '->addArguments() does not clear existing InputArgument objects');
- }
-
- public function testAddArgument()
- {
- $this->initializeArguments();
-
- $definition = new InputDefinition();
- $definition->addArgument($this->foo);
- $this->assertEquals(['foo' => $this->foo], $definition->getArguments(), '->addArgument() adds a InputArgument object');
- $definition->addArgument($this->bar);
- $this->assertEquals(['foo' => $this->foo, 'bar' => $this->bar], $definition->getArguments(), '->addArgument() adds a InputArgument object');
- }
-
- /**
- * @expectedException \LogicException
- * @expectedExceptionMessage An argument with name "foo" already exists.
- */
- public function testArgumentsMustHaveDifferentNames()
- {
- $this->initializeArguments();
-
- $definition = new InputDefinition();
- $definition->addArgument($this->foo);
- $definition->addArgument($this->foo1);
- }
-
- /**
- * @expectedException \LogicException
- * @expectedExceptionMessage Cannot add an argument after an array argument.
- */
- public function testArrayArgumentHasToBeLast()
- {
- $this->initializeArguments();
-
- $definition = new InputDefinition();
- $definition->addArgument(new InputArgument('fooarray', InputArgument::IS_ARRAY));
- $definition->addArgument(new InputArgument('anotherbar'));
- }
-
- /**
- * @expectedException \LogicException
- * @expectedExceptionMessage Cannot add a required argument after an optional one.
- */
- public function testRequiredArgumentCannotFollowAnOptionalOne()
- {
- $this->initializeArguments();
-
- $definition = new InputDefinition();
- $definition->addArgument($this->foo);
- $definition->addArgument($this->foo2);
- }
-
- public function testGetArgument()
- {
- $this->initializeArguments();
-
- $definition = new InputDefinition();
- $definition->addArguments([$this->foo]);
- $this->assertEquals($this->foo, $definition->getArgument('foo'), '->getArgument() returns a InputArgument by its name');
- }
-
- /**
- * @expectedException \InvalidArgumentException
- * @expectedExceptionMessage The "bar" argument does not exist.
- */
- public function testGetInvalidArgument()
- {
- $this->initializeArguments();
-
- $definition = new InputDefinition();
- $definition->addArguments([$this->foo]);
- $definition->getArgument('bar');
- }
-
- public function testHasArgument()
- {
- $this->initializeArguments();
-
- $definition = new InputDefinition();
- $definition->addArguments([$this->foo]);
-
- $this->assertTrue($definition->hasArgument('foo'), '->hasArgument() returns true if a InputArgument exists for the given name');
- $this->assertFalse($definition->hasArgument('bar'), '->hasArgument() returns false if a InputArgument exists for the given name');
- }
-
- public function testGetArgumentRequiredCount()
- {
- $this->initializeArguments();
-
- $definition = new InputDefinition();
- $definition->addArgument($this->foo2);
- $this->assertEquals(1, $definition->getArgumentRequiredCount(), '->getArgumentRequiredCount() returns the number of required arguments');
- $definition->addArgument($this->foo);
- $this->assertEquals(1, $definition->getArgumentRequiredCount(), '->getArgumentRequiredCount() returns the number of required arguments');
- }
-
- public function testGetArgumentCount()
- {
- $this->initializeArguments();
-
- $definition = new InputDefinition();
- $definition->addArgument($this->foo2);
- $this->assertEquals(1, $definition->getArgumentCount(), '->getArgumentCount() returns the number of arguments');
- $definition->addArgument($this->foo);
- $this->assertEquals(2, $definition->getArgumentCount(), '->getArgumentCount() returns the number of arguments');
- }
-
- public function testGetArgumentDefaults()
- {
- $definition = new InputDefinition([
- new InputArgument('foo1', InputArgument::OPTIONAL),
- new InputArgument('foo2', InputArgument::OPTIONAL, '', 'default'),
- new InputArgument('foo3', InputArgument::OPTIONAL | InputArgument::IS_ARRAY),
- // new InputArgument('foo4', InputArgument::OPTIONAL | InputArgument::IS_ARRAY, '', [1, 2]),
- ]);
- $this->assertEquals(['foo1' => null, 'foo2' => 'default', 'foo3' => []], $definition->getArgumentDefaults(), '->getArgumentDefaults() return the default values for each argument');
-
- $definition = new InputDefinition([
- new InputArgument('foo4', InputArgument::OPTIONAL | InputArgument::IS_ARRAY, '', [1, 2]),
- ]);
- $this->assertEquals(['foo4' => [1, 2]], $definition->getArgumentDefaults(), '->getArgumentDefaults() return the default values for each argument');
- }
-
- public function testSetOptions()
- {
- $this->initializeOptions();
-
- $definition = new InputDefinition([$this->foo]);
- $this->assertEquals(['foo' => $this->foo], $definition->getOptions(), '->setOptions() sets the array of InputOption objects');
- $definition->setOptions([$this->bar]);
- $this->assertEquals(['bar' => $this->bar], $definition->getOptions(), '->setOptions() clears all InputOption objects');
- }
-
- /**
- * @expectedException \InvalidArgumentException
- * @expectedExceptionMessage The "-f" option does not exist.
- */
- public function testSetOptionsClearsOptions()
- {
- $this->initializeOptions();
-
- $definition = new InputDefinition([$this->foo]);
- $definition->setOptions([$this->bar]);
- $definition->getOptionForShortcut('f');
- }
-
- public function testAddOptions()
- {
- $this->initializeOptions();
-
- $definition = new InputDefinition([$this->foo]);
- $this->assertEquals(['foo' => $this->foo], $definition->getOptions(), '->addOptions() adds an array of InputOption objects');
- $definition->addOptions([$this->bar]);
- $this->assertEquals(['foo' => $this->foo, 'bar' => $this->bar], $definition->getOptions(), '->addOptions() does not clear existing InputOption objects');
- }
-
- public function testAddOption()
- {
- $this->initializeOptions();
-
- $definition = new InputDefinition();
- $definition->addOption($this->foo);
- $this->assertEquals(['foo' => $this->foo], $definition->getOptions(), '->addOption() adds a InputOption object');
- $definition->addOption($this->bar);
- $this->assertEquals(['foo' => $this->foo, 'bar' => $this->bar], $definition->getOptions(), '->addOption() adds a InputOption object');
- }
-
- /**
- * @expectedException \LogicException
- * @expectedExceptionMessage An option named "foo" already exists.
- */
- public function testAddDuplicateOption()
- {
- $this->initializeOptions();
-
- $definition = new InputDefinition();
- $definition->addOption($this->foo);
- $definition->addOption($this->foo2);
- }
-
- /**
- * @expectedException \LogicException
- * @expectedExceptionMessage An option with shortcut "f" already exists.
- */
- public function testAddDuplicateShortcutOption()
- {
- $this->initializeOptions();
-
- $definition = new InputDefinition();
- $definition->addOption($this->foo);
- $definition->addOption($this->foo1);
- }
-
- public function testGetOption()
- {
- $this->initializeOptions();
-
- $definition = new InputDefinition([$this->foo]);
- $this->assertEquals($this->foo, $definition->getOption('foo'), '->getOption() returns a InputOption by its name');
- }
-
- /**
- * @expectedException \InvalidArgumentException
- * @expectedExceptionMessage The "--bar" option does not exist.
- */
- public function testGetInvalidOption()
- {
- $this->initializeOptions();
-
- $definition = new InputDefinition([$this->foo]);
- $definition->getOption('bar');
- }
-
- public function testHasOption()
- {
- $this->initializeOptions();
-
- $definition = new InputDefinition([$this->foo]);
- $this->assertTrue($definition->hasOption('foo'), '->hasOption() returns true if a InputOption exists for the given name');
- $this->assertFalse($definition->hasOption('bar'), '->hasOption() returns false if a InputOption exists for the given name');
- }
-
- public function testHasShortcut()
- {
- $this->initializeOptions();
-
- $definition = new InputDefinition([$this->foo]);
- $this->assertTrue($definition->hasShortcut('f'), '->hasShortcut() returns true if a InputOption exists for the given shortcut');
- $this->assertFalse($definition->hasShortcut('b'), '->hasShortcut() returns false if a InputOption exists for the given shortcut');
- }
-
- public function testGetOptionForShortcut()
- {
- $this->initializeOptions();
-
- $definition = new InputDefinition([$this->foo]);
- $this->assertEquals($this->foo, $definition->getOptionForShortcut('f'), '->getOptionForShortcut() returns a InputOption by its shortcut');
- }
-
- public function testGetOptionForMultiShortcut()
- {
- $this->initializeOptions();
-
- $definition = new InputDefinition([$this->multi]);
- $this->assertEquals($this->multi, $definition->getOptionForShortcut('m'), '->getOptionForShortcut() returns a InputOption by its shortcut');
- $this->assertEquals($this->multi, $definition->getOptionForShortcut('mmm'), '->getOptionForShortcut() returns a InputOption by its shortcut');
- }
-
- /**
- * @expectedException \InvalidArgumentException
- * @expectedExceptionMessage The "-l" option does not exist.
- */
- public function testGetOptionForInvalidShortcut()
- {
- $this->initializeOptions();
-
- $definition = new InputDefinition([$this->foo]);
- $definition->getOptionForShortcut('l');
- }
-
- public function testGetOptionDefaults()
- {
- $definition = new InputDefinition([
- new InputOption('foo1', null, InputOption::VALUE_NONE),
- new InputOption('foo2', null, InputOption::VALUE_REQUIRED),
- new InputOption('foo3', null, InputOption::VALUE_REQUIRED, '', 'default'),
- new InputOption('foo4', null, InputOption::VALUE_OPTIONAL),
- new InputOption('foo5', null, InputOption::VALUE_OPTIONAL, '', 'default'),
- new InputOption('foo6', null, InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY),
- new InputOption('foo7', null, InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, '', [1, 2]),
- ]);
- $defaults = [
- 'foo1' => false,
- 'foo2' => null,
- 'foo3' => 'default',
- 'foo4' => null,
- 'foo5' => 'default',
- 'foo6' => [],
- 'foo7' => [1, 2],
- ];
- $this->assertSame($defaults, $definition->getOptionDefaults(), '->getOptionDefaults() returns the default values for all options');
- }
-
- /**
- * @dataProvider getGetSynopsisData
- */
- public function testGetSynopsis(InputDefinition $definition, $expectedSynopsis, $message = null)
- {
- $this->assertEquals($expectedSynopsis, $definition->getSynopsis(), $message ? '->getSynopsis() '.$message : '');
- }
-
- public function getGetSynopsisData()
- {
- return [
- [new InputDefinition([new InputOption('foo')]), '[--foo]', 'puts optional options in square brackets'],
- [new InputDefinition([new InputOption('foo', 'f')]), '[-f|--foo]', 'separates shortcut with a pipe'],
- [new InputDefinition([new InputOption('foo', 'f', InputOption::VALUE_REQUIRED)]), '[-f|--foo FOO]', 'uses shortcut as value placeholder'],
- [new InputDefinition([new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL)]), '[-f|--foo [FOO]]', 'puts optional values in square brackets'],
-
- [new InputDefinition([new InputArgument('foo', InputArgument::REQUIRED)]), '', 'puts arguments in angle brackets'],
- [new InputDefinition([new InputArgument('foo')]), '[]', 'puts optional arguments in square brackets'],
- [new InputDefinition([new InputArgument('foo'), new InputArgument('bar')]), '[ []]', 'chains optional arguments inside brackets'],
- [new InputDefinition([new InputArgument('foo', InputArgument::IS_ARRAY)]), '[...]', 'uses an ellipsis for array arguments'],
- [new InputDefinition([new InputArgument('foo', InputArgument::REQUIRED | InputArgument::IS_ARRAY)]), '...', 'uses an ellipsis for required array arguments'],
-
- [new InputDefinition([new InputOption('foo'), new InputArgument('foo', InputArgument::REQUIRED)]), '[--foo] [--] ', 'puts [--] between options and arguments'],
- ];
- }
-
- public function testGetShortSynopsis()
- {
- $definition = new InputDefinition([new InputOption('foo'), new InputOption('bar'), new InputArgument('cat')]);
- $this->assertEquals('[options] [--] []', $definition->getSynopsis(true), '->getSynopsis(true) groups options in [options]');
- }
-
- protected function initializeArguments()
- {
- $this->foo = new InputArgument('foo');
- $this->bar = new InputArgument('bar');
- $this->foo1 = new InputArgument('foo');
- $this->foo2 = new InputArgument('foo2', InputArgument::REQUIRED);
- }
-
- protected function initializeOptions()
- {
- $this->foo = new InputOption('foo', 'f');
- $this->bar = new InputOption('bar', 'b');
- $this->foo1 = new InputOption('fooBis', 'f');
- $this->foo2 = new InputOption('foo', 'p');
- $this->multi = new InputOption('multi', 'm|mm|mmm');
- }
-}
diff --git a/vendor/symfony/console/Tests/Input/InputOptionTest.php b/vendor/symfony/console/Tests/Input/InputOptionTest.php
deleted file mode 100644
index ad1c043ed..000000000
--- a/vendor/symfony/console/Tests/Input/InputOptionTest.php
+++ /dev/null
@@ -1,196 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Console\Tests\Input;
-
-use PHPUnit\Framework\TestCase;
-use Symfony\Component\Console\Input\InputOption;
-
-class InputOptionTest extends TestCase
-{
- public function testConstructor()
- {
- $option = new InputOption('foo');
- $this->assertEquals('foo', $option->getName(), '__construct() takes a name as its first argument');
- $option = new InputOption('--foo');
- $this->assertEquals('foo', $option->getName(), '__construct() removes the leading -- of the option name');
- }
-
- /**
- * @expectedException \InvalidArgumentException
- * @expectedExceptionMessage Impossible to have an option mode VALUE_IS_ARRAY if the option does not accept a value.
- */
- public function testArrayModeWithoutValue()
- {
- new InputOption('foo', 'f', InputOption::VALUE_IS_ARRAY);
- }
-
- public function testShortcut()
- {
- $option = new InputOption('foo', 'f');
- $this->assertEquals('f', $option->getShortcut(), '__construct() can take a shortcut as its second argument');
- $option = new InputOption('foo', '-f|-ff|fff');
- $this->assertEquals('f|ff|fff', $option->getShortcut(), '__construct() removes the leading - of the shortcuts');
- $option = new InputOption('foo', ['f', 'ff', '-fff']);
- $this->assertEquals('f|ff|fff', $option->getShortcut(), '__construct() removes the leading - of the shortcuts');
- $option = new InputOption('foo');
- $this->assertNull($option->getShortcut(), '__construct() makes the shortcut null by default');
- }
-
- public function testModes()
- {
- $option = new InputOption('foo', 'f');
- $this->assertFalse($option->acceptValue(), '__construct() gives a "InputOption::VALUE_NONE" mode by default');
- $this->assertFalse($option->isValueRequired(), '__construct() gives a "InputOption::VALUE_NONE" mode by default');
- $this->assertFalse($option->isValueOptional(), '__construct() gives a "InputOption::VALUE_NONE" mode by default');
-
- $option = new InputOption('foo', 'f', null);
- $this->assertFalse($option->acceptValue(), '__construct() can take "InputOption::VALUE_NONE" as its mode');
- $this->assertFalse($option->isValueRequired(), '__construct() can take "InputOption::VALUE_NONE" as its mode');
- $this->assertFalse($option->isValueOptional(), '__construct() can take "InputOption::VALUE_NONE" as its mode');
-
- $option = new InputOption('foo', 'f', InputOption::VALUE_NONE);
- $this->assertFalse($option->acceptValue(), '__construct() can take "InputOption::VALUE_NONE" as its mode');
- $this->assertFalse($option->isValueRequired(), '__construct() can take "InputOption::VALUE_NONE" as its mode');
- $this->assertFalse($option->isValueOptional(), '__construct() can take "InputOption::VALUE_NONE" as its mode');
-
- $option = new InputOption('foo', 'f', InputOption::VALUE_REQUIRED);
- $this->assertTrue($option->acceptValue(), '__construct() can take "InputOption::VALUE_REQUIRED" as its mode');
- $this->assertTrue($option->isValueRequired(), '__construct() can take "InputOption::VALUE_REQUIRED" as its mode');
- $this->assertFalse($option->isValueOptional(), '__construct() can take "InputOption::VALUE_REQUIRED" as its mode');
-
- $option = new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL);
- $this->assertTrue($option->acceptValue(), '__construct() can take "InputOption::VALUE_OPTIONAL" as its mode');
- $this->assertFalse($option->isValueRequired(), '__construct() can take "InputOption::VALUE_OPTIONAL" as its mode');
- $this->assertTrue($option->isValueOptional(), '__construct() can take "InputOption::VALUE_OPTIONAL" as its mode');
- }
-
- /**
- * @expectedException \InvalidArgumentException
- * @expectedExceptionMessage Option mode "-1" is not valid.
- */
- public function testInvalidModes()
- {
- new InputOption('foo', 'f', '-1');
- }
-
- /**
- * @expectedException \InvalidArgumentException
- */
- public function testEmptyNameIsInvalid()
- {
- new InputOption('');
- }
-
- /**
- * @expectedException \InvalidArgumentException
- */
- public function testDoubleDashNameIsInvalid()
- {
- new InputOption('--');
- }
-
- /**
- * @expectedException \InvalidArgumentException
- */
- public function testSingleDashOptionIsInvalid()
- {
- new InputOption('foo', '-');
- }
-
- public function testIsArray()
- {
- $option = new InputOption('foo', null, InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY);
- $this->assertTrue($option->isArray(), '->isArray() returns true if the option can be an array');
- $option = new InputOption('foo', null, InputOption::VALUE_NONE);
- $this->assertFalse($option->isArray(), '->isArray() returns false if the option can not be an array');
- }
-
- public function testGetDescription()
- {
- $option = new InputOption('foo', 'f', null, 'Some description');
- $this->assertEquals('Some description', $option->getDescription(), '->getDescription() returns the description message');
- }
-
- public function testGetDefault()
- {
- $option = new InputOption('foo', null, InputOption::VALUE_OPTIONAL, '', 'default');
- $this->assertEquals('default', $option->getDefault(), '->getDefault() returns the default value');
-
- $option = new InputOption('foo', null, InputOption::VALUE_REQUIRED, '', 'default');
- $this->assertEquals('default', $option->getDefault(), '->getDefault() returns the default value');
-
- $option = new InputOption('foo', null, InputOption::VALUE_REQUIRED);
- $this->assertNull($option->getDefault(), '->getDefault() returns null if no default value is configured');
-
- $option = new InputOption('foo', null, InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY);
- $this->assertEquals([], $option->getDefault(), '->getDefault() returns an empty array if option is an array');
-
- $option = new InputOption('foo', null, InputOption::VALUE_NONE);
- $this->assertFalse($option->getDefault(), '->getDefault() returns false if the option does not take a value');
- }
-
- public function testSetDefault()
- {
- $option = new InputOption('foo', null, InputOption::VALUE_REQUIRED, '', 'default');
- $option->setDefault(null);
- $this->assertNull($option->getDefault(), '->setDefault() can reset the default value by passing null');
- $option->setDefault('another');
- $this->assertEquals('another', $option->getDefault(), '->setDefault() changes the default value');
-
- $option = new InputOption('foo', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY);
- $option->setDefault([1, 2]);
- $this->assertEquals([1, 2], $option->getDefault(), '->setDefault() changes the default value');
- }
-
- /**
- * @expectedException \LogicException
- * @expectedExceptionMessage Cannot set a default value when using InputOption::VALUE_NONE mode.
- */
- public function testDefaultValueWithValueNoneMode()
- {
- $option = new InputOption('foo', 'f', InputOption::VALUE_NONE);
- $option->setDefault('default');
- }
-
- /**
- * @expectedException \LogicException
- * @expectedExceptionMessage A default value for an array option must be an array.
- */
- public function testDefaultValueWithIsArrayMode()
- {
- $option = new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY);
- $option->setDefault('default');
- }
-
- public function testEquals()
- {
- $option = new InputOption('foo', 'f', null, 'Some description');
- $option2 = new InputOption('foo', 'f', null, 'Alternative description');
- $this->assertTrue($option->equals($option2));
-
- $option = new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL, 'Some description');
- $option2 = new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL, 'Some description', true);
- $this->assertFalse($option->equals($option2));
-
- $option = new InputOption('foo', 'f', null, 'Some description');
- $option2 = new InputOption('bar', 'f', null, 'Some description');
- $this->assertFalse($option->equals($option2));
-
- $option = new InputOption('foo', 'f', null, 'Some description');
- $option2 = new InputOption('foo', '', null, 'Some description');
- $this->assertFalse($option->equals($option2));
-
- $option = new InputOption('foo', 'f', null, 'Some description');
- $option2 = new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL, 'Some description');
- $this->assertFalse($option->equals($option2));
- }
-}
diff --git a/vendor/symfony/console/Tests/Input/InputTest.php b/vendor/symfony/console/Tests/Input/InputTest.php
deleted file mode 100644
index 61608bf27..000000000
--- a/vendor/symfony/console/Tests/Input/InputTest.php
+++ /dev/null
@@ -1,149 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Console\Tests\Input;
-
-use PHPUnit\Framework\TestCase;
-use Symfony\Component\Console\Input\ArrayInput;
-use Symfony\Component\Console\Input\InputArgument;
-use Symfony\Component\Console\Input\InputDefinition;
-use Symfony\Component\Console\Input\InputOption;
-
-class InputTest extends TestCase
-{
- public function testConstructor()
- {
- $input = new ArrayInput(['name' => 'foo'], new InputDefinition([new InputArgument('name')]));
- $this->assertEquals('foo', $input->getArgument('name'), '->__construct() takes a InputDefinition as an argument');
- }
-
- public function testOptions()
- {
- $input = new ArrayInput(['--name' => 'foo'], new InputDefinition([new InputOption('name')]));
- $this->assertEquals('foo', $input->getOption('name'), '->getOption() returns the value for the given option');
-
- $input->setOption('name', 'bar');
- $this->assertEquals('bar', $input->getOption('name'), '->setOption() sets the value for a given option');
- $this->assertEquals(['name' => 'bar'], $input->getOptions(), '->getOptions() returns all option values');
-
- $input = new ArrayInput(['--name' => 'foo'], new InputDefinition([new InputOption('name'), new InputOption('bar', '', InputOption::VALUE_OPTIONAL, '', 'default')]));
- $this->assertEquals('default', $input->getOption('bar'), '->getOption() returns the default value for optional options');
- $this->assertEquals(['name' => 'foo', 'bar' => 'default'], $input->getOptions(), '->getOptions() returns all option values, even optional ones');
-
- $input = new ArrayInput(['--name' => 'foo', '--bar' => ''], new InputDefinition([new InputOption('name'), new InputOption('bar', '', InputOption::VALUE_OPTIONAL, '', 'default')]));
- $this->assertEquals('', $input->getOption('bar'), '->getOption() returns null for options explicitly passed without value (or an empty value)');
- $this->assertEquals(['name' => 'foo', 'bar' => ''], $input->getOptions(), '->getOptions() returns all option values.');
-
- $input = new ArrayInput(['--name' => 'foo', '--bar' => null], new InputDefinition([new InputOption('name'), new InputOption('bar', '', InputOption::VALUE_OPTIONAL, '', 'default')]));
- $this->assertNull($input->getOption('bar'), '->getOption() returns null for options explicitly passed without value (or an empty value)');
- $this->assertEquals(['name' => 'foo', 'bar' => null], $input->getOptions(), '->getOptions() returns all option values');
- }
-
- /**
- * @expectedException \InvalidArgumentException
- * @expectedExceptionMessage The "foo" option does not exist.
- */
- public function testSetInvalidOption()
- {
- $input = new ArrayInput(['--name' => 'foo'], new InputDefinition([new InputOption('name'), new InputOption('bar', '', InputOption::VALUE_OPTIONAL, '', 'default')]));
- $input->setOption('foo', 'bar');
- }
-
- /**
- * @expectedException \InvalidArgumentException
- * @expectedExceptionMessage The "foo" option does not exist.
- */
- public function testGetInvalidOption()
- {
- $input = new ArrayInput(['--name' => 'foo'], new InputDefinition([new InputOption('name'), new InputOption('bar', '', InputOption::VALUE_OPTIONAL, '', 'default')]));
- $input->getOption('foo');
- }
-
- public function testArguments()
- {
- $input = new ArrayInput(['name' => 'foo'], new InputDefinition([new InputArgument('name')]));
- $this->assertEquals('foo', $input->getArgument('name'), '->getArgument() returns the value for the given argument');
-
- $input->setArgument('name', 'bar');
- $this->assertEquals('bar', $input->getArgument('name'), '->setArgument() sets the value for a given argument');
- $this->assertEquals(['name' => 'bar'], $input->getArguments(), '->getArguments() returns all argument values');
-
- $input = new ArrayInput(['name' => 'foo'], new InputDefinition([new InputArgument('name'), new InputArgument('bar', InputArgument::OPTIONAL, '', 'default')]));
- $this->assertEquals('default', $input->getArgument('bar'), '->getArgument() returns the default value for optional arguments');
- $this->assertEquals(['name' => 'foo', 'bar' => 'default'], $input->getArguments(), '->getArguments() returns all argument values, even optional ones');
- }
-
- /**
- * @expectedException \InvalidArgumentException
- * @expectedExceptionMessage The "foo" argument does not exist.
- */
- public function testSetInvalidArgument()
- {
- $input = new ArrayInput(['name' => 'foo'], new InputDefinition([new InputArgument('name'), new InputArgument('bar', InputArgument::OPTIONAL, '', 'default')]));
- $input->setArgument('foo', 'bar');
- }
-
- /**
- * @expectedException \InvalidArgumentException
- * @expectedExceptionMessage The "foo" argument does not exist.
- */
- public function testGetInvalidArgument()
- {
- $input = new ArrayInput(['name' => 'foo'], new InputDefinition([new InputArgument('name'), new InputArgument('bar', InputArgument::OPTIONAL, '', 'default')]));
- $input->getArgument('foo');
- }
-
- /**
- * @expectedException \RuntimeException
- * @expectedExceptionMessage Not enough arguments (missing: "name").
- */
- public function testValidateWithMissingArguments()
- {
- $input = new ArrayInput([]);
- $input->bind(new InputDefinition([new InputArgument('name', InputArgument::REQUIRED)]));
- $input->validate();
- }
-
- /**
- * @expectedException \RuntimeException
- * @expectedExceptionMessage Not enough arguments (missing: "name").
- */
- public function testValidateWithMissingRequiredArguments()
- {
- $input = new ArrayInput(['bar' => 'baz']);
- $input->bind(new InputDefinition([new InputArgument('name', InputArgument::REQUIRED), new InputArgument('bar', InputArgument::OPTIONAL)]));
- $input->validate();
- }
-
- public function testValidate()
- {
- $input = new ArrayInput(['name' => 'foo']);
- $input->bind(new InputDefinition([new InputArgument('name', InputArgument::REQUIRED)]));
-
- $this->assertNull($input->validate());
- }
-
- public function testSetGetInteractive()
- {
- $input = new ArrayInput([]);
- $this->assertTrue($input->isInteractive(), '->isInteractive() returns whether the input should be interactive or not');
- $input->setInteractive(false);
- $this->assertFalse($input->isInteractive(), '->setInteractive() changes the interactive flag');
- }
-
- public function testSetGetStream()
- {
- $input = new ArrayInput([]);
- $stream = fopen('php://memory', 'r+', false);
- $input->setStream($stream);
- $this->assertSame($stream, $input->getStream());
- }
-}
diff --git a/vendor/symfony/console/Tests/Input/StringInputTest.php b/vendor/symfony/console/Tests/Input/StringInputTest.php
deleted file mode 100644
index 7f2189452..000000000
--- a/vendor/symfony/console/Tests/Input/StringInputTest.php
+++ /dev/null
@@ -1,87 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Console\Tests\Input;
-
-use PHPUnit\Framework\TestCase;
-use Symfony\Component\Console\Input\InputDefinition;
-use Symfony\Component\Console\Input\InputOption;
-use Symfony\Component\Console\Input\StringInput;
-
-class StringInputTest extends TestCase
-{
- /**
- * @dataProvider getTokenizeData
- */
- public function testTokenize($input, $tokens, $message)
- {
- $input = new StringInput($input);
- $r = new \ReflectionClass('Symfony\Component\Console\Input\ArgvInput');
- $p = $r->getProperty('tokens');
- $p->setAccessible(true);
- $this->assertEquals($tokens, $p->getValue($input), $message);
- }
-
- public function testInputOptionWithGivenString()
- {
- $definition = new InputDefinition(
- [new InputOption('foo', null, InputOption::VALUE_REQUIRED)]
- );
-
- // call to bind
- $input = new StringInput('--foo=bar');
- $input->bind($definition);
- $this->assertEquals('bar', $input->getOption('foo'));
- }
-
- public function getTokenizeData()
- {
- return [
- ['', [], '->tokenize() parses an empty string'],
- ['foo', ['foo'], '->tokenize() parses arguments'],
- [' foo bar ', ['foo', 'bar'], '->tokenize() ignores whitespaces between arguments'],
- ['"quoted"', ['quoted'], '->tokenize() parses quoted arguments'],
- ["'quoted'", ['quoted'], '->tokenize() parses quoted arguments'],
- ["'a\rb\nc\td'", ["a\rb\nc\td"], '->tokenize() parses whitespace chars in strings'],
- ["'a'\r'b'\n'c'\t'd'", ['a', 'b', 'c', 'd'], '->tokenize() parses whitespace chars between args as spaces'],
- ['\"quoted\"', ['"quoted"'], '->tokenize() parses escaped-quoted arguments'],
- ["\'quoted\'", ['\'quoted\''], '->tokenize() parses escaped-quoted arguments'],
- ['-a', ['-a'], '->tokenize() parses short options'],
- ['-azc', ['-azc'], '->tokenize() parses aggregated short options'],
- ['-awithavalue', ['-awithavalue'], '->tokenize() parses short options with a value'],
- ['-a"foo bar"', ['-afoo bar'], '->tokenize() parses short options with a value'],
- ['-a"foo bar""foo bar"', ['-afoo barfoo bar'], '->tokenize() parses short options with a value'],
- ['-a\'foo bar\'', ['-afoo bar'], '->tokenize() parses short options with a value'],
- ['-a\'foo bar\'\'foo bar\'', ['-afoo barfoo bar'], '->tokenize() parses short options with a value'],
- ['-a\'foo bar\'"foo bar"', ['-afoo barfoo bar'], '->tokenize() parses short options with a value'],
- ['--long-option', ['--long-option'], '->tokenize() parses long options'],
- ['--long-option=foo', ['--long-option=foo'], '->tokenize() parses long options with a value'],
- ['--long-option="foo bar"', ['--long-option=foo bar'], '->tokenize() parses long options with a value'],
- ['--long-option="foo bar""another"', ['--long-option=foo baranother'], '->tokenize() parses long options with a value'],
- ['--long-option=\'foo bar\'', ['--long-option=foo bar'], '->tokenize() parses long options with a value'],
- ["--long-option='foo bar''another'", ['--long-option=foo baranother'], '->tokenize() parses long options with a value'],
- ["--long-option='foo bar'\"another\"", ['--long-option=foo baranother'], '->tokenize() parses long options with a value'],
- ['foo -a -ffoo --long bar', ['foo', '-a', '-ffoo', '--long', 'bar'], '->tokenize() parses when several arguments and options'],
- ];
- }
-
- public function testToString()
- {
- $input = new StringInput('-f foo');
- $this->assertEquals('-f foo', (string) $input);
-
- $input = new StringInput('-f --bar=foo "a b c d"');
- $this->assertEquals('-f --bar=foo '.escapeshellarg('a b c d'), (string) $input);
-
- $input = new StringInput('-f --bar=foo \'a b c d\' '."'A\nB\\'C'");
- $this->assertEquals('-f --bar=foo '.escapeshellarg('a b c d').' '.escapeshellarg("A\nB'C"), (string) $input);
- }
-}
diff --git a/vendor/symfony/console/Tests/Logger/ConsoleLoggerTest.php b/vendor/symfony/console/Tests/Logger/ConsoleLoggerTest.php
deleted file mode 100644
index c99eb839b..000000000
--- a/vendor/symfony/console/Tests/Logger/ConsoleLoggerTest.php
+++ /dev/null
@@ -1,215 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Console\Tests\Logger;
-
-use PHPUnit\Framework\TestCase;
-use Psr\Log\LoggerInterface;
-use Psr\Log\LogLevel;
-use Symfony\Component\Console\Logger\ConsoleLogger;
-use Symfony\Component\Console\Output\BufferedOutput;
-use Symfony\Component\Console\Output\OutputInterface;
-use Symfony\Component\Console\Tests\Fixtures\DummyOutput;
-
-/**
- * Console logger test.
- *
- * @author Kévin Dunglas
- * @author Jordi Boggiano
- */
-class ConsoleLoggerTest extends TestCase
-{
- /**
- * @var DummyOutput
- */
- protected $output;
-
- /**
- * @return LoggerInterface
- */
- public function getLogger()
- {
- $this->output = new DummyOutput(OutputInterface::VERBOSITY_VERBOSE);
-
- return new ConsoleLogger($this->output, [
- LogLevel::EMERGENCY => OutputInterface::VERBOSITY_NORMAL,
- LogLevel::ALERT => OutputInterface::VERBOSITY_NORMAL,
- LogLevel::CRITICAL => OutputInterface::VERBOSITY_NORMAL,
- LogLevel::ERROR => OutputInterface::VERBOSITY_NORMAL,
- LogLevel::WARNING => OutputInterface::VERBOSITY_NORMAL,
- LogLevel::NOTICE => OutputInterface::VERBOSITY_NORMAL,
- LogLevel::INFO => OutputInterface::VERBOSITY_NORMAL,
- LogLevel::DEBUG => OutputInterface::VERBOSITY_NORMAL,
- ]);
- }
-
- /**
- * Return the log messages in order.
- *
- * @return string[]
- */
- public function getLogs()
- {
- return $this->output->getLogs();
- }
-
- /**
- * @dataProvider provideOutputMappingParams
- */
- public function testOutputMapping($logLevel, $outputVerbosity, $isOutput, $addVerbosityLevelMap = [])
- {
- $out = new BufferedOutput($outputVerbosity);
- $logger = new ConsoleLogger($out, $addVerbosityLevelMap);
- $logger->log($logLevel, 'foo bar');
- $logs = $out->fetch();
- $this->assertEquals($isOutput ? "[$logLevel] foo bar".PHP_EOL : '', $logs);
- }
-
- public function provideOutputMappingParams()
- {
- $quietMap = [LogLevel::EMERGENCY => OutputInterface::VERBOSITY_QUIET];
-
- return [
- [LogLevel::EMERGENCY, OutputInterface::VERBOSITY_NORMAL, true],
- [LogLevel::WARNING, OutputInterface::VERBOSITY_NORMAL, true],
- [LogLevel::INFO, OutputInterface::VERBOSITY_NORMAL, false],
- [LogLevel::DEBUG, OutputInterface::VERBOSITY_NORMAL, false],
- [LogLevel::INFO, OutputInterface::VERBOSITY_VERBOSE, false],
- [LogLevel::INFO, OutputInterface::VERBOSITY_VERY_VERBOSE, true],
- [LogLevel::DEBUG, OutputInterface::VERBOSITY_VERY_VERBOSE, false],
- [LogLevel::DEBUG, OutputInterface::VERBOSITY_DEBUG, true],
- [LogLevel::ALERT, OutputInterface::VERBOSITY_QUIET, false],
- [LogLevel::EMERGENCY, OutputInterface::VERBOSITY_QUIET, false],
- [LogLevel::ALERT, OutputInterface::VERBOSITY_QUIET, false, $quietMap],
- [LogLevel::EMERGENCY, OutputInterface::VERBOSITY_QUIET, true, $quietMap],
- ];
- }
-
- public function testHasErrored()
- {
- $logger = new ConsoleLogger(new BufferedOutput());
-
- $this->assertFalse($logger->hasErrored());
-
- $logger->warning('foo');
- $this->assertFalse($logger->hasErrored());
-
- $logger->error('bar');
- $this->assertTrue($logger->hasErrored());
- }
-
- public function testImplements()
- {
- $this->assertInstanceOf('Psr\Log\LoggerInterface', $this->getLogger());
- }
-
- /**
- * @dataProvider provideLevelsAndMessages
- */
- public function testLogsAtAllLevels($level, $message)
- {
- $logger = $this->getLogger();
- $logger->{$level}($message, ['user' => 'Bob']);
- $logger->log($level, $message, ['user' => 'Bob']);
-
- $expected = [
- $level.' message of level '.$level.' with context: Bob',
- $level.' message of level '.$level.' with context: Bob',
- ];
- $this->assertEquals($expected, $this->getLogs());
- }
-
- public function provideLevelsAndMessages()
- {
- return [
- LogLevel::EMERGENCY => [LogLevel::EMERGENCY, 'message of level emergency with context: {user}'],
- LogLevel::ALERT => [LogLevel::ALERT, 'message of level alert with context: {user}'],
- LogLevel::CRITICAL => [LogLevel::CRITICAL, 'message of level critical with context: {user}'],
- LogLevel::ERROR => [LogLevel::ERROR, 'message of level error with context: {user}'],
- LogLevel::WARNING => [LogLevel::WARNING, 'message of level warning with context: {user}'],
- LogLevel::NOTICE => [LogLevel::NOTICE, 'message of level notice with context: {user}'],
- LogLevel::INFO => [LogLevel::INFO, 'message of level info with context: {user}'],
- LogLevel::DEBUG => [LogLevel::DEBUG, 'message of level debug with context: {user}'],
- ];
- }
-
- /**
- * @expectedException \Psr\Log\InvalidArgumentException
- */
- public function testThrowsOnInvalidLevel()
- {
- $logger = $this->getLogger();
- $logger->log('invalid level', 'Foo');
- }
-
- public function testContextReplacement()
- {
- $logger = $this->getLogger();
- $logger->info('{Message {nothing} {user} {foo.bar} a}', ['user' => 'Bob', 'foo.bar' => 'Bar']);
-
- $expected = ['info {Message {nothing} Bob Bar a}'];
- $this->assertEquals($expected, $this->getLogs());
- }
-
- public function testObjectCastToString()
- {
- if (method_exists($this, 'createPartialMock')) {
- $dummy = $this->createPartialMock('Symfony\Component\Console\Tests\Logger\DummyTest', ['__toString']);
- } else {
- $dummy = $this->getMock('Symfony\Component\Console\Tests\Logger\DummyTest', ['__toString']);
- }
- $dummy->method('__toString')->willReturn('DUMMY');
-
- $this->getLogger()->warning($dummy);
-
- $expected = ['warning DUMMY'];
- $this->assertEquals($expected, $this->getLogs());
- }
-
- public function testContextCanContainAnything()
- {
- $context = [
- 'bool' => true,
- 'null' => null,
- 'string' => 'Foo',
- 'int' => 0,
- 'float' => 0.5,
- 'nested' => ['with object' => new DummyTest()],
- 'object' => new \DateTime(),
- 'resource' => fopen('php://memory', 'r'),
- ];
-
- $this->getLogger()->warning('Crazy context data', $context);
-
- $expected = ['warning Crazy context data'];
- $this->assertEquals($expected, $this->getLogs());
- }
-
- public function testContextExceptionKeyCanBeExceptionOrOtherValues()
- {
- $logger = $this->getLogger();
- $logger->warning('Random message', ['exception' => 'oops']);
- $logger->critical('Uncaught Exception!', ['exception' => new \LogicException('Fail')]);
-
- $expected = [
- 'warning Random message',
- 'critical Uncaught Exception!',
- ];
- $this->assertEquals($expected, $this->getLogs());
- }
-}
-
-class DummyTest
-{
- public function __toString()
- {
- }
-}
diff --git a/vendor/symfony/console/Tests/Output/ConsoleOutputTest.php b/vendor/symfony/console/Tests/Output/ConsoleOutputTest.php
deleted file mode 100644
index db39a02b8..000000000
--- a/vendor/symfony/console/Tests/Output/ConsoleOutputTest.php
+++ /dev/null
@@ -1,42 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Console\Tests\Output;
-
-use PHPUnit\Framework\TestCase;
-use Symfony\Component\Console\Formatter\OutputFormatter;
-use Symfony\Component\Console\Output\ConsoleOutput;
-use Symfony\Component\Console\Output\Output;
-
-class ConsoleOutputTest extends TestCase
-{
- public function testConstructor()
- {
- $output = new ConsoleOutput(Output::VERBOSITY_QUIET, true);
- $this->assertEquals(Output::VERBOSITY_QUIET, $output->getVerbosity(), '__construct() takes the verbosity as its first argument');
- $this->assertSame($output->getFormatter(), $output->getErrorOutput()->getFormatter(), '__construct() takes a formatter or null as the third argument');
- }
-
- public function testSetFormatter()
- {
- $output = new ConsoleOutput();
- $outputFormatter = new OutputFormatter();
- $output->setFormatter($outputFormatter);
- $this->assertSame($outputFormatter, $output->getFormatter());
- }
-
- public function testSetVerbosity()
- {
- $output = new ConsoleOutput();
- $output->setVerbosity(Output::VERBOSITY_VERBOSE);
- $this->assertSame(Output::VERBOSITY_VERBOSE, $output->getVerbosity());
- }
-}
diff --git a/vendor/symfony/console/Tests/Output/ConsoleSectionOutputTest.php b/vendor/symfony/console/Tests/Output/ConsoleSectionOutputTest.php
deleted file mode 100644
index 4c292c2c6..000000000
--- a/vendor/symfony/console/Tests/Output/ConsoleSectionOutputTest.php
+++ /dev/null
@@ -1,163 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Console\Tests\Output;
-
-use PHPUnit\Framework\TestCase;
-use Symfony\Component\Console\Formatter\OutputFormatter;
-use Symfony\Component\Console\Helper\QuestionHelper;
-use Symfony\Component\Console\Input\StreamableInputInterface;
-use Symfony\Component\Console\Output\ConsoleSectionOutput;
-use Symfony\Component\Console\Output\OutputInterface;
-use Symfony\Component\Console\Output\StreamOutput;
-use Symfony\Component\Console\Question\Question;
-
-class ConsoleSectionOutputTest extends TestCase
-{
- private $stream;
-
- protected function setUp()
- {
- $this->stream = fopen('php://memory', 'r+b', false);
- }
-
- protected function tearDown()
- {
- $this->stream = null;
- }
-
- public function testClearAll()
- {
- $sections = [];
- $output = new ConsoleSectionOutput($this->stream, $sections, OutputInterface::VERBOSITY_NORMAL, true, new OutputFormatter());
-
- $output->writeln('Foo'.PHP_EOL.'Bar');
- $output->clear();
-
- rewind($output->getStream());
- $this->assertEquals('Foo'.PHP_EOL.'Bar'.PHP_EOL.sprintf("\x1b[%dA", 2)."\x1b[0J", stream_get_contents($output->getStream()));
- }
-
- public function testClearNumberOfLines()
- {
- $sections = [];
- $output = new ConsoleSectionOutput($this->stream, $sections, OutputInterface::VERBOSITY_NORMAL, true, new OutputFormatter());
-
- $output->writeln("Foo\nBar\nBaz\nFooBar");
- $output->clear(2);
-
- rewind($output->getStream());
- $this->assertEquals("Foo\nBar\nBaz\nFooBar".PHP_EOL.sprintf("\x1b[%dA", 2)."\x1b[0J", stream_get_contents($output->getStream()));
- }
-
- public function testClearNumberOfLinesWithMultipleSections()
- {
- $output = new StreamOutput($this->stream);
- $sections = [];
- $output1 = new ConsoleSectionOutput($output->getStream(), $sections, OutputInterface::VERBOSITY_NORMAL, true, new OutputFormatter());
- $output2 = new ConsoleSectionOutput($output->getStream(), $sections, OutputInterface::VERBOSITY_NORMAL, true, new OutputFormatter());
-
- $output2->writeln('Foo');
- $output2->writeln('Bar');
- $output2->clear(1);
- $output1->writeln('Baz');
-
- rewind($output->getStream());
-
- $this->assertEquals('Foo'.PHP_EOL.'Bar'.PHP_EOL."\x1b[1A\x1b[0J\e[1A\e[0J".'Baz'.PHP_EOL.'Foo'.PHP_EOL, stream_get_contents($output->getStream()));
- }
-
- public function testClearPreservingEmptyLines()
- {
- $output = new StreamOutput($this->stream);
- $sections = [];
- $output1 = new ConsoleSectionOutput($output->getStream(), $sections, OutputInterface::VERBOSITY_NORMAL, true, new OutputFormatter());
- $output2 = new ConsoleSectionOutput($output->getStream(), $sections, OutputInterface::VERBOSITY_NORMAL, true, new OutputFormatter());
-
- $output2->writeln(PHP_EOL.'foo');
- $output2->clear(1);
- $output1->writeln('bar');
-
- rewind($output->getStream());
-
- $this->assertEquals(PHP_EOL.'foo'.PHP_EOL."\x1b[1A\x1b[0J\x1b[1A\x1b[0J".'bar'.PHP_EOL.PHP_EOL, stream_get_contents($output->getStream()));
- }
-
- public function testOverwrite()
- {
- $sections = [];
- $output = new ConsoleSectionOutput($this->stream, $sections, OutputInterface::VERBOSITY_NORMAL, true, new OutputFormatter());
-
- $output->writeln('Foo');
- $output->overwrite('Bar');
-
- rewind($output->getStream());
- $this->assertEquals('Foo'.PHP_EOL."\x1b[1A\x1b[0JBar".PHP_EOL, stream_get_contents($output->getStream()));
- }
-
- public function testOverwriteMultipleLines()
- {
- $sections = [];
- $output = new ConsoleSectionOutput($this->stream, $sections, OutputInterface::VERBOSITY_NORMAL, true, new OutputFormatter());
-
- $output->writeln('Foo'.PHP_EOL.'Bar'.PHP_EOL.'Baz');
- $output->overwrite('Bar');
-
- rewind($output->getStream());
- $this->assertEquals('Foo'.PHP_EOL.'Bar'.PHP_EOL.'Baz'.PHP_EOL.sprintf("\x1b[%dA", 3)."\x1b[0J".'Bar'.PHP_EOL, stream_get_contents($output->getStream()));
- }
-
- public function testAddingMultipleSections()
- {
- $sections = [];
- $output1 = new ConsoleSectionOutput($this->stream, $sections, OutputInterface::VERBOSITY_NORMAL, true, new OutputFormatter());
- $output2 = new ConsoleSectionOutput($this->stream, $sections, OutputInterface::VERBOSITY_NORMAL, true, new OutputFormatter());
-
- $this->assertCount(2, $sections);
- }
-
- public function testMultipleSectionsOutput()
- {
- $output = new StreamOutput($this->stream);
- $sections = [];
- $output1 = new ConsoleSectionOutput($output->getStream(), $sections, OutputInterface::VERBOSITY_NORMAL, true, new OutputFormatter());
- $output2 = new ConsoleSectionOutput($output->getStream(), $sections, OutputInterface::VERBOSITY_NORMAL, true, new OutputFormatter());
-
- $output1->writeln('Foo');
- $output2->writeln('Bar');
-
- $output1->overwrite('Baz');
- $output2->overwrite('Foobar');
-
- rewind($output->getStream());
- $this->assertEquals('Foo'.PHP_EOL.'Bar'.PHP_EOL."\x1b[2A\x1b[0JBar".PHP_EOL."\x1b[1A\x1b[0JBaz".PHP_EOL.'Bar'.PHP_EOL."\x1b[1A\x1b[0JFoobar".PHP_EOL, stream_get_contents($output->getStream()));
- }
-
- public function testClearSectionContainingQuestion()
- {
- $inputStream = fopen('php://memory', 'r+b', false);
- fwrite($inputStream, "Batman & Robin\n");
- rewind($inputStream);
-
- $input = $this->getMockBuilder(StreamableInputInterface::class)->getMock();
- $input->expects($this->once())->method('isInteractive')->willReturn(true);
- $input->expects($this->once())->method('getStream')->willReturn($inputStream);
-
- $sections = [];
- $output = new ConsoleSectionOutput($this->stream, $sections, OutputInterface::VERBOSITY_NORMAL, true, new OutputFormatter());
-
- (new QuestionHelper())->ask($input, $output, new Question('What\'s your favorite super hero?'));
- $output->clear();
-
- rewind($output->getStream());
- $this->assertSame('What\'s your favorite super hero?'.PHP_EOL."\x1b[2A\x1b[0J", stream_get_contents($output->getStream()));
- }
-}
diff --git a/vendor/symfony/console/Tests/Output/NullOutputTest.php b/vendor/symfony/console/Tests/Output/NullOutputTest.php
deleted file mode 100644
index b7ff4be31..000000000
--- a/vendor/symfony/console/Tests/Output/NullOutputTest.php
+++ /dev/null
@@ -1,88 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Console\Tests\Output;
-
-use PHPUnit\Framework\TestCase;
-use Symfony\Component\Console\Formatter\OutputFormatter;
-use Symfony\Component\Console\Output\NullOutput;
-use Symfony\Component\Console\Output\Output;
-use Symfony\Component\Console\Output\OutputInterface;
-
-class NullOutputTest extends TestCase
-{
- public function testConstructor()
- {
- $output = new NullOutput();
-
- ob_start();
- $output->write('foo');
- $buffer = ob_get_clean();
-
- $this->assertSame('', $buffer, '->write() does nothing (at least nothing is printed)');
- $this->assertFalse($output->isDecorated(), '->isDecorated() returns false');
- }
-
- public function testVerbosity()
- {
- $output = new NullOutput();
- $this->assertSame(OutputInterface::VERBOSITY_QUIET, $output->getVerbosity(), '->getVerbosity() returns VERBOSITY_QUIET for NullOutput by default');
-
- $output->setVerbosity(OutputInterface::VERBOSITY_VERBOSE);
- $this->assertSame(OutputInterface::VERBOSITY_QUIET, $output->getVerbosity(), '->getVerbosity() always returns VERBOSITY_QUIET for NullOutput');
- }
-
- public function testSetFormatter()
- {
- $output = new NullOutput();
- $outputFormatter = new OutputFormatter();
- $output->setFormatter($outputFormatter);
- $this->assertNotSame($outputFormatter, $output->getFormatter());
- }
-
- public function testSetVerbosity()
- {
- $output = new NullOutput();
- $output->setVerbosity(Output::VERBOSITY_NORMAL);
- $this->assertEquals(Output::VERBOSITY_QUIET, $output->getVerbosity());
- }
-
- public function testSetDecorated()
- {
- $output = new NullOutput();
- $output->setDecorated(true);
- $this->assertFalse($output->isDecorated());
- }
-
- public function testIsQuiet()
- {
- $output = new NullOutput();
- $this->assertTrue($output->isQuiet());
- }
-
- public function testIsVerbose()
- {
- $output = new NullOutput();
- $this->assertFalse($output->isVerbose());
- }
-
- public function testIsVeryVerbose()
- {
- $output = new NullOutput();
- $this->assertFalse($output->isVeryVerbose());
- }
-
- public function testIsDebug()
- {
- $output = new NullOutput();
- $this->assertFalse($output->isDebug());
- }
-}
diff --git a/vendor/symfony/console/Tests/Output/OutputTest.php b/vendor/symfony/console/Tests/Output/OutputTest.php
deleted file mode 100644
index 7cfa6cdc0..000000000
--- a/vendor/symfony/console/Tests/Output/OutputTest.php
+++ /dev/null
@@ -1,189 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Console\Tests\Output;
-
-use PHPUnit\Framework\TestCase;
-use Symfony\Component\Console\Formatter\OutputFormatterStyle;
-use Symfony\Component\Console\Output\Output;
-
-class OutputTest extends TestCase
-{
- public function testConstructor()
- {
- $output = new TestOutput(Output::VERBOSITY_QUIET, true);
- $this->assertEquals(Output::VERBOSITY_QUIET, $output->getVerbosity(), '__construct() takes the verbosity as its first argument');
- $this->assertTrue($output->isDecorated(), '__construct() takes the decorated flag as its second argument');
- }
-
- public function testSetIsDecorated()
- {
- $output = new TestOutput();
- $output->setDecorated(true);
- $this->assertTrue($output->isDecorated(), 'setDecorated() sets the decorated flag');
- }
-
- public function testSetGetVerbosity()
- {
- $output = new TestOutput();
- $output->setVerbosity(Output::VERBOSITY_QUIET);
- $this->assertEquals(Output::VERBOSITY_QUIET, $output->getVerbosity(), '->setVerbosity() sets the verbosity');
-
- $this->assertTrue($output->isQuiet());
- $this->assertFalse($output->isVerbose());
- $this->assertFalse($output->isVeryVerbose());
- $this->assertFalse($output->isDebug());
-
- $output->setVerbosity(Output::VERBOSITY_NORMAL);
- $this->assertFalse($output->isQuiet());
- $this->assertFalse($output->isVerbose());
- $this->assertFalse($output->isVeryVerbose());
- $this->assertFalse($output->isDebug());
-
- $output->setVerbosity(Output::VERBOSITY_VERBOSE);
- $this->assertFalse($output->isQuiet());
- $this->assertTrue($output->isVerbose());
- $this->assertFalse($output->isVeryVerbose());
- $this->assertFalse($output->isDebug());
-
- $output->setVerbosity(Output::VERBOSITY_VERY_VERBOSE);
- $this->assertFalse($output->isQuiet());
- $this->assertTrue($output->isVerbose());
- $this->assertTrue($output->isVeryVerbose());
- $this->assertFalse($output->isDebug());
-
- $output->setVerbosity(Output::VERBOSITY_DEBUG);
- $this->assertFalse($output->isQuiet());
- $this->assertTrue($output->isVerbose());
- $this->assertTrue($output->isVeryVerbose());
- $this->assertTrue($output->isDebug());
- }
-
- public function testWriteWithVerbosityQuiet()
- {
- $output = new TestOutput(Output::VERBOSITY_QUIET);
- $output->writeln('foo');
- $this->assertEquals('', $output->output, '->writeln() outputs nothing if verbosity is set to VERBOSITY_QUIET');
- }
-
- public function testWriteAnArrayOfMessages()
- {
- $output = new TestOutput();
- $output->writeln(['foo', 'bar']);
- $this->assertEquals("foo\nbar\n", $output->output, '->writeln() can take an array of messages to output');
- }
-
- public function testWriteAnIterableOfMessages()
- {
- $output = new TestOutput();
- $output->writeln($this->generateMessages());
- $this->assertEquals("foo\nbar\n", $output->output, '->writeln() can take an iterable of messages to output');
- }
-
- private function generateMessages(): iterable
- {
- yield 'foo';
- yield 'bar';
- }
-
- /**
- * @dataProvider provideWriteArguments
- */
- public function testWriteRawMessage($message, $type, $expectedOutput)
- {
- $output = new TestOutput();
- $output->writeln($message, $type);
- $this->assertEquals($expectedOutput, $output->output);
- }
-
- public function provideWriteArguments()
- {
- return [
- ['foo', Output::OUTPUT_RAW, "foo\n"],
- ['foo', Output::OUTPUT_PLAIN, "foo\n"],
- ];
- }
-
- public function testWriteWithDecorationTurnedOff()
- {
- $output = new TestOutput();
- $output->setDecorated(false);
- $output->writeln('foo');
- $this->assertEquals("foo\n", $output->output, '->writeln() strips decoration tags if decoration is set to false');
- }
-
- public function testWriteDecoratedMessage()
- {
- $fooStyle = new OutputFormatterStyle('yellow', 'red', ['blink']);
- $output = new TestOutput();
- $output->getFormatter()->setStyle('FOO', $fooStyle);
- $output->setDecorated(true);
- $output->writeln('foo');
- $this->assertEquals("\033[33;41;5mfoo\033[39;49;25m\n", $output->output, '->writeln() decorates the output');
- }
-
- public function testWriteWithInvalidStyle()
- {
- $output = new TestOutput();
-
- $output->clear();
- $output->write('foo');
- $this->assertEquals('foo', $output->output, '->write() do nothing when a style does not exist');
-
- $output->clear();
- $output->writeln('foo');
- $this->assertEquals("foo\n", $output->output, '->writeln() do nothing when a style does not exist');
- }
-
- /**
- * @dataProvider verbosityProvider
- */
- public function testWriteWithVerbosityOption($verbosity, $expected, $msg)
- {
- $output = new TestOutput();
-
- $output->setVerbosity($verbosity);
- $output->clear();
- $output->write('1', false);
- $output->write('2', false, Output::VERBOSITY_QUIET);
- $output->write('3', false, Output::VERBOSITY_NORMAL);
- $output->write('4', false, Output::VERBOSITY_VERBOSE);
- $output->write('5', false, Output::VERBOSITY_VERY_VERBOSE);
- $output->write('6', false, Output::VERBOSITY_DEBUG);
- $this->assertEquals($expected, $output->output, $msg);
- }
-
- public function verbosityProvider()
- {
- return [
- [Output::VERBOSITY_QUIET, '2', '->write() in QUIET mode only outputs when an explicit QUIET verbosity is passed'],
- [Output::VERBOSITY_NORMAL, '123', '->write() in NORMAL mode outputs anything below an explicit VERBOSE verbosity'],
- [Output::VERBOSITY_VERBOSE, '1234', '->write() in VERBOSE mode outputs anything below an explicit VERY_VERBOSE verbosity'],
- [Output::VERBOSITY_VERY_VERBOSE, '12345', '->write() in VERY_VERBOSE mode outputs anything below an explicit DEBUG verbosity'],
- [Output::VERBOSITY_DEBUG, '123456', '->write() in DEBUG mode outputs everything'],
- ];
- }
-}
-
-class TestOutput extends Output
-{
- public $output = '';
-
- public function clear()
- {
- $this->output = '';
- }
-
- protected function doWrite($message, $newline)
- {
- $this->output .= $message.($newline ? "\n" : '');
- }
-}
diff --git a/vendor/symfony/console/Tests/Output/StreamOutputTest.php b/vendor/symfony/console/Tests/Output/StreamOutputTest.php
deleted file mode 100644
index 780b5681f..000000000
--- a/vendor/symfony/console/Tests/Output/StreamOutputTest.php
+++ /dev/null
@@ -1,61 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Console\Tests\Output;
-
-use PHPUnit\Framework\TestCase;
-use Symfony\Component\Console\Output\Output;
-use Symfony\Component\Console\Output\StreamOutput;
-
-class StreamOutputTest extends TestCase
-{
- protected $stream;
-
- protected function setUp()
- {
- $this->stream = fopen('php://memory', 'a', false);
- }
-
- protected function tearDown()
- {
- $this->stream = null;
- }
-
- public function testConstructor()
- {
- $output = new StreamOutput($this->stream, Output::VERBOSITY_QUIET, true);
- $this->assertEquals(Output::VERBOSITY_QUIET, $output->getVerbosity(), '__construct() takes the verbosity as its first argument');
- $this->assertTrue($output->isDecorated(), '__construct() takes the decorated flag as its second argument');
- }
-
- /**
- * @expectedException \InvalidArgumentException
- * @expectedExceptionMessage The StreamOutput class needs a stream as its first argument.
- */
- public function testStreamIsRequired()
- {
- new StreamOutput('foo');
- }
-
- public function testGetStream()
- {
- $output = new StreamOutput($this->stream);
- $this->assertEquals($this->stream, $output->getStream(), '->getStream() returns the current stream');
- }
-
- public function testDoWrite()
- {
- $output = new StreamOutput($this->stream);
- $output->writeln('foo');
- rewind($output->getStream());
- $this->assertEquals('foo'.PHP_EOL, stream_get_contents($output->getStream()), '->doWrite() writes to the stream');
- }
-}
diff --git a/vendor/symfony/console/Tests/Question/ChoiceQuestionTest.php b/vendor/symfony/console/Tests/Question/ChoiceQuestionTest.php
deleted file mode 100644
index 5ec7a9cac..000000000
--- a/vendor/symfony/console/Tests/Question/ChoiceQuestionTest.php
+++ /dev/null
@@ -1,64 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Console\Tests\Question;
-
-use PHPUnit\Framework\TestCase;
-use Symfony\Component\Console\Question\ChoiceQuestion;
-
-class ChoiceQuestionTest extends TestCase
-{
- /**
- * @dataProvider selectUseCases
- */
- public function testSelectUseCases($multiSelect, $answers, $expected, $message)
- {
- $question = new ChoiceQuestion('A question', [
- 'First response',
- 'Second response',
- 'Third response',
- 'Fourth response',
- ]);
-
- $question->setMultiselect($multiSelect);
-
- foreach ($answers as $answer) {
- $validator = $question->getValidator();
- $actual = $validator($answer);
-
- $this->assertEquals($actual, $expected, $message);
- }
- }
-
- public function selectUseCases()
- {
- return [
- [
- false,
- ['First response', 'First response ', ' First response', ' First response '],
- 'First response',
- 'When passed single answer on singleSelect, the defaultValidator must return this answer as a string',
- ],
- [
- true,
- ['First response', 'First response ', ' First response', ' First response '],
- ['First response'],
- 'When passed single answer on MultiSelect, the defaultValidator must return this answer as an array',
- ],
- [
- true,
- ['First response,Second response', ' First response , Second response '],
- ['First response', 'Second response'],
- 'When passed multiple answers on MultiSelect, the defaultValidator must return these answers as an array',
- ],
- ];
- }
-}
diff --git a/vendor/symfony/console/Tests/Question/ConfirmationQuestionTest.php b/vendor/symfony/console/Tests/Question/ConfirmationQuestionTest.php
deleted file mode 100644
index 83899772a..000000000
--- a/vendor/symfony/console/Tests/Question/ConfirmationQuestionTest.php
+++ /dev/null
@@ -1,62 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Console\Tests\Question;
-
-use PHPUnit\Framework\TestCase;
-use Symfony\Component\Console\Question\ConfirmationQuestion;
-
-class ConfirmationQuestionTest extends TestCase
-{
- /**
- * @dataProvider normalizerUsecases
- */
- public function testDefaultRegexUsecases($default, $answers, $expected, $message)
- {
- $sut = new ConfirmationQuestion('A question', $default);
-
- foreach ($answers as $answer) {
- $normalizer = $sut->getNormalizer();
- $actual = $normalizer($answer);
- $this->assertEquals($expected, $actual, sprintf($message, $answer));
- }
- }
-
- public function normalizerUsecases()
- {
- return [
- [
- true,
- ['y', 'Y', 'yes', 'YES', 'yEs', ''],
- true,
- 'When default is true, the normalizer must return true for "%s"',
- ],
- [
- true,
- ['n', 'N', 'no', 'NO', 'nO', 'foo', '1', '0'],
- false,
- 'When default is true, the normalizer must return false for "%s"',
- ],
- [
- false,
- ['y', 'Y', 'yes', 'YES', 'yEs'],
- true,
- 'When default is false, the normalizer must return true for "%s"',
- ],
- [
- false,
- ['n', 'N', 'no', 'NO', 'nO', 'foo', '1', '0', ''],
- false,
- 'When default is false, the normalizer must return false for "%s"',
- ],
- ];
- }
-}
diff --git a/vendor/symfony/console/Tests/Style/SymfonyStyleTest.php b/vendor/symfony/console/Tests/Style/SymfonyStyleTest.php
deleted file mode 100644
index 88d00c8a9..000000000
--- a/vendor/symfony/console/Tests/Style/SymfonyStyleTest.php
+++ /dev/null
@@ -1,118 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Console\Tests\Style;
-
-use PHPUnit\Framework\TestCase;
-use Symfony\Component\Console\Command\Command;
-use Symfony\Component\Console\Formatter\OutputFormatter;
-use Symfony\Component\Console\Input\InputInterface;
-use Symfony\Component\Console\Output\ConsoleOutputInterface;
-use Symfony\Component\Console\Output\OutputInterface;
-use Symfony\Component\Console\Style\SymfonyStyle;
-use Symfony\Component\Console\Tester\CommandTester;
-
-class SymfonyStyleTest extends TestCase
-{
- /** @var Command */
- protected $command;
- /** @var CommandTester */
- protected $tester;
- private $colSize;
-
- protected function setUp()
- {
- $this->colSize = getenv('COLUMNS');
- putenv('COLUMNS=121');
- $this->command = new Command('sfstyle');
- $this->tester = new CommandTester($this->command);
- }
-
- protected function tearDown()
- {
- putenv($this->colSize ? 'COLUMNS='.$this->colSize : 'COLUMNS');
- $this->command = null;
- $this->tester = null;
- }
-
- /**
- * @dataProvider inputCommandToOutputFilesProvider
- */
- public function testOutputs($inputCommandFilepath, $outputFilepath)
- {
- $code = require $inputCommandFilepath;
- $this->command->setCode($code);
- $this->tester->execute([], ['interactive' => false, 'decorated' => false]);
- $this->assertStringEqualsFile($outputFilepath, $this->tester->getDisplay(true));
- }
-
- /**
- * @dataProvider inputInteractiveCommandToOutputFilesProvider
- */
- public function testInteractiveOutputs($inputCommandFilepath, $outputFilepath)
- {
- $code = require $inputCommandFilepath;
- $this->command->setCode($code);
- $this->tester->execute([], ['interactive' => true, 'decorated' => false]);
- $this->assertStringEqualsFile($outputFilepath, $this->tester->getDisplay(true));
- }
-
- public function inputInteractiveCommandToOutputFilesProvider()
- {
- $baseDir = __DIR__.'/../Fixtures/Style/SymfonyStyle';
-
- return array_map(null, glob($baseDir.'/command/interactive_command_*.php'), glob($baseDir.'/output/interactive_output_*.txt'));
- }
-
- public function inputCommandToOutputFilesProvider()
- {
- $baseDir = __DIR__.'/../Fixtures/Style/SymfonyStyle';
-
- return array_map(null, glob($baseDir.'/command/command_*.php'), glob($baseDir.'/output/output_*.txt'));
- }
-
- public function testGetErrorStyle()
- {
- $input = $this->getMockBuilder(InputInterface::class)->getMock();
-
- $errorOutput = $this->getMockBuilder(OutputInterface::class)->getMock();
- $errorOutput
- ->method('getFormatter')
- ->willReturn(new OutputFormatter());
- $errorOutput
- ->expects($this->once())
- ->method('write');
-
- $output = $this->getMockBuilder(ConsoleOutputInterface::class)->getMock();
- $output
- ->method('getFormatter')
- ->willReturn(new OutputFormatter());
- $output
- ->expects($this->once())
- ->method('getErrorOutput')
- ->willReturn($errorOutput);
-
- $io = new SymfonyStyle($input, $output);
- $io->getErrorStyle()->write('');
- }
-
- public function testGetErrorStyleUsesTheCurrentOutputIfNoErrorOutputIsAvailable()
- {
- $output = $this->getMockBuilder(OutputInterface::class)->getMock();
- $output
- ->method('getFormatter')
- ->willReturn(new OutputFormatter());
-
- $style = new SymfonyStyle($this->getMockBuilder(InputInterface::class)->getMock(), $output);
-
- $this->assertInstanceOf(SymfonyStyle::class, $style->getErrorStyle());
- }
-}
diff --git a/vendor/symfony/console/Tests/TerminalTest.php b/vendor/symfony/console/Tests/TerminalTest.php
deleted file mode 100644
index 93b8c44a7..000000000
--- a/vendor/symfony/console/Tests/TerminalTest.php
+++ /dev/null
@@ -1,59 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Console\Tests;
-
-use PHPUnit\Framework\TestCase;
-use Symfony\Component\Console\Terminal;
-
-class TerminalTest extends TestCase
-{
- private $colSize;
- private $lineSize;
-
- protected function setUp()
- {
- $this->colSize = getenv('COLUMNS');
- $this->lineSize = getenv('LINES');
- }
-
- protected function tearDown()
- {
- putenv($this->colSize ? 'COLUMNS='.$this->colSize : 'COLUMNS');
- putenv($this->lineSize ? 'LINES' : 'LINES='.$this->lineSize);
- }
-
- public function test()
- {
- putenv('COLUMNS=100');
- putenv('LINES=50');
- $terminal = new Terminal();
- $this->assertSame(100, $terminal->getWidth());
- $this->assertSame(50, $terminal->getHeight());
-
- putenv('COLUMNS=120');
- putenv('LINES=60');
- $terminal = new Terminal();
- $this->assertSame(120, $terminal->getWidth());
- $this->assertSame(60, $terminal->getHeight());
- }
-
- public function test_zero_values()
- {
- putenv('COLUMNS=0');
- putenv('LINES=0');
-
- $terminal = new Terminal();
-
- $this->assertSame(0, $terminal->getWidth());
- $this->assertSame(0, $terminal->getHeight());
- }
-}
diff --git a/vendor/symfony/console/Tests/Tester/ApplicationTesterTest.php b/vendor/symfony/console/Tests/Tester/ApplicationTesterTest.php
deleted file mode 100644
index 752273153..000000000
--- a/vendor/symfony/console/Tests/Tester/ApplicationTesterTest.php
+++ /dev/null
@@ -1,113 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Console\Tests\Tester;
-
-use PHPUnit\Framework\TestCase;
-use Symfony\Component\Console\Application;
-use Symfony\Component\Console\Helper\QuestionHelper;
-use Symfony\Component\Console\Output\Output;
-use Symfony\Component\Console\Question\Question;
-use Symfony\Component\Console\Tester\ApplicationTester;
-
-class ApplicationTesterTest extends TestCase
-{
- protected $application;
- protected $tester;
-
- protected function setUp()
- {
- $this->application = new Application();
- $this->application->setAutoExit(false);
- $this->application->register('foo')
- ->addArgument('foo')
- ->setCode(function ($input, $output) {
- $output->writeln('foo');
- })
- ;
-
- $this->tester = new ApplicationTester($this->application);
- $this->tester->run(['command' => 'foo', 'foo' => 'bar'], ['interactive' => false, 'decorated' => false, 'verbosity' => Output::VERBOSITY_VERBOSE]);
- }
-
- protected function tearDown()
- {
- $this->application = null;
- $this->tester = null;
- }
-
- public function testRun()
- {
- $this->assertFalse($this->tester->getInput()->isInteractive(), '->execute() takes an interactive option');
- $this->assertFalse($this->tester->getOutput()->isDecorated(), '->execute() takes a decorated option');
- $this->assertEquals(Output::VERBOSITY_VERBOSE, $this->tester->getOutput()->getVerbosity(), '->execute() takes a verbosity option');
- }
-
- public function testGetInput()
- {
- $this->assertEquals('bar', $this->tester->getInput()->getArgument('foo'), '->getInput() returns the current input instance');
- }
-
- public function testGetOutput()
- {
- rewind($this->tester->getOutput()->getStream());
- $this->assertEquals('foo'.PHP_EOL, stream_get_contents($this->tester->getOutput()->getStream()), '->getOutput() returns the current output instance');
- }
-
- public function testGetDisplay()
- {
- $this->assertEquals('foo'.PHP_EOL, $this->tester->getDisplay(), '->getDisplay() returns the display of the last execution');
- }
-
- public function testSetInputs()
- {
- $application = new Application();
- $application->setAutoExit(false);
- $application->register('foo')->setCode(function ($input, $output) {
- $helper = new QuestionHelper();
- $helper->ask($input, $output, new Question('Q1'));
- $helper->ask($input, $output, new Question('Q2'));
- $helper->ask($input, $output, new Question('Q3'));
- });
- $tester = new ApplicationTester($application);
-
- $tester->setInputs(['I1', 'I2', 'I3']);
- $tester->run(['command' => 'foo']);
-
- $this->assertSame(0, $tester->getStatusCode());
- $this->assertEquals('Q1Q2Q3', $tester->getDisplay(true));
- }
-
- public function testGetStatusCode()
- {
- $this->assertSame(0, $this->tester->getStatusCode(), '->getStatusCode() returns the status code');
- }
-
- public function testErrorOutput()
- {
- $application = new Application();
- $application->setAutoExit(false);
- $application->register('foo')
- ->addArgument('foo')
- ->setCode(function ($input, $output) {
- $output->getErrorOutput()->write('foo');
- })
- ;
-
- $tester = new ApplicationTester($application);
- $tester->run(
- ['command' => 'foo', 'foo' => 'bar'],
- ['capture_stderr_separately' => true]
- );
-
- $this->assertSame('foo', $tester->getErrorOutput());
- }
-}
diff --git a/vendor/symfony/console/Tests/Tester/CommandTesterTest.php b/vendor/symfony/console/Tests/Tester/CommandTesterTest.php
deleted file mode 100644
index 706629673..000000000
--- a/vendor/symfony/console/Tests/Tester/CommandTesterTest.php
+++ /dev/null
@@ -1,235 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Console\Tests\Tester;
-
-use PHPUnit\Framework\TestCase;
-use Symfony\Component\Console\Application;
-use Symfony\Component\Console\Command\Command;
-use Symfony\Component\Console\Helper\HelperSet;
-use Symfony\Component\Console\Helper\QuestionHelper;
-use Symfony\Component\Console\Output\Output;
-use Symfony\Component\Console\Question\ChoiceQuestion;
-use Symfony\Component\Console\Question\Question;
-use Symfony\Component\Console\Style\SymfonyStyle;
-use Symfony\Component\Console\Tester\CommandTester;
-
-class CommandTesterTest extends TestCase
-{
- protected $command;
- protected $tester;
-
- protected function setUp()
- {
- $this->command = new Command('foo');
- $this->command->addArgument('command');
- $this->command->addArgument('foo');
- $this->command->setCode(function ($input, $output) { $output->writeln('foo'); });
-
- $this->tester = new CommandTester($this->command);
- $this->tester->execute(['foo' => 'bar'], ['interactive' => false, 'decorated' => false, 'verbosity' => Output::VERBOSITY_VERBOSE]);
- }
-
- protected function tearDown()
- {
- $this->command = null;
- $this->tester = null;
- }
-
- public function testExecute()
- {
- $this->assertFalse($this->tester->getInput()->isInteractive(), '->execute() takes an interactive option');
- $this->assertFalse($this->tester->getOutput()->isDecorated(), '->execute() takes a decorated option');
- $this->assertEquals(Output::VERBOSITY_VERBOSE, $this->tester->getOutput()->getVerbosity(), '->execute() takes a verbosity option');
- }
-
- public function testGetInput()
- {
- $this->assertEquals('bar', $this->tester->getInput()->getArgument('foo'), '->getInput() returns the current input instance');
- }
-
- public function testGetOutput()
- {
- rewind($this->tester->getOutput()->getStream());
- $this->assertEquals('foo'.PHP_EOL, stream_get_contents($this->tester->getOutput()->getStream()), '->getOutput() returns the current output instance');
- }
-
- public function testGetDisplay()
- {
- $this->assertEquals('foo'.PHP_EOL, $this->tester->getDisplay(), '->getDisplay() returns the display of the last execution');
- }
-
- public function testGetStatusCode()
- {
- $this->assertSame(0, $this->tester->getStatusCode(), '->getStatusCode() returns the status code');
- }
-
- public function testCommandFromApplication()
- {
- $application = new Application();
- $application->setAutoExit(false);
-
- $command = new Command('foo');
- $command->setCode(function ($input, $output) { $output->writeln('foo'); });
-
- $application->add($command);
-
- $tester = new CommandTester($application->find('foo'));
-
- // check that there is no need to pass the command name here
- $this->assertEquals(0, $tester->execute([]));
- }
-
- public function testCommandWithInputs()
- {
- $questions = [
- 'What\'s your name?',
- 'How are you?',
- 'Where do you come from?',
- ];
-
- $command = new Command('foo');
- $command->setHelperSet(new HelperSet([new QuestionHelper()]));
- $command->setCode(function ($input, $output) use ($questions, $command) {
- $helper = $command->getHelper('question');
- $helper->ask($input, $output, new Question($questions[0]));
- $helper->ask($input, $output, new Question($questions[1]));
- $helper->ask($input, $output, new Question($questions[2]));
- });
-
- $tester = new CommandTester($command);
- $tester->setInputs(['Bobby', 'Fine', 'France']);
- $tester->execute([]);
-
- $this->assertEquals(0, $tester->getStatusCode());
- $this->assertEquals(implode('', $questions), $tester->getDisplay(true));
- }
-
- public function testCommandWithDefaultInputs()
- {
- $questions = [
- 'What\'s your name?',
- 'How are you?',
- 'Where do you come from?',
- ];
-
- $command = new Command('foo');
- $command->setHelperSet(new HelperSet([new QuestionHelper()]));
- $command->setCode(function ($input, $output) use ($questions, $command) {
- $helper = $command->getHelper('question');
- $helper->ask($input, $output, new Question($questions[0], 'Bobby'));
- $helper->ask($input, $output, new Question($questions[1], 'Fine'));
- $helper->ask($input, $output, new Question($questions[2], 'France'));
- });
-
- $tester = new CommandTester($command);
- $tester->setInputs(['', '', '']);
- $tester->execute([]);
-
- $this->assertEquals(0, $tester->getStatusCode());
- $this->assertEquals(implode('', $questions), $tester->getDisplay(true));
- }
-
- /**
- * @expectedException \RuntimeException
- * @expectedExceptionMessage Aborted.
- */
- public function testCommandWithWrongInputsNumber()
- {
- $questions = [
- 'What\'s your name?',
- 'How are you?',
- 'Where do you come from?',
- ];
-
- $command = new Command('foo');
- $command->setHelperSet(new HelperSet([new QuestionHelper()]));
- $command->setCode(function ($input, $output) use ($questions, $command) {
- $helper = $command->getHelper('question');
- $helper->ask($input, $output, new ChoiceQuestion('choice', ['a', 'b']));
- $helper->ask($input, $output, new Question($questions[0]));
- $helper->ask($input, $output, new Question($questions[1]));
- $helper->ask($input, $output, new Question($questions[2]));
- });
-
- $tester = new CommandTester($command);
- $tester->setInputs(['a', 'Bobby', 'Fine']);
- $tester->execute([]);
- }
-
- /**
- * @expectedException \RuntimeException
- * @expectedExceptionMessage Aborted.
- */
- public function testCommandWithQuestionsButNoInputs()
- {
- $questions = [
- 'What\'s your name?',
- 'How are you?',
- 'Where do you come from?',
- ];
-
- $command = new Command('foo');
- $command->setHelperSet(new HelperSet([new QuestionHelper()]));
- $command->setCode(function ($input, $output) use ($questions, $command) {
- $helper = $command->getHelper('question');
- $helper->ask($input, $output, new ChoiceQuestion('choice', ['a', 'b']));
- $helper->ask($input, $output, new Question($questions[0]));
- $helper->ask($input, $output, new Question($questions[1]));
- $helper->ask($input, $output, new Question($questions[2]));
- });
-
- $tester = new CommandTester($command);
- $tester->execute([]);
- }
-
- public function testSymfonyStyleCommandWithInputs()
- {
- $questions = [
- 'What\'s your name?',
- 'How are you?',
- 'Where do you come from?',
- ];
-
- $command = new Command('foo');
- $command->setCode(function ($input, $output) use ($questions, $command) {
- $io = new SymfonyStyle($input, $output);
- $io->ask($questions[0]);
- $io->ask($questions[1]);
- $io->ask($questions[2]);
- });
-
- $tester = new CommandTester($command);
- $tester->setInputs(['Bobby', 'Fine', 'France']);
- $tester->execute([]);
-
- $this->assertEquals(0, $tester->getStatusCode());
- }
-
- public function testErrorOutput()
- {
- $command = new Command('foo');
- $command->addArgument('command');
- $command->addArgument('foo');
- $command->setCode(function ($input, $output) {
- $output->getErrorOutput()->write('foo');
- }
- );
-
- $tester = new CommandTester($command);
- $tester->execute(
- ['foo' => 'bar'],
- ['capture_stderr_separately' => true]
- );
-
- $this->assertSame('foo', $tester->getErrorOutput());
- }
-}
diff --git a/vendor/symfony/console/composer.json b/vendor/symfony/console/composer.json
index 33922220b..90cbd24f5 100644
--- a/vendor/symfony/console/composer.json
+++ b/vendor/symfony/console/composer.json
@@ -1,7 +1,7 @@
{
"name": "symfony/console",
"type": "library",
- "description": "Symfony Console Component",
+ "description": "Eases the creation of beautiful and testable command line interfaces",
"keywords": [],
"homepage": "https://symfony.com",
"license": "MIT",
@@ -16,20 +16,23 @@
}
],
"require": {
- "php": "^7.1.3",
- "symfony/contracts": "^1.0",
- "symfony/polyfill-mbstring": "~1.0"
+ "php": ">=7.1.3",
+ "symfony/polyfill-mbstring": "~1.0",
+ "symfony/polyfill-php73": "^1.8",
+ "symfony/polyfill-php80": "^1.16",
+ "symfony/service-contracts": "^1.1|^2"
},
"require-dev": {
- "symfony/config": "~3.4|~4.0",
- "symfony/event-dispatcher": "~3.4|~4.0",
- "symfony/dependency-injection": "~3.4|~4.0",
- "symfony/lock": "~3.4|~4.0",
- "symfony/process": "~3.4|~4.0",
- "psr/log": "~1.0"
+ "symfony/config": "^3.4|^4.0|^5.0",
+ "symfony/event-dispatcher": "^4.3",
+ "symfony/dependency-injection": "^3.4|^4.0|^5.0",
+ "symfony/lock": "^4.4|^5.0",
+ "symfony/process": "^3.4|^4.0|^5.0",
+ "symfony/var-dumper": "^4.3|^5.0",
+ "psr/log": "^1|^2"
},
"provide": {
- "psr/log-implementation": "1.0"
+ "psr/log-implementation": "1.0|2.0"
},
"suggest": {
"symfony/event-dispatcher": "",
@@ -38,7 +41,10 @@
"psr/log": "For using the console logger"
},
"conflict": {
+ "psr/log": ">=3",
"symfony/dependency-injection": "<3.4",
+ "symfony/event-dispatcher": "<4.3|>=5",
+ "symfony/lock": "<4.4",
"symfony/process": "<3.3"
},
"autoload": {
@@ -47,10 +53,5 @@
"/Tests/"
]
},
- "minimum-stability": "dev",
- "extra": {
- "branch-alias": {
- "dev-master": "4.2-dev"
- }
- }
+ "minimum-stability": "dev"
}
diff --git a/vendor/symfony/console/phpunit.xml.dist b/vendor/symfony/console/phpunit.xml.dist
deleted file mode 100644
index 15e7e52a9..000000000
--- a/vendor/symfony/console/phpunit.xml.dist
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-
-
-
-
-
-
-
- ./Tests/
-
-
-
-
-
- ./
-
- ./Resources
- ./Tests
- ./vendor
-
-
-
-
-
-
-
-
- Symfony\Component\Console
-
-
-
-
-
diff --git a/vendor/symfony/contracts/CHANGELOG.md b/vendor/symfony/contracts/CHANGELOG.md
deleted file mode 100644
index f909b4976..000000000
--- a/vendor/symfony/contracts/CHANGELOG.md
+++ /dev/null
@@ -1,19 +0,0 @@
-CHANGELOG
-=========
-
-1.1.0
------
-
- * added `HttpClient` namespace with contracts for implementing flexible HTTP clients
- * added `EventDispatcherInterface` and `Event` in namespace `EventDispatcher`
- * added `ServiceProviderInterface` in namespace `Service`
-
-1.0.0
------
-
- * added `Service\ResetInterface` to provide a way to reset an object to its initial state
- * added `Translation\TranslatorInterface` and `Translation\TranslatorTrait`
- * added `Cache` contract to extend PSR-6 with tag invalidation, callback-based computation and stampede protection
- * added `Service\ServiceSubscriberInterface` to declare the dependencies of a class that consumes a service locator
- * added `Service\ServiceSubscriberTrait` to implement `Service\ServiceSubscriberInterface` using methods' return types
- * added `Service\ServiceLocatorTrait` to help implement PSR-11 service locators
diff --git a/vendor/symfony/contracts/Cache/CacheInterface.php b/vendor/symfony/contracts/Cache/CacheInterface.php
deleted file mode 100644
index 4b1686b87..000000000
--- a/vendor/symfony/contracts/Cache/CacheInterface.php
+++ /dev/null
@@ -1,57 +0,0 @@
-
- *
- * 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
deleted file mode 100644
index 7bbdef087..000000000
--- a/vendor/symfony/contracts/Cache/CacheTrait.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\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);
- $this->logger && $this->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
deleted file mode 100644
index 7dae2aac3..000000000
--- a/vendor/symfony/contracts/Cache/CallbackInterface.php
+++ /dev/null
@@ -1,30 +0,0 @@
-
- *
- * 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
deleted file mode 100644
index 4884a2fff..000000000
--- a/vendor/symfony/contracts/Cache/ItemInterface.php
+++ /dev/null
@@ -1,60 +0,0 @@
-
- *
- * 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';
-
- /**
- * 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/contracts/Cache/README.md b/vendor/symfony/contracts/Cache/README.md
deleted file mode 100644
index 58c589e9e..000000000
--- a/vendor/symfony/contracts/Cache/README.md
+++ /dev/null
@@ -1,9 +0,0 @@
-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
deleted file mode 100644
index 7c4cf1111..000000000
--- a/vendor/symfony/contracts/Cache/TagAwareCacheInterface.php
+++ /dev/null
@@ -1,38 +0,0 @@
-
- *
- * 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
deleted file mode 100644
index d5d7e99b9..000000000
--- a/vendor/symfony/contracts/Cache/composer.json
+++ /dev/null
@@ -1,34 +0,0 @@
-{
- "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"
- },
- "suggest": {
- "psr/cache": "",
- "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/HttpClient/ChunkInterface.php b/vendor/symfony/contracts/HttpClient/ChunkInterface.php
deleted file mode 100644
index bbec2cdfa..000000000
--- a/vendor/symfony/contracts/HttpClient/ChunkInterface.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\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 inactivity 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 inactivity timeout is reached
- */
- public function isFirst(): bool;
-
- /**
- * Tells when the body just completed.
- *
- * @throws TransportExceptionInterface on a network error or when the inactivity timeout is reached
- */
- public function isLast(): bool;
-
- /**
- * Returns the content of the response chunk.
- *
- * @throws TransportExceptionInterface on a network error or when the inactivity 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/contracts/HttpClient/Exception/ClientExceptionInterface.php b/vendor/symfony/contracts/HttpClient/Exception/ClientExceptionInterface.php
deleted file mode 100644
index 5b5fa5084..000000000
--- a/vendor/symfony/contracts/HttpClient/Exception/ClientExceptionInterface.php
+++ /dev/null
@@ -1,23 +0,0 @@
-
- *
- * 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 4xx response is returned.
- *
- * @author Nicolas Grekas
- *
- * @experimental in 1.1
- */
-interface ClientExceptionInterface extends HttpExceptionInterface
-{
-}
diff --git a/vendor/symfony/contracts/HttpClient/Exception/HttpExceptionInterface.php b/vendor/symfony/contracts/HttpClient/Exception/HttpExceptionInterface.php
deleted file mode 100644
index 0e9f39f6e..000000000
--- a/vendor/symfony/contracts/HttpClient/Exception/HttpExceptionInterface.php
+++ /dev/null
@@ -1,26 +0,0 @@
-
- *
- * 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
deleted file mode 100644
index 8cdd3e70d..000000000
--- a/vendor/symfony/contracts/HttpClient/Exception/RedirectionExceptionInterface.php
+++ /dev/null
@@ -1,23 +0,0 @@
-
- *
- * 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
deleted file mode 100644
index f994ba2dd..000000000
--- a/vendor/symfony/contracts/HttpClient/Exception/ServerExceptionInterface.php
+++ /dev/null
@@ -1,23 +0,0 @@
-
- *
- * 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
deleted file mode 100644
index 1cdc30a2f..000000000
--- a/vendor/symfony/contracts/HttpClient/Exception/TransportExceptionInterface.php
+++ /dev/null
@@ -1,23 +0,0 @@
-
- *
- * 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
deleted file mode 100644
index b98558522..000000000
--- a/vendor/symfony/contracts/HttpClient/HttpClientInterface.php
+++ /dev/null
@@ -1,91 +0,0 @@
-
- *
- * 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; when
- // an array is passed, it is meant as a form payload of field names and values
- 'json' => null, // array|\JsonSerializable - when set, implementations MUST set the "body" option to
- // the JSON-encoded value and set the "content-type" headers to a JSON-compatible
- // value if they are not defined - 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 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 - whether the content of the response should be buffered or not
- '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 inactivity timeout - defaults to ini_get('default_socket_timeout')
- '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 inactivity timeout before exiting the iterator
- */
- public function stream($responses, float $timeout = null): ResponseStreamInterface;
-}
diff --git a/vendor/symfony/contracts/HttpClient/README.md b/vendor/symfony/contracts/HttpClient/README.md
deleted file mode 100644
index 01f811894..000000000
--- a/vendor/symfony/contracts/HttpClient/README.md
+++ /dev/null
@@ -1,9 +0,0 @@
-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
deleted file mode 100644
index a7e01be84..000000000
--- a/vendor/symfony/contracts/HttpClient/ResponseInterface.php
+++ /dev/null
@@ -1,106 +0,0 @@
-
- *
- * 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\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 TransportExceptionInterface When the body cannot be decoded or 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;
-
- /**
- * Cancels the response.
- */
- 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:
- * - response_headers - an array modelled after the special $http_response_header variable
- * - redirect_count - the number of redirects followed while executing the request
- * - redirect_url - the resolved location of redirect responses, null otherwise
- * - start_time - the time when the request was sent or 0.0 when it's pending
- * - http_method - the HTTP verb of the last request
- * - http_code - the last response code or 0 when it is not known yet
- * - error - the error message when the transfer was aborted, null otherwise
- * - user_data - the value of the "user_data" request option, null if not set
- * - url - the last effective URL of the request
- *
- * 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
deleted file mode 100644
index dfff554df..000000000
--- a/vendor/symfony/contracts/HttpClient/ResponseStreamInterface.php
+++ /dev/null
@@ -1,26 +0,0 @@
-
- *
- * 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
deleted file mode 100644
index 676319893..000000000
--- a/vendor/symfony/contracts/HttpClient/Test/Fixtures/web/index.php
+++ /dev/null
@@ -1,128 +0,0 @@
- $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;
- }
-}
-
-switch ($vars['REQUEST_URI']) {
- default:
- exit;
-
- case '/':
- case '/?a=a&b=b':
- case 'http://127.0.0.1:8057/':
- case 'http://localhost:8057/':
- header('Content-Type: application/json');
- ob_start('ob_gzhandler');
- break;
-
- 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 '/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;
-}
-
-header('Content-Type: application/json', true);
-
-echo json_encode($vars, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
diff --git a/vendor/symfony/contracts/HttpClient/Test/HttpClientTestCase.php b/vendor/symfony/contracts/HttpClient/Test/HttpClientTestCase.php
deleted file mode 100644
index c995bc26f..000000000
--- a/vendor/symfony/contracts/HttpClient/Test/HttpClientTestCase.php
+++ /dev/null
@@ -1,757 +0,0 @@
-
- *
- * 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()
- {
- 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 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 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));
- }
-
- 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 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->assertContains('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 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' => 3]);
- }
-
- 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__);
-
- $downloaded = 0;
- $start = microtime(true);
- $client->request('GET', 'http://localhost:8057/timeout-long');
- $client = null;
- $duration = microtime(true) - $start;
-
- $this->assertGreaterThan(1, $duration);
- $this->assertLessThan(3, $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->assertContains('gzip', $headers['content-encoding'][0]);
-
- $body = $response->toArray();
-
- $this->assertContains('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']);
- }
-
- /**
- * @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->assertContains('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();
- }
-}
diff --git a/vendor/symfony/contracts/HttpClient/Test/TestHttpServer.php b/vendor/symfony/contracts/HttpClient/Test/TestHttpServer.php
deleted file mode 100644
index 8e7a469c4..000000000
--- a/vendor/symfony/contracts/HttpClient/Test/TestHttpServer.php
+++ /dev/null
@@ -1,49 +0,0 @@
-
- *
- * 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/README.md b/vendor/symfony/contracts/README.md
deleted file mode 100644
index 480c2a90e..000000000
--- a/vendor/symfony/contracts/README.md
+++ /dev/null
@@ -1,54 +0,0 @@
-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/ServiceSubscriberTrait.php b/vendor/symfony/contracts/Service/ServiceSubscriberTrait.php
deleted file mode 100644
index ceaef6fa1..000000000
--- a/vendor/symfony/contracts/Service/ServiceSubscriberTrait.php
+++ /dev/null
@@ -1,61 +0,0 @@
-
- *
- * 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 */
- private $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);
- }
- }
-}
diff --git a/vendor/symfony/contracts/Tests/Cache/CacheTraitTest.php b/vendor/symfony/contracts/Tests/Cache/CacheTraitTest.php
deleted file mode 100644
index f77d103c9..000000000
--- a/vendor/symfony/contracts/Tests/Cache/CacheTraitTest.php
+++ /dev/null
@@ -1,165 +0,0 @@
-
- *
- * 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)
- {
- }
-
- public function deleteItem($key)
- {
- }
-
- public function deleteItems(array $keys = [])
- {
- }
-
- public function getItem($key)
- {
- }
-
- public function getItems(array $key = [])
- {
- }
-
- public function saveDeferred(CacheItemInterface $item)
- {
- }
-
- public function save(CacheItemInterface $item)
- {
- }
-
- public function commit()
- {
- }
-
- public function clear()
- {
- }
-}
diff --git a/vendor/symfony/contracts/Tests/Service/ServiceSubscriberTraitTest.php b/vendor/symfony/contracts/Tests/Service/ServiceSubscriberTraitTest.php
deleted file mode 100644
index 344bba877..000000000
--- a/vendor/symfony/contracts/Tests/Service/ServiceSubscriberTraitTest.php
+++ /dev/null
@@ -1,65 +0,0 @@
-
- *
- * 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/LICENSE b/vendor/symfony/contracts/Translation/LICENSE
deleted file mode 100644
index 3f853aaf3..000000000
--- a/vendor/symfony/contracts/Translation/LICENSE
+++ /dev/null
@@ -1,19 +0,0 @@
-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
deleted file mode 100644
index dbd8894fe..000000000
--- a/vendor/symfony/contracts/Translation/LocaleAwareInterface.php
+++ /dev/null
@@ -1,31 +0,0 @@
-
- *
- * 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
deleted file mode 100644
index 6c693ce0b..000000000
--- a/vendor/symfony/contracts/Translation/README.md
+++ /dev/null
@@ -1,9 +0,0 @@
-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
deleted file mode 100644
index 48466300b..000000000
--- a/vendor/symfony/contracts/Translation/Test/TranslatorTest.php
+++ /dev/null
@@ -1,353 +0,0 @@
-
- *
- * 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
- * @expectedException \InvalidArgumentException
- */
- public function testThrowExceptionIfMatchingMessageCannotBeFound($id, $number)
- {
- $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
deleted file mode 100644
index d86763737..000000000
--- a/vendor/symfony/contracts/Translation/TranslatorInterface.php
+++ /dev/null
@@ -1,65 +0,0 @@
-
- *
- * 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
deleted file mode 100644
index c1021923c..000000000
--- a/vendor/symfony/contracts/Translation/TranslatorTrait.php
+++ /dev/null
@@ -1,255 +0,0 @@
-
- *
- * 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)
- {
- $id = (string) $id;
-
- 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
deleted file mode 100644
index 09749d35f..000000000
--- a/vendor/symfony/contracts/Translation/composer.json
+++ /dev/null
@@ -1,33 +0,0 @@
-{
- "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
deleted file mode 100644
index f78ba697d..000000000
--- a/vendor/symfony/contracts/composer.json
+++ /dev/null
@@ -1,55 +0,0 @@
-{
- "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"
- },
- "require-dev": {
- "psr/cache": "^1.0",
- "psr/container": "^1.0",
- "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/cache": "When using the Cache contracts",
- "psr/container": "When using the Service contracts",
- "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/contracts/phpunit.xml.dist b/vendor/symfony/contracts/phpunit.xml.dist
deleted file mode 100644
index fd93d020f..000000000
--- a/vendor/symfony/contracts/phpunit.xml.dist
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
-
-
-
-
-
-
- ./Tests/
- ./Service/Test/
- ./Translation/Test/
-
-
-
-
-
- ./
-
- ./Tests
- ./Service/Test/
- ./Translation/Test/
- ./vendor
-
-
-
-
-
diff --git a/vendor/symfony/console/.gitignore b/vendor/symfony/deprecation-contracts/.gitignore
similarity index 100%
rename from vendor/symfony/console/.gitignore
rename to vendor/symfony/deprecation-contracts/.gitignore
diff --git a/vendor/symfony/deprecation-contracts/CHANGELOG.md b/vendor/symfony/deprecation-contracts/CHANGELOG.md
new file mode 100644
index 000000000..7932e2613
--- /dev/null
+++ b/vendor/symfony/deprecation-contracts/CHANGELOG.md
@@ -0,0 +1,5 @@
+CHANGELOG
+=========
+
+The changelog is maintained for all Symfony contracts at the following URL:
+https://github.com/symfony/contracts/blob/main/CHANGELOG.md
diff --git a/vendor/symfony/contracts/EventDispatcher/LICENSE b/vendor/symfony/deprecation-contracts/LICENSE
similarity index 96%
rename from vendor/symfony/contracts/EventDispatcher/LICENSE
rename to vendor/symfony/deprecation-contracts/LICENSE
index 3f853aaf3..ad85e1737 100644
--- a/vendor/symfony/contracts/EventDispatcher/LICENSE
+++ b/vendor/symfony/deprecation-contracts/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2018-2019 Fabien Potencier
+Copyright (c) 2020-2021 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/deprecation-contracts/README.md b/vendor/symfony/deprecation-contracts/README.md
new file mode 100644
index 000000000..4957933a6
--- /dev/null
+++ b/vendor/symfony/deprecation-contracts/README.md
@@ -0,0 +1,26 @@
+Symfony Deprecation Contracts
+=============================
+
+A generic function and convention to trigger deprecation notices.
+
+This package provides a single global function named `trigger_deprecation()` that triggers silenced deprecation notices.
+
+By using a custom PHP error handler such as the one provided by the Symfony ErrorHandler component,
+the triggered deprecations can be caught and logged for later discovery, both on dev and prod environments.
+
+The function requires at least 3 arguments:
+ - the name of the Composer package that is triggering the deprecation
+ - the version of the package that introduced the deprecation
+ - the message of the deprecation
+ - more arguments can be provided: they will be inserted in the message using `printf()` formatting
+
+Example:
+```php
+trigger_deprecation('symfony/blockchain', '8.9', 'Using "%s" is deprecated, use "%s" instead.', 'bitcoin', 'fabcoin');
+```
+
+This will generate the following message:
+`Since symfony/blockchain 8.9: Using "bitcoin" is deprecated, use "fabcoin" instead.`
+
+While not necessarily recommended, the deprecation notices can be completely ignored by declaring an empty
+`function trigger_deprecation() {}` in your application.
diff --git a/vendor/symfony/contracts/HttpClient/composer.json b/vendor/symfony/deprecation-contracts/composer.json
similarity index 53%
rename from vendor/symfony/contracts/HttpClient/composer.json
rename to vendor/symfony/deprecation-contracts/composer.json
index 4dc9b2d38..cc7cc1237 100644
--- a/vendor/symfony/contracts/HttpClient/composer.json
+++ b/vendor/symfony/deprecation-contracts/composer.json
@@ -1,8 +1,7 @@
{
- "name": "symfony/http-client-contracts",
+ "name": "symfony/deprecation-contracts",
"type": "library",
- "description": "Generic abstractions related to HTTP clients",
- "keywords": ["abstractions", "contracts", "decoupling", "interfaces", "interoperability", "standards"],
+ "description": "A generic function and convention to trigger deprecation notices",
"homepage": "https://symfony.com",
"license": "MIT",
"authors": [
@@ -16,18 +15,21 @@
}
],
"require": {
- "php": "^7.1.3"
- },
- "suggest": {
- "symfony/http-client-implementation": ""
+ "php": ">=7.1"
},
"autoload": {
- "psr-4": { "Symfony\\Contracts\\HttpClient\\": "" }
+ "files": [
+ "function.php"
+ ]
},
"minimum-stability": "dev",
"extra": {
"branch-alias": {
- "dev-master": "1.1-dev"
+ "dev-main": "2.5-dev"
+ },
+ "thanks": {
+ "name": "symfony/contracts",
+ "url": "https://github.com/symfony/contracts"
}
}
}
diff --git a/vendor/symfony/deprecation-contracts/function.php b/vendor/symfony/deprecation-contracts/function.php
new file mode 100644
index 000000000..d4371504a
--- /dev/null
+++ b/vendor/symfony/deprecation-contracts/function.php
@@ -0,0 +1,27 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+if (!function_exists('trigger_deprecation')) {
+ /**
+ * Triggers a silenced deprecation notice.
+ *
+ * @param string $package The name of the Composer package that is triggering the deprecation
+ * @param string $version The version of the package that introduced the deprecation
+ * @param string $message The message of the deprecation
+ * @param mixed ...$args Values to insert in the message using printf() formatting
+ *
+ * @author Nicolas Grekas
+ */
+ function trigger_deprecation(string $package, string $version, string $message, ...$args): void
+ {
+ @trigger_error(($package || $version ? "Since $package $version: " : '').($args ? vsprintf($message, $args) : $message), \E_USER_DEPRECATED);
+ }
+}
diff --git a/vendor/symfony/event-dispatcher/.gitignore b/vendor/symfony/event-dispatcher-contracts/.gitignore
similarity index 100%
rename from vendor/symfony/event-dispatcher/.gitignore
rename to vendor/symfony/event-dispatcher-contracts/.gitignore
diff --git a/vendor/symfony/contracts/EventDispatcher/Event.php b/vendor/symfony/event-dispatcher-contracts/Event.php
similarity index 100%
rename from vendor/symfony/contracts/EventDispatcher/Event.php
rename to vendor/symfony/event-dispatcher-contracts/Event.php
diff --git a/vendor/symfony/contracts/EventDispatcher/EventDispatcherInterface.php b/vendor/symfony/event-dispatcher-contracts/EventDispatcherInterface.php
similarity index 100%
rename from vendor/symfony/contracts/EventDispatcher/EventDispatcherInterface.php
rename to vendor/symfony/event-dispatcher-contracts/EventDispatcherInterface.php
diff --git a/vendor/symfony/contracts/HttpClient/LICENSE b/vendor/symfony/event-dispatcher-contracts/LICENSE
similarity index 96%
rename from vendor/symfony/contracts/HttpClient/LICENSE
rename to vendor/symfony/event-dispatcher-contracts/LICENSE
index 3f853aaf3..235841453 100644
--- a/vendor/symfony/contracts/HttpClient/LICENSE
+++ b/vendor/symfony/event-dispatcher-contracts/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2018-2019 Fabien Potencier
+Copyright (c) 2018-2021 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/EventDispatcher/README.md b/vendor/symfony/event-dispatcher-contracts/README.md
similarity index 75%
rename from vendor/symfony/contracts/EventDispatcher/README.md
rename to vendor/symfony/event-dispatcher-contracts/README.md
index fb051c73f..b1ab4c00c 100644
--- a/vendor/symfony/contracts/EventDispatcher/README.md
+++ b/vendor/symfony/event-dispatcher-contracts/README.md
@@ -6,4 +6,4 @@ 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.
+See https://github.com/symfony/contracts/blob/main/README.md for more information.
diff --git a/vendor/symfony/contracts/EventDispatcher/composer.json b/vendor/symfony/event-dispatcher-contracts/composer.json
similarity index 82%
rename from vendor/symfony/contracts/EventDispatcher/composer.json
rename to vendor/symfony/event-dispatcher-contracts/composer.json
index 55802a491..9d4bd7bea 100644
--- a/vendor/symfony/contracts/EventDispatcher/composer.json
+++ b/vendor/symfony/event-dispatcher-contracts/composer.json
@@ -16,7 +16,7 @@
}
],
"require": {
- "php": "^7.1.3"
+ "php": ">=7.1.3"
},
"suggest": {
"psr/event-dispatcher": "",
@@ -28,7 +28,11 @@
"minimum-stability": "dev",
"extra": {
"branch-alias": {
- "dev-master": "1.1-dev"
+ "dev-main": "1.1-dev"
+ },
+ "thanks": {
+ "name": "symfony/contracts",
+ "url": "https://github.com/symfony/contracts"
}
}
}
diff --git a/vendor/symfony/event-dispatcher/CHANGELOG.md b/vendor/symfony/event-dispatcher/CHANGELOG.md
index c6aa5389a..4a3ea066e 100644
--- a/vendor/symfony/event-dispatcher/CHANGELOG.md
+++ b/vendor/symfony/event-dispatcher/CHANGELOG.md
@@ -1,24 +1,49 @@
CHANGELOG
=========
+4.4.0
+-----
+
+ * `AddEventAliasesPass` has been added, allowing applications and bundles to extend the event alias mapping used by `RegisterListenersPass`.
+ * Made the `event` attribute of the `kernel.event_listener` tag optional for FQCN events.
+
+4.3.0
+-----
+
+ * The signature of the `EventDispatcherInterface::dispatch()` method should be updated to `dispatch($event, string $eventName = null)`, not doing so is deprecated
+ * deprecated the `Event` class, use `Symfony\Contracts\EventDispatcher\Event` instead
+
+4.1.0
+-----
+
+ * added support for invokable event listeners tagged with `kernel.event_listener` by default
+ * The `TraceableEventDispatcher::getOrphanedEvents()` method has been added.
+ * The `TraceableEventDispatcherInterface` has been deprecated.
+
+4.0.0
+-----
+
+ * removed the `ContainerAwareEventDispatcher` class
+ * added the `reset()` method to the `TraceableEventDispatcherInterface`
+
3.4.0
-----
- * Implementing `TraceableEventDispatcherInterface` without the `reset()` method has been deprecated.
+ * Implementing `TraceableEventDispatcherInterface` without the `reset()` method has been deprecated.
3.3.0
-----
- * The ContainerAwareEventDispatcher class has been deprecated. Use EventDispatcher with closure factories instead.
+ * The ContainerAwareEventDispatcher class has been deprecated. Use EventDispatcher with closure factories instead.
3.0.0
-----
- * The method `getListenerPriority($eventName, $listener)` has been added to the
- `EventDispatcherInterface`.
- * The methods `Event::setDispatcher()`, `Event::getDispatcher()`, `Event::setName()`
- and `Event::getName()` have been removed.
- The event dispatcher and the event name are passed to the listener call.
+ * The method `getListenerPriority($eventName, $listener)` has been added to the
+ `EventDispatcherInterface`.
+ * The methods `Event::setDispatcher()`, `Event::getDispatcher()`, `Event::setName()`
+ and `Event::getName()` have been removed.
+ The event dispatcher and the event name are passed to the listener call.
2.5.0
-----
diff --git a/vendor/symfony/event-dispatcher/ContainerAwareEventDispatcher.php b/vendor/symfony/event-dispatcher/ContainerAwareEventDispatcher.php
deleted file mode 100644
index 7a2b68be2..000000000
--- a/vendor/symfony/event-dispatcher/ContainerAwareEventDispatcher.php
+++ /dev/null
@@ -1,197 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\EventDispatcher;
-
-use Symfony\Component\DependencyInjection\ContainerInterface;
-
-/**
- * Lazily loads listeners and subscribers from the dependency injection
- * container.
- *
- * @author Fabien Potencier
- * @author Bernhard Schussek
- * @author Jordan Alliot
- *
- * @deprecated since 3.3, to be removed in 4.0. Use EventDispatcher with closure factories instead.
- */
-class ContainerAwareEventDispatcher extends EventDispatcher
-{
- private $container;
-
- /**
- * The service IDs of the event listeners and subscribers.
- */
- private $listenerIds = array();
-
- /**
- * The services registered as listeners.
- */
- private $listeners = array();
-
- public function __construct(ContainerInterface $container)
- {
- $this->container = $container;
-
- $class = get_class($this);
- if ($this instanceof \PHPUnit_Framework_MockObject_MockObject || $this instanceof \Prophecy\Doubler\DoubleInterface) {
- $class = get_parent_class($class);
- }
- if (__CLASS__ !== $class) {
- @trigger_error(sprintf('The %s class is deprecated since version 3.3 and will be removed in 4.0. Use EventDispatcher with closure factories instead.', __CLASS__), E_USER_DEPRECATED);
- }
- }
-
- /**
- * Adds a service as event listener.
- *
- * @param string $eventName Event for which the listener is added
- * @param array $callback The service ID of the listener service & the method
- * name that has to be called
- * @param int $priority The higher this value, the earlier an event listener
- * will be triggered in the chain.
- * Defaults to 0.
- *
- * @throws \InvalidArgumentException
- */
- public function addListenerService($eventName, $callback, $priority = 0)
- {
- @trigger_error(sprintf('The %s class is deprecated since version 3.3 and will be removed in 4.0. Use EventDispatcher with closure factories instead.', __CLASS__), E_USER_DEPRECATED);
-
- if (!is_array($callback) || 2 !== count($callback)) {
- throw new \InvalidArgumentException('Expected an array("service", "method") argument');
- }
-
- $this->listenerIds[$eventName][] = array($callback[0], $callback[1], $priority);
- }
-
- public function removeListener($eventName, $listener)
- {
- $this->lazyLoad($eventName);
-
- if (isset($this->listenerIds[$eventName])) {
- foreach ($this->listenerIds[$eventName] as $i => list($serviceId, $method)) {
- $key = $serviceId.'.'.$method;
- if (isset($this->listeners[$eventName][$key]) && $listener === array($this->listeners[$eventName][$key], $method)) {
- unset($this->listeners[$eventName][$key]);
- if (empty($this->listeners[$eventName])) {
- unset($this->listeners[$eventName]);
- }
- unset($this->listenerIds[$eventName][$i]);
- if (empty($this->listenerIds[$eventName])) {
- unset($this->listenerIds[$eventName]);
- }
- }
- }
- }
-
- parent::removeListener($eventName, $listener);
- }
-
- /**
- * {@inheritdoc}
- */
- public function hasListeners($eventName = null)
- {
- if (null === $eventName) {
- return $this->listenerIds || $this->listeners || parent::hasListeners();
- }
-
- if (isset($this->listenerIds[$eventName])) {
- return true;
- }
-
- return parent::hasListeners($eventName);
- }
-
- /**
- * {@inheritdoc}
- */
- public function getListeners($eventName = null)
- {
- if (null === $eventName) {
- foreach ($this->listenerIds as $serviceEventName => $args) {
- $this->lazyLoad($serviceEventName);
- }
- } else {
- $this->lazyLoad($eventName);
- }
-
- return parent::getListeners($eventName);
- }
-
- /**
- * {@inheritdoc}
- */
- public function getListenerPriority($eventName, $listener)
- {
- $this->lazyLoad($eventName);
-
- return parent::getListenerPriority($eventName, $listener);
- }
-
- /**
- * Adds a service as event subscriber.
- *
- * @param string $serviceId The service ID of the subscriber service
- * @param string $class The service's class name (which must implement EventSubscriberInterface)
- */
- public function addSubscriberService($serviceId, $class)
- {
- @trigger_error(sprintf('The %s class is deprecated since version 3.3 and will be removed in 4.0. Use EventDispatcher with closure factories instead.', __CLASS__), E_USER_DEPRECATED);
-
- foreach ($class::getSubscribedEvents() as $eventName => $params) {
- if (is_string($params)) {
- $this->listenerIds[$eventName][] = array($serviceId, $params, 0);
- } elseif (is_string($params[0])) {
- $this->listenerIds[$eventName][] = array($serviceId, $params[0], isset($params[1]) ? $params[1] : 0);
- } else {
- foreach ($params as $listener) {
- $this->listenerIds[$eventName][] = array($serviceId, $listener[0], isset($listener[1]) ? $listener[1] : 0);
- }
- }
- }
- }
-
- public function getContainer()
- {
- @trigger_error('The '.__METHOD__.'() method is deprecated since version 3.3 as its class will be removed in 4.0. Inject the container or the services you need in your listeners/subscribers instead.', E_USER_DEPRECATED);
-
- return $this->container;
- }
-
- /**
- * Lazily loads listeners for this event from the dependency injection
- * container.
- *
- * @param string $eventName The name of the event to dispatch. The name of
- * the event is the name of the method that is
- * invoked on listeners.
- */
- protected function lazyLoad($eventName)
- {
- if (isset($this->listenerIds[$eventName])) {
- foreach ($this->listenerIds[$eventName] as list($serviceId, $method, $priority)) {
- $listener = $this->container->get($serviceId);
-
- $key = $serviceId.'.'.$method;
- if (!isset($this->listeners[$eventName][$key])) {
- $this->addListener($eventName, array($listener, $method), $priority);
- } elseif ($this->listeners[$eventName][$key] !== $listener) {
- parent::removeListener($eventName, array($this->listeners[$eventName][$key], $method));
- $this->addListener($eventName, array($listener, $method), $priority);
- }
-
- $this->listeners[$eventName][$key] = $listener;
- }
- }
- }
-}
diff --git a/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php b/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php
index 9b5c689ad..e79d1a8e3 100644
--- a/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php
+++ b/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php
@@ -11,11 +11,17 @@
namespace Symfony\Component\EventDispatcher\Debug;
+use Psr\EventDispatcher\StoppableEventInterface;
+use Psr\Log\LoggerInterface;
+use Symfony\Component\EventDispatcher\Event;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
-use Symfony\Component\EventDispatcher\Event;
+use Symfony\Component\EventDispatcher\LegacyEventDispatcherProxy;
+use Symfony\Component\EventDispatcher\LegacyEventProxy;
+use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\Stopwatch\Stopwatch;
-use Psr\Log\LoggerInterface;
+use Symfony\Contracts\EventDispatcher\Event as ContractsEvent;
/**
* Collects some data about event listeners.
@@ -29,17 +35,21 @@ class TraceableEventDispatcher implements TraceableEventDispatcherInterface
protected $logger;
protected $stopwatch;
- private $called;
+ private $callStack;
private $dispatcher;
private $wrappedListeners;
+ private $orphanedEvents;
+ private $requestStack;
+ private $currentRequestHash = '';
- public function __construct(EventDispatcherInterface $dispatcher, Stopwatch $stopwatch, LoggerInterface $logger = null)
+ public function __construct(EventDispatcherInterface $dispatcher, Stopwatch $stopwatch, LoggerInterface $logger = null, RequestStack $requestStack = null)
{
- $this->dispatcher = $dispatcher;
+ $this->dispatcher = LegacyEventDispatcherProxy::decorate($dispatcher);
$this->stopwatch = $stopwatch;
$this->logger = $logger;
- $this->called = array();
- $this->wrappedListeners = array();
+ $this->wrappedListeners = [];
+ $this->orphanedEvents = [];
+ $this->requestStack = $requestStack;
}
/**
@@ -120,43 +130,75 @@ class TraceableEventDispatcher implements TraceableEventDispatcherInterface
/**
* {@inheritdoc}
+ *
+ * @param string|null $eventName
*/
- public function dispatch($eventName, Event $event = null)
+ public function dispatch($event/*, string $eventName = null*/)
{
- if (null === $event) {
- $event = new Event();
+ if (null === $this->callStack) {
+ $this->callStack = new \SplObjectStorage();
}
- if (null !== $this->logger && $event->isPropagationStopped()) {
+ $currentRequestHash = $this->currentRequestHash = $this->requestStack && ($request = $this->requestStack->getCurrentRequest()) ? spl_object_hash($request) : '';
+ $eventName = 1 < \func_num_args() ? func_get_arg(1) : null;
+
+ if (\is_object($event)) {
+ $eventName = $eventName ?? \get_class($event);
+ } else {
+ @trigger_error(sprintf('Calling the "%s::dispatch()" method with the event name as first argument is deprecated since Symfony 4.3, pass it second and provide the event object first instead.', EventDispatcherInterface::class), \E_USER_DEPRECATED);
+ $swap = $event;
+ $event = $eventName ?? new Event();
+ $eventName = $swap;
+
+ if (!$event instanceof Event) {
+ throw new \TypeError(sprintf('Argument 1 passed to "%s::dispatch()" must be an instance of "%s", "%s" given.', EventDispatcherInterface::class, Event::class, \is_object($event) ? \get_class($event) : \gettype($event)));
+ }
+ }
+
+ if (null !== $this->logger && ($event instanceof Event || $event instanceof ContractsEvent || $event instanceof StoppableEventInterface) && $event->isPropagationStopped()) {
$this->logger->debug(sprintf('The "%s" event is already stopped. No listeners have been called.', $eventName));
}
$this->preProcess($eventName);
- $this->preDispatch($eventName, $event);
-
- $e = $this->stopwatch->start($eventName, 'section');
-
- $this->dispatcher->dispatch($eventName, $event);
-
- if ($e->isStarted()) {
- $e->stop();
+ try {
+ $this->beforeDispatch($eventName, $event);
+ try {
+ $e = $this->stopwatch->start($eventName, 'section');
+ try {
+ $this->dispatcher->dispatch($event, $eventName);
+ } finally {
+ if ($e->isStarted()) {
+ $e->stop();
+ }
+ }
+ } finally {
+ $this->afterDispatch($eventName, $event);
+ }
+ } finally {
+ $this->currentRequestHash = $currentRequestHash;
+ $this->postProcess($eventName);
}
- $this->postDispatch($eventName, $event);
- $this->postProcess($eventName);
-
return $event;
}
/**
* {@inheritdoc}
+ *
+ * @param Request|null $request The request to get listeners for
*/
- public function getCalledListeners()
+ public function getCalledListeners(/* Request $request = null */)
{
- $called = array();
- foreach ($this->called as $eventName => $listeners) {
- foreach ($listeners as $listener) {
- $called[$eventName.'.'.$listener->getPretty()] = $listener->getInfo($eventName);
+ if (null === $this->callStack) {
+ return [];
+ }
+
+ $hash = 1 <= \func_num_args() && null !== ($request = func_get_arg(0)) ? spl_object_hash($request) : null;
+ $called = [];
+ foreach ($this->callStack as $listener) {
+ [$eventName, $requestHash] = $this->callStack->getInfo();
+ if (null === $hash || $hash === $requestHash) {
+ $called[] = $listener->getInfo($eventName);
}
}
@@ -165,51 +207,73 @@ class TraceableEventDispatcher implements TraceableEventDispatcherInterface
/**
* {@inheritdoc}
+ *
+ * @param Request|null $request The request to get listeners for
*/
- public function getNotCalledListeners()
+ public function getNotCalledListeners(/* Request $request = null */)
{
try {
$allListeners = $this->getListeners();
} catch (\Exception $e) {
if (null !== $this->logger) {
- $this->logger->info('An exception was thrown while getting the uncalled listeners.', array('exception' => $e));
+ $this->logger->info('An exception was thrown while getting the uncalled listeners.', ['exception' => $e]);
}
// unable to retrieve the uncalled listeners
- return array();
+ return [];
}
- $notCalled = array();
- foreach ($allListeners as $eventName => $listeners) {
- foreach ($listeners as $listener) {
- $called = false;
- if (isset($this->called[$eventName])) {
- foreach ($this->called[$eventName] as $l) {
- if ($l->getWrappedListener() === $listener) {
- $called = true;
+ $hash = 1 <= \func_num_args() && null !== ($request = func_get_arg(0)) ? spl_object_hash($request) : null;
+ $calledListeners = [];
- break;
- }
- }
- }
+ if (null !== $this->callStack) {
+ foreach ($this->callStack as $calledListener) {
+ [, $requestHash] = $this->callStack->getInfo();
- if (!$called) {
- if (!$listener instanceof WrappedListener) {
- $listener = new WrappedListener($listener, null, $this->stopwatch, $this);
- }
- $notCalled[$eventName.'.'.$listener->getPretty()] = $listener->getInfo($eventName);
+ if (null === $hash || $hash === $requestHash) {
+ $calledListeners[] = $calledListener->getWrappedListener();
}
}
}
- uasort($notCalled, array($this, 'sortListenersByPriority'));
+ $notCalled = [];
+ foreach ($allListeners as $eventName => $listeners) {
+ foreach ($listeners as $listener) {
+ if (!\in_array($listener, $calledListeners, true)) {
+ if (!$listener instanceof WrappedListener) {
+ $listener = new WrappedListener($listener, null, $this->stopwatch, $this);
+ }
+ $notCalled[] = $listener->getInfo($eventName);
+ }
+ }
+ }
+
+ uasort($notCalled, [$this, 'sortNotCalledListeners']);
return $notCalled;
}
+ /**
+ * @param Request|null $request The request to get orphaned events for
+ */
+ public function getOrphanedEvents(/* Request $request = null */): array
+ {
+ if (1 <= \func_num_args() && null !== $request = func_get_arg(0)) {
+ return $this->orphanedEvents[spl_object_hash($request)] ?? [];
+ }
+
+ if (!$this->orphanedEvents) {
+ return [];
+ }
+
+ return array_merge(...array_values($this->orphanedEvents));
+ }
+
public function reset()
{
- $this->called = array();
+ $this->callStack = null;
+ $this->orphanedEvents = [];
+ $this->currentRequestHash = '';
}
/**
@@ -222,41 +286,62 @@ class TraceableEventDispatcher implements TraceableEventDispatcherInterface
*/
public function __call($method, $arguments)
{
- return call_user_func_array(array($this->dispatcher, $method), $arguments);
+ return $this->dispatcher->{$method}(...$arguments);
}
/**
* Called before dispatching the event.
*
- * @param string $eventName The event name
- * @param Event $event The event
+ * @param object $event
+ */
+ protected function beforeDispatch(string $eventName, $event)
+ {
+ $this->preDispatch($eventName, $event instanceof Event ? $event : new LegacyEventProxy($event));
+ }
+
+ /**
+ * Called after dispatching the event.
+ *
+ * @param object $event
+ */
+ protected function afterDispatch(string $eventName, $event)
+ {
+ $this->postDispatch($eventName, $event instanceof Event ? $event : new LegacyEventProxy($event));
+ }
+
+ /**
+ * @deprecated since Symfony 4.3, will be removed in 5.0, use beforeDispatch instead
*/
protected function preDispatch($eventName, Event $event)
{
}
/**
- * Called after dispatching the event.
- *
- * @param string $eventName The event name
- * @param Event $event The event
+ * @deprecated since Symfony 4.3, will be removed in 5.0, use afterDispatch instead
*/
protected function postDispatch($eventName, Event $event)
{
}
- private function preProcess($eventName)
+ private function preProcess(string $eventName)
{
+ if (!$this->dispatcher->hasListeners($eventName)) {
+ $this->orphanedEvents[$this->currentRequestHash][] = $eventName;
+
+ return;
+ }
+
foreach ($this->dispatcher->getListeners($eventName) as $listener) {
$priority = $this->getListenerPriority($eventName, $listener);
- $wrappedListener = new WrappedListener($listener, null, $this->stopwatch, $this);
+ $wrappedListener = new WrappedListener($listener instanceof WrappedListener ? $listener->getWrappedListener() : $listener, null, $this->stopwatch, $this);
$this->wrappedListeners[$eventName][] = $wrappedListener;
$this->dispatcher->removeListener($eventName, $listener);
$this->dispatcher->addListener($eventName, $wrappedListener, $priority);
+ $this->callStack->attach($wrappedListener, [$eventName, $this->currentRequestHash]);
}
}
- private function postProcess($eventName)
+ private function postProcess(string $eventName)
{
unset($this->wrappedListeners[$eventName]);
$skipped = false;
@@ -270,19 +355,15 @@ class TraceableEventDispatcher implements TraceableEventDispatcherInterface
$this->dispatcher->addListener($eventName, $listener->getWrappedListener(), $priority);
if (null !== $this->logger) {
- $context = array('event' => $eventName, 'listener' => $listener->getPretty());
+ $context = ['event' => $eventName, 'listener' => $listener->getPretty()];
}
if ($listener->wasCalled()) {
if (null !== $this->logger) {
$this->logger->debug('Notified event "{event}" to listener "{listener}".', $context);
}
-
- if (!isset($this->called[$eventName])) {
- $this->called[$eventName] = new \SplObjectStorage();
- }
-
- $this->called[$eventName]->attach($listener);
+ } else {
+ $this->callStack->detach($listener);
}
if (null !== $this->logger && $skipped) {
@@ -299,13 +380,17 @@ class TraceableEventDispatcher implements TraceableEventDispatcherInterface
}
}
- private function sortListenersByPriority($a, $b)
+ private function sortNotCalledListeners(array $a, array $b)
{
- if (is_int($a['priority']) && !is_int($b['priority'])) {
+ if (0 !== $cmp = strcmp($a['event'], $b['event'])) {
+ return $cmp;
+ }
+
+ if (\is_int($a['priority']) && !\is_int($b['priority'])) {
return 1;
}
- if (!is_int($a['priority']) && is_int($b['priority'])) {
+ if (!\is_int($a['priority']) && \is_int($b['priority'])) {
return -1;
}
diff --git a/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcherInterface.php b/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcherInterface.php
index f0212753b..4fedb9a41 100644
--- a/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcherInterface.php
+++ b/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcherInterface.php
@@ -12,25 +12,31 @@
namespace Symfony\Component\EventDispatcher\Debug;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
+use Symfony\Component\HttpFoundation\Request;
+use Symfony\Contracts\Service\ResetInterface;
/**
- * @author Fabien Potencier
+ * @deprecated since Symfony 4.1
*
- * @method reset() Resets the trace.
+ * @author Fabien Potencier
*/
-interface TraceableEventDispatcherInterface extends EventDispatcherInterface
+interface TraceableEventDispatcherInterface extends EventDispatcherInterface, ResetInterface
{
/**
* Gets the called listeners.
*
+ * @param Request|null $request The request to get listeners for
+ *
* @return array An array of called listeners
*/
- public function getCalledListeners();
+ public function getCalledListeners(/* Request $request = null */);
/**
* Gets the not called listeners.
*
+ * @param Request|null $request The request to get listeners for
+ *
* @return array An array of not called listeners
*/
- public function getNotCalledListeners();
+ public function getNotCalledListeners(/* Request $request = null */);
}
diff --git a/vendor/symfony/event-dispatcher/Debug/WrappedListener.php b/vendor/symfony/event-dispatcher/Debug/WrappedListener.php
index f7b0273e1..9b910e667 100644
--- a/vendor/symfony/event-dispatcher/Debug/WrappedListener.php
+++ b/vendor/symfony/event-dispatcher/Debug/WrappedListener.php
@@ -11,17 +11,23 @@
namespace Symfony\Component\EventDispatcher\Debug;
-use Symfony\Component\Stopwatch\Stopwatch;
+use Psr\EventDispatcher\StoppableEventInterface;
use Symfony\Component\EventDispatcher\Event;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
+use Symfony\Component\EventDispatcher\LegacyEventProxy;
+use Symfony\Component\Stopwatch\Stopwatch;
use Symfony\Component\VarDumper\Caster\ClassStub;
+use Symfony\Contracts\EventDispatcher\Event as ContractsEvent;
/**
* @author Fabien Potencier
+ *
+ * @final since Symfony 4.3: the "Event" type-hint on __invoke() will be replaced by "object" in 5.0
*/
class WrappedListener
{
private $listener;
+ private $optimizedListener;
private $name;
private $called;
private $stoppedPropagation;
@@ -29,26 +35,35 @@ class WrappedListener
private $dispatcher;
private $pretty;
private $stub;
+ private $priority;
private static $hasClassStub;
- public function __construct($listener, $name, Stopwatch $stopwatch, EventDispatcherInterface $dispatcher = null)
+ public function __construct($listener, ?string $name, Stopwatch $stopwatch, EventDispatcherInterface $dispatcher = null)
{
$this->listener = $listener;
- $this->name = $name;
+ $this->optimizedListener = $listener instanceof \Closure ? $listener : (\is_callable($listener) ? \Closure::fromCallable($listener) : null);
$this->stopwatch = $stopwatch;
$this->dispatcher = $dispatcher;
$this->called = false;
$this->stoppedPropagation = false;
- if (is_array($listener)) {
- $this->name = is_object($listener[0]) ? get_class($listener[0]) : $listener[0];
+ if (\is_array($listener)) {
+ $this->name = \is_object($listener[0]) ? \get_class($listener[0]) : $listener[0];
$this->pretty = $this->name.'::'.$listener[1];
} elseif ($listener instanceof \Closure) {
- $this->pretty = $this->name = 'closure';
- } elseif (is_string($listener)) {
+ $r = new \ReflectionFunction($listener);
+ if (str_contains($r->name, '{closure}')) {
+ $this->pretty = $this->name = 'closure';
+ } elseif ($class = $r->getClosureScopeClass()) {
+ $this->name = $class->name;
+ $this->pretty = $this->name.'::'.$r->name;
+ } else {
+ $this->pretty = $this->name = $r->name;
+ }
+ } elseif (\is_string($listener)) {
$this->pretty = $this->name = $listener;
} else {
- $this->name = get_class($listener);
+ $this->name = \get_class($listener);
$this->pretty = $this->name.'::__invoke';
}
@@ -87,27 +102,34 @@ class WrappedListener
$this->stub = self::$hasClassStub ? new ClassStub($this->pretty.'()', $this->listener) : $this->pretty.'()';
}
- return array(
+ return [
'event' => $eventName,
- 'priority' => null !== $this->dispatcher ? $this->dispatcher->getListenerPriority($eventName, $this->listener) : null,
+ 'priority' => null !== $this->priority ? $this->priority : (null !== $this->dispatcher ? $this->dispatcher->getListenerPriority($eventName, $this->listener) : null),
'pretty' => $this->pretty,
'stub' => $this->stub,
- );
+ ];
}
public function __invoke(Event $event, $eventName, EventDispatcherInterface $dispatcher)
{
+ if ($event instanceof LegacyEventProxy) {
+ $event = $event->getEvent();
+ }
+
+ $dispatcher = $this->dispatcher ?: $dispatcher;
+
$this->called = true;
+ $this->priority = $dispatcher->getListenerPriority($eventName, $this->listener);
$e = $this->stopwatch->start($this->name, 'event_listener');
- call_user_func($this->listener, $event, $eventName, $this->dispatcher ?: $dispatcher);
+ ($this->optimizedListener ?? $this->listener)($event, $eventName, $dispatcher);
if ($e->isStarted()) {
$e->stop();
}
- if ($event->isPropagationStopped()) {
+ if (($event instanceof Event || $event instanceof ContractsEvent || $event instanceof StoppableEventInterface) && $event->isPropagationStopped()) {
$this->stoppedPropagation = true;
}
}
diff --git a/vendor/symfony/event-dispatcher/DependencyInjection/AddEventAliasesPass.php b/vendor/symfony/event-dispatcher/DependencyInjection/AddEventAliasesPass.php
new file mode 100644
index 000000000..c4ea50f78
--- /dev/null
+++ b/vendor/symfony/event-dispatcher/DependencyInjection/AddEventAliasesPass.php
@@ -0,0 +1,42 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\EventDispatcher\DependencyInjection;
+
+use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
+use Symfony\Component\DependencyInjection\ContainerBuilder;
+
+/**
+ * This pass allows bundles to extend the list of event aliases.
+ *
+ * @author Alexander M. Turek
+ */
+class AddEventAliasesPass implements CompilerPassInterface
+{
+ private $eventAliases;
+ private $eventAliasesParameter;
+
+ public function __construct(array $eventAliases, string $eventAliasesParameter = 'event_dispatcher.event_aliases')
+ {
+ $this->eventAliases = $eventAliases;
+ $this->eventAliasesParameter = $eventAliasesParameter;
+ }
+
+ public function process(ContainerBuilder $container): void
+ {
+ $eventAliases = $container->hasParameter($this->eventAliasesParameter) ? $container->getParameter($this->eventAliasesParameter) : [];
+
+ $container->setParameter(
+ $this->eventAliasesParameter,
+ array_merge($eventAliases, $this->eventAliases)
+ );
+ }
+}
diff --git a/vendor/symfony/event-dispatcher/DependencyInjection/RegisterListenersPass.php b/vendor/symfony/event-dispatcher/DependencyInjection/RegisterListenersPass.php
index 9f9c09c52..1c4e12ec8 100644
--- a/vendor/symfony/event-dispatcher/DependencyInjection/RegisterListenersPass.php
+++ b/vendor/symfony/event-dispatcher/DependencyInjection/RegisterListenersPass.php
@@ -12,12 +12,14 @@
namespace Symfony\Component\EventDispatcher\DependencyInjection;
use Symfony\Component\DependencyInjection\Argument\ServiceClosureArgument;
-use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
+use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
use Symfony\Component\DependencyInjection\Reference;
+use Symfony\Component\EventDispatcher\Event as LegacyEvent;
use Symfony\Component\EventDispatcher\EventDispatcher;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
+use Symfony\Contracts\EventDispatcher\Event;
/**
* Compiler pass to register tagged services for an event dispatcher.
@@ -27,20 +29,17 @@ class RegisterListenersPass implements CompilerPassInterface
protected $dispatcherService;
protected $listenerTag;
protected $subscriberTag;
+ protected $eventAliasesParameter;
- private $hotPathEvents = array();
+ private $hotPathEvents = [];
private $hotPathTagName;
- /**
- * @param string $dispatcherService Service name of the event dispatcher in processed container
- * @param string $listenerTag Tag name used for listener
- * @param string $subscriberTag Tag name used for subscribers
- */
- public function __construct($dispatcherService = 'event_dispatcher', $listenerTag = 'kernel.event_listener', $subscriberTag = 'kernel.event_subscriber')
+ public function __construct(string $dispatcherService = 'event_dispatcher', string $listenerTag = 'kernel.event_listener', string $subscriberTag = 'kernel.event_subscriber', string $eventAliasesParameter = 'event_dispatcher.event_aliases')
{
$this->dispatcherService = $dispatcherService;
$this->listenerTag = $listenerTag;
$this->subscriberTag = $subscriberTag;
+ $this->eventAliasesParameter = $eventAliasesParameter;
}
public function setHotPathEvents(array $hotPathEvents, $tagName = 'container.hot_path')
@@ -57,25 +56,42 @@ class RegisterListenersPass implements CompilerPassInterface
return;
}
+ $aliases = [];
+
+ if ($container->hasParameter($this->eventAliasesParameter)) {
+ $aliases = $container->getParameter($this->eventAliasesParameter);
+ }
+
$definition = $container->findDefinition($this->dispatcherService);
foreach ($container->findTaggedServiceIds($this->listenerTag, true) as $id => $events) {
foreach ($events as $event) {
- $priority = isset($event['priority']) ? $event['priority'] : 0;
+ $priority = $event['priority'] ?? 0;
if (!isset($event['event'])) {
- throw new InvalidArgumentException(sprintf('Service "%s" must define the "event" attribute on "%s" tags.', $id, $this->listenerTag));
+ if ($container->getDefinition($id)->hasTag($this->subscriberTag)) {
+ continue;
+ }
+
+ $event['method'] = $event['method'] ?? '__invoke';
+ $event['event'] = $this->getEventFromTypeDeclaration($container, $id, $event['method']);
}
+ $event['event'] = $aliases[$event['event']] ?? $event['event'];
+
if (!isset($event['method'])) {
- $event['method'] = 'on'.preg_replace_callback(array(
- '/(?<=\b)[a-z]/i',
+ $event['method'] = 'on'.preg_replace_callback([
+ '/(?<=\b|_)[a-z]/i',
'/[^a-z0-9]/i',
- ), function ($matches) { return strtoupper($matches[0]); }, $event['event']);
+ ], function ($matches) { return strtoupper($matches[0]); }, $event['event']);
$event['method'] = preg_replace('/[^a-z0-9]/i', '', $event['method']);
+
+ if (null !== ($class = $container->getDefinition($id)->getClass()) && ($r = $container->getReflectionClass($class, false)) && !$r->hasMethod($event['method']) && $r->hasMethod('__invoke')) {
+ $event['method'] = '__invoke';
+ }
}
- $definition->addMethodCall('addListener', array($event['event'], array(new ServiceClosureArgument(new Reference($id)), $event['method']), $priority));
+ $definition->addMethodCall('addListener', [$event['event'], [new ServiceClosureArgument(new Reference($id)), $event['method']], $priority]);
if (isset($this->hotPathEvents[$event['event']])) {
$container->getDefinition($id)->addTag($this->hotPathTagName);
@@ -89,31 +105,49 @@ class RegisterListenersPass implements CompilerPassInterface
$def = $container->getDefinition($id);
// We must assume that the class value has been correctly filled, even if the service is created by a factory
- $class = $container->getParameterBag()->resolveValue($def->getClass());
- $interface = 'Symfony\Component\EventDispatcher\EventSubscriberInterface';
+ $class = $def->getClass();
- if (!is_subclass_of($class, $interface)) {
- if (!class_exists($class, false)) {
- throw new InvalidArgumentException(sprintf('Class "%s" used for service "%s" cannot be found.', $class, $id));
- }
-
- throw new InvalidArgumentException(sprintf('Service "%s" must implement interface "%s".', $id, $interface));
+ if (!$r = $container->getReflectionClass($class)) {
+ throw new InvalidArgumentException(sprintf('Class "%s" used for service "%s" cannot be found.', $class, $id));
}
- $container->addObjectResource($class);
+ if (!$r->isSubclassOf(EventSubscriberInterface::class)) {
+ throw new InvalidArgumentException(sprintf('Service "%s" must implement interface "%s".', $id, EventSubscriberInterface::class));
+ }
+ $class = $r->name;
+ ExtractingEventDispatcher::$aliases = $aliases;
ExtractingEventDispatcher::$subscriber = $class;
$extractingDispatcher->addSubscriber($extractingDispatcher);
foreach ($extractingDispatcher->listeners as $args) {
- $args[1] = array(new ServiceClosureArgument(new Reference($id)), $args[1]);
+ $args[1] = [new ServiceClosureArgument(new Reference($id)), $args[1]];
$definition->addMethodCall('addListener', $args);
if (isset($this->hotPathEvents[$args[0]])) {
- $container->getDefinition($id)->addTag('container.hot_path');
+ $container->getDefinition($id)->addTag($this->hotPathTagName);
}
}
- $extractingDispatcher->listeners = array();
+ $extractingDispatcher->listeners = [];
+ ExtractingEventDispatcher::$aliases = [];
}
}
+
+ private function getEventFromTypeDeclaration(ContainerBuilder $container, string $id, string $method): string
+ {
+ if (
+ null === ($class = $container->getDefinition($id)->getClass())
+ || !($r = $container->getReflectionClass($class, false))
+ || !$r->hasMethod($method)
+ || 1 > ($m = $r->getMethod($method))->getNumberOfParameters()
+ || !($type = $m->getParameters()[0]->getType()) instanceof \ReflectionNamedType
+ || $type->isBuiltin()
+ || Event::class === ($name = $type->getName())
+ || LegacyEvent::class === $name
+ ) {
+ throw new InvalidArgumentException(sprintf('Service "%s" must define the "event" attribute on "%s" tags.', $id, $this->listenerTag));
+ }
+
+ return $name;
+ }
}
/**
@@ -121,19 +155,24 @@ class RegisterListenersPass implements CompilerPassInterface
*/
class ExtractingEventDispatcher extends EventDispatcher implements EventSubscriberInterface
{
- public $listeners = array();
+ public $listeners = [];
+ public static $aliases = [];
public static $subscriber;
public function addListener($eventName, $listener, $priority = 0)
{
- $this->listeners[] = array($eventName, $listener[1], $priority);
+ $this->listeners[] = [$eventName, $listener[1], $priority];
}
- public static function getSubscribedEvents()
+ public static function getSubscribedEvents(): array
{
- $callback = array(self::$subscriber, 'getSubscribedEvents');
+ $events = [];
- return $callback();
+ foreach ([self::$subscriber, 'getSubscribedEvents']() as $eventName => $params) {
+ $events[self::$aliases[$eventName] ?? $eventName] = $params;
+ }
+
+ return $events;
}
}
diff --git a/vendor/symfony/event-dispatcher/Event.php b/vendor/symfony/event-dispatcher/Event.php
index 9c56b2f55..307c4be5d 100644
--- a/vendor/symfony/event-dispatcher/Event.php
+++ b/vendor/symfony/event-dispatcher/Event.php
@@ -12,32 +12,16 @@
namespace Symfony\Component\EventDispatcher;
/**
- * 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
+ * @deprecated since Symfony 4.3, use "Symfony\Contracts\EventDispatcher\Event" instead
*/
class Event
{
- /**
- * @var bool Whether no further event listeners should be triggered
- */
private $propagationStopped = false;
/**
- * Returns whether further event listeners should be triggered.
- *
- * @see Event::stopPropagation()
- *
* @return bool Whether propagation was already stopped for this event
+ *
+ * @deprecated since Symfony 4.3, use "Symfony\Contracts\EventDispatcher\Event" instead
*/
public function isPropagationStopped()
{
@@ -45,11 +29,7 @@ class Event
}
/**
- * 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().
+ * @deprecated since Symfony 4.3, use "Symfony\Contracts\EventDispatcher\Event" instead
*/
public function stopPropagation()
{
diff --git a/vendor/symfony/event-dispatcher/EventDispatcher.php b/vendor/symfony/event-dispatcher/EventDispatcher.php
index bc79a958d..8b6222718 100644
--- a/vendor/symfony/event-dispatcher/EventDispatcher.php
+++ b/vendor/symfony/event-dispatcher/EventDispatcher.php
@@ -11,6 +11,10 @@
namespace Symfony\Component\EventDispatcher;
+use Psr\EventDispatcher\StoppableEventInterface;
+use Symfony\Component\EventDispatcher\Debug\WrappedListener;
+use Symfony\Contracts\EventDispatcher\Event as ContractsEvent;
+
/**
* The EventDispatcherInterface is the central point of Symfony's event listener system.
*
@@ -28,20 +32,45 @@ namespace Symfony\Component\EventDispatcher;
*/
class EventDispatcher implements EventDispatcherInterface
{
- private $listeners = array();
- private $sorted = array();
+ private $listeners = [];
+ private $sorted = [];
+ private $optimized;
+
+ public function __construct()
+ {
+ if (__CLASS__ === static::class) {
+ $this->optimized = [];
+ }
+ }
/**
* {@inheritdoc}
+ *
+ * @param string|null $eventName
*/
- public function dispatch($eventName, Event $event = null)
+ public function dispatch($event/*, string $eventName = null*/)
{
- if (null === $event) {
- $event = new Event();
+ $eventName = 1 < \func_num_args() ? func_get_arg(1) : null;
+
+ if (\is_object($event)) {
+ $eventName = $eventName ?? \get_class($event);
+ } elseif (\is_string($event) && (null === $eventName || $eventName instanceof ContractsEvent || $eventName instanceof Event)) {
+ @trigger_error(sprintf('Calling the "%s::dispatch()" method with the event name as the first argument is deprecated since Symfony 4.3, pass it as the second argument and provide the event object as the first argument instead.', EventDispatcherInterface::class), \E_USER_DEPRECATED);
+ $swap = $event;
+ $event = $eventName ?? new Event();
+ $eventName = $swap;
+ } else {
+ throw new \TypeError(sprintf('Argument 1 passed to "%s::dispatch()" must be an object, "%s" given.', EventDispatcherInterface::class, \is_object($event) ? \get_class($event) : \gettype($event)));
}
- if ($listeners = $this->getListeners($eventName)) {
- $this->doDispatch($listeners, $eventName, $event);
+ if (null !== $this->optimized && null !== $eventName) {
+ $listeners = $this->optimized[$eventName] ?? (empty($this->listeners[$eventName]) ? [] : $this->optimizeListeners($eventName));
+ } else {
+ $listeners = $this->getListeners($eventName);
+ }
+
+ if ($listeners) {
+ $this->callListeners($listeners, $eventName, $event);
}
return $event;
@@ -54,7 +83,7 @@ class EventDispatcher implements EventDispatcherInterface
{
if (null !== $eventName) {
if (empty($this->listeners[$eventName])) {
- return array();
+ return [];
}
if (!isset($this->sorted[$eventName])) {
@@ -79,24 +108,27 @@ class EventDispatcher implements EventDispatcherInterface
public function getListenerPriority($eventName, $listener)
{
if (empty($this->listeners[$eventName])) {
- return;
+ return null;
}
- if (is_array($listener) && isset($listener[0]) && $listener[0] instanceof \Closure) {
+ if (\is_array($listener) && isset($listener[0]) && $listener[0] instanceof \Closure && 2 >= \count($listener)) {
$listener[0] = $listener[0]();
+ $listener[1] = $listener[1] ?? '__invoke';
}
- foreach ($this->listeners[$eventName] as $priority => $listeners) {
- foreach ($listeners as $k => $v) {
- if ($v !== $listener && is_array($v) && isset($v[0]) && $v[0] instanceof \Closure) {
+ foreach ($this->listeners[$eventName] as $priority => &$listeners) {
+ foreach ($listeners as &$v) {
+ if ($v !== $listener && \is_array($v) && isset($v[0]) && $v[0] instanceof \Closure && 2 >= \count($v)) {
$v[0] = $v[0]();
- $this->listeners[$eventName][$priority][$k] = $v;
+ $v[1] = $v[1] ?? '__invoke';
}
if ($v === $listener) {
return $priority;
}
}
}
+
+ return null;
}
/**
@@ -123,7 +155,7 @@ class EventDispatcher implements EventDispatcherInterface
public function addListener($eventName, $listener, $priority = 0)
{
$this->listeners[$eventName][$priority][] = $listener;
- unset($this->sorted[$eventName]);
+ unset($this->sorted[$eventName], $this->optimized[$eventName]);
}
/**
@@ -135,25 +167,23 @@ class EventDispatcher implements EventDispatcherInterface
return;
}
- if (is_array($listener) && isset($listener[0]) && $listener[0] instanceof \Closure) {
+ if (\is_array($listener) && isset($listener[0]) && $listener[0] instanceof \Closure && 2 >= \count($listener)) {
$listener[0] = $listener[0]();
+ $listener[1] = $listener[1] ?? '__invoke';
}
- foreach ($this->listeners[$eventName] as $priority => $listeners) {
- foreach ($listeners as $k => $v) {
- if ($v !== $listener && is_array($v) && isset($v[0]) && $v[0] instanceof \Closure) {
+ foreach ($this->listeners[$eventName] as $priority => &$listeners) {
+ foreach ($listeners as $k => &$v) {
+ if ($v !== $listener && \is_array($v) && isset($v[0]) && $v[0] instanceof \Closure && 2 >= \count($v)) {
$v[0] = $v[0]();
+ $v[1] = $v[1] ?? '__invoke';
}
if ($v === $listener) {
- unset($listeners[$k], $this->sorted[$eventName]);
- } else {
- $listeners[$k] = $v;
+ unset($listeners[$k], $this->sorted[$eventName], $this->optimized[$eventName]);
}
}
- if ($listeners) {
- $this->listeners[$eventName][$priority] = $listeners;
- } else {
+ if (!$listeners) {
unset($this->listeners[$eventName][$priority]);
}
}
@@ -165,13 +195,13 @@ class EventDispatcher implements EventDispatcherInterface
public function addSubscriber(EventSubscriberInterface $subscriber)
{
foreach ($subscriber->getSubscribedEvents() as $eventName => $params) {
- if (is_string($params)) {
- $this->addListener($eventName, array($subscriber, $params));
- } elseif (is_string($params[0])) {
- $this->addListener($eventName, array($subscriber, $params[0]), isset($params[1]) ? $params[1] : 0);
+ if (\is_string($params)) {
+ $this->addListener($eventName, [$subscriber, $params]);
+ } elseif (\is_string($params[0])) {
+ $this->addListener($eventName, [$subscriber, $params[0]], $params[1] ?? 0);
} else {
foreach ($params as $listener) {
- $this->addListener($eventName, array($subscriber, $listener[0]), isset($listener[1]) ? $listener[1] : 0);
+ $this->addListener($eventName, [$subscriber, $listener[0]], $listener[1] ?? 0);
}
}
}
@@ -183,12 +213,12 @@ class EventDispatcher implements EventDispatcherInterface
public function removeSubscriber(EventSubscriberInterface $subscriber)
{
foreach ($subscriber->getSubscribedEvents() as $eventName => $params) {
- if (is_array($params) && is_array($params[0])) {
+ if (\is_array($params) && \is_array($params[0])) {
foreach ($params as $listener) {
- $this->removeListener($eventName, array($subscriber, $listener[0]));
+ $this->removeListener($eventName, [$subscriber, $listener[0]]);
}
} else {
- $this->removeListener($eventName, array($subscriber, is_string($params) ? $params : $params[0]));
+ $this->removeListener($eventName, [$subscriber, \is_string($params) ? $params : $params[0]]);
}
}
}
@@ -201,7 +231,29 @@ class EventDispatcher implements EventDispatcherInterface
*
* @param callable[] $listeners The event listeners
* @param string $eventName The name of the event to dispatch
- * @param Event $event The event object to pass to the event handlers/listeners
+ * @param object $event The event object to pass to the event handlers/listeners
+ */
+ protected function callListeners(iterable $listeners, string $eventName, $event)
+ {
+ if ($event instanceof Event) {
+ $this->doDispatch($listeners, $eventName, $event);
+
+ return;
+ }
+
+ $stoppable = $event instanceof ContractsEvent || $event instanceof StoppableEventInterface;
+
+ foreach ($listeners as $listener) {
+ if ($stoppable && $event->isPropagationStopped()) {
+ break;
+ }
+ // @deprecated: the ternary operator is part of a BC layer and should be removed in 5.0
+ $listener($listener instanceof WrappedListener ? new LegacyEventProxy($event) : $event, $eventName, $this);
+ }
+ }
+
+ /**
+ * @deprecated since Symfony 4.3, use callListeners() instead
*/
protected function doDispatch($listeners, $eventName, Event $event)
{
@@ -209,28 +261,54 @@ class EventDispatcher implements EventDispatcherInterface
if ($event->isPropagationStopped()) {
break;
}
- \call_user_func($listener, $event, $eventName, $this);
+ $listener($event, $eventName, $this);
}
}
/**
* Sorts the internal list of listeners for the given event by priority.
- *
- * @param string $eventName The name of the event
*/
- private function sortListeners($eventName)
+ private function sortListeners(string $eventName)
{
krsort($this->listeners[$eventName]);
- $this->sorted[$eventName] = array();
+ $this->sorted[$eventName] = [];
- foreach ($this->listeners[$eventName] as $priority => $listeners) {
- foreach ($listeners as $k => $listener) {
- if (\is_array($listener) && isset($listener[0]) && $listener[0] instanceof \Closure) {
+ foreach ($this->listeners[$eventName] as &$listeners) {
+ foreach ($listeners as $k => &$listener) {
+ if (\is_array($listener) && isset($listener[0]) && $listener[0] instanceof \Closure && 2 >= \count($listener)) {
$listener[0] = $listener[0]();
- $this->listeners[$eventName][$priority][$k] = $listener;
+ $listener[1] = $listener[1] ?? '__invoke';
}
$this->sorted[$eventName][] = $listener;
}
}
}
+
+ /**
+ * Optimizes the internal list of listeners for the given event by priority.
+ */
+ private function optimizeListeners(string $eventName): array
+ {
+ krsort($this->listeners[$eventName]);
+ $this->optimized[$eventName] = [];
+
+ foreach ($this->listeners[$eventName] as &$listeners) {
+ foreach ($listeners as &$listener) {
+ $closure = &$this->optimized[$eventName][];
+ if (\is_array($listener) && isset($listener[0]) && $listener[0] instanceof \Closure && 2 >= \count($listener)) {
+ $closure = static function (...$args) use (&$listener, &$closure) {
+ if ($listener[0] instanceof \Closure) {
+ $listener[0] = $listener[0]();
+ $listener[1] = $listener[1] ?? '__invoke';
+ }
+ ($closure = \Closure::fromCallable($listener))(...$args);
+ };
+ } else {
+ $closure = $listener instanceof \Closure || $listener instanceof WrappedListener ? $listener : \Closure::fromCallable($listener);
+ }
+ }
+ }
+
+ return $this->optimized[$eventName];
+ }
}
diff --git a/vendor/symfony/event-dispatcher/EventDispatcherInterface.php b/vendor/symfony/event-dispatcher/EventDispatcherInterface.php
index d3d0cb8a4..ceaa62aeb 100644
--- a/vendor/symfony/event-dispatcher/EventDispatcherInterface.php
+++ b/vendor/symfony/event-dispatcher/EventDispatcherInterface.php
@@ -11,6 +11,8 @@
namespace Symfony\Component\EventDispatcher;
+use Symfony\Contracts\EventDispatcher\EventDispatcherInterface as ContractsEventDispatcherInterface;
+
/**
* The EventDispatcherInterface is the central point of Symfony's event listener system.
* Listeners are registered on the manager and events are dispatched through the
@@ -18,21 +20,8 @@ namespace Symfony\Component\EventDispatcher;
*
* @author Bernhard Schussek
*/
-interface EventDispatcherInterface
+interface EventDispatcherInterface extends ContractsEventDispatcherInterface
{
- /**
- * Dispatches an event to all registered listeners.
- *
- * @param string $eventName The name of the event to dispatch. The name of
- * the event is the name of the method that is
- * invoked on listeners.
- * @param Event $event The event to pass to the event handlers/listeners
- * If not supplied, an empty Event instance is created
- *
- * @return Event
- */
- public function dispatch($eventName, Event $event = null);
-
/**
* Adds an event listener that listens on the specified events.
*
@@ -46,7 +35,7 @@ interface EventDispatcherInterface
/**
* Adds an event subscriber.
*
- * The subscriber is asked for all the events he is
+ * The subscriber is asked for all the events it is
* interested in and added as a listener for these events.
*/
public function addSubscriber(EventSubscriberInterface $subscriber);
@@ -64,7 +53,7 @@ interface EventDispatcherInterface
/**
* Gets the listeners of a specific event or all listeners sorted by descending priority.
*
- * @param string $eventName The name of the event
+ * @param string|null $eventName The name of the event
*
* @return array The event listeners for the specified event, or all event listeners by event name
*/
@@ -85,7 +74,7 @@ interface EventDispatcherInterface
/**
* Checks whether an event has any registered listeners.
*
- * @param string $eventName The name of the event
+ * @param string|null $eventName The name of the event
*
* @return bool true if the specified event has any listeners, false otherwise
*/
diff --git a/vendor/symfony/event-dispatcher/EventSubscriberInterface.php b/vendor/symfony/event-dispatcher/EventSubscriberInterface.php
index 8af778919..a0fc96dfe 100644
--- a/vendor/symfony/event-dispatcher/EventSubscriberInterface.php
+++ b/vendor/symfony/event-dispatcher/EventSubscriberInterface.php
@@ -12,7 +12,7 @@
namespace Symfony\Component\EventDispatcher;
/**
- * An EventSubscriber knows himself what events he is interested in.
+ * An EventSubscriber knows itself what events it is interested in.
* If an EventSubscriber is added to an EventDispatcherInterface, the manager invokes
* {@link getSubscribedEvents} and registers the subscriber as a listener for all
* returned events.
@@ -36,11 +36,14 @@ interface EventSubscriberInterface
*
* For instance:
*
- * * array('eventName' => 'methodName')
- * * array('eventName' => array('methodName', $priority))
- * * array('eventName' => array(array('methodName1', $priority), array('methodName2')))
+ * * ['eventName' => 'methodName']
+ * * ['eventName' => ['methodName', $priority]]
+ * * ['eventName' => [['methodName1', $priority], ['methodName2']]]
*
- * @return array The event names to listen to
+ * The code must not depend on runtime state as it will only be called at compile time.
+ * All logic depending on runtime state must be put into the individual methods handling the events.
+ *
+ * @return array The event names to listen to
*/
public static function getSubscribedEvents();
}
diff --git a/vendor/symfony/event-dispatcher/GenericEvent.php b/vendor/symfony/event-dispatcher/GenericEvent.php
index 95c99408d..23333bc21 100644
--- a/vendor/symfony/event-dispatcher/GenericEvent.php
+++ b/vendor/symfony/event-dispatcher/GenericEvent.php
@@ -29,7 +29,7 @@ class GenericEvent extends Event implements \ArrayAccess, \IteratorAggregate
* @param mixed $subject The subject of the event, usually an object or a callable
* @param array $arguments Arguments to store in the event
*/
- public function __construct($subject = null, array $arguments = array())
+ public function __construct($subject = null, array $arguments = [])
{
$this->subject = $subject;
$this->arguments = $arguments;
@@ -38,7 +38,7 @@ class GenericEvent extends Event implements \ArrayAccess, \IteratorAggregate
/**
* Getter for subject property.
*
- * @return mixed $subject The observer subject
+ * @return mixed The observer subject
*/
public function getSubject()
{
@@ -95,7 +95,7 @@ class GenericEvent extends Event implements \ArrayAccess, \IteratorAggregate
*
* @return $this
*/
- public function setArguments(array $args = array())
+ public function setArguments(array $args = [])
{
$this->arguments = $args;
@@ -111,7 +111,7 @@ class GenericEvent extends Event implements \ArrayAccess, \IteratorAggregate
*/
public function hasArgument($key)
{
- return array_key_exists($key, $this->arguments);
+ return \array_key_exists($key, $this->arguments);
}
/**
@@ -123,6 +123,7 @@ class GenericEvent extends Event implements \ArrayAccess, \IteratorAggregate
*
* @throws \InvalidArgumentException if key does not exist in $this->args
*/
+ #[\ReturnTypeWillChange]
public function offsetGet($key)
{
return $this->getArgument($key);
@@ -133,7 +134,10 @@ class GenericEvent extends Event implements \ArrayAccess, \IteratorAggregate
*
* @param string $key Array key to set
* @param mixed $value Value
+ *
+ * @return void
*/
+ #[\ReturnTypeWillChange]
public function offsetSet($key, $value)
{
$this->setArgument($key, $value);
@@ -143,7 +147,10 @@ class GenericEvent extends Event implements \ArrayAccess, \IteratorAggregate
* ArrayAccess for unset argument.
*
* @param string $key Array key
+ *
+ * @return void
*/
+ #[\ReturnTypeWillChange]
public function offsetUnset($key)
{
if ($this->hasArgument($key)) {
@@ -158,6 +165,7 @@ class GenericEvent extends Event implements \ArrayAccess, \IteratorAggregate
*
* @return bool
*/
+ #[\ReturnTypeWillChange]
public function offsetExists($key)
{
return $this->hasArgument($key);
@@ -168,6 +176,7 @@ class GenericEvent extends Event implements \ArrayAccess, \IteratorAggregate
*
* @return \ArrayIterator
*/
+ #[\ReturnTypeWillChange]
public function getIterator()
{
return new \ArrayIterator($this->arguments);
diff --git a/vendor/symfony/event-dispatcher/ImmutableEventDispatcher.php b/vendor/symfony/event-dispatcher/ImmutableEventDispatcher.php
index b3cf56c50..75a7d7318 100644
--- a/vendor/symfony/event-dispatcher/ImmutableEventDispatcher.php
+++ b/vendor/symfony/event-dispatcher/ImmutableEventDispatcher.php
@@ -22,15 +22,26 @@ class ImmutableEventDispatcher implements EventDispatcherInterface
public function __construct(EventDispatcherInterface $dispatcher)
{
- $this->dispatcher = $dispatcher;
+ $this->dispatcher = LegacyEventDispatcherProxy::decorate($dispatcher);
}
/**
* {@inheritdoc}
+ *
+ * @param string|null $eventName
*/
- public function dispatch($eventName, Event $event = null)
+ public function dispatch($event/*, string $eventName = null*/)
{
- return $this->dispatcher->dispatch($eventName, $event);
+ $eventName = 1 < \func_num_args() ? func_get_arg(1) : null;
+
+ if (is_scalar($event)) {
+ // deprecated
+ $swap = $event;
+ $event = $eventName ?? new Event();
+ $eventName = $swap;
+ }
+
+ return $this->dispatcher->dispatch($event, $eventName);
}
/**
diff --git a/vendor/symfony/event-dispatcher/LICENSE b/vendor/symfony/event-dispatcher/LICENSE
index 17d16a133..88bf75bb4 100644
--- a/vendor/symfony/event-dispatcher/LICENSE
+++ b/vendor/symfony/event-dispatcher/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2004-2017 Fabien Potencier
+Copyright (c) 2004-2022 Fabien Potencier
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/vendor/symfony/event-dispatcher/LegacyEventDispatcherProxy.php b/vendor/symfony/event-dispatcher/LegacyEventDispatcherProxy.php
new file mode 100644
index 000000000..8ee6cba1b
--- /dev/null
+++ b/vendor/symfony/event-dispatcher/LegacyEventDispatcherProxy.php
@@ -0,0 +1,147 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\EventDispatcher;
+
+use Psr\EventDispatcher\StoppableEventInterface;
+use Symfony\Contracts\EventDispatcher\Event as ContractsEvent;
+use Symfony\Contracts\EventDispatcher\EventDispatcherInterface as ContractsEventDispatcherInterface;
+
+/**
+ * A helper class to provide BC/FC with the legacy signature of EventDispatcherInterface::dispatch().
+ *
+ * This class should be deprecated in Symfony 5.1
+ *
+ * @author Nicolas Grekas
+ */
+final class LegacyEventDispatcherProxy implements EventDispatcherInterface
+{
+ private $dispatcher;
+
+ public static function decorate(?ContractsEventDispatcherInterface $dispatcher): ?ContractsEventDispatcherInterface
+ {
+ if (null === $dispatcher) {
+ return null;
+ }
+ $r = new \ReflectionMethod($dispatcher, 'dispatch');
+ $param2 = $r->getParameters()[1] ?? null;
+
+ if (!$param2 || !$param2->hasType() || $param2->getType()->isBuiltin()) {
+ return $dispatcher;
+ }
+
+ @trigger_error(sprintf('The signature of the "%s::dispatch()" method should be updated to "dispatch($event, string $eventName = null)", not doing so is deprecated since Symfony 4.3.', $r->class), \E_USER_DEPRECATED);
+
+ $self = new self();
+ $self->dispatcher = $dispatcher;
+
+ return $self;
+ }
+
+ /**
+ * {@inheritdoc}
+ *
+ * @param string|null $eventName
+ *
+ * @return object
+ */
+ public function dispatch($event/*, string $eventName = null*/)
+ {
+ $eventName = 1 < \func_num_args() ? func_get_arg(1) : null;
+
+ if (\is_object($event)) {
+ $eventName = $eventName ?? \get_class($event);
+ } elseif (\is_string($event) && (null === $eventName || $eventName instanceof ContractsEvent || $eventName instanceof Event)) {
+ @trigger_error(sprintf('Calling the "%s::dispatch()" method with the event name as the first argument is deprecated since Symfony 4.3, pass it as the second argument and provide the event object as the first argument instead.', ContractsEventDispatcherInterface::class), \E_USER_DEPRECATED);
+ $swap = $event;
+ $event = $eventName ?? new Event();
+ $eventName = $swap;
+ } else {
+ throw new \TypeError(sprintf('Argument 1 passed to "%s::dispatch()" must be an object, "%s" given.', ContractsEventDispatcherInterface::class, \is_object($event) ? \get_class($event) : \gettype($event)));
+ }
+
+ $listeners = $this->getListeners($eventName);
+ $stoppable = $event instanceof Event || $event instanceof ContractsEvent || $event instanceof StoppableEventInterface;
+
+ foreach ($listeners as $listener) {
+ if ($stoppable && $event->isPropagationStopped()) {
+ break;
+ }
+ $listener($event, $eventName, $this);
+ }
+
+ return $event;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function addListener($eventName, $listener, $priority = 0)
+ {
+ return $this->dispatcher->addListener($eventName, $listener, $priority);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function addSubscriber(EventSubscriberInterface $subscriber)
+ {
+ return $this->dispatcher->addSubscriber($subscriber);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function removeListener($eventName, $listener)
+ {
+ return $this->dispatcher->removeListener($eventName, $listener);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function removeSubscriber(EventSubscriberInterface $subscriber)
+ {
+ return $this->dispatcher->removeSubscriber($subscriber);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getListeners($eventName = null): array
+ {
+ return $this->dispatcher->getListeners($eventName);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getListenerPriority($eventName, $listener): ?int
+ {
+ return $this->dispatcher->getListenerPriority($eventName, $listener);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function hasListeners($eventName = null): bool
+ {
+ return $this->dispatcher->hasListeners($eventName);
+ }
+
+ /**
+ * Proxies all method calls to the original event dispatcher.
+ */
+ public function __call($method, $arguments)
+ {
+ return $this->dispatcher->{$method}(...$arguments);
+ }
+}
diff --git a/vendor/symfony/event-dispatcher/LegacyEventProxy.php b/vendor/symfony/event-dispatcher/LegacyEventProxy.php
new file mode 100644
index 000000000..45ee251d6
--- /dev/null
+++ b/vendor/symfony/event-dispatcher/LegacyEventProxy.php
@@ -0,0 +1,62 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\EventDispatcher;
+
+use Psr\EventDispatcher\StoppableEventInterface;
+use Symfony\Contracts\EventDispatcher\Event as ContractsEvent;
+
+/**
+ * @internal to be removed in 5.0.
+ */
+final class LegacyEventProxy extends Event
+{
+ private $event;
+
+ /**
+ * @param object $event
+ */
+ public function __construct($event)
+ {
+ $this->event = $event;
+ }
+
+ /**
+ * @return object $event
+ */
+ public function getEvent()
+ {
+ return $this->event;
+ }
+
+ public function isPropagationStopped(): bool
+ {
+ if (!$this->event instanceof ContractsEvent && !$this->event instanceof StoppableEventInterface) {
+ return false;
+ }
+
+ return $this->event->isPropagationStopped();
+ }
+
+ public function stopPropagation()
+ {
+ if (!$this->event instanceof ContractsEvent) {
+ return;
+ }
+
+ $this->event->stopPropagation();
+ }
+
+ public function __call($name, $args)
+ {
+ return $this->event->{$name}(...$args);
+ }
+}
diff --git a/vendor/symfony/event-dispatcher/README.md b/vendor/symfony/event-dispatcher/README.md
index 185c3fecf..dcdb68d21 100644
--- a/vendor/symfony/event-dispatcher/README.md
+++ b/vendor/symfony/event-dispatcher/README.md
@@ -8,8 +8,8 @@ them.
Resources
---------
- * [Documentation](https://symfony.com/doc/current/components/event_dispatcher/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)
+ * [Documentation](https://symfony.com/doc/current/components/event_dispatcher.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/event-dispatcher/Tests/AbstractEventDispatcherTest.php b/vendor/symfony/event-dispatcher/Tests/AbstractEventDispatcherTest.php
deleted file mode 100644
index 9443f2166..000000000
--- a/vendor/symfony/event-dispatcher/Tests/AbstractEventDispatcherTest.php
+++ /dev/null
@@ -1,442 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\EventDispatcher\Tests;
-
-use PHPUnit\Framework\TestCase;
-use Symfony\Component\EventDispatcher\Event;
-use Symfony\Component\EventDispatcher\EventDispatcher;
-use Symfony\Component\EventDispatcher\EventSubscriberInterface;
-
-abstract class AbstractEventDispatcherTest extends TestCase
-{
- /* Some pseudo events */
- const preFoo = 'pre.foo';
- const postFoo = 'post.foo';
- const preBar = 'pre.bar';
- const postBar = 'post.bar';
-
- /**
- * @var EventDispatcher
- */
- private $dispatcher;
-
- private $listener;
-
- protected function setUp()
- {
- $this->dispatcher = $this->createEventDispatcher();
- $this->listener = new TestEventListener();
- }
-
- protected function tearDown()
- {
- $this->dispatcher = null;
- $this->listener = null;
- }
-
- abstract protected function createEventDispatcher();
-
- public function testInitialState()
- {
- $this->assertEquals(array(), $this->dispatcher->getListeners());
- $this->assertFalse($this->dispatcher->hasListeners(self::preFoo));
- $this->assertFalse($this->dispatcher->hasListeners(self::postFoo));
- }
-
- public function testAddListener()
- {
- $this->dispatcher->addListener('pre.foo', array($this->listener, 'preFoo'));
- $this->dispatcher->addListener('post.foo', array($this->listener, 'postFoo'));
- $this->assertTrue($this->dispatcher->hasListeners());
- $this->assertTrue($this->dispatcher->hasListeners(self::preFoo));
- $this->assertTrue($this->dispatcher->hasListeners(self::postFoo));
- $this->assertCount(1, $this->dispatcher->getListeners(self::preFoo));
- $this->assertCount(1, $this->dispatcher->getListeners(self::postFoo));
- $this->assertCount(2, $this->dispatcher->getListeners());
- }
-
- public function testGetListenersSortsByPriority()
- {
- $listener1 = new TestEventListener();
- $listener2 = new TestEventListener();
- $listener3 = new TestEventListener();
- $listener1->name = '1';
- $listener2->name = '2';
- $listener3->name = '3';
-
- $this->dispatcher->addListener('pre.foo', array($listener1, 'preFoo'), -10);
- $this->dispatcher->addListener('pre.foo', array($listener2, 'preFoo'), 10);
- $this->dispatcher->addListener('pre.foo', array($listener3, 'preFoo'));
-
- $expected = array(
- array($listener2, 'preFoo'),
- array($listener3, 'preFoo'),
- array($listener1, 'preFoo'),
- );
-
- $this->assertSame($expected, $this->dispatcher->getListeners('pre.foo'));
- }
-
- public function testGetAllListenersSortsByPriority()
- {
- $listener1 = new TestEventListener();
- $listener2 = new TestEventListener();
- $listener3 = new TestEventListener();
- $listener4 = new TestEventListener();
- $listener5 = new TestEventListener();
- $listener6 = new TestEventListener();
-
- $this->dispatcher->addListener('pre.foo', $listener1, -10);
- $this->dispatcher->addListener('pre.foo', $listener2);
- $this->dispatcher->addListener('pre.foo', $listener3, 10);
- $this->dispatcher->addListener('post.foo', $listener4, -10);
- $this->dispatcher->addListener('post.foo', $listener5);
- $this->dispatcher->addListener('post.foo', $listener6, 10);
-
- $expected = array(
- 'pre.foo' => array($listener3, $listener2, $listener1),
- 'post.foo' => array($listener6, $listener5, $listener4),
- );
-
- $this->assertSame($expected, $this->dispatcher->getListeners());
- }
-
- public function testGetListenerPriority()
- {
- $listener1 = new TestEventListener();
- $listener2 = new TestEventListener();
-
- $this->dispatcher->addListener('pre.foo', $listener1, -10);
- $this->dispatcher->addListener('pre.foo', $listener2);
-
- $this->assertSame(-10, $this->dispatcher->getListenerPriority('pre.foo', $listener1));
- $this->assertSame(0, $this->dispatcher->getListenerPriority('pre.foo', $listener2));
- $this->assertNull($this->dispatcher->getListenerPriority('pre.bar', $listener2));
- $this->assertNull($this->dispatcher->getListenerPriority('pre.foo', function () {}));
- }
-
- public function testDispatch()
- {
- $this->dispatcher->addListener('pre.foo', array($this->listener, 'preFoo'));
- $this->dispatcher->addListener('post.foo', array($this->listener, 'postFoo'));
- $this->dispatcher->dispatch(self::preFoo);
- $this->assertTrue($this->listener->preFooInvoked);
- $this->assertFalse($this->listener->postFooInvoked);
- $this->assertInstanceOf('Symfony\Component\EventDispatcher\Event', $this->dispatcher->dispatch('noevent'));
- $this->assertInstanceOf('Symfony\Component\EventDispatcher\Event', $this->dispatcher->dispatch(self::preFoo));
- $event = new Event();
- $return = $this->dispatcher->dispatch(self::preFoo, $event);
- $this->assertSame($event, $return);
- }
-
- public function testDispatchForClosure()
- {
- $invoked = 0;
- $listener = function () use (&$invoked) {
- ++$invoked;
- };
- $this->dispatcher->addListener('pre.foo', $listener);
- $this->dispatcher->addListener('post.foo', $listener);
- $this->dispatcher->dispatch(self::preFoo);
- $this->assertEquals(1, $invoked);
- }
-
- public function testStopEventPropagation()
- {
- $otherListener = new TestEventListener();
-
- // postFoo() stops the propagation, so only one listener should
- // be executed
- // Manually set priority to enforce $this->listener to be called first
- $this->dispatcher->addListener('post.foo', array($this->listener, 'postFoo'), 10);
- $this->dispatcher->addListener('post.foo', array($otherListener, 'preFoo'));
- $this->dispatcher->dispatch(self::postFoo);
- $this->assertTrue($this->listener->postFooInvoked);
- $this->assertFalse($otherListener->postFooInvoked);
- }
-
- public function testDispatchByPriority()
- {
- $invoked = array();
- $listener1 = function () use (&$invoked) {
- $invoked[] = '1';
- };
- $listener2 = function () use (&$invoked) {
- $invoked[] = '2';
- };
- $listener3 = function () use (&$invoked) {
- $invoked[] = '3';
- };
- $this->dispatcher->addListener('pre.foo', $listener1, -10);
- $this->dispatcher->addListener('pre.foo', $listener2);
- $this->dispatcher->addListener('pre.foo', $listener3, 10);
- $this->dispatcher->dispatch(self::preFoo);
- $this->assertEquals(array('3', '2', '1'), $invoked);
- }
-
- public function testRemoveListener()
- {
- $this->dispatcher->addListener('pre.bar', $this->listener);
- $this->assertTrue($this->dispatcher->hasListeners(self::preBar));
- $this->dispatcher->removeListener('pre.bar', $this->listener);
- $this->assertFalse($this->dispatcher->hasListeners(self::preBar));
- $this->dispatcher->removeListener('notExists', $this->listener);
- }
-
- public function testAddSubscriber()
- {
- $eventSubscriber = new TestEventSubscriber();
- $this->dispatcher->addSubscriber($eventSubscriber);
- $this->assertTrue($this->dispatcher->hasListeners(self::preFoo));
- $this->assertTrue($this->dispatcher->hasListeners(self::postFoo));
- }
-
- public function testAddSubscriberWithPriorities()
- {
- $eventSubscriber = new TestEventSubscriber();
- $this->dispatcher->addSubscriber($eventSubscriber);
-
- $eventSubscriber = new TestEventSubscriberWithPriorities();
- $this->dispatcher->addSubscriber($eventSubscriber);
-
- $listeners = $this->dispatcher->getListeners('pre.foo');
- $this->assertTrue($this->dispatcher->hasListeners(self::preFoo));
- $this->assertCount(2, $listeners);
- $this->assertInstanceOf('Symfony\Component\EventDispatcher\Tests\TestEventSubscriberWithPriorities', $listeners[0][0]);
- }
-
- public function testAddSubscriberWithMultipleListeners()
- {
- $eventSubscriber = new TestEventSubscriberWithMultipleListeners();
- $this->dispatcher->addSubscriber($eventSubscriber);
-
- $listeners = $this->dispatcher->getListeners('pre.foo');
- $this->assertTrue($this->dispatcher->hasListeners(self::preFoo));
- $this->assertCount(2, $listeners);
- $this->assertEquals('preFoo2', $listeners[0][1]);
- }
-
- public function testRemoveSubscriber()
- {
- $eventSubscriber = new TestEventSubscriber();
- $this->dispatcher->addSubscriber($eventSubscriber);
- $this->assertTrue($this->dispatcher->hasListeners(self::preFoo));
- $this->assertTrue($this->dispatcher->hasListeners(self::postFoo));
- $this->dispatcher->removeSubscriber($eventSubscriber);
- $this->assertFalse($this->dispatcher->hasListeners(self::preFoo));
- $this->assertFalse($this->dispatcher->hasListeners(self::postFoo));
- }
-
- public function testRemoveSubscriberWithPriorities()
- {
- $eventSubscriber = new TestEventSubscriberWithPriorities();
- $this->dispatcher->addSubscriber($eventSubscriber);
- $this->assertTrue($this->dispatcher->hasListeners(self::preFoo));
- $this->dispatcher->removeSubscriber($eventSubscriber);
- $this->assertFalse($this->dispatcher->hasListeners(self::preFoo));
- }
-
- public function testRemoveSubscriberWithMultipleListeners()
- {
- $eventSubscriber = new TestEventSubscriberWithMultipleListeners();
- $this->dispatcher->addSubscriber($eventSubscriber);
- $this->assertTrue($this->dispatcher->hasListeners(self::preFoo));
- $this->assertCount(2, $this->dispatcher->getListeners(self::preFoo));
- $this->dispatcher->removeSubscriber($eventSubscriber);
- $this->assertFalse($this->dispatcher->hasListeners(self::preFoo));
- }
-
- public function testEventReceivesTheDispatcherInstanceAsArgument()
- {
- $listener = new TestWithDispatcher();
- $this->dispatcher->addListener('test', array($listener, 'foo'));
- $this->assertNull($listener->name);
- $this->assertNull($listener->dispatcher);
- $this->dispatcher->dispatch('test');
- $this->assertEquals('test', $listener->name);
- $this->assertSame($this->dispatcher, $listener->dispatcher);
- }
-
- /**
- * @see https://bugs.php.net/bug.php?id=62976
- *
- * This bug affects:
- * - The PHP 5.3 branch for versions < 5.3.18
- * - The PHP 5.4 branch for versions < 5.4.8
- * - The PHP 5.5 branch is not affected
- */
- public function testWorkaroundForPhpBug62976()
- {
- $dispatcher = $this->createEventDispatcher();
- $dispatcher->addListener('bug.62976', new CallableClass());
- $dispatcher->removeListener('bug.62976', function () {});
- $this->assertTrue($dispatcher->hasListeners('bug.62976'));
- }
-
- public function testHasListenersWhenAddedCallbackListenerIsRemoved()
- {
- $listener = function () {};
- $this->dispatcher->addListener('foo', $listener);
- $this->dispatcher->removeListener('foo', $listener);
- $this->assertFalse($this->dispatcher->hasListeners());
- }
-
- public function testGetListenersWhenAddedCallbackListenerIsRemoved()
- {
- $listener = function () {};
- $this->dispatcher->addListener('foo', $listener);
- $this->dispatcher->removeListener('foo', $listener);
- $this->assertSame(array(), $this->dispatcher->getListeners());
- }
-
- public function testHasListenersWithoutEventsReturnsFalseAfterHasListenersWithEventHasBeenCalled()
- {
- $this->assertFalse($this->dispatcher->hasListeners('foo'));
- $this->assertFalse($this->dispatcher->hasListeners());
- }
-
- public function testHasListenersIsLazy()
- {
- $called = 0;
- $listener = array(function () use (&$called) { ++$called; }, 'onFoo');
- $this->dispatcher->addListener('foo', $listener);
- $this->assertTrue($this->dispatcher->hasListeners());
- $this->assertTrue($this->dispatcher->hasListeners('foo'));
- $this->assertSame(0, $called);
- }
-
- public function testDispatchLazyListener()
- {
- $called = 0;
- $factory = function () use (&$called) {
- ++$called;
-
- return new TestWithDispatcher();
- };
- $this->dispatcher->addListener('foo', array($factory, 'foo'));
- $this->assertSame(0, $called);
- $this->dispatcher->dispatch('foo', new Event());
- $this->dispatcher->dispatch('foo', new Event());
- $this->assertSame(1, $called);
- }
-
- public function testRemoveFindsLazyListeners()
- {
- $test = new TestWithDispatcher();
- $factory = function () use ($test) { return $test; };
-
- $this->dispatcher->addListener('foo', array($factory, 'foo'));
- $this->assertTrue($this->dispatcher->hasListeners('foo'));
- $this->dispatcher->removeListener('foo', array($test, 'foo'));
- $this->assertFalse($this->dispatcher->hasListeners('foo'));
-
- $this->dispatcher->addListener('foo', array($test, 'foo'));
- $this->assertTrue($this->dispatcher->hasListeners('foo'));
- $this->dispatcher->removeListener('foo', array($factory, 'foo'));
- $this->assertFalse($this->dispatcher->hasListeners('foo'));
- }
-
- public function testPriorityFindsLazyListeners()
- {
- $test = new TestWithDispatcher();
- $factory = function () use ($test) { return $test; };
-
- $this->dispatcher->addListener('foo', array($factory, 'foo'), 3);
- $this->assertSame(3, $this->dispatcher->getListenerPriority('foo', array($test, 'foo')));
- $this->dispatcher->removeListener('foo', array($factory, 'foo'));
-
- $this->dispatcher->addListener('foo', array($test, 'foo'), 5);
- $this->assertSame(5, $this->dispatcher->getListenerPriority('foo', array($factory, 'foo')));
- }
-
- public function testGetLazyListeners()
- {
- $test = new TestWithDispatcher();
- $factory = function () use ($test) { return $test; };
-
- $this->dispatcher->addListener('foo', array($factory, 'foo'), 3);
- $this->assertSame(array(array($test, 'foo')), $this->dispatcher->getListeners('foo'));
-
- $this->dispatcher->removeListener('foo', array($test, 'foo'));
- $this->dispatcher->addListener('bar', array($factory, 'foo'), 3);
- $this->assertSame(array('bar' => array(array($test, 'foo'))), $this->dispatcher->getListeners());
- }
-}
-
-class CallableClass
-{
- public function __invoke()
- {
- }
-}
-
-class TestEventListener
-{
- public $preFooInvoked = false;
- public $postFooInvoked = false;
-
- /* Listener methods */
-
- public function preFoo(Event $e)
- {
- $this->preFooInvoked = true;
- }
-
- public function postFoo(Event $e)
- {
- $this->postFooInvoked = true;
-
- $e->stopPropagation();
- }
-}
-
-class TestWithDispatcher
-{
- public $name;
- public $dispatcher;
-
- public function foo(Event $e, $name, $dispatcher)
- {
- $this->name = $name;
- $this->dispatcher = $dispatcher;
- }
-}
-
-class TestEventSubscriber implements EventSubscriberInterface
-{
- public static function getSubscribedEvents()
- {
- return array('pre.foo' => 'preFoo', 'post.foo' => 'postFoo');
- }
-}
-
-class TestEventSubscriberWithPriorities implements EventSubscriberInterface
-{
- public static function getSubscribedEvents()
- {
- return array(
- 'pre.foo' => array('preFoo', 10),
- 'post.foo' => array('postFoo'),
- );
- }
-}
-
-class TestEventSubscriberWithMultipleListeners implements EventSubscriberInterface
-{
- public static function getSubscribedEvents()
- {
- return array('pre.foo' => array(
- array('preFoo1'),
- array('preFoo2', 10),
- ));
- }
-}
diff --git a/vendor/symfony/event-dispatcher/Tests/ContainerAwareEventDispatcherTest.php b/vendor/symfony/event-dispatcher/Tests/ContainerAwareEventDispatcherTest.php
deleted file mode 100644
index 9d5eecc54..000000000
--- a/vendor/symfony/event-dispatcher/Tests/ContainerAwareEventDispatcherTest.php
+++ /dev/null
@@ -1,210 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\EventDispatcher\Tests;
-
-use Symfony\Component\DependencyInjection\Container;
-use Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher;
-use Symfony\Component\EventDispatcher\Event;
-use Symfony\Component\EventDispatcher\EventSubscriberInterface;
-
-/**
- * @group legacy
- */
-class ContainerAwareEventDispatcherTest extends AbstractEventDispatcherTest
-{
- protected function createEventDispatcher()
- {
- $container = new Container();
-
- return new ContainerAwareEventDispatcher($container);
- }
-
- public function testAddAListenerService()
- {
- $event = new Event();
-
- $service = $this->getMockBuilder('Symfony\Component\EventDispatcher\Tests\Service')->getMock();
-
- $service
- ->expects($this->once())
- ->method('onEvent')
- ->with($event)
- ;
-
- $container = new Container();
- $container->set('service.listener', $service);
-
- $dispatcher = new ContainerAwareEventDispatcher($container);
- $dispatcher->addListenerService('onEvent', array('service.listener', 'onEvent'));
-
- $dispatcher->dispatch('onEvent', $event);
- }
-
- public function testAddASubscriberService()
- {
- $event = new Event();
-
- $service = $this->getMockBuilder('Symfony\Component\EventDispatcher\Tests\SubscriberService')->getMock();
-
- $service
- ->expects($this->once())
- ->method('onEvent')
- ->with($event)
- ;
-
- $service
- ->expects($this->once())
- ->method('onEventWithPriority')
- ->with($event)
- ;
-
- $service
- ->expects($this->once())
- ->method('onEventNested')
- ->with($event)
- ;
-
- $container = new Container();
- $container->set('service.subscriber', $service);
-
- $dispatcher = new ContainerAwareEventDispatcher($container);
- $dispatcher->addSubscriberService('service.subscriber', 'Symfony\Component\EventDispatcher\Tests\SubscriberService');
-
- $dispatcher->dispatch('onEvent', $event);
- $dispatcher->dispatch('onEventWithPriority', $event);
- $dispatcher->dispatch('onEventNested', $event);
- }
-
- public function testPreventDuplicateListenerService()
- {
- $event = new Event();
-
- $service = $this->getMockBuilder('Symfony\Component\EventDispatcher\Tests\Service')->getMock();
-
- $service
- ->expects($this->once())
- ->method('onEvent')
- ->with($event)
- ;
-
- $container = new Container();
- $container->set('service.listener', $service);
-
- $dispatcher = new ContainerAwareEventDispatcher($container);
- $dispatcher->addListenerService('onEvent', array('service.listener', 'onEvent'), 5);
- $dispatcher->addListenerService('onEvent', array('service.listener', 'onEvent'), 10);
-
- $dispatcher->dispatch('onEvent', $event);
- }
-
- public function testHasListenersOnLazyLoad()
- {
- $event = new Event();
-
- $service = $this->getMockBuilder('Symfony\Component\EventDispatcher\Tests\Service')->getMock();
-
- $container = new Container();
- $container->set('service.listener', $service);
-
- $dispatcher = new ContainerAwareEventDispatcher($container);
- $dispatcher->addListenerService('onEvent', array('service.listener', 'onEvent'));
-
- $service
- ->expects($this->once())
- ->method('onEvent')
- ->with($event)
- ;
-
- $this->assertTrue($dispatcher->hasListeners());
-
- if ($dispatcher->hasListeners('onEvent')) {
- $dispatcher->dispatch('onEvent');
- }
- }
-
- public function testGetListenersOnLazyLoad()
- {
- $service = $this->getMockBuilder('Symfony\Component\EventDispatcher\Tests\Service')->getMock();
-
- $container = new Container();
- $container->set('service.listener', $service);
-
- $dispatcher = new ContainerAwareEventDispatcher($container);
- $dispatcher->addListenerService('onEvent', array('service.listener', 'onEvent'));
-
- $listeners = $dispatcher->getListeners();
-
- $this->assertArrayHasKey('onEvent', $listeners);
-
- $this->assertCount(1, $dispatcher->getListeners('onEvent'));
- }
-
- public function testRemoveAfterDispatch()
- {
- $service = $this->getMockBuilder('Symfony\Component\EventDispatcher\Tests\Service')->getMock();
-
- $container = new Container();
- $container->set('service.listener', $service);
-
- $dispatcher = new ContainerAwareEventDispatcher($container);
- $dispatcher->addListenerService('onEvent', array('service.listener', 'onEvent'));
-
- $dispatcher->dispatch('onEvent', new Event());
- $dispatcher->removeListener('onEvent', array($container->get('service.listener'), 'onEvent'));
- $this->assertFalse($dispatcher->hasListeners('onEvent'));
- }
-
- public function testRemoveBeforeDispatch()
- {
- $service = $this->getMockBuilder('Symfony\Component\EventDispatcher\Tests\Service')->getMock();
-
- $container = new Container();
- $container->set('service.listener', $service);
-
- $dispatcher = new ContainerAwareEventDispatcher($container);
- $dispatcher->addListenerService('onEvent', array('service.listener', 'onEvent'));
-
- $dispatcher->removeListener('onEvent', array($container->get('service.listener'), 'onEvent'));
- $this->assertFalse($dispatcher->hasListeners('onEvent'));
- }
-}
-
-class Service
-{
- public function onEvent(Event $e)
- {
- }
-}
-
-class SubscriberService implements EventSubscriberInterface
-{
- public static function getSubscribedEvents()
- {
- return array(
- 'onEvent' => 'onEvent',
- 'onEventWithPriority' => array('onEventWithPriority', 10),
- 'onEventNested' => array(array('onEventNested')),
- );
- }
-
- public function onEvent(Event $e)
- {
- }
-
- public function onEventWithPriority(Event $e)
- {
- }
-
- public function onEventNested(Event $e)
- {
- }
-}
diff --git a/vendor/symfony/event-dispatcher/Tests/Debug/TraceableEventDispatcherTest.php b/vendor/symfony/event-dispatcher/Tests/Debug/TraceableEventDispatcherTest.php
deleted file mode 100644
index 53a3421af..000000000
--- a/vendor/symfony/event-dispatcher/Tests/Debug/TraceableEventDispatcherTest.php
+++ /dev/null
@@ -1,257 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\EventDispatcher\Tests\Debug;
-
-use PHPUnit\Framework\TestCase;
-use Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher;
-use Symfony\Component\EventDispatcher\EventDispatcherInterface;
-use Symfony\Component\EventDispatcher\EventSubscriberInterface;
-use Symfony\Component\EventDispatcher\EventDispatcher;
-use Symfony\Component\EventDispatcher\Event;
-use Symfony\Component\Stopwatch\Stopwatch;
-
-class TraceableEventDispatcherTest extends TestCase
-{
- public function testAddRemoveListener()
- {
- $dispatcher = new EventDispatcher();
- $tdispatcher = new TraceableEventDispatcher($dispatcher, new Stopwatch());
-
- $tdispatcher->addListener('foo', $listener = function () {});
- $listeners = $dispatcher->getListeners('foo');
- $this->assertCount(1, $listeners);
- $this->assertSame($listener, $listeners[0]);
-
- $tdispatcher->removeListener('foo', $listener);
- $this->assertCount(0, $dispatcher->getListeners('foo'));
- }
-
- public function testGetListeners()
- {
- $dispatcher = new EventDispatcher();
- $tdispatcher = new TraceableEventDispatcher($dispatcher, new Stopwatch());
-
- $tdispatcher->addListener('foo', $listener = function () {});
- $this->assertSame($dispatcher->getListeners('foo'), $tdispatcher->getListeners('foo'));
- }
-
- public function testHasListeners()
- {
- $dispatcher = new EventDispatcher();
- $tdispatcher = new TraceableEventDispatcher($dispatcher, new Stopwatch());
-
- $this->assertFalse($dispatcher->hasListeners('foo'));
- $this->assertFalse($tdispatcher->hasListeners('foo'));
-
- $tdispatcher->addListener('foo', $listener = function () {});
- $this->assertTrue($dispatcher->hasListeners('foo'));
- $this->assertTrue($tdispatcher->hasListeners('foo'));
- }
-
- public function testGetListenerPriority()
- {
- $dispatcher = new EventDispatcher();
- $tdispatcher = new TraceableEventDispatcher($dispatcher, new Stopwatch());
-
- $tdispatcher->addListener('foo', function () {}, 123);
-
- $listeners = $dispatcher->getListeners('foo');
- $this->assertSame(123, $tdispatcher->getListenerPriority('foo', $listeners[0]));
-
- // Verify that priority is preserved when listener is removed and re-added
- // in preProcess() and postProcess().
- $tdispatcher->dispatch('foo', new Event());
- $listeners = $dispatcher->getListeners('foo');
- $this->assertSame(123, $tdispatcher->getListenerPriority('foo', $listeners[0]));
- }
-
- public function testGetListenerPriorityWhileDispatching()
- {
- $tdispatcher = new TraceableEventDispatcher(new EventDispatcher(), new Stopwatch());
- $priorityWhileDispatching = null;
-
- $listener = function () use ($tdispatcher, &$priorityWhileDispatching, &$listener) {
- $priorityWhileDispatching = $tdispatcher->getListenerPriority('bar', $listener);
- };
-
- $tdispatcher->addListener('bar', $listener, 5);
- $tdispatcher->dispatch('bar');
- $this->assertSame(5, $priorityWhileDispatching);
- }
-
- public function testAddRemoveSubscriber()
- {
- $dispatcher = new EventDispatcher();
- $tdispatcher = new TraceableEventDispatcher($dispatcher, new Stopwatch());
-
- $subscriber = new EventSubscriber();
-
- $tdispatcher->addSubscriber($subscriber);
- $listeners = $dispatcher->getListeners('foo');
- $this->assertCount(1, $listeners);
- $this->assertSame(array($subscriber, 'call'), $listeners[0]);
-
- $tdispatcher->removeSubscriber($subscriber);
- $this->assertCount(0, $dispatcher->getListeners('foo'));
- }
-
- public function testGetCalledListeners()
- {
- $tdispatcher = new TraceableEventDispatcher(new EventDispatcher(), new Stopwatch());
- $tdispatcher->addListener('foo', function () {}, 5);
-
- $listeners = $tdispatcher->getNotCalledListeners();
- $this->assertArrayHasKey('stub', $listeners['foo.closure']);
- unset($listeners['foo.closure']['stub']);
- $this->assertEquals(array(), $tdispatcher->getCalledListeners());
- $this->assertEquals(array('foo.closure' => array('event' => 'foo', 'pretty' => 'closure', 'priority' => 5)), $listeners);
-
- $tdispatcher->dispatch('foo');
-
- $listeners = $tdispatcher->getCalledListeners();
- $this->assertArrayHasKey('stub', $listeners['foo.closure']);
- unset($listeners['foo.closure']['stub']);
- $this->assertEquals(array('foo.closure' => array('event' => 'foo', 'pretty' => 'closure', 'priority' => 5)), $listeners);
- $this->assertEquals(array(), $tdispatcher->getNotCalledListeners());
- }
-
- public function testClearCalledListeners()
- {
- $tdispatcher = new TraceableEventDispatcher(new EventDispatcher(), new Stopwatch());
- $tdispatcher->addListener('foo', function () {}, 5);
-
- $tdispatcher->dispatch('foo');
- $tdispatcher->reset();
-
- $listeners = $tdispatcher->getNotCalledListeners();
- $this->assertArrayHasKey('stub', $listeners['foo.closure']);
- unset($listeners['foo.closure']['stub']);
- $this->assertEquals(array(), $tdispatcher->getCalledListeners());
- $this->assertEquals(array('foo.closure' => array('event' => 'foo', 'pretty' => 'closure', 'priority' => 5)), $listeners);
- }
-
- public function testGetCalledListenersNested()
- {
- $tdispatcher = null;
- $dispatcher = new TraceableEventDispatcher(new EventDispatcher(), new Stopwatch());
- $dispatcher->addListener('foo', function (Event $event, $eventName, $dispatcher) use (&$tdispatcher) {
- $tdispatcher = $dispatcher;
- $dispatcher->dispatch('bar');
- });
- $dispatcher->addListener('bar', function (Event $event) {});
- $dispatcher->dispatch('foo');
- $this->assertSame($dispatcher, $tdispatcher);
- $this->assertCount(2, $dispatcher->getCalledListeners());
- }
-
- public function testLogger()
- {
- $logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock();
-
- $dispatcher = new EventDispatcher();
- $tdispatcher = new TraceableEventDispatcher($dispatcher, new Stopwatch(), $logger);
- $tdispatcher->addListener('foo', $listener1 = function () {});
- $tdispatcher->addListener('foo', $listener2 = function () {});
-
- $logger->expects($this->at(0))->method('debug')->with('Notified event "{event}" to listener "{listener}".', array('event' => 'foo', 'listener' => 'closure'));
- $logger->expects($this->at(1))->method('debug')->with('Notified event "{event}" to listener "{listener}".', array('event' => 'foo', 'listener' => 'closure'));
-
- $tdispatcher->dispatch('foo');
- }
-
- public function testLoggerWithStoppedEvent()
- {
- $logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock();
-
- $dispatcher = new EventDispatcher();
- $tdispatcher = new TraceableEventDispatcher($dispatcher, new Stopwatch(), $logger);
- $tdispatcher->addListener('foo', $listener1 = function (Event $event) { $event->stopPropagation(); });
- $tdispatcher->addListener('foo', $listener2 = function () {});
-
- $logger->expects($this->at(0))->method('debug')->with('Notified event "{event}" to listener "{listener}".', array('event' => 'foo', 'listener' => 'closure'));
- $logger->expects($this->at(1))->method('debug')->with('Listener "{listener}" stopped propagation of the event "{event}".', array('event' => 'foo', 'listener' => 'closure'));
- $logger->expects($this->at(2))->method('debug')->with('Listener "{listener}" was not called for event "{event}".', array('event' => 'foo', 'listener' => 'closure'));
-
- $tdispatcher->dispatch('foo');
- }
-
- public function testDispatchCallListeners()
- {
- $called = array();
-
- $dispatcher = new EventDispatcher();
- $tdispatcher = new TraceableEventDispatcher($dispatcher, new Stopwatch());
- $tdispatcher->addListener('foo', function () use (&$called) { $called[] = 'foo1'; }, 10);
- $tdispatcher->addListener('foo', function () use (&$called) { $called[] = 'foo2'; }, 20);
-
- $tdispatcher->dispatch('foo');
-
- $this->assertSame(array('foo2', 'foo1'), $called);
- }
-
- public function testDispatchNested()
- {
- $dispatcher = new TraceableEventDispatcher(new EventDispatcher(), new Stopwatch());
- $loop = 1;
- $dispatchedEvents = 0;
- $dispatcher->addListener('foo', $listener1 = function () use ($dispatcher, &$loop) {
- ++$loop;
- if (2 == $loop) {
- $dispatcher->dispatch('foo');
- }
- });
- $dispatcher->addListener('foo', function () use (&$dispatchedEvents) {
- ++$dispatchedEvents;
- });
-
- $dispatcher->dispatch('foo');
-
- $this->assertSame(2, $dispatchedEvents);
- }
-
- public function testDispatchReusedEventNested()
- {
- $nestedCall = false;
- $dispatcher = new TraceableEventDispatcher(new EventDispatcher(), new Stopwatch());
- $dispatcher->addListener('foo', function (Event $e) use ($dispatcher) {
- $dispatcher->dispatch('bar', $e);
- });
- $dispatcher->addListener('bar', function (Event $e) use (&$nestedCall) {
- $nestedCall = true;
- });
-
- $this->assertFalse($nestedCall);
- $dispatcher->dispatch('foo');
- $this->assertTrue($nestedCall);
- }
-
- public function testListenerCanRemoveItselfWhenExecuted()
- {
- $eventDispatcher = new TraceableEventDispatcher(new EventDispatcher(), new Stopwatch());
- $listener1 = function ($event, $eventName, EventDispatcherInterface $dispatcher) use (&$listener1) {
- $dispatcher->removeListener('foo', $listener1);
- };
- $eventDispatcher->addListener('foo', $listener1);
- $eventDispatcher->addListener('foo', function () {});
- $eventDispatcher->dispatch('foo');
-
- $this->assertCount(1, $eventDispatcher->getListeners('foo'), 'expected listener1 to be removed');
- }
-}
-
-class EventSubscriber implements EventSubscriberInterface
-{
- public static function getSubscribedEvents()
- {
- return array('foo' => 'call');
- }
-}
diff --git a/vendor/symfony/event-dispatcher/Tests/DependencyInjection/RegisterListenersPassTest.php b/vendor/symfony/event-dispatcher/Tests/DependencyInjection/RegisterListenersPassTest.php
deleted file mode 100644
index dbb1aa5c5..000000000
--- a/vendor/symfony/event-dispatcher/Tests/DependencyInjection/RegisterListenersPassTest.php
+++ /dev/null
@@ -1,179 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\EventDispatcher\Tests\DependencyInjection;
-
-use PHPUnit\Framework\TestCase;
-use Symfony\Component\DependencyInjection\Argument\ServiceClosureArgument;
-use Symfony\Component\DependencyInjection\ContainerBuilder;
-use Symfony\Component\DependencyInjection\Reference;
-use Symfony\Component\EventDispatcher\DependencyInjection\RegisterListenersPass;
-
-class RegisterListenersPassTest extends TestCase
-{
- /**
- * Tests that event subscribers not implementing EventSubscriberInterface
- * trigger an exception.
- *
- * @expectedException \InvalidArgumentException
- */
- public function testEventSubscriberWithoutInterface()
- {
- // one service, not implementing any interface
- $services = array(
- 'my_event_subscriber' => array(0 => array()),
- );
-
- $definition = $this->getMockBuilder('Symfony\Component\DependencyInjection\Definition')->getMock();
- $definition->expects($this->atLeastOnce())
- ->method('getClass')
- ->will($this->returnValue('stdClass'));
-
- $builder = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerBuilder')->setMethods(array('hasDefinition', 'findTaggedServiceIds', 'getDefinition'))->getMock();
- $builder->expects($this->any())
- ->method('hasDefinition')
- ->will($this->returnValue(true));
-
- // We don't test kernel.event_listener here
- $builder->expects($this->atLeastOnce())
- ->method('findTaggedServiceIds')
- ->will($this->onConsecutiveCalls(array(), $services));
-
- $builder->expects($this->atLeastOnce())
- ->method('getDefinition')
- ->will($this->returnValue($definition));
-
- $registerListenersPass = new RegisterListenersPass();
- $registerListenersPass->process($builder);
- }
-
- public function testValidEventSubscriber()
- {
- $services = array(
- 'my_event_subscriber' => array(0 => array()),
- );
-
- $definition = $this->getMockBuilder('Symfony\Component\DependencyInjection\Definition')->getMock();
- $definition->expects($this->atLeastOnce())
- ->method('getClass')
- ->will($this->returnValue('Symfony\Component\EventDispatcher\Tests\DependencyInjection\SubscriberService'));
-
- $builder = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerBuilder')->setMethods(array('hasDefinition', 'findTaggedServiceIds', 'getDefinition', 'findDefinition'))->getMock();
- $builder->expects($this->any())
- ->method('hasDefinition')
- ->will($this->returnValue(true));
-
- // We don't test kernel.event_listener here
- $builder->expects($this->atLeastOnce())
- ->method('findTaggedServiceIds')
- ->will($this->onConsecutiveCalls(array(), $services));
-
- $builder->expects($this->atLeastOnce())
- ->method('getDefinition')
- ->will($this->returnValue($definition));
-
- $builder->expects($this->atLeastOnce())
- ->method('findDefinition')
- ->will($this->returnValue($definition));
-
- $registerListenersPass = new RegisterListenersPass();
- $registerListenersPass->process($builder);
- }
-
- /**
- * @expectedException \InvalidArgumentException
- * @expectedExceptionMessage The service "foo" tagged "kernel.event_listener" must not be abstract.
- */
- public function testAbstractEventListener()
- {
- $container = new ContainerBuilder();
- $container->register('foo', 'stdClass')->setAbstract(true)->addTag('kernel.event_listener', array());
- $container->register('event_dispatcher', 'stdClass');
-
- $registerListenersPass = new RegisterListenersPass();
- $registerListenersPass->process($container);
- }
-
- /**
- * @expectedException \InvalidArgumentException
- * @expectedExceptionMessage The service "foo" tagged "kernel.event_subscriber" must not be abstract.
- */
- public function testAbstractEventSubscriber()
- {
- $container = new ContainerBuilder();
- $container->register('foo', 'stdClass')->setAbstract(true)->addTag('kernel.event_subscriber', array());
- $container->register('event_dispatcher', 'stdClass');
-
- $registerListenersPass = new RegisterListenersPass();
- $registerListenersPass->process($container);
- }
-
- public function testEventSubscriberResolvableClassName()
- {
- $container = new ContainerBuilder();
-
- $container->setParameter('subscriber.class', 'Symfony\Component\EventDispatcher\Tests\DependencyInjection\SubscriberService');
- $container->register('foo', '%subscriber.class%')->addTag('kernel.event_subscriber', array());
- $container->register('event_dispatcher', 'stdClass');
-
- $registerListenersPass = new RegisterListenersPass();
- $registerListenersPass->process($container);
-
- $definition = $container->getDefinition('event_dispatcher');
- $expectedCalls = array(
- array(
- 'addListener',
- array(
- 'event',
- array(new ServiceClosureArgument(new Reference('foo')), 'onEvent'),
- 0,
- ),
- ),
- );
- $this->assertEquals($expectedCalls, $definition->getMethodCalls());
- }
-
- public function testHotPathEvents()
- {
- $container = new ContainerBuilder();
-
- $container->register('foo', SubscriberService::class)->addTag('kernel.event_subscriber', array());
- $container->register('event_dispatcher', 'stdClass');
-
- (new RegisterListenersPass())->setHotPathEvents(array('event'))->process($container);
-
- $this->assertTrue($container->getDefinition('foo')->hasTag('container.hot_path'));
- }
-
- /**
- * @expectedException \InvalidArgumentException
- * @expectedExceptionMessage You have requested a non-existent parameter "subscriber.class"
- */
- public function testEventSubscriberUnresolvableClassName()
- {
- $container = new ContainerBuilder();
- $container->register('foo', '%subscriber.class%')->addTag('kernel.event_subscriber', array());
- $container->register('event_dispatcher', 'stdClass');
-
- $registerListenersPass = new RegisterListenersPass();
- $registerListenersPass->process($container);
- }
-}
-
-class SubscriberService implements \Symfony\Component\EventDispatcher\EventSubscriberInterface
-{
- public static function getSubscribedEvents()
- {
- return array(
- 'event' => 'onEvent',
- );
- }
-}
diff --git a/vendor/symfony/event-dispatcher/Tests/EventDispatcherTest.php b/vendor/symfony/event-dispatcher/Tests/EventDispatcherTest.php
deleted file mode 100644
index 5faa5c8be..000000000
--- a/vendor/symfony/event-dispatcher/Tests/EventDispatcherTest.php
+++ /dev/null
@@ -1,22 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\EventDispatcher\Tests;
-
-use Symfony\Component\EventDispatcher\EventDispatcher;
-
-class EventDispatcherTest extends AbstractEventDispatcherTest
-{
- protected function createEventDispatcher()
- {
- return new EventDispatcher();
- }
-}
diff --git a/vendor/symfony/event-dispatcher/Tests/EventTest.php b/vendor/symfony/event-dispatcher/Tests/EventTest.php
deleted file mode 100644
index 5be2ea09f..000000000
--- a/vendor/symfony/event-dispatcher/Tests/EventTest.php
+++ /dev/null
@@ -1,55 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\EventDispatcher\Tests;
-
-use PHPUnit\Framework\TestCase;
-use Symfony\Component\EventDispatcher\Event;
-
-/**
- * Test class for Event.
- */
-class EventTest extends TestCase
-{
- /**
- * @var \Symfony\Component\EventDispatcher\Event
- */
- protected $event;
-
- /**
- * Sets up the fixture, for example, opens a network connection.
- * This method is called before a test is executed.
- */
- protected function setUp()
- {
- $this->event = new Event();
- }
-
- /**
- * Tears down the fixture, for example, closes a network connection.
- * This method is called after a test is executed.
- */
- protected function tearDown()
- {
- $this->event = null;
- }
-
- public function testIsPropagationStopped()
- {
- $this->assertFalse($this->event->isPropagationStopped());
- }
-
- public function testStopPropagationAndIsPropagationStopped()
- {
- $this->event->stopPropagation();
- $this->assertTrue($this->event->isPropagationStopped());
- }
-}
diff --git a/vendor/symfony/event-dispatcher/Tests/GenericEventTest.php b/vendor/symfony/event-dispatcher/Tests/GenericEventTest.php
deleted file mode 100644
index 9cf68c987..000000000
--- a/vendor/symfony/event-dispatcher/Tests/GenericEventTest.php
+++ /dev/null
@@ -1,140 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\EventDispatcher\Tests;
-
-use PHPUnit\Framework\TestCase;
-use Symfony\Component\EventDispatcher\GenericEvent;
-
-/**
- * Test class for Event.
- */
-class GenericEventTest extends TestCase
-{
- /**
- * @var GenericEvent
- */
- private $event;
-
- private $subject;
-
- /**
- * Prepares the environment before running a test.
- */
- protected function setUp()
- {
- parent::setUp();
-
- $this->subject = new \stdClass();
- $this->event = new GenericEvent($this->subject, array('name' => 'Event'));
- }
-
- /**
- * Cleans up the environment after running a test.
- */
- protected function tearDown()
- {
- $this->subject = null;
- $this->event = null;
-
- parent::tearDown();
- }
-
- public function testConstruct()
- {
- $this->assertEquals($this->event, new GenericEvent($this->subject, array('name' => 'Event')));
- }
-
- /**
- * Tests Event->getArgs().
- */
- public function testGetArguments()
- {
- // test getting all
- $this->assertSame(array('name' => 'Event'), $this->event->getArguments());
- }
-
- public function testSetArguments()
- {
- $result = $this->event->setArguments(array('foo' => 'bar'));
- $this->assertAttributeSame(array('foo' => 'bar'), 'arguments', $this->event);
- $this->assertSame($this->event, $result);
- }
-
- public function testSetArgument()
- {
- $result = $this->event->setArgument('foo2', 'bar2');
- $this->assertAttributeSame(array('name' => 'Event', 'foo2' => 'bar2'), 'arguments', $this->event);
- $this->assertEquals($this->event, $result);
- }
-
- public function testGetArgument()
- {
- // test getting key
- $this->assertEquals('Event', $this->event->getArgument('name'));
- }
-
- /**
- * @expectedException \InvalidArgumentException
- */
- public function testGetArgException()
- {
- $this->event->getArgument('nameNotExist');
- }
-
- public function testOffsetGet()
- {
- // test getting key
- $this->assertEquals('Event', $this->event['name']);
-
- // test getting invalid arg
- $this->{method_exists($this, $_ = 'expectException') ? $_ : 'setExpectedException'}('InvalidArgumentException');
- $this->assertFalse($this->event['nameNotExist']);
- }
-
- public function testOffsetSet()
- {
- $this->event['foo2'] = 'bar2';
- $this->assertAttributeSame(array('name' => 'Event', 'foo2' => 'bar2'), 'arguments', $this->event);
- }
-
- public function testOffsetUnset()
- {
- unset($this->event['name']);
- $this->assertAttributeSame(array(), 'arguments', $this->event);
- }
-
- public function testOffsetIsset()
- {
- $this->assertArrayHasKey('name', $this->event);
- $this->assertArrayNotHasKey('nameNotExist', $this->event);
- }
-
- public function testHasArgument()
- {
- $this->assertTrue($this->event->hasArgument('name'));
- $this->assertFalse($this->event->hasArgument('nameNotExist'));
- }
-
- public function testGetSubject()
- {
- $this->assertSame($this->subject, $this->event->getSubject());
- }
-
- public function testHasIterator()
- {
- $data = array();
- foreach ($this->event as $key => $value) {
- $data[$key] = $value;
- }
- $this->assertEquals(array('name' => 'Event'), $data);
- }
-}
diff --git a/vendor/symfony/event-dispatcher/Tests/ImmutableEventDispatcherTest.php b/vendor/symfony/event-dispatcher/Tests/ImmutableEventDispatcherTest.php
deleted file mode 100644
index 04f2861e3..000000000
--- a/vendor/symfony/event-dispatcher/Tests/ImmutableEventDispatcherTest.php
+++ /dev/null
@@ -1,106 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\EventDispatcher\Tests;
-
-use PHPUnit\Framework\TestCase;
-use Symfony\Component\EventDispatcher\Event;
-use Symfony\Component\EventDispatcher\ImmutableEventDispatcher;
-
-/**
- * @author Bernhard Schussek
- */
-class ImmutableEventDispatcherTest extends TestCase
-{
- /**
- * @var \PHPUnit_Framework_MockObject_MockObject
- */
- private $innerDispatcher;
-
- /**
- * @var ImmutableEventDispatcher
- */
- private $dispatcher;
-
- protected function setUp()
- {
- $this->innerDispatcher = $this->getMockBuilder('Symfony\Component\EventDispatcher\EventDispatcherInterface')->getMock();
- $this->dispatcher = new ImmutableEventDispatcher($this->innerDispatcher);
- }
-
- public function testDispatchDelegates()
- {
- $event = new Event();
-
- $this->innerDispatcher->expects($this->once())
- ->method('dispatch')
- ->with('event', $event)
- ->will($this->returnValue('result'));
-
- $this->assertSame('result', $this->dispatcher->dispatch('event', $event));
- }
-
- public function testGetListenersDelegates()
- {
- $this->innerDispatcher->expects($this->once())
- ->method('getListeners')
- ->with('event')
- ->will($this->returnValue('result'));
-
- $this->assertSame('result', $this->dispatcher->getListeners('event'));
- }
-
- public function testHasListenersDelegates()
- {
- $this->innerDispatcher->expects($this->once())
- ->method('hasListeners')
- ->with('event')
- ->will($this->returnValue('result'));
-
- $this->assertSame('result', $this->dispatcher->hasListeners('event'));
- }
-
- /**
- * @expectedException \BadMethodCallException
- */
- public function testAddListenerDisallowed()
- {
- $this->dispatcher->addListener('event', function () { return 'foo'; });
- }
-
- /**
- * @expectedException \BadMethodCallException
- */
- public function testAddSubscriberDisallowed()
- {
- $subscriber = $this->getMockBuilder('Symfony\Component\EventDispatcher\EventSubscriberInterface')->getMock();
-
- $this->dispatcher->addSubscriber($subscriber);
- }
-
- /**
- * @expectedException \BadMethodCallException
- */
- public function testRemoveListenerDisallowed()
- {
- $this->dispatcher->removeListener('event', function () { return 'foo'; });
- }
-
- /**
- * @expectedException \BadMethodCallException
- */
- public function testRemoveSubscriberDisallowed()
- {
- $subscriber = $this->getMockBuilder('Symfony\Component\EventDispatcher\EventSubscriberInterface')->getMock();
-
- $this->dispatcher->removeSubscriber($subscriber);
- }
-}
diff --git a/vendor/symfony/event-dispatcher/composer.json b/vendor/symfony/event-dispatcher/composer.json
index 75b881b91..55c2716a6 100644
--- a/vendor/symfony/event-dispatcher/composer.json
+++ b/vendor/symfony/event-dispatcher/composer.json
@@ -1,7 +1,7 @@
{
"name": "symfony/event-dispatcher",
"type": "library",
- "description": "Symfony EventDispatcher Component",
+ "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them",
"keywords": [],
"homepage": "https://symfony.com",
"license": "MIT",
@@ -16,17 +16,26 @@
}
],
"require": {
- "php": "^5.5.9|>=7.0.8"
+ "php": ">=7.1.3",
+ "symfony/event-dispatcher-contracts": "^1.1",
+ "symfony/polyfill-php80": "^1.16"
},
"require-dev": {
- "symfony/dependency-injection": "~3.3|~4.0",
- "symfony/expression-language": "~2.8|~3.0|~4.0",
- "symfony/config": "~2.8|~3.0|~4.0",
- "symfony/stopwatch": "~2.8|~3.0|~4.0",
- "psr/log": "~1.0"
+ "symfony/dependency-injection": "^3.4|^4.0|^5.0",
+ "symfony/expression-language": "^3.4|^4.0|^5.0",
+ "symfony/config": "^3.4|^4.0|^5.0",
+ "symfony/error-handler": "~3.4|~4.4",
+ "symfony/http-foundation": "^3.4|^4.0|^5.0",
+ "symfony/service-contracts": "^1.1|^2",
+ "symfony/stopwatch": "^3.4|^4.0|^5.0",
+ "psr/log": "^1|^2|^3"
},
"conflict": {
- "symfony/dependency-injection": "<3.3"
+ "symfony/dependency-injection": "<3.4"
+ },
+ "provide": {
+ "psr/event-dispatcher-implementation": "1.0",
+ "symfony/event-dispatcher-implementation": "1.1"
},
"suggest": {
"symfony/dependency-injection": "",
@@ -38,10 +47,5 @@
"/Tests/"
]
},
- "minimum-stability": "dev",
- "extra": {
- "branch-alias": {
- "dev-master": "3.4-dev"
- }
- }
+ "minimum-stability": "dev"
}
diff --git a/vendor/symfony/event-dispatcher/phpunit.xml.dist b/vendor/symfony/event-dispatcher/phpunit.xml.dist
deleted file mode 100644
index b3ad1bdf5..000000000
--- a/vendor/symfony/event-dispatcher/phpunit.xml.dist
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
-
-
-
-
-
-
- ./Tests/
-
-
-
-
-
- ./
-
- ./Resources
- ./Tests
- ./vendor
-
-
-
-
diff --git a/vendor/symfony/finder/CHANGELOG.md b/vendor/symfony/finder/CHANGELOG.md
index 33f5bd589..6a44e87c2 100644
--- a/vendor/symfony/finder/CHANGELOG.md
+++ b/vendor/symfony/finder/CHANGELOG.md
@@ -1,6 +1,14 @@
CHANGELOG
=========
+5.4.0
+-----
+
+ * Deprecate `Comparator::setTarget()` and `Comparator::setOperator()`
+ * Add a constructor to `Comparator` that allows setting target and operator
+ * Finder's iterator has now `Symfony\Component\Finder\SplFileInfo` inner type specified
+ * Add recursive .gitignore files support
+
5.0.0
-----
diff --git a/vendor/symfony/finder/Comparator/Comparator.php b/vendor/symfony/finder/Comparator/Comparator.php
index cfe3965fa..3af551f4c 100644
--- a/vendor/symfony/finder/Comparator/Comparator.php
+++ b/vendor/symfony/finder/Comparator/Comparator.php
@@ -12,8 +12,6 @@
namespace Symfony\Component\Finder\Comparator;
/**
- * Comparator.
- *
* @author Fabien Potencier
*/
class Comparator
@@ -21,25 +19,44 @@ class Comparator
private $target;
private $operator = '==';
+ public function __construct(string $target = null, string $operator = '==')
+ {
+ if (null === $target) {
+ trigger_deprecation('symfony/finder', '5.4', 'Constructing a "%s" without setting "$target" is deprecated.', __CLASS__);
+ }
+
+ $this->target = $target;
+ $this->doSetOperator($operator);
+ }
+
/**
* Gets the target value.
*
- * @return string The target value
+ * @return string
*/
public function getTarget()
{
+ if (null === $this->target) {
+ trigger_deprecation('symfony/finder', '5.4', 'Calling "%s" without initializing the target is deprecated.', __METHOD__);
+ }
+
return $this->target;
}
+ /**
+ * @deprecated set the target via the constructor instead
+ */
public function setTarget(string $target)
{
+ trigger_deprecation('symfony/finder', '5.4', '"%s" is deprecated. Set the target via the constructor instead.', __METHOD__);
+
$this->target = $target;
}
/**
* Gets the comparison operator.
*
- * @return string The operator
+ * @return string
*/
public function getOperator()
{
@@ -50,18 +67,14 @@ class Comparator
* Sets the comparison operator.
*
* @throws \InvalidArgumentException
+ *
+ * @deprecated set the operator via the constructor instead
*/
public function setOperator(string $operator)
{
- if ('' === $operator) {
- $operator = '==';
- }
+ trigger_deprecation('symfony/finder', '5.4', '"%s" is deprecated. Set the operator via the constructor instead.', __METHOD__);
- if (!\in_array($operator, ['>', '<', '>=', '<=', '==', '!='])) {
- throw new \InvalidArgumentException(sprintf('Invalid operator "%s".', $operator));
- }
-
- $this->operator = $operator;
+ $this->doSetOperator('' === $operator ? '==' : $operator);
}
/**
@@ -73,6 +86,10 @@ class Comparator
*/
public function test($test)
{
+ if (null === $this->target) {
+ trigger_deprecation('symfony/finder', '5.4', 'Calling "%s" without initializing the target is deprecated.', __METHOD__);
+ }
+
switch ($this->operator) {
case '>':
return $test > $this->target;
@@ -88,4 +105,13 @@ class Comparator
return $test == $this->target;
}
+
+ private function doSetOperator(string $operator): void
+ {
+ if (!\in_array($operator, ['>', '<', '>=', '<=', '==', '!='])) {
+ throw new \InvalidArgumentException(sprintf('Invalid operator "%s".', $operator));
+ }
+
+ $this->operator = $operator;
+ }
}
diff --git a/vendor/symfony/finder/Comparator/DateComparator.php b/vendor/symfony/finder/Comparator/DateComparator.php
index d17c77a9d..8f651e148 100644
--- a/vendor/symfony/finder/Comparator/DateComparator.php
+++ b/vendor/symfony/finder/Comparator/DateComparator.php
@@ -36,7 +36,7 @@ class DateComparator extends Comparator
throw new \InvalidArgumentException(sprintf('"%s" is not a valid date.', $matches[2]));
}
- $operator = isset($matches[1]) ? $matches[1] : '==';
+ $operator = $matches[1] ?? '==';
if ('since' === $operator || 'after' === $operator) {
$operator = '>';
}
@@ -45,7 +45,6 @@ class DateComparator extends Comparator
$operator = '<';
}
- $this->setOperator($operator);
- $this->setTarget($target);
+ parent::__construct($target, $operator);
}
}
diff --git a/vendor/symfony/finder/Comparator/NumberComparator.php b/vendor/symfony/finder/Comparator/NumberComparator.php
index 80667c9dd..ff85d9677 100644
--- a/vendor/symfony/finder/Comparator/NumberComparator.php
+++ b/vendor/symfony/finder/Comparator/NumberComparator.php
@@ -41,8 +41,8 @@ class NumberComparator extends Comparator
*/
public function __construct(?string $test)
{
- if (!preg_match('#^\s*(==|!=|[<>]=?)?\s*([0-9\.]+)\s*([kmg]i?)?\s*$#i', $test, $matches)) {
- throw new \InvalidArgumentException(sprintf('Don\'t understand "%s" as a number test.', $test));
+ if (null === $test || !preg_match('#^\s*(==|!=|[<>]=?)?\s*([0-9\.]+)\s*([kmg]i?)?\s*$#i', $test, $matches)) {
+ throw new \InvalidArgumentException(sprintf('Don\'t understand "%s" as a number test.', $test ?? 'null'));
}
$target = $matches[2];
@@ -73,7 +73,6 @@ class NumberComparator extends Comparator
}
}
- $this->setTarget($target);
- $this->setOperator(isset($matches[1]) ? $matches[1] : '==');
+ parent::__construct($target, $matches[1] ?: '==');
}
}
diff --git a/vendor/symfony/finder/Finder.php b/vendor/symfony/finder/Finder.php
index 25d0b0f3a..8cc564cd6 100644
--- a/vendor/symfony/finder/Finder.php
+++ b/vendor/symfony/finder/Finder.php
@@ -20,6 +20,7 @@ use Symfony\Component\Finder\Iterator\DepthRangeFilterIterator;
use Symfony\Component\Finder\Iterator\ExcludeDirectoryFilterIterator;
use Symfony\Component\Finder\Iterator\FilecontentFilterIterator;
use Symfony\Component\Finder\Iterator\FilenameFilterIterator;
+use Symfony\Component\Finder\Iterator\LazyIterator;
use Symfony\Component\Finder\Iterator\SizeRangeFilterIterator;
use Symfony\Component\Finder\Iterator\SortableIterator;
@@ -35,6 +36,8 @@ use Symfony\Component\Finder\Iterator\SortableIterator;
* $finder = Finder::create()->files()->name('*.php')->in(__DIR__);
*
* @author Fabien Potencier
+ *
+ * @implements \IteratorAggregate
*/
class Finder implements \IteratorAggregate, \Countable
{
@@ -581,16 +584,16 @@ class Finder implements \IteratorAggregate, \Countable
foreach ((array) $dirs as $dir) {
if (is_dir($dir)) {
- $resolvedDirs[] = $this->normalizeDir($dir);
+ $resolvedDirs[] = [$this->normalizeDir($dir)];
} elseif ($glob = glob($dir, (\defined('GLOB_BRACE') ? \GLOB_BRACE : 0) | \GLOB_ONLYDIR | \GLOB_NOSORT)) {
sort($glob);
- $resolvedDirs = array_merge($resolvedDirs, array_map([$this, 'normalizeDir'], $glob));
+ $resolvedDirs[] = array_map([$this, 'normalizeDir'], $glob);
} else {
throw new DirectoryNotFoundException(sprintf('The "%s" directory does not exist.', $dir));
}
}
- $this->dirs = array_merge($this->dirs, $resolvedDirs);
+ $this->dirs = array_merge($this->dirs, ...$resolvedDirs);
return $this;
}
@@ -600,10 +603,11 @@ class Finder implements \IteratorAggregate, \Countable
*
* This method implements the IteratorAggregate interface.
*
- * @return \Iterator|SplFileInfo[] An iterator
+ * @return \Iterator
*
* @throws \LogicException if the in() method has not been called
*/
+ #[\ReturnTypeWillChange]
public function getIterator()
{
if (0 === \count($this->dirs) && 0 === \count($this->iterators)) {
@@ -611,18 +615,30 @@ class Finder implements \IteratorAggregate, \Countable
}
if (1 === \count($this->dirs) && 0 === \count($this->iterators)) {
- return $this->searchInDirectory($this->dirs[0]);
+ $iterator = $this->searchInDirectory($this->dirs[0]);
+
+ if ($this->sort || $this->reverseSorting) {
+ $iterator = (new Iterator\SortableIterator($iterator, $this->sort, $this->reverseSorting))->getIterator();
+ }
+
+ return $iterator;
}
$iterator = new \AppendIterator();
foreach ($this->dirs as $dir) {
- $iterator->append($this->searchInDirectory($dir));
+ $iterator->append(new \IteratorIterator(new LazyIterator(function () use ($dir) {
+ return $this->searchInDirectory($dir);
+ })));
}
foreach ($this->iterators as $it) {
$iterator->append($it);
}
+ if ($this->sort || $this->reverseSorting) {
+ $iterator = (new Iterator\SortableIterator($iterator, $this->sort, $this->reverseSorting))->getIterator();
+ }
+
return $iterator;
}
@@ -641,10 +657,11 @@ class Finder implements \IteratorAggregate, \Countable
$this->iterators[] = $iterator->getIterator();
} elseif ($iterator instanceof \Iterator) {
$this->iterators[] = $iterator;
- } elseif ($iterator instanceof \Traversable || \is_array($iterator)) {
+ } elseif (is_iterable($iterator)) {
$it = new \ArrayIterator();
foreach ($iterator as $file) {
- $it->append($file instanceof \SplFileInfo ? $file : new \SplFileInfo($file));
+ $file = $file instanceof \SplFileInfo ? $file : new \SplFileInfo($file);
+ $it[$file->getPathname()] = $file;
}
$this->iterators[] = $it;
} else {
@@ -673,6 +690,7 @@ class Finder implements \IteratorAggregate, \Countable
*
* @return int
*/
+ #[\ReturnTypeWillChange]
public function count()
{
return iterator_count($this->getIterator());
@@ -691,14 +709,6 @@ class Finder implements \IteratorAggregate, \Countable
$notPaths[] = '#(^|/)\..+(/|$)#';
}
- if (static::IGNORE_VCS_IGNORED_FILES === (static::IGNORE_VCS_IGNORED_FILES & $this->ignore)) {
- $gitignoreFilePath = sprintf('%s/.gitignore', $dir);
- if (!is_readable($gitignoreFilePath)) {
- throw new \RuntimeException(sprintf('The "ignoreVCSIgnored" option cannot be used by the Finder as the "%s" file is not readable.', $gitignoreFilePath));
- }
- $notPaths = array_merge($notPaths, [Gitignore::toRegex(file_get_contents($gitignoreFilePath))]);
- }
-
$minDepth = 0;
$maxDepth = \PHP_INT_MAX;
@@ -767,9 +777,8 @@ class Finder implements \IteratorAggregate, \Countable
$iterator = new Iterator\PathFilterIterator($iterator, $this->paths, $notPaths);
}
- if ($this->sort || $this->reverseSorting) {
- $iteratorAggregate = new Iterator\SortableIterator($iterator, $this->sort, $this->reverseSorting);
- $iterator = $iteratorAggregate->getIterator();
+ if (static::IGNORE_VCS_IGNORED_FILES === (static::IGNORE_VCS_IGNORED_FILES & $this->ignore)) {
+ $iterator = new Iterator\VcsIgnoredFilterIterator($iterator, $dir);
}
return $iterator;
diff --git a/vendor/symfony/finder/Gitignore.php b/vendor/symfony/finder/Gitignore.php
index dfe0a0a26..d42cca1dc 100644
--- a/vendor/symfony/finder/Gitignore.php
+++ b/vendor/symfony/finder/Gitignore.php
@@ -14,6 +14,7 @@ namespace Symfony\Component\Finder;
/**
* Gitignore matches against text.
*
+ * @author Michael Voříšek
* @author Ahmed Abdou
*/
class Gitignore
@@ -21,113 +22,72 @@ class Gitignore
/**
* Returns a regexp which is the equivalent of the gitignore pattern.
*
- * @return string The regexp
+ * Format specification: https://git-scm.com/docs/gitignore#_pattern_format
*/
public static function toRegex(string $gitignoreFileContent): string
{
- $gitignoreFileContent = preg_replace('/^[^\\\r\n]*#.*/m', '', $gitignoreFileContent);
- $gitignoreLines = preg_split('/\r\n|\r|\n/', $gitignoreFileContent);
-
- $positives = [];
- $negatives = [];
- foreach ($gitignoreLines as $i => $line) {
- $line = trim($line);
- if ('' === $line) {
- continue;
- }
-
- if (1 === preg_match('/^!/', $line)) {
- $positives[$i] = null;
- $negatives[$i] = self::getRegexFromGitignore(preg_replace('/^!(.*)/', '${1}', $line), true);
-
- continue;
- }
- $negatives[$i] = null;
- $positives[$i] = self::getRegexFromGitignore($line);
- }
-
- $index = 0;
- $patterns = [];
- foreach ($positives as $pattern) {
- if (null === $pattern) {
- continue;
- }
-
- $negativesAfter = array_filter(\array_slice($negatives, ++$index));
- if ([] !== $negativesAfter) {
- $pattern .= sprintf('(?'.$regex.'($|\/.*))';
+ $slashPos = strpos($gitignoreLine, '/');
+ if (false !== $slashPos && \strlen($gitignoreLine) - 1 !== $slashPos) {
+ if (0 === $slashPos) {
+ $gitignoreLine = substr($gitignoreLine, 1);
+ }
+ $isAbsolute = true;
+ } else {
+ $isAbsolute = false;
+ }
+
+ $regex = preg_quote(str_replace('\\', '', $gitignoreLine), '~');
+ $regex = preg_replace_callback('~\\\\\[((?:\\\\!)?)([^\[\]]*)\\\\\]~', function (array $matches): string {
+ return '['.('' !== $matches[1] ? '^' : '').str_replace('\\-', '-', $matches[2]).']';
+ }, $regex);
+ $regex = preg_replace('~(?:(?:\\\\\*){2,}(/?))+~', '(?:(?:(?!//).(?
+ *
+ * @extends \FilterIterator