*/
-class MercurialProcessor
+class MercurialProcessor implements ProcessorInterface
{
private $level;
private static $cache;
diff --git a/vendor/monolog/monolog/src/Monolog/Processor/ProcessIdProcessor.php b/vendor/monolog/monolog/src/Monolog/Processor/ProcessIdProcessor.php
index 9d3f5590..66b80fbb 100644
--- a/vendor/monolog/monolog/src/Monolog/Processor/ProcessIdProcessor.php
+++ b/vendor/monolog/monolog/src/Monolog/Processor/ProcessIdProcessor.php
@@ -16,7 +16,7 @@ namespace Monolog\Processor;
*
* @author Andreas Hörnicke
*/
-class ProcessIdProcessor
+class ProcessIdProcessor implements ProcessorInterface
{
/**
* @param array $record
diff --git a/vendor/monolog/monolog/src/Monolog/Processor/ProcessorInterface.php b/vendor/monolog/monolog/src/Monolog/Processor/ProcessorInterface.php
new file mode 100644
index 00000000..7e64d4df
--- /dev/null
+++ b/vendor/monolog/monolog/src/Monolog/Processor/ProcessorInterface.php
@@ -0,0 +1,25 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Monolog\Processor;
+
+/**
+ * An optional interface to allow labelling Monolog processors.
+ *
+ * @author Nicolas Grekas
+ */
+interface ProcessorInterface
+{
+ /**
+ * @return array The processed records
+ */
+ public function __invoke(array $records);
+}
diff --git a/vendor/monolog/monolog/src/Monolog/Processor/PsrLogMessageProcessor.php b/vendor/monolog/monolog/src/Monolog/Processor/PsrLogMessageProcessor.php
index c2686ce5..00885054 100644
--- a/vendor/monolog/monolog/src/Monolog/Processor/PsrLogMessageProcessor.php
+++ b/vendor/monolog/monolog/src/Monolog/Processor/PsrLogMessageProcessor.php
@@ -11,6 +11,8 @@
namespace Monolog\Processor;
+use Monolog\Utils;
+
/**
* Processes a record's message according to PSR-3 rules
*
@@ -18,7 +20,7 @@ namespace Monolog\Processor;
*
* @author Jordi Boggiano
*/
-class PsrLogMessageProcessor
+class PsrLogMessageProcessor implements ProcessorInterface
{
/**
* @param array $record
@@ -35,7 +37,7 @@ class PsrLogMessageProcessor
if (is_null($val) || is_scalar($val) || (is_object($val) && method_exists($val, "__toString"))) {
$replacements['{'.$key.'}'] = $val;
} elseif (is_object($val)) {
- $replacements['{'.$key.'}'] = '[object '.get_class($val).']';
+ $replacements['{'.$key.'}'] = '[object '.Utils::getClass($val).']';
} else {
$replacements['{'.$key.'}'] = '['.gettype($val).']';
}
diff --git a/vendor/monolog/monolog/src/Monolog/Processor/TagProcessor.php b/vendor/monolog/monolog/src/Monolog/Processor/TagProcessor.php
index 7e2df2ac..615a4d99 100644
--- a/vendor/monolog/monolog/src/Monolog/Processor/TagProcessor.php
+++ b/vendor/monolog/monolog/src/Monolog/Processor/TagProcessor.php
@@ -16,7 +16,7 @@ namespace Monolog\Processor;
*
* @author Martijn Riemers
*/
-class TagProcessor
+class TagProcessor implements ProcessorInterface
{
private $tags;
diff --git a/vendor/monolog/monolog/src/Monolog/Processor/UidProcessor.php b/vendor/monolog/monolog/src/Monolog/Processor/UidProcessor.php
index 812707cd..d1f708cf 100644
--- a/vendor/monolog/monolog/src/Monolog/Processor/UidProcessor.php
+++ b/vendor/monolog/monolog/src/Monolog/Processor/UidProcessor.php
@@ -11,12 +11,14 @@
namespace Monolog\Processor;
+use Monolog\ResettableInterface;
+
/**
* Adds a unique identifier into records
*
* @author Simon Mönch
*/
-class UidProcessor
+class UidProcessor implements ProcessorInterface, ResettableInterface
{
private $uid;
@@ -26,7 +28,8 @@ class UidProcessor
throw new \InvalidArgumentException('The uid length must be an integer between 1 and 32');
}
- $this->uid = substr(hash('md5', uniqid('', true)), 0, $length);
+
+ $this->uid = $this->generateUid($length);
}
public function __invoke(array $record)
@@ -43,4 +46,14 @@ class UidProcessor
{
return $this->uid;
}
+
+ public function reset()
+ {
+ $this->uid = $this->generateUid(strlen($this->uid));
+ }
+
+ private function generateUid($length)
+ {
+ return substr(hash('md5', uniqid('', true)), 0, $length);
+ }
}
diff --git a/vendor/monolog/monolog/src/Monolog/Processor/WebProcessor.php b/vendor/monolog/monolog/src/Monolog/Processor/WebProcessor.php
index ea1d8978..684188f6 100644
--- a/vendor/monolog/monolog/src/Monolog/Processor/WebProcessor.php
+++ b/vendor/monolog/monolog/src/Monolog/Processor/WebProcessor.php
@@ -16,7 +16,7 @@ namespace Monolog\Processor;
*
* @author Jordi Boggiano
*/
-class WebProcessor
+class WebProcessor implements ProcessorInterface
{
/**
* @var array|\ArrayAccess
diff --git a/vendor/monolog/monolog/src/Monolog/ResettableInterface.php b/vendor/monolog/monolog/src/Monolog/ResettableInterface.php
new file mode 100644
index 00000000..635bc77d
--- /dev/null
+++ b/vendor/monolog/monolog/src/Monolog/ResettableInterface.php
@@ -0,0 +1,31 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Monolog;
+
+/**
+ * Handler or Processor implementing this interface will be reset when Logger::reset() is called.
+ *
+ * Resetting ends a log cycle gets them back to their initial state.
+ *
+ * Resetting a Handler or a Processor means flushing/cleaning all buffers, resetting internal
+ * state, and getting it back to a state in which it can receive log records again.
+ *
+ * This is useful in case you want to avoid logs leaking between two requests or jobs when you
+ * have a long running process like a worker or an application server serving multiple requests
+ * in one process.
+ *
+ * @author Grégoire Pineau
+ */
+interface ResettableInterface
+{
+ public function reset();
+}
diff --git a/vendor/monolog/monolog/src/Monolog/SignalHandler.php b/vendor/monolog/monolog/src/Monolog/SignalHandler.php
new file mode 100644
index 00000000..d5907805
--- /dev/null
+++ b/vendor/monolog/monolog/src/Monolog/SignalHandler.php
@@ -0,0 +1,115 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Monolog;
+
+use Psr\Log\LoggerInterface;
+use Psr\Log\LogLevel;
+use ReflectionExtension;
+
+/**
+ * Monolog POSIX signal handler
+ *
+ * @author Robert Gust-Bardon
+ */
+class SignalHandler
+{
+ private $logger;
+
+ private $previousSignalHandler = array();
+ private $signalLevelMap = array();
+ private $signalRestartSyscalls = array();
+
+ public function __construct(LoggerInterface $logger)
+ {
+ $this->logger = $logger;
+ }
+
+ public function registerSignalHandler($signo, $level = LogLevel::CRITICAL, $callPrevious = true, $restartSyscalls = true, $async = true)
+ {
+ if (!extension_loaded('pcntl') || !function_exists('pcntl_signal')) {
+ return $this;
+ }
+
+ if ($callPrevious) {
+ if (function_exists('pcntl_signal_get_handler')) {
+ $handler = pcntl_signal_get_handler($signo);
+ if ($handler === false) {
+ return $this;
+ }
+ $this->previousSignalHandler[$signo] = $handler;
+ } else {
+ $this->previousSignalHandler[$signo] = true;
+ }
+ } else {
+ unset($this->previousSignalHandler[$signo]);
+ }
+ $this->signalLevelMap[$signo] = $level;
+ $this->signalRestartSyscalls[$signo] = $restartSyscalls;
+
+ if (function_exists('pcntl_async_signals') && $async !== null) {
+ pcntl_async_signals($async);
+ }
+
+ pcntl_signal($signo, array($this, 'handleSignal'), $restartSyscalls);
+
+ return $this;
+ }
+
+ public function handleSignal($signo, array $siginfo = null)
+ {
+ static $signals = array();
+
+ if (!$signals && extension_loaded('pcntl')) {
+ $pcntl = new ReflectionExtension('pcntl');
+ $constants = $pcntl->getConstants();
+ if (!$constants) {
+ // HHVM 3.24.2 returns an empty array.
+ $constants = get_defined_constants(true);
+ $constants = $constants['Core'];
+ }
+ foreach ($constants as $name => $value) {
+ if (substr($name, 0, 3) === 'SIG' && $name[3] !== '_' && is_int($value)) {
+ $signals[$value] = $name;
+ }
+ }
+ unset($constants);
+ }
+
+ $level = isset($this->signalLevelMap[$signo]) ? $this->signalLevelMap[$signo] : LogLevel::CRITICAL;
+ $signal = isset($signals[$signo]) ? $signals[$signo] : $signo;
+ $context = isset($siginfo) ? $siginfo : array();
+ $this->logger->log($level, sprintf('Program received signal %s', $signal), $context);
+
+ if (!isset($this->previousSignalHandler[$signo])) {
+ return;
+ }
+
+ if ($this->previousSignalHandler[$signo] === true || $this->previousSignalHandler[$signo] === SIG_DFL) {
+ if (extension_loaded('pcntl') && function_exists('pcntl_signal') && function_exists('pcntl_sigprocmask') && function_exists('pcntl_signal_dispatch')
+ && extension_loaded('posix') && function_exists('posix_getpid') && function_exists('posix_kill')) {
+ $restartSyscalls = isset($this->restartSyscalls[$signo]) ? $this->restartSyscalls[$signo] : true;
+ pcntl_signal($signo, SIG_DFL, $restartSyscalls);
+ pcntl_sigprocmask(SIG_UNBLOCK, array($signo), $oldset);
+ posix_kill(posix_getpid(), $signo);
+ pcntl_signal_dispatch();
+ pcntl_sigprocmask(SIG_SETMASK, $oldset);
+ pcntl_signal($signo, array($this, 'handleSignal'), $restartSyscalls);
+ }
+ } elseif (is_callable($this->previousSignalHandler[$signo])) {
+ if (PHP_VERSION_ID >= 70100) {
+ $this->previousSignalHandler[$signo]($signo, $siginfo);
+ } else {
+ $this->previousSignalHandler[$signo]($signo);
+ }
+ }
+ }
+}
diff --git a/vendor/monolog/monolog/src/Monolog/Utils.php b/vendor/monolog/monolog/src/Monolog/Utils.php
new file mode 100644
index 00000000..eb9be863
--- /dev/null
+++ b/vendor/monolog/monolog/src/Monolog/Utils.php
@@ -0,0 +1,25 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Monolog;
+
+class Utils
+{
+ /**
+ * @internal
+ */
+ public static function getClass($object)
+ {
+ $class = \get_class($object);
+
+ return 'c' === $class[0] && 0 === strpos($class, "class@anonymous\0") ? get_parent_class($class).'@anonymous' : $class;
+ }
+}
diff --git a/vendor/monolog/monolog/tests/Monolog/Formatter/FluentdFormatterTest.php b/vendor/monolog/monolog/tests/Monolog/Formatter/FluentdFormatterTest.php
index 622b2bae..fd36dbcf 100644
--- a/vendor/monolog/monolog/tests/Monolog/Formatter/FluentdFormatterTest.php
+++ b/vendor/monolog/monolog/tests/Monolog/Formatter/FluentdFormatterTest.php
@@ -40,7 +40,7 @@ class FluentdFormatterTest extends TestCase
$formatter = new FluentdFormatter();
$this->assertEquals(
- '["test",0,{"message":"test","extra":[],"level":300,"level_name":"WARNING"}]',
+ '["test",0,{"message":"test","context":[],"extra":[],"level":300,"level_name":"WARNING"}]',
$formatter->format($record)
);
}
@@ -55,7 +55,7 @@ class FluentdFormatterTest extends TestCase
$formatter = new FluentdFormatter(true);
$this->assertEquals(
- '["test.error",0,{"message":"test","extra":[]}]',
+ '["test.error",0,{"message":"test","context":[],"extra":[]}]',
$formatter->format($record)
);
}
diff --git a/vendor/monolog/monolog/tests/Monolog/Formatter/JsonFormatterTest.php b/vendor/monolog/monolog/tests/Monolog/Formatter/JsonFormatterTest.php
index c9445f36..24b06cc9 100644
--- a/vendor/monolog/monolog/tests/Monolog/Formatter/JsonFormatterTest.php
+++ b/vendor/monolog/monolog/tests/Monolog/Formatter/JsonFormatterTest.php
@@ -180,4 +180,40 @@ class JsonFormatterTest extends TestCase
'}';
return $formattedException;
}
+
+ public function testNormalizeHandleLargeArraysWithExactly1000Items()
+ {
+ $formatter = new NormalizerFormatter();
+ $largeArray = range(1, 1000);
+
+ $res = $formatter->format(array(
+ 'level_name' => 'CRITICAL',
+ 'channel' => 'test',
+ 'message' => 'bar',
+ 'context' => array($largeArray),
+ 'datetime' => new \DateTime,
+ 'extra' => array(),
+ ));
+
+ $this->assertCount(1000, $res['context'][0]);
+ $this->assertArrayNotHasKey('...', $res['context'][0]);
+ }
+
+ public function testNormalizeHandleLargeArrays()
+ {
+ $formatter = new NormalizerFormatter();
+ $largeArray = range(1, 2000);
+
+ $res = $formatter->format(array(
+ 'level_name' => 'CRITICAL',
+ 'channel' => 'test',
+ 'message' => 'bar',
+ 'context' => array($largeArray),
+ 'datetime' => new \DateTime,
+ 'extra' => array(),
+ ));
+
+ $this->assertCount(1001, $res['context'][0]);
+ $this->assertEquals('Over 1000 items (2000 total), aborting normalization', $res['context'][0]['...']);
+ }
}
diff --git a/vendor/monolog/monolog/tests/Monolog/Formatter/NormalizerFormatterTest.php b/vendor/monolog/monolog/tests/Monolog/Formatter/NormalizerFormatterTest.php
index 57bcdf98..bafd1c74 100644
--- a/vendor/monolog/monolog/tests/Monolog/Formatter/NormalizerFormatterTest.php
+++ b/vendor/monolog/monolog/tests/Monolog/Formatter/NormalizerFormatterTest.php
@@ -193,6 +193,15 @@ class NormalizerFormatterTest extends \PHPUnit_Framework_TestCase
$this->assertEquals(@json_encode(array($foo, $bar)), $res);
}
+ public function testCanNormalizeReferences()
+ {
+ $formatter = new NormalizerFormatter();
+ $x = array('foo' => 'bar');
+ $y = array('x' => &$x);
+ $x['y'] = &$y;
+ $formatter->format($y);
+ }
+
public function testIgnoresInvalidTypes()
{
// set up the recursion
@@ -217,6 +226,24 @@ class NormalizerFormatterTest extends \PHPUnit_Framework_TestCase
$this->assertEquals(@json_encode(array($resource)), $res);
}
+ public function testNormalizeHandleLargeArraysWithExactly1000Items()
+ {
+ $formatter = new NormalizerFormatter();
+ $largeArray = range(1, 1000);
+
+ $res = $formatter->format(array(
+ 'level_name' => 'CRITICAL',
+ 'channel' => 'test',
+ 'message' => 'bar',
+ 'context' => array($largeArray),
+ 'datetime' => new \DateTime,
+ 'extra' => array(),
+ ));
+
+ $this->assertCount(1000, $res['context'][0]);
+ $this->assertArrayNotHasKey('...', $res['context'][0]);
+ }
+
public function testNormalizeHandleLargeArrays()
{
$formatter = new NormalizerFormatter();
@@ -231,7 +258,7 @@ class NormalizerFormatterTest extends \PHPUnit_Framework_TestCase
'extra' => array(),
));
- $this->assertCount(1000, $res['context'][0]);
+ $this->assertCount(1001, $res['context'][0]);
$this->assertEquals('Over 1000 items (2000 total), aborting normalization', $res['context'][0]['...']);
}
@@ -380,6 +407,29 @@ class NormalizerFormatterTest extends \PHPUnit_Framework_TestCase
$result['context']['exception']['trace'][0]
);
}
+
+ public function testExceptionTraceDoesNotLeakCallUserFuncArgs()
+ {
+ try {
+ $arg = new TestInfoLeak;
+ call_user_func(array($this, 'throwHelper'), $arg, $dt = new \DateTime());
+ } catch (\Exception $e) {
+ }
+
+ $formatter = new NormalizerFormatter();
+ $record = array('context' => array('exception' => $e));
+ $result = $formatter->format($record);
+
+ $this->assertSame(
+ '{"function":"throwHelper","class":"Monolog\\\\Formatter\\\\NormalizerFormatterTest","type":"->","args":["[object] (Monolog\\\\Formatter\\\\TestInfoLeak)","'.$dt->format('Y-m-d H:i:s').'"]}',
+ $result['context']['exception']['trace'][0]
+ );
+ }
+
+ private function throwHelper($arg)
+ {
+ throw new \RuntimeException('Thrown');
+ }
}
class TestFooNorm
@@ -421,3 +471,11 @@ class TestToStringError
throw new \RuntimeException('Could not convert to string');
}
}
+
+class TestInfoLeak
+{
+ public function __toString()
+ {
+ return 'Sensitive information';
+ }
+}
diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/BrowserConsoleHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/BrowserConsoleHandlerTest.php
index ffb1d746..ffe45da2 100644
--- a/vendor/monolog/monolog/tests/Monolog/Handler/BrowserConsoleHandlerTest.php
+++ b/vendor/monolog/monolog/tests/Monolog/Handler/BrowserConsoleHandlerTest.php
@@ -21,7 +21,7 @@ class BrowserConsoleHandlerTest extends TestCase
{
protected function setUp()
{
- BrowserConsoleHandler::reset();
+ BrowserConsoleHandler::resetStatic();
}
protected function generateScript()
diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/ChromePHPHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/ChromePHPHandlerTest.php
index 0449f8b1..421cc491 100644
--- a/vendor/monolog/monolog/tests/Monolog/Handler/ChromePHPHandlerTest.php
+++ b/vendor/monolog/monolog/tests/Monolog/Handler/ChromePHPHandlerTest.php
@@ -21,7 +21,7 @@ class ChromePHPHandlerTest extends TestCase
{
protected function setUp()
{
- TestChromePHPHandler::reset();
+ TestChromePHPHandler::resetStatic();
$_SERVER['HTTP_USER_AGENT'] = 'Monolog Test; Chrome/1.0';
}
@@ -136,7 +136,7 @@ class TestChromePHPHandler extends ChromePHPHandler
{
protected $headers = array();
- public static function reset()
+ public static function resetStatic()
{
self::$initialized = false;
self::$overflowed = false;
diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/FingersCrossedHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/FingersCrossedHandlerTest.php
index b92bf437..0ec36531 100644
--- a/vendor/monolog/monolog/tests/Monolog/Handler/FingersCrossedHandlerTest.php
+++ b/vendor/monolog/monolog/tests/Monolog/Handler/FingersCrossedHandlerTest.php
@@ -58,7 +58,7 @@ class FingersCrossedHandlerTest extends TestCase
* @covers Monolog\Handler\FingersCrossedHandler::activate
* @covers Monolog\Handler\FingersCrossedHandler::reset
*/
- public function testHandleRestartBufferingAfterReset()
+ public function testHandleResetBufferingAfterReset()
{
$test = new TestHandler();
$handler = new FingersCrossedHandler($test);
@@ -76,7 +76,7 @@ class FingersCrossedHandlerTest extends TestCase
* @covers Monolog\Handler\FingersCrossedHandler::handle
* @covers Monolog\Handler\FingersCrossedHandler::activate
*/
- public function testHandleRestartBufferingAfterBeingTriggeredWhenStopBufferingIsDisabled()
+ public function testHandleResetBufferingAfterBeingTriggeredWhenStopBufferingIsDisabled()
{
$test = new TestHandler();
$handler = new FingersCrossedHandler($test, Logger::WARNING, 0, false, false);
diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/FirePHPHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/FirePHPHandlerTest.php
index 0eb10a63..7a404e66 100644
--- a/vendor/monolog/monolog/tests/Monolog/Handler/FirePHPHandlerTest.php
+++ b/vendor/monolog/monolog/tests/Monolog/Handler/FirePHPHandlerTest.php
@@ -21,7 +21,7 @@ class FirePHPHandlerTest extends TestCase
{
public function setUp()
{
- TestFirePHPHandler::reset();
+ TestFirePHPHandler::resetStatic();
$_SERVER['HTTP_USER_AGENT'] = 'Monolog Test; FirePHP/1.0';
}
@@ -77,7 +77,7 @@ class TestFirePHPHandler extends FirePHPHandler
{
protected $headers = array();
- public static function reset()
+ public static function resetStatic()
{
self::$initialized = false;
self::$sendHeaders = true;
diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/InsightOpsHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/InsightOpsHandlerTest.php
new file mode 100644
index 00000000..97c18b59
--- /dev/null
+++ b/vendor/monolog/monolog/tests/Monolog/Handler/InsightOpsHandlerTest.php
@@ -0,0 +1,80 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+ namespace Monolog\Handler;
+
+ use Monolog\TestCase;
+ use Monolog\Logger;
+
+/**
+ * @author Robert Kaufmann III
+ * @author Gabriel Machado
+ */
+class InsightOpsHandlerTest extends TestCase
+{
+ /**
+ * @var resource
+ */
+ private $resource;
+
+ /**
+ * @var LogEntriesHandler
+ */
+ private $handler;
+
+ public function testWriteContent()
+ {
+ $this->createHandler();
+ $this->handler->handle($this->getRecord(Logger::CRITICAL, 'Critical write test'));
+
+ fseek($this->resource, 0);
+ $content = fread($this->resource, 1024);
+
+ $this->assertRegexp('/testToken \[\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\] test.CRITICAL: Critical write test/', $content);
+ }
+
+ public function testWriteBatchContent()
+ {
+ $this->createHandler();
+ $this->handler->handleBatch($this->getMultipleRecords());
+
+ fseek($this->resource, 0);
+ $content = fread($this->resource, 1024);
+
+ $this->assertRegexp('/(testToken \[\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\] .* \[\] \[\]\n){3}/', $content);
+ }
+
+ private function createHandler()
+ {
+ $useSSL = extension_loaded('openssl');
+ $args = array('testToken', 'us', $useSSL, Logger::DEBUG, true);
+ $this->resource = fopen('php://memory', 'a');
+ $this->handler = $this->getMock(
+ '\Monolog\Handler\InsightOpsHandler',
+ array('fsockopen', 'streamSetTimeout', 'closeSocket'),
+ $args
+ );
+
+ $reflectionProperty = new \ReflectionProperty('\Monolog\Handler\SocketHandler', 'connectionString');
+ $reflectionProperty->setAccessible(true);
+ $reflectionProperty->setValue($this->handler, 'localhost:1234');
+
+ $this->handler->expects($this->any())
+ ->method('fsockopen')
+ ->will($this->returnValue($this->resource));
+ $this->handler->expects($this->any())
+ ->method('streamSetTimeout')
+ ->will($this->returnValue(true));
+ $this->handler->expects($this->any())
+ ->method('closeSocket')
+ ->will($this->returnValue(true));
+ }
+}
diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/RotatingFileHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/RotatingFileHandlerTest.php
index f1feb228..c6f5fac9 100644
--- a/vendor/monolog/monolog/tests/Monolog/Handler/RotatingFileHandlerTest.php
+++ b/vendor/monolog/monolog/tests/Monolog/Handler/RotatingFileHandlerTest.php
@@ -191,6 +191,40 @@ class RotatingFileHandlerTest extends TestCase
);
}
+ /**
+ * @dataProvider rotationWhenSimilarFilesExistTests
+ */
+ public function testRotationWhenSimilarFileNamesExist($dateFormat)
+ {
+ touch($old1 = __DIR__.'/Fixtures/foo-foo-'.date($dateFormat).'.rot');
+ touch($old2 = __DIR__.'/Fixtures/foo-bar-'.date($dateFormat).'.rot');
+
+ $log = __DIR__.'/Fixtures/foo-'.date($dateFormat).'.rot';
+
+ $handler = new RotatingFileHandler(__DIR__.'/Fixtures/foo.rot', 2);
+ $handler->setFormatter($this->getIdentityFormatter());
+ $handler->setFilenameFormat('{filename}-{date}', $dateFormat);
+ $handler->handle($this->getRecord());
+ $handler->close();
+
+ $this->assertTrue(file_exists($log));
+ }
+
+ public function rotationWhenSimilarFilesExistTests()
+ {
+
+ return array(
+ 'Rotation is triggered when the file of the current day is not present but similar exists'
+ => array(RotatingFileHandler::FILE_PER_DAY),
+
+ 'Rotation is triggered when the file of the current month is not present but similar exists'
+ => array(RotatingFileHandler::FILE_PER_MONTH),
+
+ 'Rotation is triggered when the file of the current year is not present but similar exists'
+ => array(RotatingFileHandler::FILE_PER_YEAR),
+ );
+ }
+
public function testReuseCurrentFile()
{
$log = __DIR__.'/Fixtures/foo-'.date('Y-m-d').'.rot';
diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/Slack/SlackRecordTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/Slack/SlackRecordTest.php
index e1aa96d7..b9de7367 100644
--- a/vendor/monolog/monolog/tests/Monolog/Handler/Slack/SlackRecordTest.php
+++ b/vendor/monolog/monolog/tests/Monolog/Handler/Slack/SlackRecordTest.php
@@ -320,12 +320,12 @@ class SlackRecordTest extends TestCase
'short' => false,
),
array(
- 'title' => 'tags',
+ 'title' => 'Tags',
'value' => sprintf('```%s```', json_encode($extra['tags'])),
'short' => false
),
array(
- 'title' => 'test',
+ 'title' => 'Test',
'value' => $context['test'],
'short' => false
)
@@ -353,6 +353,14 @@ class SlackRecordTest extends TestCase
$this->assertSame($record['datetime']->getTimestamp(), $attachment['ts']);
}
+ public function testContextHasException()
+ {
+ $record = $this->getRecord(Logger::CRITICAL, 'This is a critical message.', array('exception' => new \Exception()));
+ $slackRecord = new SlackRecord(null, null, true, null, false, true);
+ $data = $slackRecord->getSlackData($record);
+ $this->assertInternalType('string', $data['attachments'][0]['fields'][1]['value']);
+ }
+
public function testExcludeExtraAndContextFields()
{
$record = $this->getRecord(
@@ -368,12 +376,12 @@ class SlackRecordTest extends TestCase
$expected = array(
array(
- 'title' => 'info',
+ 'title' => 'Info',
'value' => sprintf('```%s```', json_encode(array('author' => 'Jordi'), $this->jsonPrettyPrintFlag)),
'short' => false
),
array(
- 'title' => 'tags',
+ 'title' => 'Tags',
'value' => sprintf('```%s```', json_encode(array('web'))),
'short' => false
),
diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/SocketHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/SocketHandlerTest.php
index 1f9c1f28..1da987c9 100644
--- a/vendor/monolog/monolog/tests/Monolog/Handler/SocketHandlerTest.php
+++ b/vendor/monolog/monolog/tests/Monolog/Handler/SocketHandlerTest.php
@@ -77,6 +77,13 @@ class SocketHandlerTest extends TestCase
$this->assertEquals(10.25, $this->handler->getWritingTimeout());
}
+ public function testSetChunkSize()
+ {
+ $this->createHandler('localhost:1234');
+ $this->handler->setChunkSize(1025);
+ $this->assertEquals(1025, $this->handler->getChunkSize());
+ }
+
public function testSetConnectionString()
{
$this->createHandler('tcp://localhost:9090');
@@ -120,6 +127,19 @@ class SocketHandlerTest extends TestCase
$this->writeRecord('Hello world');
}
+ /**
+ * @expectedException UnexpectedValueException
+ */
+ public function testExceptionIsThrownIfCannotSetChunkSize()
+ {
+ $this->setMockHandler(array('streamSetChunkSize'));
+ $this->handler->setChunkSize(8192);
+ $this->handler->expects($this->once())
+ ->method('streamSetChunkSize')
+ ->will($this->returnValue(false));
+ $this->writeRecord('Hello world');
+ }
+
/**
* @expectedException RuntimeException
*/
@@ -304,6 +324,12 @@ class SocketHandlerTest extends TestCase
->will($this->returnValue(true));
}
+ if (!in_array('streamSetChunkSize', $methods)) {
+ $this->handler->expects($this->any())
+ ->method('streamSetChunkSize')
+ ->will($this->returnValue(8192));
+ }
+
$this->handler->setFormatter($this->getIdentityFormatter());
}
}
diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/TestHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/TestHandlerTest.php
index bfb8d3df..a7c4fc98 100644
--- a/vendor/monolog/monolog/tests/Monolog/Handler/TestHandlerTest.php
+++ b/vendor/monolog/monolog/tests/Monolog/Handler/TestHandlerTest.php
@@ -54,6 +54,52 @@ class TestHandlerTest extends TestCase
$this->assertEquals(array($record), $records);
}
+ public function testHandlerAssertEmptyContext() {
+ $handler = new TestHandler;
+ $record = $this->getRecord(Logger::WARNING, 'test', array());
+ $this->assertFalse($handler->hasWarning(array(
+ 'message' => 'test',
+ 'context' => array(),
+ )));
+
+ $handler->handle($record);
+
+ $this->assertTrue($handler->hasWarning(array(
+ 'message' => 'test',
+ 'context' => array(),
+ )));
+ $this->assertFalse($handler->hasWarning(array(
+ 'message' => 'test',
+ 'context' => array(
+ 'foo' => 'bar'
+ ),
+ )));
+ }
+
+ public function testHandlerAssertNonEmptyContext() {
+ $handler = new TestHandler;
+ $record = $this->getRecord(Logger::WARNING, 'test', array('foo' => 'bar'));
+ $this->assertFalse($handler->hasWarning(array(
+ 'message' => 'test',
+ 'context' => array(
+ 'foo' => 'bar'
+ ),
+ )));
+
+ $handler->handle($record);
+
+ $this->assertTrue($handler->hasWarning(array(
+ 'message' => 'test',
+ 'context' => array(
+ 'foo' => 'bar'
+ ),
+ )));
+ $this->assertFalse($handler->hasWarning(array(
+ 'message' => 'test',
+ 'context' => array(),
+ )));
+ }
+
public function methodProvider()
{
return array(
diff --git a/vendor/monolog/monolog/tests/Monolog/Handler/WhatFailureGroupHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/Handler/WhatFailureGroupHandlerTest.php
index 8d37a1fc..0594a232 100644
--- a/vendor/monolog/monolog/tests/Monolog/Handler/WhatFailureGroupHandlerTest.php
+++ b/vendor/monolog/monolog/tests/Monolog/Handler/WhatFailureGroupHandlerTest.php
@@ -87,6 +87,29 @@ class WhatFailureGroupHandlerTest extends TestCase
$this->assertTrue($records[0]['extra']['foo']);
}
+ /**
+ * @covers Monolog\Handler\WhatFailureGroupHandler::handleBatch
+ */
+ public function testHandleBatchUsesProcessors()
+ {
+ $testHandlers = array(new TestHandler(), new TestHandler());
+ $handler = new WhatFailureGroupHandler($testHandlers);
+ $handler->pushProcessor(function ($record) {
+ $record['extra']['foo'] = true;
+
+ return $record;
+ });
+ $handler->handleBatch(array($this->getRecord(Logger::DEBUG), $this->getRecord(Logger::INFO)));
+ foreach ($testHandlers as $test) {
+ $this->assertTrue($test->hasDebugRecords());
+ $this->assertTrue($test->hasInfoRecords());
+ $this->assertTrue(count($test->getRecords()) === 2);
+ $records = $test->getRecords();
+ $this->assertTrue($records[0]['extra']['foo']);
+ $this->assertTrue($records[1]['extra']['foo']);
+ }
+ }
+
/**
* @covers Monolog\Handler\WhatFailureGroupHandler::handle
*/
diff --git a/vendor/monolog/monolog/tests/Monolog/LoggerTest.php b/vendor/monolog/monolog/tests/Monolog/LoggerTest.php
index 1ecc34a0..442e87de 100644
--- a/vendor/monolog/monolog/tests/Monolog/LoggerTest.php
+++ b/vendor/monolog/monolog/tests/Monolog/LoggerTest.php
@@ -545,4 +545,146 @@ class LoggerTest extends \PHPUnit_Framework_TestCase
'without microseconds' => array(false, PHP_VERSION_ID >= 70100 ? 'assertNotSame' : 'assertSame'),
);
}
+
+ /**
+ * @covers Monolog\Logger::setExceptionHandler
+ */
+ public function testSetExceptionHandler()
+ {
+ $logger = new Logger(__METHOD__);
+ $this->assertNull($logger->getExceptionHandler());
+ $callback = function ($ex) {
+ };
+ $logger->setExceptionHandler($callback);
+ $this->assertEquals($callback, $logger->getExceptionHandler());
+ }
+
+ /**
+ * @covers Monolog\Logger::setExceptionHandler
+ * @expectedException InvalidArgumentException
+ */
+ public function testBadExceptionHandlerType()
+ {
+ $logger = new Logger(__METHOD__);
+ $logger->setExceptionHandler(false);
+ }
+
+ /**
+ * @covers Monolog\Logger::handleException
+ * @expectedException Exception
+ */
+ public function testDefaultHandleException()
+ {
+ $logger = new Logger(__METHOD__);
+ $handler = $this->getMock('Monolog\Handler\HandlerInterface');
+ $handler->expects($this->any())
+ ->method('isHandling')
+ ->will($this->returnValue(true))
+ ;
+ $handler->expects($this->any())
+ ->method('handle')
+ ->will($this->throwException(new \Exception('Some handler exception')))
+ ;
+ $logger->pushHandler($handler);
+ $logger->info('test');
+ }
+
+ /**
+ * @covers Monolog\Logger::handleException
+ * @covers Monolog\Logger::addRecord
+ */
+ public function testCustomHandleException()
+ {
+ $logger = new Logger(__METHOD__);
+ $that = $this;
+ $logger->setExceptionHandler(function ($e, $record) use ($that) {
+ $that->assertEquals($e->getMessage(), 'Some handler exception');
+ $that->assertTrue(is_array($record));
+ $that->assertEquals($record['message'], 'test');
+ });
+ $handler = $this->getMock('Monolog\Handler\HandlerInterface');
+ $handler->expects($this->any())
+ ->method('isHandling')
+ ->will($this->returnValue(true))
+ ;
+ $handler->expects($this->any())
+ ->method('handle')
+ ->will($this->throwException(new \Exception('Some handler exception')))
+ ;
+ $logger->pushHandler($handler);
+ $logger->info('test');
+ }
+
+ public function testReset()
+ {
+ $logger = new Logger('app');
+
+ $testHandler = new Handler\TestHandler();
+ $bufferHandler = new Handler\BufferHandler($testHandler);
+ $groupHandler = new Handler\GroupHandler(array($bufferHandler));
+ $fingersCrossedHandler = new Handler\FingersCrossedHandler($groupHandler);
+
+ $logger->pushHandler($fingersCrossedHandler);
+
+ $processorUid1 = new Processor\UidProcessor(10);
+ $uid1 = $processorUid1->getUid();
+ $groupHandler->pushProcessor($processorUid1);
+
+ $processorUid2 = new Processor\UidProcessor(5);
+ $uid2 = $processorUid2->getUid();
+ $logger->pushProcessor($processorUid2);
+
+ $getProperty = function ($object, $property) {
+ $reflectionProperty = new \ReflectionProperty(get_class($object), $property);
+ $reflectionProperty->setAccessible(true);
+
+ return $reflectionProperty->getValue($object);
+ };
+ $that = $this;
+ $assertBufferOfBufferHandlerEmpty = function () use ($getProperty, $bufferHandler, $that) {
+ $that->assertEmpty($getProperty($bufferHandler, 'buffer'));
+ };
+ $assertBuffersEmpty = function() use ($assertBufferOfBufferHandlerEmpty, $getProperty, $fingersCrossedHandler, $that) {
+ $assertBufferOfBufferHandlerEmpty();
+ $that->assertEmpty($getProperty($fingersCrossedHandler, 'buffer'));
+ };
+
+ $logger->debug('debug');
+ $logger->reset();
+ $assertBuffersEmpty();
+ $this->assertFalse($testHandler->hasDebugRecords());
+ $this->assertFalse($testHandler->hasErrorRecords());
+ $this->assertNotSame($uid1, $uid1 = $processorUid1->getUid());
+ $this->assertNotSame($uid2, $uid2 = $processorUid2->getUid());
+
+ $logger->debug('debug');
+ $logger->error('error');
+ $logger->reset();
+ $assertBuffersEmpty();
+ $this->assertTrue($testHandler->hasDebugRecords());
+ $this->assertTrue($testHandler->hasErrorRecords());
+ $this->assertNotSame($uid1, $uid1 = $processorUid1->getUid());
+ $this->assertNotSame($uid2, $uid2 = $processorUid2->getUid());
+
+ $logger->info('info');
+ $this->assertNotEmpty($getProperty($fingersCrossedHandler, 'buffer'));
+ $assertBufferOfBufferHandlerEmpty();
+ $this->assertFalse($testHandler->hasInfoRecords());
+
+ $logger->reset();
+ $assertBuffersEmpty();
+ $this->assertFalse($testHandler->hasInfoRecords());
+ $this->assertNotSame($uid1, $uid1 = $processorUid1->getUid());
+ $this->assertNotSame($uid2, $uid2 = $processorUid2->getUid());
+
+ $logger->notice('notice');
+ $logger->emergency('emergency');
+ $logger->reset();
+ $assertBuffersEmpty();
+ $this->assertFalse($testHandler->hasInfoRecords());
+ $this->assertTrue($testHandler->hasNoticeRecords());
+ $this->assertTrue($testHandler->hasEmergencyRecords());
+ $this->assertNotSame($uid1, $processorUid1->getUid());
+ $this->assertNotSame($uid2, $processorUid2->getUid());
+ }
}
diff --git a/vendor/monolog/monolog/tests/Monolog/SignalHandlerTest.php b/vendor/monolog/monolog/tests/Monolog/SignalHandlerTest.php
new file mode 100644
index 00000000..9fa07929
--- /dev/null
+++ b/vendor/monolog/monolog/tests/Monolog/SignalHandlerTest.php
@@ -0,0 +1,287 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Monolog;
+
+use Monolog\Handler\StreamHandler;
+use Monolog\Handler\TestHandler;
+use Psr\Log\LogLevel;
+
+/**
+ * @author Robert Gust-Bardon
+ * @covers Monolog\SignalHandler
+ */
+class SignalHandlerTest extends TestCase
+{
+
+ private $asyncSignalHandling;
+ private $blockedSignals;
+ private $signalHandlers;
+
+ protected function setUp()
+ {
+ $this->signalHandlers = array();
+ if (extension_loaded('pcntl')) {
+ if (function_exists('pcntl_async_signals')) {
+ $this->asyncSignalHandling = pcntl_async_signals();
+ }
+ if (function_exists('pcntl_sigprocmask')) {
+ pcntl_sigprocmask(SIG_BLOCK, array(), $this->blockedSignals);
+ }
+ }
+ }
+
+ protected function tearDown()
+ {
+ if ($this->asyncSignalHandling !== null) {
+ pcntl_async_signals($this->asyncSignalHandling);
+ }
+ if ($this->blockedSignals !== null) {
+ pcntl_sigprocmask(SIG_SETMASK, $this->blockedSignals);
+ }
+ if ($this->signalHandlers) {
+ pcntl_signal_dispatch();
+ foreach ($this->signalHandlers as $signo => $handler) {
+ pcntl_signal($signo, $handler);
+ }
+ }
+ }
+
+ private function setSignalHandler($signo, $handler = SIG_DFL) {
+ if (function_exists('pcntl_signal_get_handler')) {
+ $this->signalHandlers[$signo] = pcntl_signal_get_handler($signo);
+ } else {
+ $this->signalHandlers[$signo] = SIG_DFL;
+ }
+ $this->assertTrue(pcntl_signal($signo, $handler));
+ }
+
+ public function testHandleSignal()
+ {
+ $logger = new Logger('test', array($handler = new TestHandler));
+ $errHandler = new SignalHandler($logger);
+ $signo = 2; // SIGINT.
+ $siginfo = array('signo' => $signo, 'errno' => 0, 'code' => 0);
+ $errHandler->handleSignal($signo, $siginfo);
+ $this->assertCount(1, $handler->getRecords());
+ $this->assertTrue($handler->hasCriticalRecords());
+ $records = $handler->getRecords();
+ $this->assertSame($siginfo, $records[0]['context']);
+ }
+
+ /**
+ * @depends testHandleSignal
+ * @requires extension pcntl
+ * @requires extension posix
+ * @requires function pcntl_signal
+ * @requires function pcntl_signal_dispatch
+ * @requires function posix_getpid
+ * @requires function posix_kill
+ */
+ public function testRegisterSignalHandler()
+ {
+ // SIGCONT and SIGURG should be ignored by default.
+ if (!defined('SIGCONT') || !defined('SIGURG')) {
+ $this->markTestSkipped('This test requires the SIGCONT and SIGURG pcntl constants.');
+ }
+
+ $this->setSignalHandler(SIGCONT, SIG_IGN);
+ $this->setSignalHandler(SIGURG, SIG_IGN);
+
+ $logger = new Logger('test', array($handler = new TestHandler));
+ $errHandler = new SignalHandler($logger);
+ $pid = posix_getpid();
+
+ $this->assertTrue(posix_kill($pid, SIGURG));
+ $this->assertTrue(pcntl_signal_dispatch());
+ $this->assertCount(0, $handler->getRecords());
+
+ $errHandler->registerSignalHandler(SIGURG, LogLevel::INFO, false, false, false);
+
+ $this->assertTrue(posix_kill($pid, SIGCONT));
+ $this->assertTrue(pcntl_signal_dispatch());
+ $this->assertCount(0, $handler->getRecords());
+
+ $this->assertTrue(posix_kill($pid, SIGURG));
+ $this->assertTrue(pcntl_signal_dispatch());
+ $this->assertCount(1, $handler->getRecords());
+ $this->assertTrue($handler->hasInfoThatContains('SIGURG'));
+ }
+
+ /**
+ * @dataProvider defaultPreviousProvider
+ * @depends testRegisterSignalHandler
+ * @requires function pcntl_fork
+ * @requires function pcntl_sigprocmask
+ * @requires function pcntl_waitpid
+ */
+ public function testRegisterDefaultPreviousSignalHandler($signo, $callPrevious, $expected)
+ {
+ $this->setSignalHandler($signo, SIG_DFL);
+
+ $path = tempnam(sys_get_temp_dir(), 'monolog-');
+ $this->assertNotFalse($path);
+
+ $pid = pcntl_fork();
+ if ($pid === 0) { // Child.
+ $streamHandler = new StreamHandler($path);
+ $streamHandler->setFormatter($this->getIdentityFormatter());
+ $logger = new Logger('test', array($streamHandler));
+ $errHandler = new SignalHandler($logger);
+ $errHandler->registerSignalHandler($signo, LogLevel::INFO, $callPrevious, false, false);
+ pcntl_sigprocmask(SIG_SETMASK, array(SIGCONT));
+ posix_kill(posix_getpid(), $signo);
+ pcntl_signal_dispatch();
+ // If $callPrevious is true, SIGINT should terminate by this line.
+ pcntl_sigprocmask(SIG_BLOCK, array(), $oldset);
+ file_put_contents($path, implode(' ', $oldset), FILE_APPEND);
+ posix_kill(posix_getpid(), $signo);
+ pcntl_signal_dispatch();
+ exit();
+ }
+
+ $this->assertNotSame(-1, $pid);
+ $this->assertNotSame(-1, pcntl_waitpid($pid, $status));
+ $this->assertNotSame(-1, $status);
+ $this->assertSame($expected, file_get_contents($path));
+ }
+
+ public function defaultPreviousProvider()
+ {
+ if (!defined('SIGCONT') || !defined('SIGINT') || !defined('SIGURG')) {
+ return array();
+ }
+
+ return array(
+ array(SIGINT, false, 'Program received signal SIGINT'.SIGCONT.'Program received signal SIGINT'),
+ array(SIGINT, true, 'Program received signal SIGINT'),
+ array(SIGURG, false, 'Program received signal SIGURG'.SIGCONT.'Program received signal SIGURG'),
+ array(SIGURG, true, 'Program received signal SIGURG'.SIGCONT.'Program received signal SIGURG'),
+ );
+ }
+
+ /**
+ * @dataProvider callablePreviousProvider
+ * @depends testRegisterSignalHandler
+ * @requires function pcntl_signal_get_handler
+ */
+ public function testRegisterCallablePreviousSignalHandler($callPrevious)
+ {
+ $this->setSignalHandler(SIGURG, SIG_IGN);
+
+ $logger = new Logger('test', array($handler = new TestHandler));
+ $errHandler = new SignalHandler($logger);
+ $previousCalled = 0;
+ pcntl_signal(SIGURG, function ($signo, array $siginfo = null) use (&$previousCalled) {
+ ++$previousCalled;
+ });
+ $errHandler->registerSignalHandler(SIGURG, LogLevel::INFO, $callPrevious, false, false);
+ $this->assertTrue(posix_kill(posix_getpid(), SIGURG));
+ $this->assertTrue(pcntl_signal_dispatch());
+ $this->assertCount(1, $handler->getRecords());
+ $this->assertTrue($handler->hasInfoThatContains('SIGURG'));
+ $this->assertSame($callPrevious ? 1 : 0, $previousCalled);
+ }
+
+ public function callablePreviousProvider()
+ {
+ return array(
+ array(false),
+ array(true),
+ );
+ }
+
+ /**
+ * @dataProvider restartSyscallsProvider
+ * @depends testRegisterDefaultPreviousSignalHandler
+ * @requires function pcntl_fork
+ * @requires function pcntl_waitpid
+ */
+ public function testRegisterSyscallRestartingSignalHandler($restartSyscalls)
+ {
+ $this->setSignalHandler(SIGURG, SIG_IGN);
+
+ $parentPid = posix_getpid();
+ $microtime = microtime(true);
+
+ $pid = pcntl_fork();
+ if ($pid === 0) { // Child.
+ usleep(100000);
+ posix_kill($parentPid, SIGURG);
+ usleep(100000);
+ exit();
+ }
+
+ $this->assertNotSame(-1, $pid);
+ $logger = new Logger('test', array($handler = new TestHandler));
+ $errHandler = new SignalHandler($logger);
+ $errHandler->registerSignalHandler(SIGURG, LogLevel::INFO, false, $restartSyscalls, false);
+ if ($restartSyscalls) {
+ // pcntl_wait is expected to be restarted after the signal handler.
+ $this->assertNotSame(-1, pcntl_waitpid($pid, $status));
+ } else {
+ // pcntl_wait is expected to be interrupted when the signal handler is invoked.
+ $this->assertSame(-1, pcntl_waitpid($pid, $status));
+ }
+ $this->assertSame($restartSyscalls, microtime(true) - $microtime > 0.15);
+ $this->assertTrue(pcntl_signal_dispatch());
+ $this->assertCount(1, $handler->getRecords());
+ if ($restartSyscalls) {
+ // The child has already exited.
+ $this->assertSame(-1, pcntl_waitpid($pid, $status));
+ } else {
+ // The child has not exited yet.
+ $this->assertNotSame(-1, pcntl_waitpid($pid, $status));
+ }
+ }
+
+ public function restartSyscallsProvider()
+ {
+ return array(
+ array(false),
+ array(true),
+ array(false),
+ array(true),
+ );
+ }
+
+ /**
+ * @dataProvider asyncProvider
+ * @depends testRegisterDefaultPreviousSignalHandler
+ * @requires function pcntl_async_signals
+ */
+ public function testRegisterAsyncSignalHandler($initialAsync, $desiredAsync, $expectedBefore, $expectedAfter)
+ {
+ $this->setSignalHandler(SIGURG, SIG_IGN);
+ pcntl_async_signals($initialAsync);
+
+ $logger = new Logger('test', array($handler = new TestHandler));
+ $errHandler = new SignalHandler($logger);
+ $errHandler->registerSignalHandler(SIGURG, LogLevel::INFO, false, false, $desiredAsync);
+ $this->assertTrue(posix_kill(posix_getpid(), SIGURG));
+ $this->assertCount($expectedBefore, $handler->getRecords());
+ $this->assertTrue(pcntl_signal_dispatch());
+ $this->assertCount($expectedAfter, $handler->getRecords());
+ }
+
+ public function asyncProvider()
+ {
+ return array(
+ array(false, false, 0, 1),
+ array(false, null, 0, 1),
+ array(false, true, 1, 1),
+ array(true, false, 0, 1),
+ array(true, null, 1, 1),
+ array(true, true, 1, 1),
+ );
+ }
+
+}
diff --git a/vendor/nesbot/carbon/composer.json b/vendor/nesbot/carbon/composer.json
index 40be3f55..709ff4ee 100644
--- a/vendor/nesbot/carbon/composer.json
+++ b/vendor/nesbot/carbon/composer.json
@@ -25,9 +25,12 @@
"symfony/translation": "~2.6 || ~3.0 || ~4.0"
},
"require-dev": {
- "friendsofphp/php-cs-fixer": "~2",
"phpunit/phpunit": "^4.8.35 || ^5.7"
},
+ "suggest": {
+ "friendsofphp/php-cs-fixer": "Needed for the `composer phpcs` command. Allow to automatically fix code style.",
+ "phpstan/phpstan": "Needed for the `composer phpstan` command. Allow to detect potential errors."
+ },
"autoload": {
"psr-4": {
"": "src/"
diff --git a/vendor/nesbot/carbon/src/Carbon/Carbon.php b/vendor/nesbot/carbon/src/Carbon/Carbon.php
index f62dd45e..7d9db8cb 100644
--- a/vendor/nesbot/carbon/src/Carbon/Carbon.php
+++ b/vendor/nesbot/carbon/src/Carbon/Carbon.php
@@ -13,6 +13,7 @@ namespace Carbon;
use Carbon\Exceptions\InvalidDateException;
use Closure;
+use DateInterval;
use DatePeriod;
use DateTime;
use DateTimeInterface;
@@ -195,7 +196,7 @@ class Carbon extends DateTime implements JsonSerializable
't' => '(2[89]|3[01])',
'L' => '(0|1)',
'o' => '([1-9][0-9]{0,4})',
- 'Y' => '([1-9][0-9]{0,4})',
+ 'Y' => '([1-9]?[0-9]{4})',
'y' => '([0-9]{2})',
'a' => '(am|pm)',
'A' => '(AM|PM)',
@@ -217,8 +218,8 @@ class Carbon extends DateTime implements JsonSerializable
'U' => '([0-9]*)',
// The formats below are combinations of the above formats.
- 'c' => '(([1-9][0-9]{0,4})\-(1[012]|0[1-9])\-(3[01]|[12][0-9]|0[1-9])T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])[\+\-](1[012]|0[0-9]):([0134][05]))', // Y-m-dTH:i:sP
- 'r' => '(([a-zA-Z]{3}), ([123][0-9]|[1-9]) ([a-zA-Z]{3}) ([1-9][0-9]{0,4}) (2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9]) [\+\-](1[012]|0[0-9])([0134][05]))', // D, j M Y H:i:s O
+ 'c' => '(([1-9]?[0-9]{4})\-(1[012]|0[1-9])\-(3[01]|[12][0-9]|0[1-9])T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])[\+\-](1[012]|0[0-9]):([0134][05]))', // Y-m-dTH:i:sP
+ 'r' => '(([a-zA-Z]{3}), ([123][0-9]|[1-9]) ([a-zA-Z]{3}) ([1-9]?[0-9]{4}) (2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9]) [\+\-](1[012]|0[0-9])([0134][05]))', // D, j M Y H:i:s O
);
/**
@@ -2264,6 +2265,13 @@ class Carbon extends DateTime implements JsonSerializable
return $this->gt($date1) && $this->lt($date2);
}
+ protected function floatDiffInSeconds($date)
+ {
+ $date = $this->resolveCarbon($date);
+
+ return abs($this->diffInRealSeconds($date, false) + ($date->micro - $this->micro) / 1000000);
+ }
+
/**
* Get the closest date from the instance.
*
@@ -2274,7 +2282,7 @@ class Carbon extends DateTime implements JsonSerializable
*/
public function closest($date1, $date2)
{
- return $this->diffInSeconds($date1) < $this->diffInSeconds($date2) ? $date1 : $date2;
+ return $this->floatDiffInSeconds($date1) < $this->floatDiffInSeconds($date2) ? $date1 : $date2;
}
/**
@@ -2287,7 +2295,7 @@ class Carbon extends DateTime implements JsonSerializable
*/
public function farthest($date1, $date2)
{
- return $this->diffInSeconds($date1) > $this->diffInSeconds($date2) ? $date1 : $date2;
+ return $this->floatDiffInSeconds($date1) > $this->floatDiffInSeconds($date2) ? $date1 : $date2;
}
/**
@@ -3754,16 +3762,91 @@ class Carbon extends DateTime implements JsonSerializable
///////////////////////////////////////////////////////////////////
/**
- * Get the difference as a CarbonInterval instance
+ * @param DateInterval $diff
+ * @param bool $absolute
+ * @param bool $trimMicroseconds
+ *
+ * @return CarbonInterval
+ */
+ protected static function fixDiffInterval(DateInterval $diff, $absolute, $trimMicroseconds)
+ {
+ $diff = CarbonInterval::instance($diff, $trimMicroseconds);
+
+ // @codeCoverageIgnoreStart
+ if (version_compare(PHP_VERSION, '7.1.0-dev', '<')) {
+ return $diff;
+ }
+
+ // Work-around for https://bugs.php.net/bug.php?id=77145
+ if ($diff->f > 0 && $diff->y === -1 && $diff->m === 11 && $diff->d >= 27 && $diff->h === 23 && $diff->i === 59 && $diff->s === 59) {
+ $diff->y = 0;
+ $diff->m = 0;
+ $diff->d = 0;
+ $diff->h = 0;
+ $diff->i = 0;
+ $diff->s = 0;
+ $diff->f = (1000000 - round($diff->f * 1000000)) / 1000000;
+ $diff->invert();
+ } elseif ($diff->f < 0) {
+ if ($diff->s !== 0 || $diff->i !== 0 || $diff->h !== 0 || $diff->d !== 0 || $diff->m !== 0 || $diff->y !== 0) {
+ $diff->f = (round($diff->f * 1000000) + 1000000) / 1000000;
+ $diff->s--;
+ if ($diff->s < 0) {
+ $diff->s += 60;
+ $diff->i--;
+ if ($diff->i < 0) {
+ $diff->i += 60;
+ $diff->h--;
+ if ($diff->h < 0) {
+ $diff->h += 24;
+ $diff->d--;
+ if ($diff->d < 0) {
+ $diff->d += 30;
+ $diff->m--;
+ if ($diff->m < 0) {
+ $diff->m += 12;
+ $diff->y--;
+ }
+ }
+ }
+ }
+ }
+ } else {
+ $diff->f *= -1;
+ $diff->invert();
+ }
+ }
+ // @codeCoverageIgnoreEnd
+ if ($absolute && $diff->invert) {
+ $diff->invert();
+ }
+
+ return $diff;
+ }
+
+ /**
+ * Get the difference as a CarbonInterval instance.
+ *
+ * Pass false as second argument to get a microseconds-precise interval. Else
+ * microseconds in the original interval will not be kept.
*
* @param \Carbon\Carbon|\DateTimeInterface|string|null $date
- * @param bool $absolute Get the absolute of the difference
+ * @param bool $absolute Get the absolute of the difference
+ * @param bool $trimMicroseconds (true by default)
*
* @return CarbonInterval
*/
- public function diffAsCarbonInterval($date = null, $absolute = true)
+ public function diffAsCarbonInterval($date = null, $absolute = true, $trimMicroseconds = true)
{
- return CarbonInterval::instance($this->diff($this->resolveCarbon($date), $absolute));
+ $from = $this;
+ $to = $this->resolveCarbon($date);
+
+ if ($trimMicroseconds) {
+ $from = $from->copy()->startOfSecond();
+ $to = $to->copy()->startOfSecond();
+ }
+
+ return static::fixDiffInterval($from->diff($to, $absolute), $absolute, $trimMicroseconds);
}
/**
@@ -3973,6 +4056,9 @@ class Carbon extends DateTime implements JsonSerializable
public function diffInSeconds($date = null, $absolute = true)
{
$diff = $this->diff($this->resolveCarbon($date));
+ if (!$diff->days && version_compare(PHP_VERSION, '5.4.0-dev', '>=')) {
+ $diff = static::fixDiffInterval($diff, $absolute, false);
+ }
$value = $diff->days * static::HOURS_PER_DAY * static::MINUTES_PER_HOUR * static::SECONDS_PER_MINUTE +
$diff->h * static::MINUTES_PER_HOUR * static::SECONDS_PER_MINUTE +
$diff->i * static::SECONDS_PER_MINUTE +
@@ -4651,7 +4737,22 @@ class Carbon extends DateTime implements JsonSerializable
*/
public function average($date = null)
{
- return $this->addSeconds((int) ($this->diffInSeconds($this->resolveCarbon($date), false) / 2));
+ $date = $this->resolveCarbon($date);
+ $increment = $this->diffInRealSeconds($date, false) / 2;
+ $intIncrement = floor($increment);
+ $microIncrement = (int) (($date->micro - $this->micro) / 2 + 1000000 * ($increment - $intIncrement));
+ $micro = (int) ($this->micro + $microIncrement);
+ while ($micro >= 1000000) {
+ $micro -= 1000000;
+ $intIncrement++;
+ }
+ $this->addSeconds($intIncrement);
+
+ if (version_compare(PHP_VERSION, '7.1.8-dev', '>=')) {
+ $this->setTime($this->hour, $this->minute, $this->second, $micro);
+ }
+
+ return $this;
}
///////////////////////////////////////////////////////////////////
diff --git a/vendor/nesbot/carbon/src/Carbon/CarbonInterval.php b/vendor/nesbot/carbon/src/Carbon/CarbonInterval.php
index a4d78500..0bd9ab9d 100644
--- a/vendor/nesbot/carbon/src/Carbon/CarbonInterval.php
+++ b/vendor/nesbot/carbon/src/Carbon/CarbonInterval.php
@@ -490,14 +490,27 @@ class CarbonInterval extends DateInterval
* DateInterval objects created from DateTime::diff() as you can't externally
* set the $days field.
*
+ * Pass false as second argument to get a microseconds-precise interval. Else
+ * microseconds in the original interval will not be kept.
+ *
* @param DateInterval $di
+ * @param bool $trimMicroseconds (true by default)
*
* @return static
*/
- public static function instance(DateInterval $di)
+ public static function instance(DateInterval $di, $trimMicroseconds = true)
{
+ $microseconds = $trimMicroseconds || version_compare(PHP_VERSION, '7.1.0-dev', '<') ? 0 : $di->f;
$instance = new static(static::getDateIntervalSpec($di));
+ if ($microseconds) {
+ $instance->f = $microseconds;
+ }
$instance->invert = $di->invert;
+ foreach (array('y', 'm', 'd', 'h', 'i', 's') as $unit) {
+ if ($di->$unit < 0) {
+ $instance->$unit *= -1;
+ }
+ }
return $instance;
}
@@ -911,7 +924,7 @@ class CarbonInterval extends DateInterval
*/
public function add(DateInterval $interval)
{
- $sign = $interval->invert === 1 ? -1 : 1;
+ $sign = ($this->invert === 1) !== ($interval->invert === 1) ? -1 : 1;
if (static::wasCreatedFromDiff($interval)) {
$this->dayz += $interval->days * $sign;
@@ -924,6 +937,18 @@ class CarbonInterval extends DateInterval
$this->seconds += $interval->s * $sign;
}
+ if (($this->years || $this->months || $this->dayz || $this->hours || $this->minutes || $this->seconds) &&
+ $this->years <= 0 && $this->months <= 0 && $this->dayz <= 0 && $this->hours <= 0 && $this->minutes <= 0 && $this->seconds <= 0
+ ) {
+ $this->years *= -1;
+ $this->months *= -1;
+ $this->dayz *= -1;
+ $this->hours *= -1;
+ $this->minutes *= -1;
+ $this->seconds *= -1;
+ $this->invert();
+ }
+
return $this;
}
@@ -961,15 +986,15 @@ class CarbonInterval extends DateInterval
public static function getDateIntervalSpec(DateInterval $interval)
{
$date = array_filter(array(
- static::PERIOD_YEARS => $interval->y,
- static::PERIOD_MONTHS => $interval->m,
- static::PERIOD_DAYS => $interval->d,
+ static::PERIOD_YEARS => abs($interval->y),
+ static::PERIOD_MONTHS => abs($interval->m),
+ static::PERIOD_DAYS => abs($interval->d),
));
$time = array_filter(array(
- static::PERIOD_HOURS => $interval->h,
- static::PERIOD_MINUTES => $interval->i,
- static::PERIOD_SECONDS => $interval->s,
+ static::PERIOD_HOURS => abs($interval->h),
+ static::PERIOD_MINUTES => abs($interval->i),
+ static::PERIOD_SECONDS => abs($interval->s),
));
$specString = static::PERIOD_PREFIX;
diff --git a/vendor/nexmo/client/LICENSE.txt b/vendor/nexmo/client/LICENSE.txt
new file mode 100644
index 00000000..ac86e75d
--- /dev/null
+++ b/vendor/nexmo/client/LICENSE.txt
@@ -0,0 +1,15 @@
+The MIT License (MIT)
+Copyright (c) 2016-2018 Nexmo, Inc
+
+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/nexmo/client/composer.json b/vendor/nexmo/client/composer.json
new file mode 100644
index 00000000..4eb1d1aa
--- /dev/null
+++ b/vendor/nexmo/client/composer.json
@@ -0,0 +1,41 @@
+{
+ "name": "nexmo/client",
+ "description": "PHP Client for using Nexmo's API.",
+ "license": "MIT",
+ "type": "library",
+ "authors": [
+ {
+ "name": "Tim Lytle",
+ "email": "tim@nexmo.com",
+ "role": "Developer",
+ "homepage": "http://twitter.com/tjlytle"
+ }
+ ],
+ "support": {
+ "email": "devrel@nexmo.com"
+ },
+ "require": {
+ "php": ">=5.6",
+ "php-http/client-implementation": "^1.0",
+ "zendframework/zend-diactoros": "^1.3",
+ "php-http/guzzle6-adapter": "^1.0",
+ "lcobucci/jwt": "^3.2"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^5.7",
+ "php-http/mock-client": "^0.3.0",
+ "estahn/phpunit-json-assertions": "^1.0.0",
+ "squizlabs/php_codesniffer": "^3.1"
+ },
+ "autoload": {
+ "psr-4": {
+ "Nexmo\\": "src/"
+ }
+ },
+ "autoload-dev": {
+ "psr-4": {
+ "Nexmo\\": "test/",
+ "NexmoTest\\": "test/"
+ }
+ }
+}
diff --git a/vendor/nexmo/client/examples/fetch_recording.php b/vendor/nexmo/client/examples/fetch_recording.php
new file mode 100644
index 00000000..bddde2c4
--- /dev/null
+++ b/vendor/nexmo/client/examples/fetch_recording.php
@@ -0,0 +1,12 @@
+get($recording);
+
+file_put_contents($recordingId.'.mp3', $data->getBody());
diff --git a/vendor/nexmo/client/examples/send.php b/vendor/nexmo/client/examples/send.php
new file mode 100644
index 00000000..90787fa5
--- /dev/null
+++ b/vendor/nexmo/client/examples/send.php
@@ -0,0 +1,72 @@
+message()->send([
+ 'to' => NEXMO_TO,
+ 'from' => NEXMO_FROM,
+ 'text' => 'Test message from the Nexmo PHP Client'
+]);
+
+//array access provides response data
+echo "Sent message to " . $message['to'] . ". Balance is now " . $message['remaining-balance'] . PHP_EOL;
+
+sleep(1);
+
+//send message using object support
+$text = new \Nexmo\Message\Text(NEXMO_TO, NEXMO_FROM, 'Test message using PHP client library');
+$text->setClientRef('test-message')
+ ->setClass(\Nexmo\Message\Text::CLASS_FLASH);
+
+$client->message()->send($text);
+
+//method access
+echo "Sent message to " . $text->getTo() . ". Balance is now " . $text->getRemainingBalance() . PHP_EOL;
+
+sleep(1);
+
+//sending a message over 160 characters
+$longwinded = <<message()->send($text);
+
+echo "Sent message to " . $text->getTo() . ". Balance is now " . $text->getRemainingBalance() . PHP_EOL;
+echo "Message was split into " . count($text) . " messages, those message ids are: " . PHP_EOL;
+for($i = 0; $i < count($text); $i++){
+ echo $text[$i]['message-id'] . PHP_EOL;
+}
+
+echo "The account balance after each message was: " . PHP_EOL;
+for($i = 0; $i < count($text); $i++){
+ echo $text->getRemainingBalance($i) . PHP_EOL;
+}
+
+//easier iteration, can use methods or array access
+foreach($text as $index => $data){
+ echo "Balance was " . $text->getRemainingBalance($index) . " after message " . $data['message-id'] . " was sent." . PHP_EOL;
+}
+
+//an invalid request
+try{
+ $text = new \Nexmo\Message\Text('not valid', NEXMO_FROM, $longwinded);
+ $client->message()->send($text);
+} catch (Nexmo\Client\Exception\Request $e) {
+ //can still get the API response
+ $text = $e->getEntity();
+ $request = $text->getRequest(); //PSR-7 Request Object
+ $response = $text->getResponse(); //PSR-7 Response Object
+ $data = $text->getResponseData(); //parsed response object
+ $code = $e->getCode(); //nexmo error code
+ error_log($e->getMessage()); //nexmo error message
+}
diff --git a/vendor/nexmo/client/phpcs.xml b/vendor/nexmo/client/phpcs.xml
new file mode 100644
index 00000000..4dc7a1b7
--- /dev/null
+++ b/vendor/nexmo/client/phpcs.xml
@@ -0,0 +1,5 @@
+
+
+
+ ./src
+
diff --git a/vendor/nexmo/client/src/Account/Balance.php b/vendor/nexmo/client/src/Account/Balance.php
new file mode 100644
index 00000000..7894ad6c
--- /dev/null
+++ b/vendor/nexmo/client/src/Account/Balance.php
@@ -0,0 +1,59 @@
+data['balance'] = $balance;
+ $this->data['auto_reload'] = $autoReload;
+ }
+
+ public function getBalance()
+ {
+ return $this['balance'];
+ }
+
+ public function getAutoReload()
+ {
+ return $this['auto_reload'];
+ }
+
+ public function jsonUnserialize(array $json)
+ {
+ $this->data = [
+ 'balance' => $json['value'],
+ 'auto_reload' => $json['autoReload']
+ ];
+ }
+
+ function jsonSerialize()
+ {
+ return $this->data;
+ }
+
+ public function offsetExists($offset)
+ {
+ return isset($this->data[$offset]);
+ }
+
+ public function offsetGet($offset)
+ {
+ return $this->data[$offset];
+ }
+
+ public function offsetSet($offset, $value)
+ {
+ throw new Exception('Balance is read only');
+ }
+
+ public function offsetUnset($offset)
+ {
+ throw new Exception('Balance is read only');
+ }
+}
\ No newline at end of file
diff --git a/vendor/nexmo/client/src/Account/Client.php b/vendor/nexmo/client/src/Account/Client.php
new file mode 100644
index 00000000..d520c288
--- /dev/null
+++ b/vendor/nexmo/client/src/Account/Client.php
@@ -0,0 +1,228 @@
+ $prefix
+ ]);
+
+ $request = new Request(
+ $this->getClient()->getRestUrl() . '/account/get-prefix-pricing/outbound?'.$queryString,
+ 'GET',
+ 'php://temp'
+ );
+
+ $response = $this->client->send($request);
+ $rawBody = $response->getBody()->getContents();
+
+ $body = json_decode($rawBody, true);
+
+ $codeCategory = (int) ($response->getStatusCode()/100);
+ if ($codeCategory != 2) {
+ if ($codeCategory == 4) {
+ throw new Exception\Request($body['error-code-label']);
+ }else if ($codeCategory == 5) {
+ throw new Exception\Server($body['error-code-label']);
+ }
+ }
+
+ if ($body['count'] == 0) {
+ return [];
+ }
+
+ // Multiple countries can match each prefix
+ $prices = [];
+
+ foreach ($body['prices'] as $p) {
+ $prefixPrice = new PrefixPrice();
+ $prefixPrice->jsonUnserialize($p);
+ $prices[] = $prefixPrice;
+ }
+ return $prices;
+ }
+
+ public function getSmsPrice($country)
+ {
+ $body = $this->makePricingRequest($country, 'sms');
+ $smsPrice = new SmsPrice();
+ $smsPrice->jsonUnserialize($body);
+ return $smsPrice;
+ }
+
+ public function getVoicePrice($country)
+ {
+ $body = $this->makePricingRequest($country, 'voice');
+ $voicePrice = new VoicePrice();
+ $voicePrice->jsonUnserialize($body);
+ return $voicePrice;
+ }
+
+ protected function makePricingRequest($country, $pricingType)
+ {
+ $queryString = http_build_query([
+ 'country' => $country
+ ]);
+
+ $request = new Request(
+ $this->getClient()->getRestUrl() . '/account/get-pricing/outbound/'.$pricingType.'?'.$queryString,
+ 'GET',
+ 'php://temp'
+ );
+
+ $response = $this->client->send($request);
+ $rawBody = $response->getBody()->getContents();
+
+ if ($rawBody === '') {
+ throw new Exception\Server('No results found');
+ }
+
+ return json_decode($rawBody, true);
+ }
+
+ public function getBalance()
+ {
+
+ $request = new Request(
+ $this->getClient()->getRestUrl() . '/account/get-balance',
+ 'GET',
+ 'php://temp'
+ );
+
+ $response = $this->client->send($request);
+ $rawBody = $response->getBody()->getContents();
+
+ if ($rawBody === '') {
+ throw new Exception\Server('No results found');
+ }
+
+ $body = json_decode($rawBody, true);
+
+ $balance = new Balance($body['value'], $body['autoReload']);
+ return $balance;
+ }
+
+ public function topUp($trx)
+ {
+ $body = [
+ 'trx' => $trx
+ ];
+
+ $request = new Request(
+ $this->getClient()->getRestUrl() . '/account/top-up'
+ ,'POST'
+ , 'php://temp'
+ , ['content-type' => 'application/x-www-form-urlencoded']
+ );
+
+ $request->getBody()->write(http_build_query($body));
+ $response = $this->client->send($request);
+
+ if($response->getStatusCode() != '200'){
+ throw $this->getException($response);
+ }
+ }
+
+ public function listSecrets($apiKey)
+ {
+ $body = $this->get( $this->getClient()->getApiUrl() . '/accounts/'.$apiKey.'/secrets');
+ return SecretCollection::fromApi($body);
+ }
+
+ public function getSecret($apiKey, $secretId)
+ {
+ $body = $this->get( $this->getClient()->getApiUrl() . '/accounts/'.$apiKey.'/secrets/'. $secretId);
+ return Secret::fromApi($body);
+ }
+
+ public function createSecret($apiKey, $newSecret)
+ {
+ $body = [
+ 'secret' => $newSecret
+ ];
+
+ $request = new Request(
+ $this->getClient()->getApiUrl() . '/accounts/'.$apiKey.'/secrets'
+ ,'POST'
+ , 'php://temp'
+ , ['content-type' => 'application/json']
+ );
+
+ $request->getBody()->write(json_encode($body));
+ $response = $this->client->send($request);
+
+ $rawBody = $response->getBody()->getContents();
+ $responseBody = json_decode($rawBody, true);
+ ApiErrorHandler::check($responseBody, $response->getStatusCode());
+
+ return Secret::fromApi($responseBody);
+ }
+
+ public function deleteSecret($apiKey, $secretId)
+ {
+ $request = new Request(
+ $this->getClient()->getApiUrl() . '/accounts/'.$apiKey.'/secrets/'. $secretId
+ ,'DELETE'
+ , 'php://temp'
+ , ['content-type' => 'application/json']
+ );
+
+ $response = $this->client->send($request);
+ $rawBody = $response->getBody()->getContents();
+ $body = json_decode($rawBody, true);
+
+ // This will throw an exception on any error
+ ApiErrorHandler::check($body, $response->getStatusCode());
+
+ // This returns a 204, so no response body
+ }
+
+ protected function get($url) {
+ $request = new Request(
+ $url
+ ,'GET'
+ , 'php://temp'
+ , ['content-type' => 'application/json']
+ );
+
+ $response = $this->client->send($request);
+ $rawBody = $response->getBody()->getContents();
+ $body = json_decode($rawBody, true);
+
+ // This will throw an exception on any error
+ ApiErrorHandler::check($body, $response->getStatusCode());
+
+ return $body;
+ }
+
+ protected function getException(ResponseInterface $response, $application = null)
+ {
+ $body = json_decode($response->getBody()->getContents(), true);
+ $status = $response->getStatusCode();
+
+ if($status >= 400 AND $status < 500) {
+ $e = new Exception\Request($body['error_title'], $status);
+ } elseif($status >= 500 AND $status < 600) {
+ $e = new Exception\Server($body['error_title'], $status);
+ } else {
+ $e = new Exception\Exception('Unexpected HTTP Status Code');
+ }
+
+ return $e;
+ }
+
+}
diff --git a/vendor/nexmo/client/src/Account/PrefixPrice.php b/vendor/nexmo/client/src/Account/PrefixPrice.php
new file mode 100644
index 00000000..9da71e60
--- /dev/null
+++ b/vendor/nexmo/client/src/Account/PrefixPrice.php
@@ -0,0 +1,13 @@
+getNetworks();
+ if (isset($networks[$networkCode]))
+ {
+ return $networks[$networkCode]->{$this->priceMethod}();
+ }
+
+ return $this->getDefaultPrice();
+ }
+
+ public function jsonUnserialize(array $json)
+ {
+ // Convert CamelCase to snake_case as that's how we use array access in every other object
+ $data = [];
+ foreach ($json as $k => $v){
+ $k = ltrim(strtolower(preg_replace('/[A-Z]([A-Z](?![a-z]))*/', '_$0', $k)), '_');
+
+ // PrefixPrice fixes
+ if ($k == 'country') {
+ $k = 'country_code';
+ }
+
+ if ($k == 'name') {
+ $data['country_display_name'] = $v;
+ $data['country_name'] = $v;
+ }
+
+ if ($k == 'prefix') {
+ $k = 'dialing_prefix';
+ }
+
+ $data[$k] = $v;
+ }
+
+ // Create objects for all the nested networks too
+ $networks = [];
+ if (isset($json['networks'])) {
+ foreach ($json['networks'] as $n){
+ if (isset($n['code'])) {
+ $n['networkCode'] = $n['code'];
+ unset ($n['code']);
+ }
+
+ if (isset($n['network'])) {
+ $n['networkName'] = $n['network'];
+ unset ($n['network']);
+ }
+
+ $network = new Network($n['networkCode'], $n['networkName']);
+ $network->jsonUnserialize($n);
+ $networks[$network->getCode()] = $network;
+ }
+ }
+
+ $data['networks'] = $networks;
+ $this->data = $data;
+ }
+
+ function jsonSerialize()
+ {
+ return $this->data;
+ }
+
+ public function offsetExists($offset)
+ {
+ return isset($this->data[$offset]);
+ }
+
+ public function offsetGet($offset)
+ {
+ return $this->data[$offset];
+ }
+
+ public function offsetSet($offset, $value)
+ {
+ throw new Exception('Price is read only');
+ }
+
+ public function offsetUnset($offset)
+ {
+ throw new Exception('Price is read only');
+ }
+}
diff --git a/vendor/nexmo/client/src/Account/Secret.php b/vendor/nexmo/client/src/Account/Secret.php
new file mode 100644
index 00000000..5566c657
--- /dev/null
+++ b/vendor/nexmo/client/src/Account/Secret.php
@@ -0,0 +1,56 @@
+data = $data;
+ }
+
+ public function getId() {
+ return $this['id'];
+ }
+
+ public function getCreatedAt() {
+ return $this['created_at'];
+ }
+
+ public function getLinks() {
+ return $this['_links'];
+ }
+
+ public static function fromApi($data) {
+ if (!isset($data['id'])) {
+ throw new InvalidResponseException("Missing key: 'id");
+ }
+ if (!isset($data['created_at'])) {
+ throw new InvalidResponseException("Missing key: 'created_at");
+ }
+ return new self($data);
+ }
+
+ public function offsetExists($offset)
+ {
+ return isset($this->data[$offset]);
+ }
+
+ public function offsetGet($offset)
+ {
+ return $this->data[$offset];
+ }
+
+ public function offsetSet($offset, $value)
+ {
+ throw new \Exception('Secret::offsetSet is not implemented');
+ }
+
+ public function offsetUnset($offset)
+ {
+ throw new \Exception('Secret::offsetUnset is not implemented');
+ }
+
+}
diff --git a/vendor/nexmo/client/src/Account/SecretCollection.php b/vendor/nexmo/client/src/Account/SecretCollection.php
new file mode 100644
index 00000000..51aa11fe
--- /dev/null
+++ b/vendor/nexmo/client/src/Account/SecretCollection.php
@@ -0,0 +1,51 @@
+data = [
+ 'secrets' => $secrets,
+ '_links' => $links
+ ];
+ }
+
+ public function getSecrets() {
+ return $this['secrets'];
+ }
+
+ public function getLinks() {
+ return $this['_links'];
+ }
+
+ public static function fromApi($data) {
+ $secrets = [];
+ foreach ($data['_embedded']['secrets'] as $s) {
+ $secrets[] = Secret::fromApi($s);
+ }
+ return new self($secrets, $data['_links']);
+ }
+
+ public function offsetExists($offset)
+ {
+ return isset($this->data[$offset]);
+ }
+
+ public function offsetGet($offset)
+ {
+ return $this->data[$offset];
+ }
+
+ public function offsetSet($offset, $value)
+ {
+ throw new \Exception('SecretCollection::offsetSet is not implemented');
+ }
+
+ public function offsetUnset($offset)
+ {
+ throw new \Exception('SecretCollection::offsetUnset is not implemented');
+ }
+
+}
diff --git a/vendor/nexmo/client/src/Account/SmsPrice.php b/vendor/nexmo/client/src/Account/SmsPrice.php
new file mode 100644
index 00000000..a5532be4
--- /dev/null
+++ b/vendor/nexmo/client/src/Account/SmsPrice.php
@@ -0,0 +1,7 @@
+id = $id;
+ }
+
+ public function getId()
+ {
+ return $this->id;
+ }
+
+ public function setVoiceConfig(VoiceConfig $config)
+ {
+ $this->voiceConfig = $config;
+ return $this;
+ }
+
+ /**
+ * @return VoiceConfig
+ */
+ public function getVoiceConfig()
+ {
+ if(!isset($this->voiceConfig)){
+ $this->setVoiceConfig(new VoiceConfig());
+ $data = $this->getResponseData();
+ if(isset($data['voice']) AND isset($data['voice']['webhooks'])){
+ foreach($data['voice']['webhooks'] as $webhook){
+ $this->voiceConfig->setWebhook($webhook['endpoint_type'], $webhook['endpoint'], $webhook['http_method']);
+ }
+ }
+ }
+
+ return $this->voiceConfig;
+ }
+
+ public function getPublicKey()
+ {
+ if(isset($this->keys['public_key'])){
+ return $this->keys['public_key'];
+ }
+ }
+
+ public function getPrivateKey()
+ {
+ if(isset($this->keys['private_key'])){
+ return $this->keys['private_key'];
+ }
+ }
+
+ public function setName($name)
+ {
+ $this->name = $name;
+ return $this;
+ }
+
+ public function getName()
+ {
+ return $this->name;
+ }
+
+ public function jsonUnserialize(array $json)
+ {
+ $this->name = $json['name'];
+ $this->id = $json['id'];
+ $this->keys = $json['keys'];
+
+ //todo: make voice hydrate-able
+ $this->voiceConfig = new VoiceConfig();
+ if(isset($json['voice']) AND isset($json['voice']['webhooks'])){
+ foreach($json['voice']['webhooks'] as $webhook){
+ $this->voiceConfig->setWebhook($webhook['endpoint_type'], new Webhook($webhook['endpoint'], $webhook['http_method']));
+ }
+ }
+ }
+
+ public function jsonSerialize()
+ {
+ return [
+ 'name' => $this->getName(),
+ //currently, the request data does not match the response data
+ 'event_url' => (string) $this->getVoiceConfig()->getWebhook(VoiceConfig::EVENT),
+ 'answer_url' => (string) $this->getVoiceConfig()->getWebhook(VoiceConfig::ANSWER),
+ 'type' => 'voice' //currently the only type
+ ];
+ }
+
+ public function __toString()
+ {
+ return (string) $this->getId();
+ }
+}
\ No newline at end of file
diff --git a/vendor/nexmo/client/src/Application/ApplicationInterface.php b/vendor/nexmo/client/src/Application/ApplicationInterface.php
new file mode 100644
index 00000000..29716094
--- /dev/null
+++ b/vendor/nexmo/client/src/Application/ApplicationInterface.php
@@ -0,0 +1,16 @@
+jsonUnserialize($data);
+ return $application;
+ }
+
+ public function get($application)
+ {
+ if(!($application instanceof Application)){
+ $application = new Application($application);
+ }
+
+ $request = new Request(
+ $this->getClient()->getApiUrl() . $this->getCollectionPath() . '/' . $application->getId()
+ ,'GET'
+ );
+
+ $application->setRequest($request);
+ $response = $this->client->send($request);
+ $application->setResponse($response);
+
+ if($response->getStatusCode() != '200'){
+ throw $this->getException($response, $application);
+ }
+
+ return $application;
+ }
+
+ public function create($application)
+ {
+ return $this->post($application);
+ }
+
+ public function post($application)
+ {
+ if(!($application instanceof Application)){
+ $application = $this->createFromArray($application);
+ }
+
+ $body = $application->getRequestData(false);
+
+ $request = new Request(
+ $this->getClient()->getApiUrl() . $this->getCollectionPath()
+ ,'POST',
+ 'php://temp',
+ ['content-type' => 'application/json']
+ );
+
+ $request->getBody()->write(json_encode($body));
+ $application->setRequest($request);
+ $response = $this->client->send($request);
+ $application->setResponse($response);
+
+ if($response->getStatusCode() != '201'){
+ throw $this->getException($response, $application);
+ }
+
+ return $application;
+ }
+
+ public function update($application, $id = null)
+ {
+ return $this->put($application, $id);
+ }
+
+ public function put($application, $id = null)
+ {
+ if(!($application instanceof Application)){
+ $application = $this->createFromArray($application);
+ }
+
+ if(is_null($id)){
+ $id = $application->getId();
+ }
+
+ $body = $application->getRequestData(false);
+
+ $request = new Request(
+ $this->getClient()->getApiUrl() . $this->getCollectionPath() . '/' . $id,
+ 'PUT',
+ 'php://temp',
+ ['content-type' => 'application/json']
+ );
+
+ $request->getBody()->write(json_encode($body));
+ $application->setRequest($request);
+ $response = $this->client->send($request);
+ $application->setResponse($response);
+
+ if($response->getStatusCode() != '200'){
+ throw $this->getException($response, $application);
+ }
+
+ return $application;
+ }
+
+ public function delete($application)
+ {
+ if(($application instanceof Application)){
+ $id = $application->getId();
+ } else {
+ $id = $application;
+ }
+
+ $request = new Request(
+ $this->getClient()->getApiUrl(). $this->getCollectionPath() . '/' . $id
+ ,'DELETE'
+ );
+
+ if($application instanceof Application){
+ $application->setRequest($request);
+ }
+
+ $response = $this->client->send($request);
+
+ if($application instanceof Application){
+ $application->setResponse($response);
+ }
+
+ if($response->getStatusCode() != '204'){
+ throw $this->getException($response, $application);
+ }
+
+ return true;
+ }
+
+ protected function getException(ResponseInterface $response, $application = null)
+ {
+ $body = json_decode($response->getBody()->getContents(), true);
+ $status = $response->getStatusCode();
+
+ if($status >= 400 AND $status < 500) {
+ $e = new Exception\Request($body['error_title'], $status);
+ } elseif($status >= 500 AND $status < 600) {
+ $e = new Exception\Server($body['error_title'], $status);
+ } else {
+ $e = new Exception\Exception('Unexpected HTTP Status Code');
+ throw $e;
+ }
+
+ //todo use interfaces here
+ if(($application instanceof Application) AND (($e instanceof Exception\Request) OR ($e instanceof Exception\Server))){
+ $e->setEntity($application);
+ }
+
+ return $e;
+ }
+
+ protected function createFromArray($array)
+ {
+ if(!is_array($array)){
+ throw new \RuntimeException('application must implement `' . ApplicationInterface::class . '` or be an array`');
+ }
+
+ foreach(['name',] as $param){
+ if(!isset($array[$param])){
+ throw new \InvalidArgumentException('missing expected key `' . $param . '`');
+ }
+ }
+
+ $application = new Application();
+ $application->setName($array['name']);
+
+ foreach(['event', 'answer'] as $type){
+ if(isset($array[$type . '_url'])){
+ $method = isset($array[$type . '_method']) ? $array[$type . '_method'] : null;
+ $application->getVoiceConfig()->setWebhook($type . '_url', new Webhook($array[$type . '_url'], $method));
+ }
+ }
+
+ return $application;
+ }
+}
diff --git a/vendor/nexmo/client/src/Application/Filter.php b/vendor/nexmo/client/src/Application/Filter.php
new file mode 100644
index 00000000..b3e13958
--- /dev/null
+++ b/vendor/nexmo/client/src/Application/Filter.php
@@ -0,0 +1,39 @@
+start = $start;
+ $this->end = $end;
+ } else {
+ $this->start = $end;
+ $this->end = $start;
+ }
+ }
+
+ public function getQuery()
+ {
+ return [
+ 'date' => $this->start->format(self::FORMAT) . '-' . $this->end->format(self::FORMAT)
+ ];
+ }
+}
\ No newline at end of file
diff --git a/vendor/nexmo/client/src/Application/VoiceConfig.php b/vendor/nexmo/client/src/Application/VoiceConfig.php
new file mode 100644
index 00000000..3792618e
--- /dev/null
+++ b/vendor/nexmo/client/src/Application/VoiceConfig.php
@@ -0,0 +1,34 @@
+webhooks[$type] = $url;
+ return $this;
+ }
+
+ public function getWebhook($type)
+ {
+ if(isset($this->webhooks[$type])){
+ return $this->webhooks[$type];
+ }
+ }
+}
\ No newline at end of file
diff --git a/vendor/nexmo/client/src/Application/Webhook.php b/vendor/nexmo/client/src/Application/Webhook.php
new file mode 100644
index 00000000..89db994a
--- /dev/null
+++ b/vendor/nexmo/client/src/Application/Webhook.php
@@ -0,0 +1,46 @@
+url = $url;
+ $this->method = $method;
+ }
+
+ public function getMethod()
+ {
+ return $this->method;
+ }
+
+ public function getUrl()
+ {
+ return $this->url;
+ }
+
+ public function __toString()
+ {
+ return $this->getUrl();
+ }
+}
\ No newline at end of file
diff --git a/vendor/nexmo/client/src/Call/Call.php b/vendor/nexmo/client/src/Call/Call.php
new file mode 100644
index 00000000..49b24bd1
--- /dev/null
+++ b/vendor/nexmo/client/src/Call/Call.php
@@ -0,0 +1,301 @@
+id = $id;
+ }
+
+ public function get()
+ {
+ $request = new Request(
+ $this->getClient()->getApiUrl() . Collection::getCollectionPath() . '/' . $this->getId()
+ ,'GET'
+ );
+
+ $response = $this->getClient()->send($request);
+
+ if($response->getStatusCode() != '200'){
+ throw $this->getException($response);
+ }
+
+ $data = json_decode($response->getBody()->getContents(), true);
+ $this->jsonUnserialize($data);
+
+ return $this;
+ }
+
+ protected function getException(ResponseInterface $response)
+ {
+ $body = json_decode($response->getBody()->getContents(), true);
+ $status = $response->getStatusCode();
+
+ if($status >= 400 AND $status < 500) {
+ $e = new Exception\Request($body['error_title'], $status);
+ } elseif($status >= 500 AND $status < 600) {
+ $e = new Exception\Server($body['error_title'], $status);
+ } else {
+ $e = new Exception\Exception('Unexpected HTTP Status Code');
+ }
+
+ return $e;
+ }
+
+ public function put($payload)
+ {
+ $request = new Request(
+ $this->getClient()->getApiUrl() . Collection::getCollectionPath() . '/' . $this->getId()
+ ,'PUT',
+ 'php://temp',
+ ['content-type' => 'application/json']
+ );
+
+ $request->getBody()->write(json_encode($payload));
+ $response = $this->client->send($request);
+
+ $responseCode = $response->getStatusCode();
+ if($responseCode != '200' && $responseCode != '204'){
+ throw $this->getException($response);
+ }
+
+ return $this;
+ }
+
+ public function getId()
+ {
+ return $this->id;
+ }
+
+ public function setTo($endpoint)
+ {
+ if(!($endpoint instanceof Endpoint)){
+ $endpoint = new Endpoint($endpoint);
+ }
+
+ $this->to = $endpoint;
+ return $this;
+ }
+
+ /**
+ * @return Endpoint
+ */
+ public function getTo()
+ {
+ if($this->lazyLoad()){
+ return new Endpoint($this->data['to']['number'], $this->data['to']['type']);
+ }
+
+ return $this->to;
+ }
+
+ public function setFrom($endpoint)
+ {
+ if(!($endpoint instanceof Endpoint)){
+ $endpoint = new Endpoint($endpoint);
+ }
+
+ $this->from = $endpoint;
+ return $this;
+ }
+
+ /**
+ * @return Endpoint
+ */
+ public function getFrom()
+ {
+ if($this->lazyLoad()){
+ return new Endpoint($this->data['from']['number'], $this->data['from']['type']);
+ }
+
+ return $this->from;
+ }
+
+ public function setWebhook($type, $url = null, $method = null)
+ {
+ if($type instanceof Webhook){
+ $this->webhooks[$type->getType()] = $type;
+ return $this;
+ }
+
+ if(is_null($url)){
+ throw new \InvalidArgumentException('must provide `Nexmo\Call\Webhook` object, or a type and url: missing url' );
+ }
+
+ $this->webhooks[$type] = new Webhook($type, $url, $method);
+ return $this;
+ }
+
+ public function setTimer($type, $length)
+ {
+ $this->data[$type . '_timer'] = $length;
+ }
+
+ public function setTimeout($type, $length)
+ {
+ $this->data[$type . '_timeout'] = $length;
+ }
+
+ public function getStatus()
+ {
+ if($this->lazyLoad()){
+ return $this->data['status'];
+ }
+ }
+
+ public function getDirection()
+ {
+ if($this->lazyLoad()){
+ return $this->data['direction'];
+ }
+ }
+
+ public function getConversation()
+ {
+ if($this->lazyLoad()){
+ return new Conversation($this->data['conversation_uuid']);
+ }
+ }
+
+ /**
+ * Returns true if the resource data is loaded.
+ *
+ * Will attempt to load the data if it's not already.
+ *
+ * @return bool
+ */
+ protected function lazyLoad()
+ {
+ if(!empty($this->data)){
+ return true;
+ }
+
+ if(isset($this->id)){
+ $this->get($this);
+ return true;
+ }
+
+ return false;
+ }
+
+ public function __get($name)
+ {
+ switch($name){
+ case 'stream':
+ case 'talk':
+ case 'dtmf':
+ return $this->lazySubresource(ucfirst($name));
+ default:
+ throw new \RuntimeException('property does not exist: ' . $name);
+ }
+ }
+
+ public function __call($name, $arguments)
+ {
+ switch($name){
+ case 'stream':
+ case 'talk':
+ case 'dtmf':
+ $entity = $this->lazySubresource(ucfirst($name));
+ return call_user_func_array($entity, $arguments);
+ default:
+ throw new \RuntimeException('method does not exist: ' . $name);
+ }
+ }
+
+ protected function lazySubresource($type)
+ {
+ if(!isset($this->subresources[$type])){
+ $class = 'Nexmo\Call\\' . $type;
+ $instance = new $class($this->getId());
+ $instance->setClient($this->getClient());
+ $this->subresources[$type] = $instance;
+ }
+
+ return $this->subresources[$type];
+ }
+
+ public function jsonSerialize()
+ {
+ $data = $this->data;
+
+ if(isset($this->to)){
+ $data['to'] = [$this->to->jsonSerialize()];
+ }
+
+ if(isset($this->from)){
+ $data['from'] = $this->from->jsonSerialize();
+ }
+
+ foreach($this->webhooks as $webhook){
+ $data = array_merge($data, $webhook->jsonSerialize());
+ }
+
+ return $data;
+ }
+
+ public function jsonUnserialize(array $json)
+ {
+ $this->data = $json;
+ $this->id = $json['uuid'];
+ }
+}
diff --git a/vendor/nexmo/client/src/Call/Collection.php b/vendor/nexmo/client/src/Call/Collection.php
new file mode 100644
index 00000000..0a710f0d
--- /dev/null
+++ b/vendor/nexmo/client/src/Call/Collection.php
@@ -0,0 +1,203 @@
+setClient($this->getClient());
+ $idOrCall->jsonUnserialize($data);
+
+ return $idOrCall;
+ }
+
+ /**
+ * @param null $callOrFilter
+ * @return $this|Call
+ */
+ public function __invoke(Filter $filter = null)
+ {
+ if(!is_null($filter)){
+ $this->setFilter($filter);
+ }
+
+ return $this;
+ }
+
+ public function create($call)
+ {
+ return $this->post($call);
+ }
+
+ public function put($payload, $idOrCall)
+ {
+ if(!($idOrCall instanceof Call)){
+ $idOrCall = new Call($idOrCall);
+ }
+
+ $idOrCall->setClient($this->getClient());
+ $idOrCall->put($payload);
+ return $idOrCall;
+ }
+
+ public function delete($call = null, $type)
+ {
+ if(is_object($call) AND is_callable([$call, 'getId'])){
+ $call = $call->getId();
+ }
+
+ if(!($call instanceof Call)){
+ $call = new Call($call);
+ }
+
+ $request = new Request(
+ $this->getClient()->getApiUrl() . $this->getCollectionPath() . '/' . $call->getId() . '/' . $type
+ ,'DELETE'
+ );
+
+ $response = $this->client->send($request);
+
+ if($response->getStatusCode() != '204'){
+ throw $this->getException($response);
+ }
+
+ return $call;
+ }
+
+ public function post($call)
+ {
+ if($call instanceof Call){
+ $body = $call->getRequestData();
+ } else {
+ $body = $call;
+ }
+
+ $request = new Request(
+ $this->getClient()->getApiUrl() . $this->getCollectionPath()
+ ,'POST',
+ 'php://temp',
+ ['content-type' => 'application/json']
+ );
+
+ $request->getBody()->write(json_encode($body));
+ $response = $this->client->send($request);
+
+ if($response->getStatusCode() != '201'){
+ throw $this->getException($response);
+ }
+
+ $body = json_decode($response->getBody()->getContents(), true);
+ $call = new Call($body['uuid']);
+ $call->jsonUnserialize($body);
+ $call->setClient($this->getClient());
+
+ return $call;
+ }
+
+ public function get($call)
+ {
+ if(!($call instanceof Call)){
+ $call = new Call($call);
+ }
+
+ $call->setClient($this->getClient());
+ $call->get();
+
+ return $call;
+ }
+
+ protected function getException(ResponseInterface $response)
+ {
+ $body = json_decode($response->getBody()->getContents(), true);
+ $status = $response->getStatusCode();
+
+ // Error responses aren't consistent. Some are generated within the
+ // proxy and some are generated within voice itself. This handles
+ // both cases
+
+ // This message isn't very useful, but we shouldn't ever see it
+ $errorTitle = 'Unexpected error';
+
+ if (isset($body['title'])) {
+ $errorTitle = $body['title'];
+ }
+
+ if (isset($body['error_title'])) {
+ $errorTitle = $body['error_title'];
+ }
+
+ if($status >= 400 AND $status < 500) {
+ $e = new Exception\Request($errorTitle, $status);
+ } elseif($status >= 500 AND $status < 600) {
+ $e = new Exception\Server($errorTitle, $status);
+ } else {
+ $e = new Exception\Exception('Unexpected HTTP Status Code');
+ throw $e;
+ }
+
+ return $e;
+ }
+
+ public function offsetExists($offset)
+ {
+ //todo: validate form of id
+ return true;
+ }
+
+ /**
+ * @param mixed $call
+ * @return Call
+ */
+ public function offsetGet($call)
+ {
+ if(!($call instanceof Call)){
+ $call = new Call($call);
+ }
+
+ $call->setClient($this->getClient());
+ return $call;
+ }
+
+ public function offsetSet($offset, $value)
+ {
+ throw new \RuntimeException('can not set collection properties');
+ }
+
+ public function offsetUnset($offset)
+ {
+ throw new \RuntimeException('can not unset collection properties');
+ }
+}
diff --git a/vendor/nexmo/client/src/Call/Dtmf.php b/vendor/nexmo/client/src/Call/Dtmf.php
new file mode 100644
index 00000000..691c2f38
--- /dev/null
+++ b/vendor/nexmo/client/src/Call/Dtmf.php
@@ -0,0 +1,139 @@
+id = $id;
+ }
+
+ public function __invoke(self $entity = null)
+ {
+ if(is_null($entity)){
+ return $this;
+ }
+
+ return $this->put($entity);
+ }
+
+ public function getId()
+ {
+ return $this->id;
+ }
+
+ public function setDigits($digits)
+ {
+ $this->data['digits'] = (string) $digits;
+ }
+
+ public function put($dtmf = null)
+ {
+ if(!$dtmf){
+ $dtmf = $this;
+ }
+
+ $request = new Request(
+ $this->getClient()->getApiUrl() . Collection::getCollectionPath() . '/' . $this->getId() . '/dtmf',
+ 'PUT',
+ 'php://temp',
+ ['content-type' => 'application/json']
+ );
+
+ $request->getBody()->write(json_encode($dtmf));
+ $response = $this->client->send($request);
+ return $this->parseEventResponse($response);
+ }
+
+ protected function parseEventResponse(ResponseInterface $response)
+ {
+ if($response->getStatusCode() != '200'){
+ throw $this->getException($response);
+ }
+
+ $json = json_decode($response->getBody()->getContents(), true);
+
+ if(!$json){
+ throw new Exception\Exception('Unexpected Response Body Format');
+ }
+
+ return new Event($json);
+ }
+
+ protected function getException(ResponseInterface $response)
+ {
+ $body = json_decode($response->getBody()->getContents(), true);
+ $status = $response->getStatusCode();
+
+ if($status >= 400 AND $status < 500) {
+ $e = new Exception\Request($body['error_title'], $status);
+ } elseif($status >= 500 AND $status < 600) {
+ $e = new Exception\Server($body['error_title'], $status);
+ } else {
+ $e = new Exception\Exception('Unexpected HTTP Status Code');
+ throw $e;
+ }
+
+ return $e;
+ }
+
+ function jsonSerialize()
+ {
+ return $this->data;
+ }
+
+ public function offsetExists($offset)
+ {
+ return isset($this->data[$offset]);
+ }
+
+ public function offsetGet($offset)
+ {
+ return $this->data[$offset];
+ }
+
+ public function offsetSet($offset, $value)
+ {
+ if(!in_array($offset, $this->params)){
+ throw new \RuntimeException('invalid parameter: ' . $offset);
+ }
+
+ $this->data[$offset] = $value;
+ }
+
+ public function offsetUnset($offset)
+ {
+ if(!in_array($offset, $this->params)){
+ throw new \RuntimeException('invalid parameter: ' . $offset);
+ }
+
+ unset($this->data[$offset]);
+ }
+}
diff --git a/vendor/nexmo/client/src/Call/Earmuff.php b/vendor/nexmo/client/src/Call/Earmuff.php
new file mode 100644
index 00000000..32cc0e11
--- /dev/null
+++ b/vendor/nexmo/client/src/Call/Earmuff.php
@@ -0,0 +1,20 @@
+ 'earmuff'
+ ];
+ }
+}
\ No newline at end of file
diff --git a/vendor/nexmo/client/src/Call/Endpoint.php b/vendor/nexmo/client/src/Call/Endpoint.php
new file mode 100644
index 00000000..a25db521
--- /dev/null
+++ b/vendor/nexmo/client/src/Call/Endpoint.php
@@ -0,0 +1,87 @@
+id = $id;
+ $this->type = $type;
+ $this->additional = $additional;
+ }
+
+ public function getType()
+ {
+ return $this->type;
+ }
+
+ public function getId()
+ {
+ return $this->id;
+ }
+
+ public function set($property, $value)
+ {
+ $this->additional[$property] = $value;
+ return $this;
+ }
+
+ public function get($property)
+ {
+ if(isset($this->additional[$property])){
+ return $this->additional[$property];
+ }
+ }
+
+ public function getNumber()
+ {
+ if(!self::PHONE == $this->type){
+ throw new \RuntimeException('number not defined for this type');
+ }
+
+ return $this->getId();
+ }
+
+ public function __toString()
+ {
+ return (string) $this->getId();
+ }
+
+ function jsonSerialize()
+ {
+ switch($this->type){
+ case 'phone':
+ return array_merge(
+ $this->additional,
+ [
+ 'type' => $this->type,
+ 'number' => $this->id
+ ]
+
+ );
+ default:
+ throw new \RuntimeException('unknown type: ' . $this->type);
+ }
+ }
+}
\ No newline at end of file
diff --git a/vendor/nexmo/client/src/Call/Event.php b/vendor/nexmo/client/src/Call/Event.php
new file mode 100644
index 00000000..b141be16
--- /dev/null
+++ b/vendor/nexmo/client/src/Call/Event.php
@@ -0,0 +1,53 @@
+data = $data;
+ }
+
+ public function getId()
+ {
+ return $this->data['uuid'];
+ }
+
+ public function getMessage()
+ {
+ return $this->data['message'];
+ }
+
+ public function offsetExists($offset)
+ {
+ return isset($this->data[$offset]);
+ }
+
+ public function offsetGet($offset)
+ {
+ return $this->data[$offset];
+ }
+
+ public function offsetSet($offset, $value)
+ {
+ throw new \RuntimeException('can not set properties directly');
+ }
+
+ public function offsetUnset($offset)
+ {
+ throw new \RuntimeException('can not set properties directly');
+ }
+}
\ No newline at end of file
diff --git a/vendor/nexmo/client/src/Call/Filter.php b/vendor/nexmo/client/src/Call/Filter.php
new file mode 100644
index 00000000..efbf0d92
--- /dev/null
+++ b/vendor/nexmo/client/src/Call/Filter.php
@@ -0,0 +1,81 @@
+query;
+ }
+
+ public function sortAscending()
+ {
+ return $this->setOrder('asc');
+ }
+
+ public function sortDescending()
+ {
+ return $this->setOrder('desc');
+ }
+
+ public function setStatus($status)
+ {
+ $this->query['status'] = (string) $status;
+ return $this;
+ }
+
+ public function setStart(\DateTime $start)
+ {
+ $start->setTimezone(new \DateTimeZone("UTC"));
+ $this->query['date_start'] = $start->format('Y-m-d\TH:i:s\Z');
+ return $this;
+ }
+
+ public function setEnd(\DateTime $end)
+ {
+ $end->setTimezone(new \DateTimeZone("UTC"));
+ $this->query['date_end'] = $end->format('Y-m-d\TH:i:s\Z');
+ return $this;
+ }
+
+ public function setSize($size)
+ {
+ $this->query['page_size'] = (int) $size;
+ return $this;
+ }
+
+ public function setIndex($index)
+ {
+ $this->query['record_index'] = (int) $index;
+ return $this;
+ }
+
+ public function setOrder($order)
+ {
+ $this->query['order'] = (string) $order;
+ return $this;
+ }
+
+ public function setConversation($conversation)
+ {
+ if($conversation instanceof Conversation){
+ $conversation = $conversation->getId();
+ }
+
+ $this->query['conversation_uuid'] = $conversation;
+
+ return $this;
+ }
+}
diff --git a/vendor/nexmo/client/src/Call/Hangup.php b/vendor/nexmo/client/src/Call/Hangup.php
new file mode 100644
index 00000000..48afd81e
--- /dev/null
+++ b/vendor/nexmo/client/src/Call/Hangup.php
@@ -0,0 +1,21 @@
+ 'hangup'
+ ];
+ }
+
+}
\ No newline at end of file
diff --git a/vendor/nexmo/client/src/Call/Mute.php b/vendor/nexmo/client/src/Call/Mute.php
new file mode 100644
index 00000000..2702bc88
--- /dev/null
+++ b/vendor/nexmo/client/src/Call/Mute.php
@@ -0,0 +1,20 @@
+ 'mute'
+ ];
+ }
+}
\ No newline at end of file
diff --git a/vendor/nexmo/client/src/Call/Stream.php b/vendor/nexmo/client/src/Call/Stream.php
new file mode 100644
index 00000000..d0c16de9
--- /dev/null
+++ b/vendor/nexmo/client/src/Call/Stream.php
@@ -0,0 +1,127 @@
+id = $id;
+ }
+
+ public function __invoke(Stream $stream = null)
+ {
+ if(is_null($stream)){
+ return $this;
+ }
+
+ return $this->put($stream);
+ }
+
+ public function getId()
+ {
+ return $this->id;
+ }
+
+ public function setUrl($url)
+ {
+ if(!is_array($url)){
+ $url = array($url);
+ }
+
+ $this->data['stream_url'] = $url;
+ }
+
+ public function setLoop($times)
+ {
+ $this->data['loop'] = (int) $times;
+ }
+
+ public function put($stream = null)
+ {
+ if(!$stream){
+ $stream = $this;
+ }
+
+ $request = new Request(
+ $this->getClient()->getApiUrl() . Collection::getCollectionPath() . '/' . $this->getId() . '/stream',
+ 'PUT',
+ 'php://temp',
+ ['content-type' => 'application/json']
+ );
+
+ $request->getBody()->write(json_encode($stream));
+ $response = $this->client->send($request);
+ return $this->parseEventResponse($response);
+ }
+
+ public function delete()
+ {
+ $request = new Request(
+ $this->getClient()->getApiUrl() . Collection::getCollectionPath() . '/' . $this->getId() . '/stream',
+ 'DELETE'
+ );
+
+ $response = $this->client->send($request);
+ return $this->parseEventResponse($response);
+ }
+
+ protected function parseEventResponse(ResponseInterface $response)
+ {
+ if($response->getStatusCode() != '200'){
+ throw $this->getException($response);
+ }
+
+ $json = json_decode($response->getBody()->getContents(), true);
+
+ if(!$json){
+ throw new Exception\Exception('Unexpected Response Body Format');
+ }
+
+ return new Event($json);
+ }
+
+ protected function getException(ResponseInterface $response)
+ {
+ $body = json_decode($response->getBody()->getContents(), true);
+ $status = $response->getStatusCode();
+
+ if($status >= 400 AND $status < 500) {
+ $e = new Exception\Request($body['error_title'], $status);
+ } elseif($status >= 500 AND $status < 600) {
+ $e = new Exception\Server($body['error_title'], $status);
+ } else {
+ $e = new Exception\Exception('Unexpected HTTP Status Code');
+ throw $e;
+ }
+
+ return $e;
+ }
+
+ function jsonSerialize()
+ {
+ return $this->data;
+ }
+}
diff --git a/vendor/nexmo/client/src/Call/Talk.php b/vendor/nexmo/client/src/Call/Talk.php
new file mode 100644
index 00000000..a16acefd
--- /dev/null
+++ b/vendor/nexmo/client/src/Call/Talk.php
@@ -0,0 +1,162 @@
+id = $id;
+ }
+
+ public function __invoke(self $entity = null)
+ {
+ if(is_null($entity)){
+ return $this;
+ }
+
+ return $this->put($entity);
+ }
+
+ public function getId()
+ {
+ return $this->id;
+ }
+
+ public function setText($text)
+ {
+ $this->data['text'] = (string) $text;
+ }
+
+ public function setVoiceName($name)
+ {
+ $this->data['voice_name'] = (string) $name;
+ }
+
+ public function setLoop($times)
+ {
+ $this->data['loop'] = (int) $times;
+ }
+
+ public function put($talk = null)
+ {
+ if(!$talk){
+ $talk = $this;
+ }
+
+ $request = new Request(
+ $this->getClient()->getApiUrl() . Collection::getCollectionPath() . '/' . $this->getId() . '/talk',
+ 'PUT',
+ 'php://temp',
+ ['content-type' => 'application/json']
+ );
+
+ $request->getBody()->write(json_encode($talk));
+ $response = $this->client->send($request);
+ return $this->parseEventResponse($response);
+ }
+
+ public function delete()
+ {
+ $request = new Request(
+ $this->getClient()->getApiUrl() . Collection::getCollectionPath() . '/' . $this->getId() . '/talk',
+ 'DELETE'
+ );
+
+ $response = $this->client->send($request);
+ return $this->parseEventResponse($response);
+ }
+
+ protected function parseEventResponse(ResponseInterface $response)
+ {
+ if($response->getStatusCode() != '200'){
+ throw $this->getException($response);
+ }
+
+ $json = json_decode($response->getBody()->getContents(), true);
+
+ if(!$json){
+ throw new Exception\Exception('Unexpected Response Body Format');
+ }
+
+ return new Event($json);
+ }
+
+ protected function getException(ResponseInterface $response)
+ {
+ $body = json_decode($response->getBody()->getContents(), true);
+ $status = $response->getStatusCode();
+
+ if($status >= 400 AND $status < 500) {
+ $e = new Exception\Request($body['error_title'], $status);
+ } elseif($status >= 500 AND $status < 600) {
+ $e = new Exception\Server($body['error_title'], $status);
+ } else {
+ $e = new Exception\Exception('Unexpected HTTP Status Code');
+ throw $e;
+ }
+
+ return $e;
+ }
+
+ function jsonSerialize()
+ {
+ return $this->data;
+ }
+
+ public function offsetExists($offset)
+ {
+ return isset($this->data[$offset]);
+ }
+
+ public function offsetGet($offset)
+ {
+ return $this->data[$offset];
+ }
+
+ public function offsetSet($offset, $value)
+ {
+ if(!in_array($offset, $this->params)){
+ throw new \RuntimeException('invalid parameter: ' . $offset);
+ }
+
+ $this->data[$offset] = $value;
+ }
+
+ public function offsetUnset($offset)
+ {
+ if(!in_array($offset, $this->params)){
+ throw new \RuntimeException('invalid parameter: ' . $offset);
+ }
+
+ unset($this->data[$offset]);
+ }
+}
diff --git a/vendor/nexmo/client/src/Call/Transfer.php b/vendor/nexmo/client/src/Call/Transfer.php
new file mode 100644
index 00000000..6c748973
--- /dev/null
+++ b/vendor/nexmo/client/src/Call/Transfer.php
@@ -0,0 +1,35 @@
+urls = $urls;
+ }
+
+ function jsonSerialize()
+ {
+ return [
+ 'action' => 'transfer',
+ 'destination' => [
+ 'type' => 'ncco',
+ 'url' => $this->urls
+ ]
+ ];
+ }
+}
\ No newline at end of file
diff --git a/vendor/nexmo/client/src/Call/Unearmuff.php b/vendor/nexmo/client/src/Call/Unearmuff.php
new file mode 100644
index 00000000..5b13e3d5
--- /dev/null
+++ b/vendor/nexmo/client/src/Call/Unearmuff.php
@@ -0,0 +1,20 @@
+ 'unearmuff'
+ ];
+ }
+}
\ No newline at end of file
diff --git a/vendor/nexmo/client/src/Call/Unmute.php b/vendor/nexmo/client/src/Call/Unmute.php
new file mode 100644
index 00000000..05c0b220
--- /dev/null
+++ b/vendor/nexmo/client/src/Call/Unmute.php
@@ -0,0 +1,20 @@
+ 'unmute'
+ ];
+ }
+}
\ No newline at end of file
diff --git a/vendor/nexmo/client/src/Call/Webhook.php b/vendor/nexmo/client/src/Call/Webhook.php
new file mode 100644
index 00000000..ebb1c2d2
--- /dev/null
+++ b/vendor/nexmo/client/src/Call/Webhook.php
@@ -0,0 +1,55 @@
+urls = $urls;
+ $this->type = $type;
+ $this->method = $method;
+ }
+
+ public function getType()
+ {
+ return $this->type;
+ }
+
+ public function add($url)
+ {
+ $this->urls[] = $url;
+ }
+
+ function jsonSerialize()
+ {
+ $data = [
+ $this->type . '_url' => $this->urls
+ ];
+
+ if(isset($this->method)){
+ $data[$this->type . '_method'] = $this->method;
+ }
+
+ return $data;
+ }
+
+
+}
\ No newline at end of file
diff --git a/vendor/nexmo/client/src/Client.php b/vendor/nexmo/client/src/Client.php
new file mode 100644
index 00000000..899f6c86
--- /dev/null
+++ b/vendor/nexmo/client/src/Client.php
@@ -0,0 +1,510 @@
+setHttpClient($client);
+
+ //make sure we know how to use the credentials
+ if(!($credentials instanceof Container) && !($credentials instanceof Basic) && !($credentials instanceof SignatureSecret) && !($credentials instanceof OAuth) && !($credentials instanceof Keypair)){
+ throw new \RuntimeException('unknown credentials type: ' . get_class($credentials));
+ }
+
+ $this->credentials = $credentials;
+
+ $this->options = $options;
+
+ // If they've provided an app name, validate it
+ if (isset($options['app'])) {
+ $this->validateAppOptions($options['app']);
+ }
+
+ // Set the default URLs. Keep the constants for
+ // backwards compatibility
+ $this->apiUrl = static::BASE_API;
+ $this->restUrl = static::BASE_REST;
+
+ // If they've provided alternative URLs, use that instead
+ // of the defaults
+ if (isset($options['base_rest_url'])) {
+ $this->restUrl = $options['base_rest_url'];
+ }
+
+ if (isset($options['base_api_url'])) {
+ $this->apiUrl = $options['base_api_url'];
+ }
+
+ $this->setFactory(new MapFactory([
+ 'account' => 'Nexmo\Account\Client',
+ 'insights' => 'Nexmo\Insights\Client',
+ 'message' => 'Nexmo\Message\Client',
+ 'verify' => 'Nexmo\Verify\Client',
+ 'applications' => 'Nexmo\Application\Client',
+ 'numbers' => 'Nexmo\Numbers\Client',
+ 'calls' => 'Nexmo\Call\Collection',
+ 'conversion' => 'Nexmo\Conversion\Client',
+ 'conversation' => 'Nexmo\Conversations\Collection',
+ 'user' => 'Nexmo\User\Collection',
+ 'redact' => 'Nexmo\Redact\Client',
+ ], $this));
+ }
+
+ public function getRestUrl() {
+ return $this->restUrl;
+ }
+
+ public function getApiUrl() {
+ return $this->apiUrl;
+ }
+
+ /**
+ * Set the Http Client to used to make API requests.
+ *
+ * This allows the default http client to be swapped out for a HTTPlug compatible
+ * replacement.
+ *
+ * @param HttpClient $client
+ * @return $this
+ */
+ public function setHttpClient(HttpClient $client)
+ {
+ $this->client = $client;
+ return $this;
+ }
+
+ /**
+ * Get the Http Client used to make API requests.
+ *
+ * @return HttpClient
+ */
+ public function getHttpClient()
+ {
+ return $this->client;
+ }
+
+ /**
+ * Set the factory used to create API specific clients.
+ *
+ * @param FactoryInterface $factory
+ * @return $this
+ */
+ public function setFactory(FactoryInterface $factory)
+ {
+ $this->factory = $factory;
+ return $this;
+ }
+
+ /**
+ * @param RequestInterface $request
+ * @param Signature $signature
+ * @return RequestInterface
+ */
+ public static function signRequest(RequestInterface $request, SignatureSecret $credentials)
+ {
+ switch($request->getHeaderLine('content-type')){
+ case 'application/json':
+ $body = $request->getBody();
+ $body->rewind();
+ $content = $body->getContents();
+ $params = json_decode($content, true);
+ $params['api_key'] = $credentials['api_key'];
+ $signature = new Signature($params, $credentials['signature_secret'], $credentials['signature_method']);
+ $body->rewind();
+ $body->write(json_encode($signature->getSignedParams()));
+ break;
+ case 'application/x-www-form-urlencoded':
+ $body = $request->getBody();
+ $body->rewind();
+ $content = $body->getContents();
+ $params = [];
+ parse_str($content, $params);
+ $params['api_key'] = $credentials['api_key'];
+ $signature = new Signature($params, $credentials['signature_secret'], $credentials['signature_method']);
+ $params = $signature->getSignedParams();
+ $body->rewind();
+ $body->write(http_build_query($params, null, '&'));
+ break;
+ default:
+ $query = [];
+ parse_str($request->getUri()->getQuery(), $query);
+ $query['api_key'] = $credentials['api_key'];
+ $signature = new Signature($query, $credentials['signature_secret'], $credentials['signature_method']);
+ $request = $request->withUri($request->getUri()->withQuery(http_build_query($signature->getSignedParams())));
+ break;
+ }
+
+ return $request;
+ }
+
+ public static function authRequest(RequestInterface $request, Basic $credentials)
+ {
+ switch($request->getHeaderLine('content-type')) {
+ case 'application/json':
+ if (static::requiresBasicAuth($request)) {
+ $c = $credentials->asArray();
+ $request = $request->withHeader('Authorization', 'Basic ' . base64_encode($c['api_key'] . ':' . $c['api_secret']));
+ } else if (static::requiresAuthInUrlNotBody($request)) {
+ $query = [];
+ parse_str($request->getUri()->getQuery(), $query);
+ $query = array_merge($query, $credentials->asArray());
+ $request = $request->withUri($request->getUri()->withQuery(http_build_query($query)));
+ } else {
+ $body = $request->getBody();
+ $body->rewind();
+ $content = $body->getContents();
+ $params = json_decode($content, true);
+ $params = array_merge($params, $credentials->asArray());
+ $body->rewind();
+ $body->write(json_encode($params));
+ }
+ break;
+ case 'application/x-www-form-urlencoded':
+ $body = $request->getBody();
+ $body->rewind();
+ $content = $body->getContents();
+ $params = [];
+ parse_str($content, $params);
+ $params = array_merge($params, $credentials->asArray());
+ $body->rewind();
+ $body->write(http_build_query($params, null, '&'));
+ break;
+ default:
+ $query = [];
+ parse_str($request->getUri()->getQuery(), $query);
+ $query = array_merge($query, $credentials->asArray());
+ $request = $request->withUri($request->getUri()->withQuery(http_build_query($query)));
+ break;
+ }
+
+ return $request;
+ }
+
+ /**
+ * @param array $claims
+ * @return \Lcobucci\JWT\Token
+ */
+ public function generateJwt($claims = [])
+ {
+ if (method_exists($this->credentials, "generateJwt")) {
+ return $this->credentials->generateJwt($claims);
+ }
+ throw new Exception(get_class($this->credentials).' does not support JWT generation');
+ }
+
+ /**
+ * Takes a URL and a key=>value array to generate a GET PSR-7 request object
+ *
+ * @param string $url The URL to make a request to
+ * @param array $params Key=>Value array of data to use as the query string
+ * @return \Psr\Http\Message\ResponseInterface
+ */
+ public function get($url, array $params = [])
+ {
+ $queryString = '?' . http_build_query($params);
+
+ $url = $url . $queryString;
+
+ $request = new Request(
+ $url,
+ 'GET'
+ );
+
+ return $this->send($request);
+ }
+
+ /**
+ * Takes a URL and a key=>value array to generate a POST PSR-7 request object
+ *
+ * @param string $url The URL to make a request to
+ * @param array $params Key=>Value array of data to send
+ * @return \Psr\Http\Message\ResponseInterface
+ */
+ public function post($url, array $params)
+ {
+ $request = new Request(
+ $url,
+ 'POST',
+ 'php://temp',
+ ['content-type' => 'application/json']
+ );
+
+ $request->getBody()->write(json_encode($params));
+ return $this->send($request);
+ }
+
+ /**
+ * Takes a URL and a key=>value array to generate a POST PSR-7 request object
+ *
+ * @param string $url The URL to make a request to
+ * @param array $params Key=>Value array of data to send
+ * @return \Psr\Http\Message\ResponseInterface
+ */
+ public function postUrlEncoded($url, array $params)
+ {
+ $request = new Request(
+ $url,
+ 'POST',
+ 'php://temp',
+ ['content-type' => 'application/x-www-form-urlencoded']
+ );
+
+ $request->getBody()->write(http_build_query($params));
+ return $this->send($request);
+ }
+
+ /**
+ * Takes a URL and a key=>value array to generate a PUT PSR-7 request object
+ *
+ * @param string $url The URL to make a request to
+ * @param array $params Key=>Value array of data to send
+ * @return \Psr\Http\Message\ResponseInterface
+ */
+ public function put($url, array $params)
+ {
+ $request = new Request(
+ $url,
+ 'PUT',
+ 'php://temp',
+ ['content-type' => 'application/json']
+ );
+
+ $request->getBody()->write(json_encode($params));
+ return $this->send($request);
+ }
+
+ /**
+ * Takes a URL and a key=>value array to generate a DELETE PSR-7 request object
+ *
+ * @param string $url The URL to make a request to
+ * @return \Psr\Http\Message\ResponseInterface
+ */
+ public function delete($url)
+ {
+ $request = new Request(
+ $url,
+ 'DELETE'
+ );
+
+ return $this->send($request);
+ }
+
+ /**
+ * Wraps the HTTP Client, creates a new PSR-7 request adding authentication, signatures, etc.
+ *
+ * @param \Psr\Http\Message\RequestInterface $request
+ * @return \Psr\Http\Message\ResponseInterface
+ */
+ public function send(\Psr\Http\Message\RequestInterface $request)
+ {
+ if($this->credentials instanceof Container) {
+ if ($this->needsKeypairAuthentication($request)) {
+ $request = $request->withHeader('Authorization', 'Bearer ' . $this->credentials->get(Keypair::class)->generateJwt());
+ } else {
+ $request = self::authRequest($request, $this->credentials->get(Basic::class));
+ }
+ } elseif($this->credentials instanceof Keypair){
+ $request = $request->withHeader('Authorization', 'Bearer ' . $this->credentials->generateJwt());
+ } elseif($this->credentials instanceof SignatureSecret){
+ $request = self::signRequest($request, $this->credentials);
+ } elseif($this->credentials instanceof Basic){
+ $request = self::authRequest($request, $this->credentials);
+ }
+
+ //todo: add oauth support
+
+ //allow any part of the URI to be replaced with a simple search
+ if(isset($this->options['url'])){
+ foreach($this->options['url'] as $search => $replace){
+ $uri = (string) $request->getUri();
+
+ $new = str_replace($search, $replace, $uri);
+ if($uri !== $new){
+ $request = $request->withUri(new Uri($new));
+ }
+ }
+ }
+
+ // The user agent must be in the following format:
+ // LIBRARY-NAME/LIBRARY-VERSION LANGUAGE-NAME/LANGUAGE-VERSION [APP-NAME/APP-VERSION]
+ // See https://github.com/Nexmo/client-library-specification/blob/master/SPECIFICATION.md#reporting
+ $userAgent = [];
+
+ // Library name
+ $userAgent[] = 'nexmo-php/'.self::VERSION;
+
+ // Language name
+ $userAgent[] = 'php/'.PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;
+
+ // If we have an app set, add that to the UA
+ if (isset($this->options['app'])) {
+ $app = $this->options['app'];
+ $userAgent[] = $app['name'].'/'.$app['version'];
+ }
+
+ // Set the header. Build by joining all the parts we have with a space
+ $request = $request->withHeader('User-Agent', implode(" ", $userAgent));
+
+ $response = $this->client->sendRequest($request);
+ return $response;
+ }
+
+ protected function validateAppOptions($app) {
+ $disallowedCharacters = ['/', ' ', "\t", "\n"];
+ foreach (['name', 'version'] as $key) {
+ if (!isset($app[$key])) {
+ throw new \InvalidArgumentException('app.'.$key.' has not been set');
+ }
+
+ foreach ($disallowedCharacters as $char) {
+ if (strpos($app[$key], $char) !== false) {
+ throw new \InvalidArgumentException('app.'.$key.' cannot contain the '.$char.' character');
+ }
+ }
+ }
+ }
+
+ public function serialize(EntityInterface $entity)
+ {
+ if($entity instanceof Verification){
+ return $this->verify()->serialize($entity);
+ }
+
+ throw new \RuntimeException('unknown class `' . get_class($entity) . '``');
+ }
+
+ public function unserialize($entity)
+ {
+ if(is_string($entity)){
+ $entity = unserialize($entity);
+ }
+
+ if($entity instanceof Verification){
+ return $this->verify()->unserialize($entity);
+ }
+
+ throw new \RuntimeException('unknown class `' . get_class($entity) . '``');
+ }
+
+ public function __call($name, $args)
+ {
+ if(!$this->factory->hasApi($name)){
+ throw new \RuntimeException('no api namespace found: ' . $name);
+ }
+
+ $collection = $this->factory->getApi($name);
+
+ if(empty($args)){
+ return $collection;
+ }
+
+ return call_user_func_array($collection, $args);
+ }
+
+ public function __get($name)
+ {
+ if(!$this->factory->hasApi($name)){
+ throw new \RuntimeException('no api namespace found: ' . $name);
+ }
+
+ return $this->factory->getApi($name);
+ }
+
+ protected static function requiresBasicAuth(\Psr\Http\Message\RequestInterface $request)
+ {
+ $path = $request->getUri()->getPath();
+ $isSecretManagementEndpoint = strpos($path, '/accounts') === 0 && strpos($path, '/secrets') !== false;
+
+ return $isSecretManagementEndpoint;
+ }
+
+ protected static function requiresAuthInUrlNotBody(\Psr\Http\Message\RequestInterface $request)
+ {
+ $path = $request->getUri()->getPath();
+ $isRedactEndpoint = strpos($path, '/v1/redact') === 0;
+
+ return $isRedactEndpoint;
+ }
+
+ protected function needsKeypairAuthentication(\Psr\Http\Message\RequestInterface $request)
+ {
+ $path = $request->getUri()->getPath();
+ $isCallEndpoint = strpos($path, '/v1/calls') === 0;
+ $isRecordingUrl = strpos($path, '/v1/files') === 0;
+ $isStitchEndpoint = strpos($path, '/beta/conversation') === 0;
+ $isUserEndpoint = strpos($path, '/beta/users') === 0;
+
+ return $isCallEndpoint || $isRecordingUrl || $isStitchEndpoint || $isUserEndpoint;
+ }
+}
diff --git a/vendor/nexmo/client/src/Client/Callback/Callback.php b/vendor/nexmo/client/src/Client/Callback/Callback.php
new file mode 100644
index 00000000..d1b2175e
--- /dev/null
+++ b/vendor/nexmo/client/src/Client/Callback/Callback.php
@@ -0,0 +1,57 @@
+expected, $keys);
+
+ if($missing){
+ throw new \RuntimeException('missing expected callback keys: ' . implode(', ', $missing));
+ }
+
+ $this->data = $data;
+ }
+
+ public function getData()
+ {
+ return $this->data;
+ }
+
+ public static function fromEnv($source = self::ENV_ALL)
+ {
+ switch(strtolower($source)){
+ case 'post':
+ $data = $_POST;
+ break;
+ case 'get':
+ $data = $_GET;
+ break;
+ case 'all':
+ $data = array_merge($_GET, $_POST);
+ break;
+ default:
+ throw new \InvalidArgumentException('invalid source: ' . $source);
+ }
+
+ return new static($data);
+ }
+}
\ No newline at end of file
diff --git a/vendor/nexmo/client/src/Client/Callback/CallbackInterface.php b/vendor/nexmo/client/src/Client/Callback/CallbackInterface.php
new file mode 100644
index 00000000..3ed342cd
--- /dev/null
+++ b/vendor/nexmo/client/src/Client/Callback/CallbackInterface.php
@@ -0,0 +1,14 @@
+client = $client;
+ }
+
+ protected function getClient()
+ {
+ if(isset($this->client)){
+ return $this->client;
+ }
+
+ throw new \RuntimeException('Nexmo\Client not set');
+ }
+}
\ No newline at end of file
diff --git a/vendor/nexmo/client/src/Client/Credentials/AbstractCredentials.php b/vendor/nexmo/client/src/Client/Credentials/AbstractCredentials.php
new file mode 100644
index 00000000..c4ae08ce
--- /dev/null
+++ b/vendor/nexmo/client/src/Client/Credentials/AbstractCredentials.php
@@ -0,0 +1,53 @@
+credentials[$offset]);
+ }
+
+ public function offsetGet($offset)
+ {
+ return $this->credentials[$offset];
+ }
+
+ public function offsetSet($offset, $value)
+ {
+ throw $this->readOnlyException();
+ }
+
+ public function offsetUnset($offset)
+ {
+ throw $this->readOnlyException();
+ }
+
+ public function __get($name)
+ {
+ return $this->credentials[$name];
+ }
+
+ public function asArray()
+ {
+ return $this->credentials;
+ }
+
+ protected function readOnlyException()
+ {
+ return new \RuntimeException(sprintf(
+ '%s is read only, cannot modify using array access.',
+ get_class($this)
+ ));
+ }
+
+}
\ No newline at end of file
diff --git a/vendor/nexmo/client/src/Client/Credentials/Basic.php b/vendor/nexmo/client/src/Client/Credentials/Basic.php
new file mode 100644
index 00000000..f5991c4c
--- /dev/null
+++ b/vendor/nexmo/client/src/Client/Credentials/Basic.php
@@ -0,0 +1,28 @@
+credentials['api_key'] = $key;
+ $this->credentials['api_secret'] = $secret;
+ }
+}
\ No newline at end of file
diff --git a/vendor/nexmo/client/src/Client/Credentials/Container.php b/vendor/nexmo/client/src/Client/Credentials/Container.php
new file mode 100644
index 00000000..62d739b7
--- /dev/null
+++ b/vendor/nexmo/client/src/Client/Credentials/Container.php
@@ -0,0 +1,69 @@
+addCredential($credential);
+ }
+ }
+
+ protected function addCredential(CredentialsInterface $credential)
+ {
+ $type = $this->getType($credential);
+ if(isset($this->credentials[$type])){
+ throw new \RuntimeException('can not use more than one of a single credential type');
+ }
+
+ $this->credentials[$type] = $credential;
+ }
+
+ protected function getType(CredentialsInterface $credential)
+ {
+ foreach ($this->types as $type) {
+ if($credential instanceof $type){
+ return $type;
+ }
+ }
+ }
+
+ public function get($type)
+ {
+ if(!isset($this->credentials[$type])){
+ throw new \RuntimeException('credental not set');
+ }
+
+ return $this->credentials[$type];
+ }
+
+ public function has($type)
+ {
+ return isset($this->credentials[$type]);
+ }
+
+ public function generateJwt($claims) {
+ return $this->credentials[Keypair::class]->generateJwt($claims);
+ }
+
+}
\ No newline at end of file
diff --git a/vendor/nexmo/client/src/Client/Credentials/CredentialsInterface.php b/vendor/nexmo/client/src/Client/Credentials/CredentialsInterface.php
new file mode 100644
index 00000000..7b92501a
--- /dev/null
+++ b/vendor/nexmo/client/src/Client/Credentials/CredentialsInterface.php
@@ -0,0 +1,14 @@
+credentials['key'] = $privateKey;
+ if($application){
+ if($application instanceof Application){
+ $application = $application->getId();
+ }
+
+ $this->credentials['application'] = $application;
+ }
+
+ $this->key = new Key($privateKey);
+ $this->signer = new Sha256();
+ }
+
+ public function generateJwt(array $claims = [])
+ {
+ $exp = time() + 60;
+ $iat = time();
+ $jti = base64_encode(mt_rand());
+
+ if(isset($claims['exp'])){
+ $exp = $claims['exp'];
+ unset($claims['exp']);
+ }
+
+ if(isset($claims['iat'])){
+ $iat = $claims['iat'];
+ unset($claims['iat']);
+ }
+
+ if(isset($claims['jti'])){
+ $jti = $claims['jti'];
+ unset($claims['jti']);
+ }
+
+ $builder = new Builder();
+ $builder->setIssuedAt($iat)
+ ->setExpiration($exp)
+ ->setId($jti);
+
+
+ if(isset($claims['nbf'])){
+ $builder->setNotBefore($claims['nbf']);
+ unset($claims['nbf']);
+ }
+
+ if(isset($this->credentials['application'])){
+ $builder->set('application_id', $this->credentials['application']);
+ }
+
+ if(!empty($claims)){
+ foreach($claims as $claim => $value){
+ $builder->set($claim, $value);
+ }
+ }
+
+ return $builder->sign($this->signer, $this->key)->getToken();
+ }
+}
\ No newline at end of file
diff --git a/vendor/nexmo/client/src/Client/Credentials/OAuth.php b/vendor/nexmo/client/src/Client/Credentials/OAuth.php
new file mode 100644
index 00000000..b5c83924
--- /dev/null
+++ b/vendor/nexmo/client/src/Client/Credentials/OAuth.php
@@ -0,0 +1,26 @@
+credentials = array_combine(array('consumer_key', 'consumer_secret', 'token', 'token_secret'), func_get_args());
+ }
+}
\ No newline at end of file
diff --git a/vendor/nexmo/client/src/Client/Credentials/SignatureSecret.php b/vendor/nexmo/client/src/Client/Credentials/SignatureSecret.php
new file mode 100644
index 00000000..f9f23277
--- /dev/null
+++ b/vendor/nexmo/client/src/Client/Credentials/SignatureSecret.php
@@ -0,0 +1,25 @@
+credentials['api_key'] = $key;
+ $this->credentials['signature_secret'] = $signature_secret;
+ $this->credentials['signature_method'] = $method;
+ }
+}
diff --git a/vendor/nexmo/client/src/Client/Exception/Exception.php b/vendor/nexmo/client/src/Client/Exception/Exception.php
new file mode 100644
index 00000000..1089f296
--- /dev/null
+++ b/vendor/nexmo/client/src/Client/Exception/Exception.php
@@ -0,0 +1,14 @@
+errors = $errors;
+ parent::__construct($message, $code, $previous);
+ }
+
+ public function getValidationErrors() {
+ return $this->errors;
+ }
+}
\ No newline at end of file
diff --git a/vendor/nexmo/client/src/Client/Factory/FactoryInterface.php b/vendor/nexmo/client/src/Client/Factory/FactoryInterface.php
new file mode 100644
index 00000000..55e27e29
--- /dev/null
+++ b/vendor/nexmo/client/src/Client/Factory/FactoryInterface.php
@@ -0,0 +1,30 @@
+map = $map;
+ $this->client = $client;
+ }
+
+ public function hasApi($api)
+ {
+ return isset($this->map[$api]);
+ }
+
+ public function getApi($api)
+ {
+ if(isset($this->cache[$api])){
+ return $this->cache[$api];
+ }
+
+ if(!$this->hasApi($api)){
+ throw new \RuntimeException(sprintf(
+ 'no map defined for `%s`',
+ $api
+ ));
+ }
+
+ $class = $this->map[$api];
+
+ $instance = new $class();
+ if($instance instanceof Client\ClientAwareInterface){
+ $instance->setClient($this->client);
+ }
+ $this->cache[$api] = $instance;
+ return $instance;
+ }
+}
\ No newline at end of file
diff --git a/vendor/nexmo/client/src/Client/Request/AbstractRequest.php b/vendor/nexmo/client/src/Client/Request/AbstractRequest.php
new file mode 100644
index 00000000..f1b9f15a
--- /dev/null
+++ b/vendor/nexmo/client/src/Client/Request/AbstractRequest.php
@@ -0,0 +1,22 @@
+params, 'is_scalar');
+ }
+}
\ No newline at end of file
diff --git a/vendor/nexmo/client/src/Client/Request/RequestInterface.php b/vendor/nexmo/client/src/Client/Request/RequestInterface.php
new file mode 100644
index 00000000..2aa435bc
--- /dev/null
+++ b/vendor/nexmo/client/src/Client/Request/RequestInterface.php
@@ -0,0 +1,21 @@
+data;
+ }
+
+ public function isSuccess()
+ {
+ return isset($this->data['status']) AND $this->data['status'] == 0;
+ }
+
+ public function isError()
+ {
+ return !$this->isSuccess();
+ }
+}
\ No newline at end of file
diff --git a/vendor/nexmo/client/src/Client/Response/Error.php b/vendor/nexmo/client/src/Client/Response/Error.php
new file mode 100644
index 00000000..9a384048
--- /dev/null
+++ b/vendor/nexmo/client/src/Client/Response/Error.php
@@ -0,0 +1,45 @@
+expected = ['status', 'error-text'];
+
+ return parent::__construct($data);
+ }
+
+ public function isError()
+ {
+ return true;
+ }
+
+ public function isSuccess()
+ {
+ return false;
+ }
+
+ public function getCode()
+ {
+ return $this->data['status'];
+ }
+
+ public function getMessage()
+ {
+ return $this->data['error-text'];
+ }
+}
\ No newline at end of file
diff --git a/vendor/nexmo/client/src/Client/Response/Response.php b/vendor/nexmo/client/src/Client/Response/Response.php
new file mode 100644
index 00000000..2207c4c9
--- /dev/null
+++ b/vendor/nexmo/client/src/Client/Response/Response.php
@@ -0,0 +1,30 @@
+expected, $keys);
+
+ if($missing){
+ throw new \RuntimeException('missing expected response keys: ' . implode(', ', $missing));
+ }
+
+ $this->data = $data;
+ }
+}
\ No newline at end of file
diff --git a/vendor/nexmo/client/src/Client/Response/ResponseInterface.php b/vendor/nexmo/client/src/Client/Response/ResponseInterface.php
new file mode 100644
index 00000000..fa18f5ce
--- /dev/null
+++ b/vendor/nexmo/client/src/Client/Response/ResponseInterface.php
@@ -0,0 +1,17 @@
+params = $params;
+ $this->signed = $params;
+
+ if(!isset($this->signed['timestamp'])){
+ $this->signed['timestamp'] = time();
+ }
+
+ //remove signature if present
+ unset($this->signed['sig']);
+
+ //sort params
+ ksort($this->signed);
+
+ $signed = [];
+ foreach ($this->signed as $key => $value) {
+ $signed[$key] = str_replace(array("&", "="), "_", $value);
+ }
+
+ //create base string
+ $base = '&'.urldecode(http_build_query($signed));
+
+ $this->signed['sig'] = $this->sign($signatureMethod, $base, $secret);
+ }
+
+ protected function sign($signatureMethod, $data, $secret) {
+ switch($signatureMethod) {
+ case 'md5hash':
+ // md5hash needs the secret appended
+ $data .= $secret;
+ return md5($data);
+ break;
+ case 'md5':
+ case 'sha1':
+ case 'sha256':
+ case 'sha512':
+ return hash_hmac($signatureMethod, $data, $secret);
+ break;
+ default:
+ throw new Exception('Unknown signature algorithm: '.$signatureMethod.'. Expected: md5hash, md5, sha1, sha256, or sha512');
+ }
+ }
+
+ /**
+ * Get the original parameters.
+ *
+ * @return array
+ */
+ public function getParams()
+ {
+ return $this->params;
+ }
+
+ /**
+ * Get the signature for the parameters.
+ *
+ * @return string
+ */
+ public function getSignature()
+ {
+ return $this->signed['sig'];
+ }
+
+ /**
+ * Get a full set of parameters including the signature and timestamp.
+ *
+ * @return array
+ */
+ public function getSignedParams()
+ {
+ return $this->signed;
+ }
+
+ /**
+ * Check that a signature (or set of parameters) is valid.
+ *
+ * @param array| string $signature
+ * @return bool
+ * @throws \InvalidArgumentException
+ */
+ public function check($signature)
+ {
+ if(is_array($signature) AND isset($signature['sig'])){
+ $signature = $signature['sig'];
+ }
+
+ if(!is_string($signature)){
+ throw new \InvalidArgumentException('signature must be string, or present in array or parameters');
+ }
+
+ return $signature == $this->signed['sig'];
+ }
+
+ /**
+ * Allow easy comparison.
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return $this->getSignature();
+ }
+}
diff --git a/vendor/nexmo/client/src/Conversations/Collection.php b/vendor/nexmo/client/src/Conversations/Collection.php
new file mode 100644
index 00000000..3ab3615b
--- /dev/null
+++ b/vendor/nexmo/client/src/Conversations/Collection.php
@@ -0,0 +1,178 @@
+setClient($this->getClient());
+ $idOrConversation->jsonUnserialize($data);
+
+ return $idOrConversation;
+ }
+
+ public function hydrateAll($conversations)
+ {
+ $hydrated = [];
+ foreach ($conversations as $conversation) {
+ $hydrated[] = $this->hydrateEntity($conversation, $conversation['id']);
+ }
+
+ return $hydrated;
+ }
+
+ /**
+ * @param null $conversation
+ * @return $this|Conversation
+ */
+ public function __invoke(Filter $filter = null)
+ {
+ if(!is_null($filter)){
+ $this->setFilter($filter);
+ }
+
+ return $this;
+ }
+
+ public function create($conversation)
+ {
+ return $this->post($conversation);
+ }
+
+ public function post($conversation)
+ {
+ if($conversation instanceof Conversation){
+ $body = $conversation->getRequestData();
+ } else {
+ $body = $conversation;
+ }
+
+ $request = new Request(
+ $this->getClient()->getApiUrl() . $this->getCollectionPath()
+ ,'POST',
+ 'php://temp',
+ ['content-type' => 'application/json']
+ );
+
+ $request->getBody()->write(json_encode($body));
+ $response = $this->getClient()->send($request);
+
+ if($response->getStatusCode() != '200'){
+ throw $this->getException($response);
+ }
+
+ $body = json_decode($response->getBody()->getContents(), true);
+ $conversation = new Conversation($body['id']);
+ $conversation->jsonUnserialize($body);
+ $conversation->setClient($this->getClient());
+
+ return $conversation;
+ }
+
+ public function get($conversation)
+ {
+ if(!($conversation instanceof Conversation)){
+ $conversation = new Conversation($conversation);
+ }
+
+ $conversation->setClient($this->getClient());
+ $conversation->get();
+
+ return $conversation;
+ }
+
+ protected function getException(ResponseInterface $response)
+ {
+ $body = json_decode($response->getBody()->getContents(), true);
+ $status = $response->getStatusCode();
+
+ // This message isn't very useful, but we shouldn't ever see it
+ $errorTitle = 'Unexpected error';
+
+ if (isset($body['description'])) {
+ $errorTitle = $body['description'];
+ }
+
+ if (isset($body['error_title'])) {
+ $errorTitle = $body['error_title'];
+ }
+
+ if($status >= 400 AND $status < 500) {
+ $e = new Exception\Request($errorTitle, $status);
+ } elseif($status >= 500 AND $status < 600) {
+ $e = new Exception\Server($errorTitle, $status);
+ } else {
+ $e = new Exception\Exception('Unexpected HTTP Status Code');
+ throw $e;
+ }
+
+ return $e;
+ }
+
+ public function offsetExists($offset)
+ {
+ return true;
+ }
+
+ /**
+ * @param mixed $conversation
+ * @return Conversation
+ */
+ public function offsetGet($conversation)
+ {
+ if(!($conversation instanceof Conversation)){
+ $conversation = new Conversation($conversation);
+ }
+
+ $conversation->setClient($this->getClient());
+ return $conversation;
+ }
+
+ public function offsetSet($offset, $value)
+ {
+ throw new \RuntimeException('can not set collection properties');
+ }
+
+ public function offsetUnset($offset)
+ {
+ throw new \RuntimeException('can not unset collection properties');
+ }
+}
diff --git a/vendor/nexmo/client/src/Conversations/Conversation.php b/vendor/nexmo/client/src/Conversations/Conversation.php
new file mode 100644
index 00000000..70d59b50
--- /dev/null
+++ b/vendor/nexmo/client/src/Conversations/Conversation.php
@@ -0,0 +1,182 @@
+data['id'] = $id;
+ }
+
+ public function setName($name)
+ {
+ $this->data['name'] = $name;
+ return $this;
+ }
+
+ public function setDisplayName($name)
+ {
+ $this->data['display_name'] = $name;
+ return $this;
+ }
+
+ public function getId()
+ {
+ if (isset($this->data['uuid'])) {
+ return $this->data['uuid'];
+ }
+ return $this->data['id'];
+ }
+
+ public function __toString()
+ {
+ return (string)$this->getId();
+ }
+
+
+ public function get()
+ {
+ $request = new Request(
+ $this->getClient()->getApiUrl() . Collection::getCollectionPath() . '/' . $this->getId()
+ ,'GET'
+ );
+
+ $response = $this->getClient()->send($request);
+
+ if($response->getStatusCode() != '200'){
+ throw $this->getException($response);
+ }
+
+ $data = json_decode($response->getBody()->getContents(), true);
+ $this->jsonUnserialize($data);
+
+ return $this;
+ }
+
+
+ public function jsonSerialize()
+ {
+ return $this->data;
+ }
+
+ public function jsonUnserialize(array $json)
+ {
+ $this->data = $json;
+ }
+
+ public function members()
+ {
+ $response = $this->getClient()->get($this->getClient()->getApiUrl() . Collection::getCollectionPath() . '/' . $this->getId() .'/members');
+
+ if($response->getStatusCode() != '200'){
+ throw $this->getException($response);
+ }
+
+ $data = json_decode($response->getBody()->getContents(), true);
+ $memberCollection = new UserCollection();
+ return $memberCollection->hydrateAll($data);
+ }
+
+ public function addMember(User $user)
+ {
+ return $this->sendPostAction($user, 'join');
+ }
+
+ public function inviteMember(User $user)
+ {
+ return $this->sendPostAction($user, 'invite');
+ }
+
+ public function removeMember(User $user)
+ {
+ $response = $this->getClient()->delete(
+ $this->getClient()->getApiUrl() . Collection::getCollectionPath() . '/' . $this->getId() .'/members/'. $user->getId()
+ );
+
+ if($response->getStatusCode() != '200'){
+ throw $this->getException($response);
+ }
+ }
+
+ public function sendPostAction(User $user, $action, $channel = 'app') {
+ $body = $user->getRequestDataForConversation();
+ $body['action'] = $action;
+ $body['channel'] = ['type' => $channel];
+
+ $response = $this->getClient()->post(
+ $this->getClient()->getApiUrl() . Collection::getCollectionPath() . '/' . $this->getId() .'/members',
+ $body
+ );
+
+ if($response->getStatusCode() != '200'){
+ throw $this->getException($response);
+ }
+
+ $body = json_decode($response->getBody()->getContents(), true);
+
+ $user = new User($body['user_id']);
+ $user->jsonUnserialize($body);
+ $user->setClient($this->getClient());
+
+ return $user;
+ }
+
+ protected function getException(ResponseInterface $response)
+ {
+ $body = json_decode($response->getBody()->getContents(), true);
+ $status = $response->getStatusCode();
+
+ // This message isn't very useful, but we shouldn't ever see it
+ $errorTitle = 'Unexpected error';
+
+ if (isset($body['description'])) {
+ $errorTitle = $body['description'];
+ }
+
+ if (isset($body['error_title'])) {
+ $errorTitle = $body['error_title'];
+ }
+
+ if($status >= 400 AND $status < 500) {
+ $e = new Exception\Request($errorTitle, $status);
+ } elseif($status >= 500 AND $status < 600) {
+ $e = new Exception\Server($errorTitle, $status);
+ } else {
+ $e = new Exception\Exception('Unexpected HTTP Status Code');
+ throw $e;
+ }
+
+ return $e;
+ }
+
+
+}
diff --git a/vendor/nexmo/client/src/Conversion/Client.php b/vendor/nexmo/client/src/Conversion/Client.php
new file mode 100644
index 00000000..691401fb
--- /dev/null
+++ b/vendor/nexmo/client/src/Conversion/Client.php
@@ -0,0 +1,63 @@
+sendConversion('sms', $message_id, $delivered, $timestamp);
+ }
+
+ public function voice($message_id, $delivered, $timestamp=null)
+ {
+ return $this->sendConversion('voice', $message_id, $delivered, $timestamp);
+ }
+
+ protected function sendConversion($type, $message_id, $delivered, $timestamp=null)
+ {
+ $params = [
+ 'message-id' => $message_id,
+ 'delivered' => $delivered
+ ];
+
+ if ($timestamp) {
+ $params['timestamp'] = $timestamp;
+ }
+
+ $response = $this->client->postUrlEncoded(
+ $this->getClient()->getApiUrl() . '/conversions/'.$type.'?'.http_build_query($params),
+ []
+ );
+
+ if($response->getStatusCode() != '200'){
+ throw $this->getException($response);
+ }
+ }
+
+ protected function getException(ResponseInterface $response)
+ {
+ $body = json_decode($response->getBody()->getContents(), true);
+ $status = $response->getStatusCode();
+
+ if($status === 402) {
+ $e = new Exception\Request("This endpoint may need activating on your account. Please email support@nexmo.com for more information", $status);
+ } elseif($status >= 400 AND $status < 500) {
+ $e = new Exception\Request($body['error_title'], $status);
+ } elseif($status >= 500 AND $status < 600) {
+ $e = new Exception\Server($body['error_title'], $status);
+ } else {
+ $e = new Exception\Exception('Unexpected HTTP Status Code');
+ }
+
+ return $e;
+ }
+
+}
diff --git a/vendor/nexmo/client/src/Entity/ArrayAccessTrait.php b/vendor/nexmo/client/src/Entity/ArrayAccessTrait.php
new file mode 100644
index 00000000..d8025dad
--- /dev/null
+++ b/vendor/nexmo/client/src/Entity/ArrayAccessTrait.php
@@ -0,0 +1,16 @@
+collection = $collection;
+ }
+
+ public function getCollection()
+ {
+ if(!isset($this->collection)){
+ throw new \RuntimeException('missing collection');
+ }
+
+ return $this->collection;
+ }
+}
\ No newline at end of file
diff --git a/vendor/nexmo/client/src/Entity/CollectionInterface.php b/vendor/nexmo/client/src/Entity/CollectionInterface.php
new file mode 100644
index 00000000..111b71d5
--- /dev/null
+++ b/vendor/nexmo/client/src/Entity/CollectionInterface.php
@@ -0,0 +1,30 @@
+hydrateEntity($this->page['_embedded'][$this->getCollectionName()][$this->current], $this->key());
+ }
+
+ /**
+ * No checks here, just advance the index.
+ */
+ public function next()
+ {
+ $this->current++;
+ }
+
+ /**
+ * Return the ID of the resource, in some cases this is `id`, in others `uuid`.
+ * @return string
+ */
+ public function key()
+ {
+ if(isset($this->page['_embedded'][$this->getCollectionName()][$this->current]['id'])){
+ return $this->page['_embedded'][$this->getCollectionName()][$this->current]['id'];
+ } elseif(isset($this->page['_embedded'][$this->getCollectionName()][$this->current]['uuid'])) {
+ return $this->page['_embedded'][$this->getCollectionName()][$this->current]['uuid'];
+ }
+
+ return $this->current;
+ }
+
+ /**
+ * Handle pagination automatically (unless configured not to).
+ * @return bool
+ */
+ public function valid()
+ {
+ //can't be valid if there's not a page (rewind sets this)
+ if(!isset($this->page)){
+ return false;
+ }
+
+ //all hal collections have an `_embedded` object, we expect there to be a property matching the collection name
+ if(!isset($this->page['_embedded']) OR !isset($this->page['_embedded'][$this->getCollectionName()])){
+ return false;
+ }
+
+ //if we have a page with no items, we've gone beyond the end of the collection
+ if(!count($this->page['_embedded'][$this->getCollectionName()])){
+ return false;
+ }
+
+ //index the start of a page at 0
+ if(is_null($this->current)){
+ $this->current = 0;
+ }
+
+ //if our current index is past the current page, fetch the next page if possible and reset the index
+ if(!isset($this->page['_embedded'][$this->getCollectionName()][$this->current])){
+ if(isset($this->page['_links']) AND isset($this->page['_links']['next'])){
+ $this->fetchPage($this->page['_links']['next']['href']);
+ $this->current = 0;
+
+ return true;
+ }
+
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Fetch the initial page
+ */
+ public function rewind()
+ {
+ $this->fetchPage($this->getCollectionPath());
+ }
+
+ /**
+ * Count of total items
+ * @return integer
+ */
+ public function count()
+ {
+ if(isset($this->page)){
+ return (int) $this->page['count'];
+ }
+ }
+
+ public function setPage($index)
+ {
+ $this->index = (int) $index;
+ return $this;
+ }
+
+ public function getPage()
+ {
+ if(isset($this->page)){
+ return $this->page['page_index'];
+ }
+
+ if(isset($this->index)){
+ return $this->index;
+ }
+
+ throw new \RuntimeException('page not set');
+ }
+
+ public function getSize()
+ {
+ if(isset($this->page)){
+ return $this->page['page_size'];
+ }
+
+ if(isset($this->size)){
+ return $this->size;
+ }
+
+ throw new \RuntimeException('size not set');
+ }
+
+ public function setSize($size)
+ {
+ $this->size = (int) $size;
+ return $this;
+ }
+
+ /**
+ * Filters reduce to query params and include paging settings.
+ *
+ * @param FilterInterface $filter
+ * @return $this
+ */
+ public function setFilter(FilterInterface $filter)
+ {
+ $this->filter = $filter;
+ return $this;
+ }
+
+ public function getFilter()
+ {
+ if(!isset($this->filter)){
+ $this->setFilter(new EmptyFilter());
+ }
+
+ return $this->filter;
+ }
+
+ /**
+ * Fetch a page using the current filter if no query is provided.
+ *
+ * @param $absoluteUri
+ */
+ protected function fetchPage($absoluteUri)
+ {
+ //use filter if no query provided
+ if(false === strpos($absoluteUri, '?')){
+ $query = [];
+
+ if(isset($this->size)){
+ $query['page_size'] = $this->size;
+ }
+
+ if(isset($this->index)){
+ $query['page_index'] = $this->index;
+ }
+
+ if(isset($this->filter)){
+ $query = array_merge($this->filter->getQuery(), $query);
+ }
+
+ $absoluteUri .= '?' . http_build_query($query);
+ }
+
+ //
+ $request = new Request(
+ $this->getClient()->getApiUrl() . $absoluteUri,
+ 'GET'
+ );
+
+ $response = $this->client->send($request);
+
+ if($response->getStatusCode() != '200'){
+ throw $this->getException($response);
+ }
+
+ $this->response = $response;
+ $this->page = json_decode($this->response->getBody()->getContents(), true);
+ }
+}
diff --git a/vendor/nexmo/client/src/Entity/EmptyFilter.php b/vendor/nexmo/client/src/Entity/EmptyFilter.php
new file mode 100644
index 00000000..f66b891a
--- /dev/null
+++ b/vendor/nexmo/client/src/Entity/EmptyFilter.php
@@ -0,0 +1,18 @@
+entity = $entity;
+ }
+
+ public function getEntity()
+ {
+ return $this->entity;
+ }
+}
\ No newline at end of file
diff --git a/vendor/nexmo/client/src/Entity/JsonResponseTrait.php b/vendor/nexmo/client/src/Entity/JsonResponseTrait.php
new file mode 100644
index 00000000..eca56f13
--- /dev/null
+++ b/vendor/nexmo/client/src/Entity/JsonResponseTrait.php
@@ -0,0 +1,39 @@
+getResponse()) && ($response instanceof ResponseInterface)){
+ if($response->getBody()->isSeekable()){
+ $response->getBody()->rewind();
+ }
+
+ $body = $response->getBody()->getContents();
+ $this->responseJson = json_decode($body, true);
+ return $this->responseJson;
+ }
+
+ return [];
+ }
+}
diff --git a/vendor/nexmo/client/src/Entity/JsonSerializableInterface.php b/vendor/nexmo/client/src/Entity/JsonSerializableInterface.php
new file mode 100644
index 00000000..6914cddc
--- /dev/null
+++ b/vendor/nexmo/client/src/Entity/JsonSerializableInterface.php
@@ -0,0 +1,14 @@
+getRequest())){
+ //TODO, figure out what the request data actually was
+ }
+
+ return $this->jsonSerialize();
+ }
+}
\ No newline at end of file
diff --git a/vendor/nexmo/client/src/Entity/JsonUnserializableInterface.php b/vendor/nexmo/client/src/Entity/JsonUnserializableInterface.php
new file mode 100644
index 00000000..aa64c02a
--- /dev/null
+++ b/vendor/nexmo/client/src/Entity/JsonUnserializableInterface.php
@@ -0,0 +1,22 @@
+response = $response;
+
+ $status = $response->getStatusCode();
+
+ if($this instanceof JsonUnserializableInterface AND ((200 == $status) OR (201 == $status))){
+ $this->jsonUnserialize($this->getResponseData());
+ }
+ }
+
+ public function setRequest(\Psr\Http\Message\RequestInterface $request)
+ {
+ $this->request = $request;
+ }
+
+ public function getRequest()
+ {
+ return $this->request;
+ }
+
+ public function getResponse()
+ {
+ return $this->response;
+ }
+}
\ No newline at end of file
diff --git a/vendor/nexmo/client/src/Entity/RequestArrayTrait.php b/vendor/nexmo/client/src/Entity/RequestArrayTrait.php
new file mode 100644
index 00000000..8d36c408
--- /dev/null
+++ b/vendor/nexmo/client/src/Entity/RequestArrayTrait.php
@@ -0,0 +1,74 @@
+getRequest())){
+ $query = [];
+ parse_str($request->getUri()->getQuery(), $query);
+ return $query;
+ }
+
+ // Trigger a pre-getRequestData() hook for any last minute
+ // decision making that needs to be done, but only if
+ // it hasn't been sent already
+ if (method_exists($this, 'preGetRequestDataHook')) {
+ $this->preGetRequestDataHook();
+ }
+
+ return $this->requestData;
+ }
+
+ protected function setRequestData($name, $value)
+ {
+ if(!($this instanceof EntityInterface)){
+ throw new \Exception(sprintf(
+ '%s can only be used if the class implements %s',
+ __TRAIT__,
+ EntityInterface::class
+ ));
+ }
+
+ if($this->getResponse()){
+ throw new \RuntimeException(sprintf(
+ 'can not set request parameter `%s` for `%s` after API request has be made',
+ $name,
+ get_class($this)
+ ));
+ }
+
+ $this->requestData[$name] = $value;
+ return $this;
+ }
+}
\ No newline at end of file
diff --git a/vendor/nexmo/client/src/Insights/Advanced.php b/vendor/nexmo/client/src/Insights/Advanced.php
new file mode 100644
index 00000000..83e11442
--- /dev/null
+++ b/vendor/nexmo/client/src/Insights/Advanced.php
@@ -0,0 +1,15 @@
+data['national_format_number'] = $number;
+ }
+
+ /**
+ * @return string
+ */
+ public function getRequestId()
+ {
+ return $this['request_id'];
+ }
+
+ /**
+ * @return string
+ */
+ public function getNationalFormatNumber()
+ {
+ return $this['national_format_number'];
+ }
+
+ /**
+ * @return string
+ */
+ public function getInternationalFormatNumber()
+ {
+ return $this['international_format_number'];
+ }
+
+ /**
+ * @return string
+ */
+ public function getCountryCode()
+ {
+ return $this['country_code'];
+ }
+
+ /**
+ * @return string
+ */
+ public function getCountryCodeISO3()
+ {
+ return $this['country_code_iso3'];
+ }
+
+ /**
+ * @return string
+ */
+ public function getCountryName()
+ {
+ return $this['country_name'];
+ }
+
+ /**
+ * @return integer
+ */
+ public function getCountryPrefix()
+ {
+ return $this['country_prefix'];
+ }
+
+ public function jsonSerialize()
+ {
+ return $this->data;
+ }
+
+ public function jsonUnserialize(array $json)
+ {
+ $this->data = $json;
+ }
+
+ public function offsetExists($offset)
+ {
+ return isset($this->data[$offset]);
+ }
+
+ public function offsetGet($offset)
+ {
+ return $this->data[$offset];
+ }
+
+ public function offsetSet($offset, $value)
+ {
+ throw new Exception('Number insights results are read only');
+ }
+
+ public function offsetUnset($offset)
+ {
+ throw new Exception('Number insights results are read only');
+ }
+}
\ No newline at end of file
diff --git a/vendor/nexmo/client/src/Insights/Client.php b/vendor/nexmo/client/src/Insights/Client.php
new file mode 100644
index 00000000..a3529796
--- /dev/null
+++ b/vendor/nexmo/client/src/Insights/Client.php
@@ -0,0 +1,118 @@
+makeRequest('/ni/basic/json', $number);
+
+ $basic = new Basic($insightsResults['national_format_number']);
+ $basic->jsonUnserialize($insightsResults);
+ return $basic;
+ }
+
+ public function standardCNam($number)
+ {
+ $insightsResults = $this->makeRequest('/ni/standard/json', $number, ['cnam' => 'true']);
+ $standard = new StandardCnam($insightsResults['national_format_number']);
+ $standard->jsonUnserialize($insightsResults);
+ return $standard;
+ }
+
+ public function advancedCnam($number)
+ {
+ $insightsResults = $this->makeRequest('/ni/advanced/json', $number, ['cnam' => 'true']);
+ $standard = new AdvancedCnam($insightsResults['national_format_number']);
+ $standard->jsonUnserialize($insightsResults);
+ return $standard;
+ }
+
+ public function standard($number, $useCnam=false)
+ {
+ $insightsResults = $this->makeRequest('/ni/standard/json', $number);
+ $standard = new Standard($insightsResults['national_format_number']);
+ $standard->jsonUnserialize($insightsResults);
+ return $standard;
+ }
+
+ public function advanced($number)
+ {
+ $insightsResults = $this->makeRequest('/ni/advanced/json', $number);
+ $advanced = new Advanced($insightsResults['national_format_number']);
+ $advanced->jsonUnserialize($insightsResults);
+ return $advanced;
+ }
+
+ public function advancedAsync($number, $webhook)
+ {
+ // This method does not have a return value as it's async. If there is no exception thrown
+ // We can assume that everything is fine
+ $this->makeRequest('/ni/advanced/async/json', $number, ['callback' => $webhook]);
+ }
+
+ public function makeRequest($path, $number, $additionalParams = [])
+ {
+ if ($number instanceof Number)
+ {
+ $number = $number->getMsisdn();
+ }
+
+ $queryString = http_build_query([
+ 'number' => $number,
+ ] + $additionalParams);
+
+ $request = new Request(
+ $this->getClient()->getApiUrl(). $path.'?'.$queryString,
+ 'GET',
+ 'php://temp',
+ [
+ 'Accept' => 'application/json'
+ ]
+ );
+
+ $response = $this->client->send($request);
+
+ $insightsResults = json_decode($response->getBody()->getContents(), true);
+
+ if('200' != $response->getStatusCode()){
+ throw $this->getException($response);
+ }
+
+ return $insightsResults;
+ }
+
+ protected function getException(ResponseInterface $response)
+ {
+ $body = json_decode($response->getBody()->getContents(), true);
+ $status = $response->getStatusCode();
+
+ if($status >= 400 AND $status < 500) {
+ $e = new Exception\Request($body['error-code-label'], $status);
+ } elseif($status >= 500 AND $status < 600) {
+ $e = new Exception\Server($body['error-code-label'], $status);
+ } else {
+ $e = new Exception\Exception('Unexpected HTTP Status Code');
+ throw $e;
+ }
+
+ return $e;
+ }
+}
diff --git a/vendor/nexmo/client/src/Insights/CnamTrait.php b/vendor/nexmo/client/src/Insights/CnamTrait.php
new file mode 100644
index 00000000..5bd136a2
--- /dev/null
+++ b/vendor/nexmo/client/src/Insights/CnamTrait.php
@@ -0,0 +1,25 @@
+enableEncodingDetection();
+ $this->requestData['text'] = (string) $text;
+ }
+}
diff --git a/vendor/nexmo/client/src/Message/Binary.php b/vendor/nexmo/client/src/Message/Binary.php
new file mode 100644
index 00000000..ab5ab191
--- /dev/null
+++ b/vendor/nexmo/client/src/Message/Binary.php
@@ -0,0 +1,55 @@
+body = (string) $body;
+ $this->udh = (string) $udh;
+ }
+
+ /**
+ * Get an array of params to use in an API request.
+ */
+ public function getRequestData($sent = true)
+ {
+ return array_merge(parent::getRequestData($sent), array(
+ 'body' => $this->body,
+ 'udh' => $this->udh,
+ ));
+ }
+}
diff --git a/vendor/nexmo/client/src/Message/Callback/Receipt.php b/vendor/nexmo/client/src/Message/Callback/Receipt.php
new file mode 100644
index 00000000..b884cc15
--- /dev/null
+++ b/vendor/nexmo/client/src/Message/Callback/Receipt.php
@@ -0,0 +1,139 @@
+ null), $data);
+
+ parent::__construct($data);
+ }
+
+ /**
+ * @return int
+ */
+ public function getErrorCode()
+ {
+ return (int) $this->data['err-code'];
+ }
+
+ /**
+ * @return string
+ */
+ public function getNetwork()
+ {
+ return (string) $this->data['network-code'];
+ }
+
+ /**
+ * @return string
+ */
+ public function getId()
+ {
+ return (string) $this->data['messageId'];
+ }
+
+ /**
+ * @return string
+ */
+ public function getReceiptFrom()
+ {
+ return (string) $this->data['msisdn'];
+ }
+
+ /**
+ * @return string
+ */
+ public function getTo()
+ {
+ return $this->getReceiptFrom();
+ }
+
+ /**
+ * @return string
+ */
+ public function getReceiptTo()
+ {
+ return (string) $this->data['to'];
+ }
+
+ /**
+ * @return string
+ */
+ public function getFrom()
+ {
+ return $this->getReceiptTo();
+ }
+
+ /**
+ * @return string
+ */
+ public function getStatus()
+ {
+ return (string) $this->data['status'];
+ }
+
+ /**
+ * @return string
+ */
+ public function getPrice()
+ {
+ return (string) $this->data['price'];
+ }
+
+ /**
+ * @return \DateTime
+ */
+ public function getTimestamp()
+ {
+ $date = \DateTime::createFromFormat('ymdHi', $this->data['scts']);
+ if($date){
+ return $date;
+ }
+
+ throw new \UnexpectedValueException('could not parse message timestamp');
+ }
+
+ /**
+ * @return \DateTime
+ */
+ public function getSent()
+ {
+ $date = \DateTime::createFromFormat('Y-m-d H:i:s', $this->data['message-timestamp']);
+ if($date){
+ return $date;
+ }
+
+ throw new \UnexpectedValueException('could not parse message timestamp');
+ }
+
+ /**
+ * @return string|null
+ */
+ public function getClientRef()
+ {
+ return $this->data['client-ref'];
+ }
+}
\ No newline at end of file
diff --git a/vendor/nexmo/client/src/Message/Client.php b/vendor/nexmo/client/src/Message/Client.php
new file mode 100644
index 00000000..7a137ce4
--- /dev/null
+++ b/vendor/nexmo/client/src/Message/Client.php
@@ -0,0 +1,324 @@
+createMessageFromArray($message);
+ }
+
+ $params = $message->getRequestData(false);
+
+ $request = new Request(
+ $this->getClient()->getRestUrl() . '/sms/json'
+ ,'POST',
+ 'php://temp',
+ ['content-type' => 'application/json']
+ );
+
+ $request->getBody()->write(json_encode($params));
+ $message->setRequest($request);
+ $response = $this->client->send($request);
+ $message->setResponse($response);
+
+ //check for valid data, as well as an error response from the API
+ $data = $message->getResponseData();
+ if(!isset($data['messages'])){
+ throw new Exception\Exception('unexpected response from API');
+ }
+
+ //normalize errors (client vrs server)
+ foreach($data['messages'] as $part){
+ switch($part['status']){
+ case '0':
+ break; //all okay
+ case '1':
+ if(preg_match('#\[\s+(\d+)\s+\]#', $part['error-text'], $match)){
+ usleep($match[1] + 1);
+ } else {
+ sleep(1);
+ }
+
+ return $this->send($message);
+ case '5':
+ $e = new Exception\Server($part['error-text'], $part['status']);
+ $e->setEntity($message);
+ throw $e;
+ default:
+ $e = new Exception\Request($part['error-text'], $part['status']);
+ $e->setEntity($message);
+ throw $e;
+ }
+ }
+
+ return $message;
+ }
+
+ /**
+ * @param $query
+ * @return MessageInterface[]
+ * @throws Exception\Exception
+ * @throws Exception\Request
+ */
+ public function get($query)
+ {
+ if($query instanceof Query){
+ $params = $query->getParams();
+ } else if($query instanceof MessageInterface){
+ $params = ['ids' => [$query->getMessageId()]];
+ } else if(is_string($query)) {
+ $params = ['ids' => [$query]];
+ } else if(is_array($query)){
+ $params = ['ids' => $query];
+ } else {
+ throw new \InvalidArgumentException('query must be an instance of Query, MessageInterface, string ID, or array of IDs.');
+ }
+
+ $request = new Request(
+ $this->getClient()->getRestUrl() . '/search/messages?' . http_build_query($params),
+ 'GET',
+ 'php://temp',
+ ['Accept' => 'application/json']
+ );
+
+ $response = $this->client->send($request);
+ $response->getBody()->rewind();
+ $data = json_decode($response->getBody()->getContents(), true);
+
+ if($response->getStatusCode() != '200' && isset($data['error-code'])){
+ throw new Exception\Request($data['error-code-label'], $data['error-code']);
+ } elseif($response->getStatusCode() != '200'){
+ throw new Exception\Request('error status from API', $response->getStatusCode());
+ }
+
+ if(!isset($data['items'])){
+ throw new Exception\Exception('unexpected response from API');
+ }
+
+ if(count($data['items']) == 0){
+ return [];
+ }
+
+ $collection = [];
+
+ foreach($data['items'] as $index => $item){
+ switch($item['type']){
+ case 'MT':
+ $new = new Message($item['message-id']);
+ break;
+ case 'MO':
+ $new = new InboundMessage($item['message-id']);
+ break;
+ default:
+ throw new Exception\Exception('unexpected response from API');
+ }
+
+ $new->setResponse($response);
+ $new->setIndex($index);
+ $collection[] = $new;
+
+ }
+
+ return $collection;
+ }
+
+ /**
+ * @param string|MessageInterface $idOrMessage
+ */
+ public function search($idOrMessage)
+ {
+ if($idOrMessage instanceof MessageInterface){
+ $id = $idOrMessage->getMessageId();
+ $message = $idOrMessage;
+ } else {
+ $id = $idOrMessage;
+ }
+
+ $request = new Request(
+ $this->getClient()->getRestUrl() . '/search/message?' . http_build_query(['id' => $id]),
+ 'GET',
+ 'php://temp',
+ ['Accept' => 'application/json']
+ );
+
+ $response = $this->client->send($request);
+
+ $response->getBody()->rewind();
+
+ $data = json_decode($response->getBody()->getContents(), true);
+
+ if($response->getStatusCode() != '200' && isset($data['error-code'])){
+ throw new Exception\Request($data['error-code-label'], $data['error-code']);
+ } elseif($response->getStatusCode() == '429'){
+ throw new Exception\Request('too many concurrent requests', $response->getStatusCode());
+ } elseif($response->getStatusCode() != '200'){
+ throw new Exception\Request('error status from API', $response->getStatusCode());
+ }
+
+ if(!$data){
+ throw new Exception\Request('no message found for `' . $id . '`');
+ }
+
+ switch($data['type']){
+ case 'MT':
+ $new = new Message($data['message-id']);
+ break;
+ case 'MO':
+ $new = new InboundMessage($data['message-id']);
+ break;
+ default:
+ throw new Exception\Exception('unexpected response from API');
+ }
+
+ if(isset($message) && !($message instanceof $new)){
+ throw new Exception\Exception(sprintf(
+ 'searched for message with type `%s` but message of type `%s`',
+ get_class($message),
+ get_class($new)
+ ));
+ }
+
+ if(!isset($message)){
+ $message = $new;
+ }
+
+ $message->setResponse($response);
+ return $message;
+ }
+
+ public function searchRejections(Query $query) {
+
+ $params = $query->getParams();
+ $request = new Request(
+ $this->getClient()->getRestUrl() . '/search/rejections?' . http_build_query($params),
+ 'GET',
+ 'php://temp',
+ ['Accept' => 'application/json']
+ );
+
+ $response = $this->client->send($request);
+ $response->getBody()->rewind();
+ $data = json_decode($response->getBody()->getContents(), true);
+
+ if($response->getStatusCode() != '200' && isset($data['error-code'])){
+ throw new Exception\Request($data['error-code-label'], $data['error-code']);
+ } elseif($response->getStatusCode() != '200'){
+ throw new Exception\Request('error status from API', $response->getStatusCode());
+ }
+
+ if(!isset($data['items'])){
+ throw new Exception\Exception('unexpected response from API');
+ }
+
+ if(count($data['items']) == 0){
+ return [];
+ }
+
+ $collection = [];
+
+ foreach($data['items'] as $index => $item){
+ switch($item['type']){
+ case 'MT':
+ $new = new Message($item['message-id']);
+ break;
+ case 'MO':
+ $new = new InboundMessage($item['message-id']);
+ break;
+ default:
+ throw new Exception\Exception('unexpected response from API');
+ }
+
+ $new->setResponse($response);
+ $new->setIndex($index);
+ $collection[] = $new;
+ }
+
+ return $collection;
+ }
+
+ /**
+ * @param array $message
+ * @return Message
+ */
+ protected function createMessageFromArray($message)
+ {
+ if(!is_array($message)){
+ throw new \RuntimeException('message must implement `' . MessageInterface::class . '` or be an array`');
+ }
+
+ foreach(['to', 'from'] as $param){
+ if(!isset($message[$param])){
+ throw new \InvalidArgumentException('missing expected key `' . $param . '`');
+ }
+ }
+
+ $to = $message['to'];
+ $from = $message['from'];
+
+ unset($message['to']);
+ unset($message['from']);
+
+ return new Message($to, $from, $message);
+ }
+
+ /**
+ * Convenience feature allowing messages to be sent without creating a message object first.
+ *
+ * @param $name
+ * @param $arguments
+ * @return MessageInterface
+ */
+ public function __call($name, $arguments)
+ {
+ if(!(strstr($name, 'send') !== 0)){
+ throw new \RuntimeException(sprintf(
+ '`%s` is not a valid method on `%s`',
+ $name,
+ get_class($this)
+ ));
+ }
+
+ $class = substr($name, 4);
+ $class = 'Nexmo\\Message\\' . ucfirst(strtolower($class));
+
+ if(!class_exists($class)){
+ throw new \RuntimeException(sprintf(
+ '`%s` is not a valid method on `%s`',
+ $name,
+ get_class($this)
+ ));
+ }
+
+ $reflection = new \ReflectionClass($class);
+ $message = $reflection->newInstanceArgs($arguments);
+
+ return $this->send($message);
+ }
+}
diff --git a/vendor/nexmo/client/src/Message/CollectionTrait.php b/vendor/nexmo/client/src/Message/CollectionTrait.php
new file mode 100644
index 00000000..c3a35ba4
--- /dev/null
+++ b/vendor/nexmo/client/src/Message/CollectionTrait.php
@@ -0,0 +1,12 @@
+index = (int) $index;
+ }
+}
\ No newline at end of file
diff --git a/vendor/nexmo/client/src/Message/EncodingDetector.php b/vendor/nexmo/client/src/Message/EncodingDetector.php
new file mode 100644
index 00000000..4ee6b099
--- /dev/null
+++ b/vendor/nexmo/client/src/Message/EncodingDetector.php
@@ -0,0 +1,53 @@
+convertIntoUnicode(),
+ [ // See: https://en.wikipedia.org/wiki/GSM_03.38#GSM_7-bit_default_alphabet_and_extension_table_of_3GPP_TS_23.038_/_GSM_03.38
+ '@', '£', '$', '¥', 'è', 'é', 'ù', 'ì', 'ò', 'ç', "\r", 'Ø', 'ø', "\n", 'Å', 'å',
+ 'Δ', '_', 'Φ', 'Γ', 'Λ', 'Ω', 'Π', 'Ψ', 'Σ', 'Θ', 'Ξ', 'Æ', 'æ', 'ß', 'É',
+ ' ', '!', '"', '#', '¤', '%', '&', '\'', '(', ')', '*', '+', ',', '-', '.', '/',
+ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=', '>', '?',
+ '¡', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
+ 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'Ä', 'Ö', 'Ñ', 'Ü', '§',
+ '¿', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',
+ 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'ä', 'ö', 'ñ', 'ü', 'à',
+ "\f", '^', '{', '}', '\\', '[', '~', ']', '|', '€',
+ ]
+ );
+
+ // Split $text into an array in a way that respects multibyte characters.
+ $textChars = preg_split('//u', $content, null, PREG_SPLIT_NO_EMPTY);
+
+ // Array of codepoint values for characters in $text.
+ $textCodePoints = array_map($this->convertIntoUnicode(), $textChars);
+
+ // Filter the array to contain only codepoints from $text that are not in the set of valid GSM codepoints.
+ $nonGsmCodePoints = array_diff($textCodePoints, $gsmCodePoints);
+
+ // The text contains unicode if the result is not empty.
+ return !empty($nonGsmCodePoints);
+ }
+
+ private function convertIntoUnicode()
+ {
+ return function ($char) {
+ $k = mb_convert_encoding($char, 'UTF-16LE', 'UTF-8');
+ $k1 = ord(substr($k, 0, 1));
+ $k2 = ord(substr($k, 1, 1));
+
+ return $k2 * 256 + $k1;
+ };
+ }
+}
diff --git a/vendor/nexmo/client/src/Message/InboundMessage.php b/vendor/nexmo/client/src/Message/InboundMessage.php
new file mode 100644
index 00000000..eae55290
--- /dev/null
+++ b/vendor/nexmo/client/src/Message/InboundMessage.php
@@ -0,0 +1,237 @@
+setRequest($idOrRequest);
+ return;
+ }
+
+ if(is_string($idOrRequest)){
+ $this->id = $idOrRequest;
+ return;
+ }
+
+ throw new \RuntimeException(sprintf(
+ '`%s` must be constructed with a server request or a message id',
+ self::class
+ ));
+ }
+
+ public static function createFromGlobals()
+ {
+ $serverRequest = \Zend\Diactoros\ServerRequestFactory::fromGlobals();
+ return new self($serverRequest);
+ }
+
+ /**
+ * Create a matching reply to the inbound message. Currently only supports text replies.
+ *
+ * @param string $body
+ * @return Text
+ */
+ public function createReply($body)
+ {
+ return new Text($this->getFrom(), $this->getTo(), $body);
+ }
+
+ public function getRequestData($sent = true)
+ {
+ $request = $this->getRequest();
+
+ if(is_null($request)){
+ return [];
+ }
+
+ if(!($request instanceof ServerRequestInterface)){
+ throw new \RuntimeException('inbound message request should only ever be `' . ServerRequestInterface::class . '`');
+ }
+
+ // Check our incoming content type
+ $isApplicationJson = false;
+ $contentTypes = $request->getHeader('Content-Type');
+ // We only respect application/json if it's the first entry without any preference weighting
+ // as that's what Nexmo send
+ if (count($contentTypes) && $contentTypes[0] === 'application/json') {
+ $isApplicationJson = true;
+ }
+
+ switch($request->getMethod()){
+ case 'POST':
+ $params = $isApplicationJson ? json_decode((string)$request->getBody(), true) : $request->getParsedBody();
+ break;
+ case 'GET':
+ $params = $request->getQueryParams();
+ break;
+ default:
+ $params = [];
+ break;
+ }
+
+ return $params;
+ }
+
+ public function getFrom()
+ {
+ if($this->getRequest()){
+ return $this['msisdn'];
+ } else {
+ return $this['from'];
+ }
+ }
+
+ public function getTo()
+ {
+ return $this['to'];
+ }
+
+ public function getMessageId()
+ {
+ if(isset($this->id)){
+ return $this->id;
+ }
+
+ return $this['messageId'];
+ }
+
+ public function isValid()
+ {
+ return (bool) $this->getMessageId();
+ }
+
+ public function getBody()
+ {
+ if($this->getRequest()){
+ return $this['text'];
+ } else {
+ return $this['body'];
+ }
+ }
+
+ public function getType()
+ {
+ return $this['type'];
+ }
+
+ public function getAccountId()
+ {
+ return $this['account-id'];
+ }
+
+ public function getNetwork()
+ {
+ return $this['network'];
+ }
+
+ /**
+ * Allow the object to access the data from the API response, a sent API request, or the user set data that the
+ * request will be created from - in that order.
+ *
+ * @param mixed $offset
+ * @return bool
+ * @throws \Exception
+ */
+ public function offsetExists($offset)
+ {
+ $response = $this->getResponseData();
+
+ if(isset($this->index)){
+ $response = $response['items'][$this->index];
+ }
+
+ $request = $this->getRequestData();
+ $dirty = $this->getRequestData(false);
+ return isset($response[$offset]) || isset($request[$offset]) || isset($dirty[$offset]);
+ }
+
+ /**
+ * Allow the object to access the data from the API response, a sent API request, or the user set data that the
+ * request will be created from - in that order.
+ *
+ * @param mixed $offset
+ * @return mixed
+ * @throws \Exception
+ */
+ public function offsetGet($offset)
+ {
+ $response = $this->getResponseData();
+
+ if(isset($this->index)){
+ $response = $response['items'][$this->index];
+ }
+
+ $request = $this->getRequestData();
+ $dirty = $this->getRequestData(false);
+
+ if(isset($response[$offset])){
+ return $response[$offset];
+ }
+
+ if(isset($request[$offset])){
+ return $request[$offset];
+ }
+
+ if(isset($dirty[$offset])){
+ return $dirty[$offset];
+ }
+ }
+
+ /**
+ * All properties are read only.
+ *
+ * @param mixed $offset
+ * @param mixed $value
+ */
+ public function offsetSet($offset, $value)
+ {
+ throw $this->getReadOnlyException($offset);
+ }
+
+ /**
+ * All properties are read only.
+ *
+ * @param mixed $offset
+ */
+ public function offsetUnset($offset)
+ {
+ throw $this->getReadOnlyException($offset);
+ }
+
+ /**
+ * All properties are read only.
+ *
+ * @param $offset
+ * @return \RuntimeException
+ */
+ protected function getReadOnlyException($offset)
+ {
+ return new \RuntimeException(sprintf(
+ 'can not modify `%s` using array access',
+ $offset
+ ));
+ }
+}
\ No newline at end of file
diff --git a/vendor/nexmo/client/src/Message/Message.php b/vendor/nexmo/client/src/Message/Message.php
new file mode 100644
index 00000000..fac8f617
--- /dev/null
+++ b/vendor/nexmo/client/src/Message/Message.php
@@ -0,0 +1,375 @@
+id = $idOrTo;
+ return;
+ }
+
+ $this->requestData['to'] = (string) $idOrTo;
+ $this->requestData['from'] = (string) $from;
+ if(static::TYPE){
+ $this->requestData['type'] = static::TYPE;
+ }
+
+ $this->requestData = array_merge($this->requestData, $additional);
+ }
+
+ public function requestDLR($dlr = true)
+ {
+ return $this->setRequestData('status-report-req', $dlr ? 1 : 0);
+ }
+
+ public function setCallback($callback) {
+ return $this->setRequestData('callback', (string) $callback);
+ }
+
+ public function setClientRef($ref)
+ {
+ return $this->setRequestData('client-ref', (string) $ref);
+ }
+
+ public function setNetwork($network)
+ {
+ return $this->setRequestData('network-code', (string) $network);
+ }
+
+ public function setTTL($ttl)
+ {
+ return $this->setRequestData('ttl', (int) $ttl);
+ }
+
+ public function setClass($class)
+ {
+ return $this->setRequestData('message-class', $class);
+ }
+
+ public function enableEncodingDetection()
+ {
+ $this->autodetectEncoding = true;
+ }
+
+ public function disableEncodingDetection()
+ {
+ $this->autodetectEncoding = false;
+ }
+
+ public function count()
+ {
+ $data = $this->getResponseData();
+ if(!isset($data['messages'])){
+ return 0;
+ }
+
+ return count($data['messages']);
+ }
+
+ public function getMessageId($index = null)
+ {
+ if(isset($this->id)){
+ return $this->id;
+ }
+
+ return $this->getMessageData('message-id', $index);
+ }
+
+ public function getStatus($index = null)
+ {
+ return $this->getMessageData('status', $index);
+ }
+
+ public function getFinalStatus($index = null)
+ {
+ return $this->getMessageData('final-status', $index);
+ }
+
+ public function getTo($index = null)
+ {
+ $data = $this->getResponseData();
+
+ //check if this is data from a send request
+ //(which also has a status, but it's not the same)
+ if(isset($data['messages'])){
+ return $this->getMessageData('to', $index);
+ }
+
+ return $this['to'];
+ }
+
+ public function getRemainingBalance($index = null)
+ {
+ return $this->getMessageData('remaining-balance', $index);
+ }
+
+ public function getPrice($index = null)
+ {
+ $data = $this->getResponseData();
+
+ //check if this is data from a send request
+ //(which also has a status, but it's not the same)
+ if(isset($data['messages'])){
+ return $this->getMessageData('message-price', $index);
+ }
+
+ return $this['price'];
+ }
+
+ public function getNetwork($index = null)
+ {
+ return $this->getMessageData('network', $index);
+ }
+
+ public function getDeliveryStatus()
+ {
+ $data = $this->getResponseData();
+
+ //check if this is data from a send request
+ //(which also has a status, but it's not the same)
+ if(isset($data['messages'])){
+ return;
+ }
+
+ return $this['status'];
+ }
+
+ public function getFrom()
+ {
+ return $this['from'];
+ }
+
+ public function getBody()
+ {
+ return $this['body'];
+ }
+
+ public function getDateReceived()
+ {
+ return new \DateTime($this['date-received']);
+ }
+
+ public function getDeliveryError()
+ {
+ return $this['error-code'];
+ }
+
+ public function getDeliveryLabel()
+ {
+ return $this['error-code-label'];
+ }
+
+ public function isEncodingDetectionEnabled()
+ {
+ return $this->autodetectEncoding;
+ }
+
+ protected function getMessageData($name, $index = null)
+ {
+ if(!isset($this->response)){
+ return null;
+ }
+
+ $data = $this->getResponseData();
+ if(is_null($index)){
+ $index = $this->count() -1;
+ }
+
+ if (isset($data['messages'])) {
+ return $data['messages'][$index][$name];
+ }
+
+ return isset($data[$name]) ? $data[$name] : null;
+ }
+
+ protected function preGetRequestDataHook()
+ {
+ // If $autodetectEncoding is true, we want to set the `type`
+ // field in our payload
+ if ($this->isEncodingDetectionEnabled()) {
+ $this->requestData['type'] = $this->detectEncoding();
+ }
+ }
+
+ protected function detectEncoding()
+ {
+ if (!isset($this->requestData['text'])) {
+ return static::TYPE;
+ }
+
+ // Auto detect unicode messages
+ $detector = new EncodingDetector;
+ if ($detector->requiresUnicodeEncoding($this->requestData['text'])){
+ return Unicode::TYPE;
+ }
+
+ return static::TYPE;
+ }
+
+ public function offsetExists($offset)
+ {
+ $response = $this->getResponseData();
+
+ if(isset($this->index)){
+ $response = $response['items'][$this->index];
+ }
+
+ $request = $this->getRequestData();
+ $dirty = $this->getRequestData(false);
+ if(isset($response[$offset]) || isset($request[$offset]) || isset($dirty[$offset])){
+ return true;
+ }
+
+ //provide access to split messages by virtual index
+ if(is_int($offset) && $offset < $this->count()){
+ return true;
+ }
+
+ return false;
+ }
+
+ public function offsetGet($offset)
+ {
+ $response = $this->getResponseData();
+
+ if(isset($this->index)){
+ $response = $response['items'][$this->index];
+ }
+
+ $request = $this->getRequestData();
+ $dirty = $this->getRequestData(false);
+
+ if(isset($response[$offset])){
+ return $response[$offset];
+ }
+
+ //provide access to split messages by virtual index, if there is data
+ if(isset($response['messages'])){
+ if(is_int($offset) && isset($response['messages'][$offset])){
+ return $response['messages'][$offset];
+ }
+
+ $index = $this->count() -1;
+
+ if(isset($response['messages'][$index]) && isset($response['messages'][$index][$offset])){
+ return $response['messages'][$index][$offset];
+ }
+
+ }
+
+ if(isset($request[$offset])){
+ return $request[$offset];
+ }
+
+ if(isset($dirty[$offset])){
+ return $dirty[$offset];
+ }
+ }
+
+ public function offsetSet($offset, $value)
+ {
+ throw $this->getReadOnlyException($offset);
+ }
+
+ public function offsetUnset($offset)
+ {
+ throw $this->getReadOnlyException($offset);
+ }
+
+ protected function getReadOnlyException($offset)
+ {
+ return new \RuntimeException(sprintf(
+ 'can not modify `%s` using array access',
+ $offset
+ ));
+ }
+
+ public function current()
+ {
+ if(!isset($this->response)){
+ return null;
+ }
+
+ $data = $this->getResponseData();
+ return $data['messages'][$this->current];
+ }
+
+ public function next()
+ {
+ $this->current++;
+ }
+
+ public function key()
+ {
+ if(!isset($this->response)){
+ return null;
+ }
+
+ return $this->current;
+ }
+
+ public function valid()
+ {
+ if(!isset($this->response)){
+ return null;
+ }
+
+ $data = $this->getResponseData();
+ return isset($data['messages'][$this->current]);
+ }
+
+ public function rewind()
+ {
+ $this->current = 0;
+ }
+
+
+
+}
diff --git a/vendor/nexmo/client/src/Message/MessageInterface.php b/vendor/nexmo/client/src/Message/MessageInterface.php
new file mode 100644
index 00000000..f458e056
--- /dev/null
+++ b/vendor/nexmo/client/src/Message/MessageInterface.php
@@ -0,0 +1,14 @@
+params['date'] = $date->format('Y-m-d');
+ $this->params['to'] = $to;
+ }
+
+ public function getParams()
+ {
+ return $this->params;
+ }
+}
\ No newline at end of file
diff --git a/vendor/nexmo/client/src/Message/Response/Collection.php b/vendor/nexmo/client/src/Message/Response/Collection.php
new file mode 100644
index 00000000..831c5dc0
--- /dev/null
+++ b/vendor/nexmo/client/src/Message/Response/Collection.php
@@ -0,0 +1,125 @@
+expected = array('message-count', 'messages');
+ $return = parent::__construct($data);
+
+ $this->count = $data['message-count'];
+
+ if(count($data['messages']) != $data['message-count']){
+ throw new \RuntimeException('invalid message count');
+ }
+
+ foreach($data['messages'] as $message){
+ if(0 != $message['status']){
+ $this->messages[] = new Error($message);
+ } else {
+ $this->messages[] = new Message($message);
+ }
+ }
+
+ $this->data = $data;
+
+ return $return;
+ }
+
+ public function getMessages()
+ {
+ return $this->messages;
+ }
+
+ public function isSuccess()
+ {
+ foreach($this->messages as $message){
+ if($message instanceof Error){
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ public function count()
+ {
+ return $this->count;
+ }
+
+ /**
+ * @link http://php.net/manual/en/iterator.current.php
+ * @return Message
+ */
+ public function current()
+ {
+ return $this->messages[$this->position];
+ }
+
+ /**
+ * @link http://php.net/manual/en/iterator.next.php
+ * @return void
+ */
+ public function next()
+ {
+ $this->position++;
+ }
+
+ /**
+ * @link http://php.net/manual/en/iterator.key.php
+ * @return int
+ */
+ public function key()
+ {
+ return $this->position;
+ }
+
+ /**
+ * @link http://php.net/manual/en/iterator.valid.php
+ * @return boolean
+ */
+ public function valid()
+ {
+ return $this->position < $this->count;
+ }
+
+ /**
+ * @link http://php.net/manual/en/iterator.rewind.php
+ * @return void
+ */
+ public function rewind()
+ {
+ $this->position = 0;
+ }
+}
\ No newline at end of file
diff --git a/vendor/nexmo/client/src/Message/Response/Message.php b/vendor/nexmo/client/src/Message/Response/Message.php
new file mode 100644
index 00000000..7069dd40
--- /dev/null
+++ b/vendor/nexmo/client/src/Message/Response/Message.php
@@ -0,0 +1,121 @@
+expected = array(
+ 'status',
+ 'message-id',
+ 'to',
+ 'message-price',
+ 'network'
+ );
+
+ //default value
+ $data = array_merge(array('client-ref' => null, 'remaining-balance' => null), $data);
+
+ $return = parent::__construct($data);
+
+ //validate receipt
+ if(!$receipt){
+ return $return;
+ }
+
+ if($receipt->getId() != $this->getId()){
+ throw new \UnexpectedValueException('receipt id must match message id');
+ }
+
+ $this->receipt = $receipt;
+
+ return $receipt;
+ }
+
+ /**
+ * @return int
+ */
+ public function getStatus()
+ {
+ return (int) $this->data['status'];
+ }
+
+ /**
+ * @return string
+ */
+ public function getId()
+ {
+ return (string) $this->data['message-id'];
+ }
+
+ /**
+ * @return string
+ */
+ public function getTo()
+ {
+ return (string) $this->data['to'];
+ }
+
+ /**
+ * @return string
+ */
+ public function getBalance()
+ {
+ return (string) $this->data['remaining-balance'];
+ }
+
+ /**
+ * @return string
+ */
+ public function getPrice()
+ {
+ return (string) $this->data['message-price'];
+ }
+
+ /**
+ * @return string
+ */
+ public function getNetwork()
+ {
+ return (string) $this->data['network'];
+ }
+
+ /**
+ * @return string
+ */
+ public function getClientRef()
+ {
+ return (string) $this->data['client-ref'];
+ }
+
+ /**
+ * @return Receipt|null
+ */
+ public function getReceipt()
+ {
+ return $this->receipt;
+ }
+
+ /**
+ * @return bool
+ */
+ public function hasReceipt()
+ {
+ return $this->receipt instanceof Receipt;
+ }
+}
\ No newline at end of file
diff --git a/vendor/nexmo/client/src/Message/Text.php b/vendor/nexmo/client/src/Message/Text.php
new file mode 100644
index 00000000..fc58a26a
--- /dev/null
+++ b/vendor/nexmo/client/src/Message/Text.php
@@ -0,0 +1,37 @@
+requestData['text'] = (string) $text;
+ }
+}
\ No newline at end of file
diff --git a/vendor/nexmo/client/src/Message/Unicode.php b/vendor/nexmo/client/src/Message/Unicode.php
new file mode 100644
index 00000000..23e1e873
--- /dev/null
+++ b/vendor/nexmo/client/src/Message/Unicode.php
@@ -0,0 +1,46 @@
+text = (string) $text;
+ }
+
+ /**
+ * Get an array of params to use in an API request.
+ */
+ public function getRequestData($sent = true)
+ {
+ return array_merge(parent::getRequestData($sent), array(
+ 'text' => $this->text
+ ));
+ }
+}
diff --git a/vendor/nexmo/client/src/Message/Vcal.php b/vendor/nexmo/client/src/Message/Vcal.php
new file mode 100644
index 00000000..ac55bf1c
--- /dev/null
+++ b/vendor/nexmo/client/src/Message/Vcal.php
@@ -0,0 +1,46 @@
+text = (string) $vcal;
+ }
+
+ /**
+ * Get an array of params to use in an API request.
+ */
+ public function getRequestData($sent = true)
+ {
+ return array_merge(parent::getRequestData($sent), array(
+ 'vcal' => $this->vcal
+ ));
+ }
+}
diff --git a/vendor/nexmo/client/src/Message/Vcard.php b/vendor/nexmo/client/src/Message/Vcard.php
new file mode 100644
index 00000000..b6fdafd3
--- /dev/null
+++ b/vendor/nexmo/client/src/Message/Vcard.php
@@ -0,0 +1,46 @@
+vcard = (string) $vcard;
+ }
+
+ /**
+ * Get an array of params to use in an API request.
+ */
+ public function getRequestData($sent = true)
+ {
+ return array_merge(parent::getRequestData($sent), array(
+ 'vcard' => $this->vcard
+ ));
+ }
+}
diff --git a/vendor/nexmo/client/src/Message/Wap.php b/vendor/nexmo/client/src/Message/Wap.php
new file mode 100644
index 00000000..1c908b2b
--- /dev/null
+++ b/vendor/nexmo/client/src/Message/Wap.php
@@ -0,0 +1,64 @@
+title = (string) $title;
+ $this->url = (string) $url;
+ $this->validity = (int) $validity;
+ }
+
+ /**
+ * Get an array of params to use in an API request.
+ */
+ public function getRequestData($sent = true)
+ {
+ return array_merge(parent::getRequestData($sent), array(
+ 'title' => $this->title,
+ 'url' => $this->url,
+ 'validity' => $this->validity,
+ ));
+ }
+}
diff --git a/vendor/nexmo/client/src/Network.php b/vendor/nexmo/client/src/Network.php
new file mode 100644
index 00000000..37aaf519
--- /dev/null
+++ b/vendor/nexmo/client/src/Network.php
@@ -0,0 +1,97 @@
+data['network_code'] = $networkCode;
+ $this->data['network_name'] = $networkName;
+ }
+
+ public function getCode()
+ {
+ return $this['network_code'];
+ }
+
+ public function getName()
+ {
+ return $this['network_name'];
+ }
+
+ public function getOutboundSmsPrice()
+ {
+ if (isset($this['sms_price'])) {
+ return $this['sms_price'];
+ }
+ return $this['price'];
+ }
+
+ public function getOutboundVoicePrice()
+ {
+ if (isset($this['voice_price'])) {
+ return $this['voice_price'];
+ }
+ return $this['price'];
+ }
+
+ public function getPrefixPrice() {
+ return $this['mt_price'];
+ }
+
+ public function getCurrency()
+ {
+ return $this['currency'];
+ }
+
+ public function jsonUnserialize(array $json)
+ {
+ // Convert CamelCase to snake_case as that's how we use array access in every other object
+ $data = [];
+ foreach ($json as $k => $v){
+ $k = ltrim(strtolower(preg_replace('/[A-Z]([A-Z](?![a-z]))*/', '_$0', $k)), '_');
+ $data[$k] = $v;
+ }
+ $this->data = $data;
+ }
+
+ function jsonSerialize()
+ {
+ return $this->data;
+ }
+
+ public function offsetExists($offset)
+ {
+ return isset($this->data[$offset]);
+ }
+
+ public function offsetGet($offset)
+ {
+ return $this->data[$offset];
+ }
+
+ public function offsetSet($offset, $value)
+ {
+ throw new Exception('Network is read only');
+ }
+
+ public function offsetUnset($offset)
+ {
+ throw new Exception('Network is read only');
+ }
+}
diff --git a/vendor/nexmo/client/src/Network/Number/Callback.php b/vendor/nexmo/client/src/Network/Number/Callback.php
new file mode 100644
index 00000000..b54fc557
--- /dev/null
+++ b/vendor/nexmo/client/src/Network/Number/Callback.php
@@ -0,0 +1,94 @@
+ 'number_type',
+ 'Network' => 'carrier_network_code',
+ 'NetworkName' => 'carrier_network_name',
+ 'Valid' => 'valid',
+ 'Ported' => 'ported',
+ 'Reachable' => 'reachable',
+ 'Roaming' => 'roaming',
+ 'RoamingCountry' => 'roaming_country_code',
+ 'RoamingNetwork' => 'roaming_network_code',
+ );
+
+ public function getId()
+ {
+ return $this->data['request_id'];
+ }
+
+ public function getCallbackTotal()
+ {
+ return $this->data['callback_total_parts'];
+ }
+
+ public function getCallbackIndex()
+ {
+ return $this->data['callback_part'];
+ }
+
+ public function getNumber()
+ {
+ return $this->data['number'];
+ }
+
+ public function __call($name, $args)
+ {
+ $type = substr($name, 0, 3);
+ $property = substr($name, 3);
+
+ if(!isset($this->optional[$property])){
+ throw new \BadMethodCallException('property does not exist: ' . $property);
+ }
+
+ $property = $this->optional[$property];
+
+ switch($type){
+ case 'get':
+ if(isset($this->data[$property])){
+ return $this->data[$property];
+ } else {
+ return null;
+ }
+ break;
+ case 'has':
+ return isset($this->data[$property]);
+ break;
+ }
+
+ throw new \BadMethodCallException('method does not exist: ' . $name);
+ }
+}
\ No newline at end of file
diff --git a/vendor/nexmo/client/src/Network/Number/Request.php b/vendor/nexmo/client/src/Network/Number/Request.php
new file mode 100644
index 00000000..dacfe7d1
--- /dev/null
+++ b/vendor/nexmo/client/src/Network/Number/Request.php
@@ -0,0 +1,61 @@
+params['number'] = $number;
+ $this->params['callback'] = $callback;
+ $this->params['callback_timeout'] = $timeout;
+ $this->params['callback_method'] = $method;
+ $this->params['client_ref'] = $ref;
+
+ if(!empty($features)){
+ $this->params['features'] = implode(',', $features);
+ }
+ }
+
+ public function getURI()
+ {
+ return '/ni/json';
+ }
+
+ /**
+ * @param ResponseInterface $response
+ * @return ResponseInterface
+ */
+ public function wrapResponse(ResponseInterface $response)
+ {
+ if($response->isError()){
+ return new Error($response->getData());
+ }
+
+ return new Response($response->getData());
+ }
+
+
+}
\ No newline at end of file
diff --git a/vendor/nexmo/client/src/Network/Number/Response.php b/vendor/nexmo/client/src/Network/Number/Response.php
new file mode 100644
index 00000000..35955569
--- /dev/null
+++ b/vendor/nexmo/client/src/Network/Number/Response.php
@@ -0,0 +1,100 @@
+expected = array_merge($this->expected, array(
+ 'request_id', 'number', 'request_price', 'remaining_balance', 'callback_total_parts'
+ ));
+
+ parent::__construct($data);
+
+ foreach($callbacks as $callback){
+ if(!($callback instanceof Callback)){
+ throw new \InvalidArgumentException('callback must be of type: Nexmo\Network\Number\Callback');
+ }
+
+ if($callback->getId() !== $this->getId()){
+ throw new \InvalidArgumentException('callback id must match request id');
+ }
+ }
+
+ $this->callbacks = $callbacks;
+ }
+
+ public function getCallbackTotal()
+ {
+ return $this->data['callback_total_parts'];
+ }
+
+ public function isComplete()
+ {
+ return count($this->callbacks) == $this->getCallbackTotal();
+ }
+
+ public function getPrice()
+ {
+ return $this->data['request_price'];
+ }
+
+ public function getBalance()
+ {
+ return $this->data['remaining_balance'];
+ }
+
+ public function getNumber()
+ {
+ return $this->data['number'];
+ }
+
+ public function getId()
+ {
+ return $this->data['request_id'];
+ }
+
+ public function getStatus()
+ {
+ return $this->data['status'];
+ }
+
+ public function __call($name, $args)
+ {
+ if(empty($this->callbacks)){
+ throw new \BadMethodCallException('can not check for response data without callback data');
+ }
+
+ foreach($this->callbacks as $callback){
+ if($last = $callback->$name()){
+ return $last;
+ }
+ }
+ return $last;
+ }
+
+ public function getCallbacks()
+ {
+ return $this->callbacks;
+ }
+
+ public static function addCallback(Response $response, Callback $callback)
+ {
+ $callbacks = $response->getCallbacks();
+ $callbacks[] = $callback;
+
+ return new static($response->getData(), $callbacks);
+ }
+}
\ No newline at end of file
diff --git a/vendor/nexmo/client/src/Numbers/Client.php b/vendor/nexmo/client/src/Numbers/Client.php
new file mode 100644
index 00000000..98cc9dcc
--- /dev/null
+++ b/vendor/nexmo/client/src/Numbers/Client.php
@@ -0,0 +1,290 @@
+get($id);
+ }
+
+ if($number instanceof Number){
+ $body = $number->getRequestData();
+ if(!isset($update) AND !isset($body['country'])){
+ $data = $this->get($number->getId());
+ $body['msisdn'] = $data->getId();
+ $body['country'] = $data->getCountry();
+ }
+ } else {
+ $body = $number;
+ }
+
+ if(isset($update)){
+ $body['msisdn'] = $update->getId();
+ $body['country'] = $update->getCountry();
+ }
+
+ $request = new Request(
+ $this->client->getRestUrl() . '/number/update',
+ 'POST',
+ 'php://temp',
+ [
+ 'Accept' => 'application/json',
+ 'Content-Type' => 'application/x-www-form-urlencoded'
+ ]
+ );
+
+ $request->getBody()->write(http_build_query($body));
+ $response = $this->client->send($request);
+
+ if('200' != $response->getStatusCode()){
+ throw $this->getException($response);
+ }
+
+ if(isset($update) AND ($number instanceof Number)){
+ return $this->get($number);
+ }
+
+ if($number instanceof Number){
+ return $this->get($number);
+ }
+
+ return $this->get($body['msisdn']);
+ }
+
+ public function get($number = null)
+ {
+ $items = $this->search($number);
+
+ // This is legacy behaviour, so we need to keep it even though
+ // it isn't technically the correct message
+ if (count($items) != 1) {
+ throw new Exception\Request('number not found', 404);
+ }
+
+ return $items[0];
+ }
+
+ /**
+ * @param null|string $number
+ * @return array []Number
+ * @deprecated Use `searchOwned` instead
+ */
+ public function search($number = null)
+ {
+ return $this->searchOwned($number);
+ }
+
+ public function searchAvailable($country, $options = [])
+ {
+ $query = [
+ 'country' => $country
+ ];
+
+ // These are all optional parameters
+ $possibleParameters = [
+ 'pattern',
+ 'search_pattern',
+ 'features',
+ 'size',
+ 'type',
+ 'index'
+ ];
+
+ foreach ($possibleParameters as $param) {
+ if (isset($options[$param])) {
+ $query[$param] = $options[$param];
+ }
+ }
+
+ $request = new Request(
+ $this->client->getRestUrl() . '/number/search?' . http_build_query($query),
+ 'GET',
+ 'php://temp'
+ );
+
+ $response = $this->client->send($request);
+
+ return $this->handleNumberSearchResult($response, null);
+ }
+
+ public function searchOwned($number = null, $options = [])
+ {
+ $query = [];
+ if ($number !== null) {
+ if($number instanceof Number){
+ $query = ['pattern' => $number->getId()];
+ } else {
+ $query = ['pattern' => $number];
+ }
+
+ }
+
+ // These are all optional parameters
+ $possibleParameters = [
+ 'search_pattern',
+ 'size',
+ 'index'
+ ];
+
+ foreach ($options as $param => $value) {
+ if (!in_array($param, $possibleParameters)) {
+ throw new Exception\Request("Unknown option: '".$param."'");
+ }
+ $query[$param] = $value;
+ }
+
+ $queryString = http_build_query($query);
+
+ $request = new Request(
+ $this->client->getRestUrl() . '/account/numbers?' . $queryString,
+ 'GET',
+ 'php://temp'
+ );
+
+ $response = $this->client->send($request);
+ return $this->handleNumberSearchResult($response, $number);
+ }
+
+ private function handleNumberSearchResult($response, $number)
+ {
+ if($response->getStatusCode() != '200'){
+ throw $this->getException($response);
+ }
+
+ $searchResults = json_decode($response->getBody()->getContents(), true);
+ if(empty($searchResults)){
+ throw new Exception\Request('number not found', 404);
+ }
+
+ if(!isset($searchResults['count']) OR !isset($searchResults['numbers'])){
+ throw new Exception\Exception('unexpected response format');
+ }
+
+ // We're going to return a list of numbers
+ $numbers = [];
+
+ // If they provided a number initially, we'll only get one response
+ // so let's reuse the object
+ if($number instanceof Number){
+ $number->jsonUnserialize($searchResults['numbers'][0]);
+ $numbers[] = $number;
+ } else {
+ // Otherwise, we return everything that matches
+ foreach ($searchResults['numbers'] as $returnedNumber) {
+ $number = new Number();
+ $number->jsonUnserialize($returnedNumber);
+ $numbers[] = $number;
+ }
+ }
+
+ return $numbers;
+ }
+
+ public function purchase($number, $country = null) {
+ // We cheat here and fetch a number using the API so that we have the country code which is required
+ // to make a cancel request
+ if (!$number instanceof Number) {
+ if (!$country) {
+ throw new Exception\Exception("You must supply a country in addition to a number to purchase a number");
+ }
+ $number = new Number($number, $country);
+ }
+
+ $body = [
+ 'msisdn' => $number->getMsisdn(),
+ 'country' => $number->getCountry()
+ ];
+
+ $request = new Request(
+ $this->client->getRestUrl() . '/number/buy',
+ 'POST',
+ 'php://temp',
+ [
+ 'Accept' => 'application/json',
+ 'Content-Type' => 'application/x-www-form-urlencoded'
+ ]
+ );
+
+ $request->getBody()->write(http_build_query($body));
+ $response = $this->client->send($request);
+
+ // Sadly we can't distinguish *why* purchasing fails, just that it
+ // has failed. Here are a few of the tests I attempted and their associated
+ // error codes + body
+ //
+ // Mismatch number/country :: 420 :: method failed
+ // Already own number :: 420 :: method failed
+ // Someone else owns the number :: 420 :: method failed
+ if('200' != $response->getStatusCode()){
+ throw $this->getException($response);
+ }
+ }
+
+ public function cancel($number) {
+ // We cheat here and fetch a number using the API so that we have the country code which is required
+ // to make a cancel request
+ if (!$number instanceof Number) {
+ $number = $this->get($number);
+ }
+
+ $body = [
+ 'msisdn' => $number->getMsisdn(),
+ 'country' => $number->getCountry()
+ ];
+
+ $request = new Request(
+ $this->client->getRestUrl() . '/number/cancel',
+ 'POST',
+ 'php://temp',
+ [
+ 'Accept' => 'application/json',
+ 'Content-Type' => 'application/x-www-form-urlencoded'
+ ]
+ );
+
+ $request->getBody()->write(http_build_query($body));
+ $response = $this->client->send($request);
+
+ // Sadly we can't distinguish *why* purchasing fails, just that it
+ // has failed.
+ if('200' != $response->getStatusCode()){
+ throw $this->getException($response);
+ }
+ }
+
+ protected function getException(ResponseInterface $response)
+ {
+ $body = json_decode($response->getBody()->getContents(), true);
+ $status = $response->getStatusCode();
+
+ if($status >= 400 AND $status < 500) {
+ $e = new Exception\Request($body['error-code-label'], $status);
+ } elseif($status >= 500 AND $status < 600) {
+ $e = new Exception\Server($body['error-code-label'], $status);
+ } else {
+ $e = new Exception\Exception('Unexpected HTTP Status Code');
+ throw $e;
+ }
+
+ return $e;
+ }
+
+}
diff --git a/vendor/nexmo/client/src/Numbers/Number.php b/vendor/nexmo/client/src/Numbers/Number.php
new file mode 100644
index 00000000..c408d664
--- /dev/null
+++ b/vendor/nexmo/client/src/Numbers/Number.php
@@ -0,0 +1,191 @@
+data['msisdn'] = $number;
+ $this->data['country'] = $country;
+ }
+
+ public function getId()
+ {
+ return $this->fromData('msisdn');
+ }
+
+ public function getMsisdn()
+ {
+ return $this->getId();
+ }
+
+ public function getNumber()
+ {
+ return $this->getId();
+ }
+
+ public function getCountry()
+ {
+ return $this->fromData('country');
+ }
+
+ public function getType()
+ {
+ return $this->fromData('type');
+ }
+
+ public function getCost()
+ {
+ return $this->fromData('cost');
+ }
+
+ public function hasFeature($feature)
+ {
+ if(!isset($this->data['features'])){
+ return false;
+ }
+
+ return in_array($feature, $this->data['features']);
+ }
+
+ public function getFeatures()
+ {
+ return $this->fromData('features');
+ }
+
+ public function setWebhook($type, $url)
+ {
+ if(!in_array($type, [self::WEBHOOK_MESSAGE, self::WEBHOOK_VOICE_STATUS])){
+ throw new \InvalidArgumentException("invalid webhook type `$type`");
+ }
+
+ $this->data[$type] = $url;
+ return $this;
+ }
+
+ public function getWebhook($type)
+ {
+ return $this->fromData($type);
+ }
+
+ public function hasWebhook($type)
+ {
+ return isset($this->data[$type]);
+ }
+
+ public function setVoiceDestination($endpoint, $type = null)
+ {
+ if(is_null($type)){
+ $type = $this->autoType($endpoint);
+ }
+
+ if(self::ENDPOINT_APP == $type AND !($endpoint instanceof Application)){
+ $endpoint = new Application($endpoint);
+ }
+
+ $this->data['voiceCallbackValue'] = $endpoint;
+ $this->data['voiceCallbackType'] = $type;
+
+ return $this;
+ }
+
+ protected function autoType($endpoint)
+ {
+ if($endpoint instanceof Application){
+ return self::ENDPOINT_APP;
+ }
+
+ if(false !== strpos($endpoint, '@')){
+ return self::ENDPOINT_SIP;
+ }
+
+ if(0 === strpos(strtolower($endpoint), 'http')){
+ return self::ENDPOINT_VXML;
+ }
+
+ if(preg_match('#[a-z]+#', $endpoint)){
+ return self::ENDPOINT_APP;
+ }
+
+ return self::ENDPOINT_TEL;
+ }
+
+ public function getVoiceDestination()
+ {
+ return $this->fromData('voiceCallbackValue');
+ }
+
+ public function getVoiceType()
+ {
+ if(!isset($this->data['voiceCallbackType'])){
+ return null;
+ }
+
+ return $this->data['voiceCallbackType'];
+ }
+
+ protected function fromData($name)
+ {
+ if(!isset($this->data[$name])){
+ throw new \RuntimeException("`{$name}` has not been set");
+ }
+
+ return $this->data[$name];
+ }
+
+ public function jsonUnserialize(array $json)
+ {
+ $this->data = $json;
+ }
+
+ function jsonSerialize()
+ {
+ $json = $this->data;
+ if(isset($json['voiceCallbackValue']) AND ($json['voiceCallbackValue'] instanceof Application)){
+ $json['voiceCallbackValue'] = $json['voiceCallbackValue']->getId();
+ }
+
+ return $json;
+ }
+
+ public function __toString()
+ {
+ return (string) $this->getId();
+ }
+}
\ No newline at end of file
diff --git a/vendor/nexmo/client/src/Redact/Client.php b/vendor/nexmo/client/src/Redact/Client.php
new file mode 100644
index 00000000..9e300294
--- /dev/null
+++ b/vendor/nexmo/client/src/Redact/Client.php
@@ -0,0 +1,78 @@
+getClient()->getApiUrl() . '/v1/redact/transaction',
+ 'POST',
+ 'php://temp',
+ [
+ 'Accept' => 'application/json',
+ 'Content-Type' => 'application/json'
+ ]
+ );
+
+ $body = ['id' => $id, 'product' => $product] + $options;
+
+ $request->getBody()->write(json_encode($body));
+ $response = $this->client->send($request);
+
+ $rawBody = $response->getBody()->getContents();
+
+ if('204' != $response->getStatusCode()){
+ throw $this->getException($response);
+ }
+
+ return null;
+ }
+
+ protected function getException(ResponseInterface $response)
+ {
+ $response->getBody()->rewind();
+ $body = json_decode($response->getBody()->getContents(), true);
+ $status = $response->getStatusCode();
+
+ $msg = 'Unexpected error';
+
+ // This is an error at the load balancer, likely auth related
+ if (isset($body['error_title'])) {
+ $msg = $body['error_title'];
+ }
+
+ if (isset($body['title'])) {
+ $msg = $body['title'];
+ if (isset($body['detail'])) {
+ $msg .= ' - '.$body['detail'];
+ }
+
+ $msg .= '. See '.$body['type'];
+ }
+
+ if($status >= 400 AND $status < 500) {
+ $e = new Exception\Request($msg, $status);
+ } elseif($status >= 500 AND $status < 600) {
+ $e = new Exception\Server($msg, $status);
+ } else {
+ $e = new Exception\Exception('Unexpected HTTP Status Code');
+ throw $e;
+ }
+
+ return $e;
+ }
+
+
+}
diff --git a/vendor/nexmo/client/src/Response.php b/vendor/nexmo/client/src/Response.php
new file mode 100644
index 00000000..ff5acee1
--- /dev/null
+++ b/vendor/nexmo/client/src/Response.php
@@ -0,0 +1,121 @@
+data = json_decode($data, true);
+ }
+
+ public function getMessages()
+ {
+ if(!isset($this->data['messages'])){
+ return array();
+ }
+
+ return $this->data['messages'];
+ }
+
+ /**
+ * (PHP 5 >= 5.1.0)
+ * Count elements of an object
+ * @link http://php.net/manual/en/countable.count.php
+ * @return int The custom count as an integer.
+ *
+ *
+ * The return value is cast to an integer.
+ */
+ public function count()
+ {
+ return $this->data['message-count'];
+ }
+
+ /**
+ * (PHP 5 >= 5.0.0)
+ * Return the current element
+ * @link http://php.net/manual/en/iterator.current.php
+ * @return \Nexmo\Response\Message
+ */
+ public function current()
+ {
+ if(!isset($this->messages[$this->position])){
+ $this->messages[$this->position] = new Message($this->data['messages'][$this->position]);
+ }
+
+ return $this->messages[$this->position];
+ }
+
+ /**
+ * (PHP 5 >= 5.0.0)
+ * Move forward to next element
+ * @link http://php.net/manual/en/iterator.next.php
+ * @return void Any returned value is ignored.
+ */
+ public function next()
+ {
+ $this->position++;
+ }
+
+ /**
+ * (PHP 5 >= 5.0.0)
+ * Return the key of the current element
+ * @link http://php.net/manual/en/iterator.key.php
+ * @return int
+ */
+ public function key()
+ {
+ return $this->position;
+ }
+
+ /**
+ * (PHP 5 >= 5.0.0)
+ * Checks if current position is valid
+ * @link http://php.net/manual/en/iterator.valid.php
+ * @return boolean The return value will be casted to boolean and then evaluated.
+ * Returns true on success or false on failure.
+ */
+ public function valid()
+ {
+ return isset($this->data['messages'][$this->position]);
+ }
+
+ /**
+ * (PHP 5 >= 5.0.0)
+ * Rewind the Iterator to the first element
+ * @link http://php.net/manual/en/iterator.rewind.php
+ * @return void Any returned value is ignored.
+ */
+ public function rewind()
+ {
+ $this->position = 0;
+ }
+
+ public function toArray()
+ {
+ return $this->data;
+ }
+}
\ No newline at end of file
diff --git a/vendor/nexmo/client/src/Response/Message.php b/vendor/nexmo/client/src/Response/Message.php
new file mode 100644
index 00000000..f3088a26
--- /dev/null
+++ b/vendor/nexmo/client/src/Response/Message.php
@@ -0,0 +1,72 @@
+data = $data;
+ }
+
+ public function getStatus()
+ {
+ return $this->checkData('status');
+ }
+
+ public function getId()
+ {
+ return $this->checkData('message-id');
+ }
+
+ public function getTo()
+ {
+ return $this->checkData('to');
+ }
+
+ public function getBalance()
+ {
+ return $this->checkData('remaining-balance');
+ }
+
+ public function getPrice()
+ {
+ return $this->checkData('message-price');
+ }
+
+ public function getNetwork()
+ {
+ return $this->checkData('network');
+ }
+
+ public function getErrorMessage()
+ {
+ if(!isset($this->data['error-text'])){
+ return '';
+ }
+
+ return $this->checkData('error-text');
+ }
+
+ protected function checkData($param)
+ {
+ if(!isset($this->data[$param])){
+ throw new \RuntimeException('tried to access ' . $param . ' but data is missing');
+ }
+
+ return $this->data[$param];
+ }
+
+ public function toArray()
+ {
+ return $this->data;
+ }
+}
\ No newline at end of file
diff --git a/vendor/nexmo/client/src/User/Collection.php b/vendor/nexmo/client/src/User/Collection.php
new file mode 100644
index 00000000..00dba8d9
--- /dev/null
+++ b/vendor/nexmo/client/src/User/Collection.php
@@ -0,0 +1,194 @@
+setClient($this->getClient());
+ $idOrUser->jsonUnserialize($data);
+
+ return $idOrUser;
+ }
+
+ public function hydrateAll($users)
+ {
+ $hydrated = [];
+ foreach ($users as $u) {
+ $key = isset($u['user_id']) ? 'user_id' : 'id';
+ $user = new User($u[$key]);
+
+ // Setting the client makes us run out of memory and I'm not sure why yet
+ // $idOrUser->setClient($this->getClient());
+
+ $user->jsonUnserialize($u);
+ $hydrated[] = $user;
+ }
+
+ return $hydrated;
+ }
+
+ /**
+ * @param null $user
+ * @return $this|User
+ */
+ public function __invoke(Filter $filter = null)
+ {
+ if(!is_null($filter)){
+ $this->setFilter($filter);
+ }
+
+ return $this;
+ }
+
+ public function fetch() {
+ $this->fetchPage(self::getCollectionPath());
+ return $this->hydrateAll($this->page);
+ }
+
+ public function create($user)
+ {
+ return $this->post($user);
+ }
+
+ public function post($user)
+ {
+ if($user instanceof User){
+ $body = $user->getRequestData();
+ } else {
+ $body = $user;
+ }
+
+ $request = new Request(
+ $this->getClient()->getApiUrl() . $this->getCollectionPath()
+ ,'POST',
+ 'php://temp',
+ ['content-type' => 'application/json']
+ );
+
+ $request->getBody()->write(json_encode($body));
+ $response = $this->client->send($request);
+
+ if($response->getStatusCode() != '200'){
+ throw $this->getException($response);
+ }
+
+ $body = json_decode($response->getBody()->getContents(), true);
+ $user = new User($body['id']);
+ $user->jsonUnserialize($body);
+ $user->setClient($this->getClient());
+
+ return $user;
+ }
+
+ public function get($user)
+ {
+ if(!($user instanceof User)){
+ $user = new User($user);
+ }
+
+ $user->setClient($this->getClient());
+ $user->get();
+
+ return $user;
+ }
+
+ protected function getException(ResponseInterface $response)
+ {
+ $body = json_decode($response->getBody()->getContents(), true);
+ $status = $response->getStatusCode();
+
+ // This message isn't very useful, but we shouldn't ever see it
+ $errorTitle = 'Unexpected error';
+
+ if (isset($body['code'])) {
+ $errorTitle = $body['code'];
+ }
+
+ if (isset($body['description']) && $body['description']) {
+ $errorTitle = $body['description'];
+ }
+
+ if (isset($body['error_title'])) {
+ $errorTitle = $body['error_title'];
+ }
+
+ if($status >= 400 AND $status < 500) {
+ $e = new Exception\Request($errorTitle, $status);
+ } elseif($status >= 500 AND $status < 600) {
+ $e = new Exception\Server($errorTitle, $status);
+ } else {
+ $e = new Exception\Exception('Unexpected HTTP Status Code');
+ throw $e;
+ }
+
+ return $e;
+ }
+
+ public function offsetExists($offset)
+ {
+ return true;
+ }
+
+ /**
+ * @param mixed $user
+ * @return User
+ */
+ public function offsetGet($user)
+ {
+ if(!($user instanceof User)){
+ $user = new User($user);
+ }
+
+ $user->setClient($this->getClient());
+ return $user;
+ }
+
+ public function offsetSet($offset, $value)
+ {
+ throw new \RuntimeException('can not set collection properties');
+ }
+
+ public function offsetUnset($offset)
+ {
+ throw new \RuntimeException('can not unset collection properties');
+ }
+}
diff --git a/vendor/nexmo/client/src/User/User.php b/vendor/nexmo/client/src/User/User.php
new file mode 100644
index 00000000..928bd922
--- /dev/null
+++ b/vendor/nexmo/client/src/User/User.php
@@ -0,0 +1,138 @@
+data['id'] = $id;
+ }
+
+ public function setName($name)
+ {
+ $this->data['name'] = $name;
+ return $this;
+ }
+
+ public function getId()
+ {
+ return $this->data['id'];
+ }
+
+ public function __toString()
+ {
+ return (string)$this->getId();
+ }
+
+
+ public function get()
+ {
+ $request = new Request(
+ $this->getClient()->getApiUrl() . Collection::getCollectionPath() . '/' . $this->getId()
+ ,'GET'
+ );
+
+ $response = $this->getClient()->send($request);
+
+ if($response->getStatusCode() != '200'){
+ throw $this->getException($response);
+ }
+
+ $data = json_decode($response->getBody()->getContents(), true);
+ $this->jsonUnserialize($data);
+
+ return $this;
+ }
+
+ public function getConversations() {
+ $response = $this->getClient()->get(
+ $this->getClient()->getApiUrl() . Collection::getCollectionPath().'/'.$this->getId().'/conversations'
+ );
+
+ if($response->getStatusCode() != '200'){
+ throw $this->getException($response);
+ }
+
+ $data = json_decode($response->getBody()->getContents(), true);
+ $conversationCollection = $this->getClient()->conversation();
+
+ return $conversationCollection->hydrateAll($data);
+ }
+
+ public function jsonSerialize()
+ {
+ return $this->data;
+ }
+
+ public function jsonUnserialize(array $json)
+ {
+ $this->data = $json;
+ }
+
+ public function getRequestDataForConversation()
+ {
+ return [
+ 'user_id' => $this->getId()
+ ];
+ }
+
+ protected function getException(ResponseInterface $response)
+ {
+ $body = json_decode($response->getBody()->getContents(), true);
+ $status = $response->getStatusCode();
+
+ // This message isn't very useful, but we shouldn't ever see it
+ $errorTitle = 'Unexpected error';
+
+ if (isset($body['code'])) {
+ $errorTitle = $body['code'];
+ }
+
+ if (isset($body['description']) && $body['description']) {
+ $errorTitle = $body['description'];
+ }
+
+ if (isset($body['error_title'])) {
+ $errorTitle = $body['error_title'];
+ }
+
+ if($status >= 400 AND $status < 500) {
+ $e = new Exception\Request($errorTitle, $status);
+ } elseif($status >= 500 AND $status < 600) {
+ $e = new Exception\Server($errorTitle, $status);
+ } else {
+ $e = new Exception\Exception('Unexpected HTTP Status Code');
+ throw $e;
+ }
+
+ return $e;
+ }
+
+
+}
diff --git a/vendor/nexmo/client/src/Verify/Check.php b/vendor/nexmo/client/src/Verify/Check.php
new file mode 100644
index 00000000..1857b092
--- /dev/null
+++ b/vendor/nexmo/client/src/Verify/Check.php
@@ -0,0 +1,48 @@
+data = $data;
+ }
+
+ public function getCode()
+ {
+ return $this->data['code'];
+ }
+
+ public function getDate()
+ {
+ return new \DateTime($this->data['date_received']);
+ }
+
+ public function getStatus()
+ {
+ return $this->data['status'];
+ }
+
+ public function getIpAddress()
+ {
+ return $this->data['ip_address'];
+ }
+}
\ No newline at end of file
diff --git a/vendor/nexmo/client/src/Verify/Client.php b/vendor/nexmo/client/src/Verify/Client.php
new file mode 100644
index 00000000..5bf68eb9
--- /dev/null
+++ b/vendor/nexmo/client/src/Verify/Client.php
@@ -0,0 +1,231 @@
+createVerificationFromArray($verification);
+ }
+
+ $params = $verification->getRequestData(false);
+
+ $request = $this->getRequest($params);
+ $response = $this->client->send($request);
+
+ $data = $this->processReqRes($verification, $request, $response, true);
+ return $this->checkError($verification, $data);
+ }
+
+ public function search($verification)
+ {
+ if(!($verification instanceof Verification)){
+ $verification = new Verification($verification);
+ }
+
+ $params = [
+ 'request_id' => $verification->getRequestId()
+ ];
+
+ $request = $this->getRequest($params, 'search');
+ $response = $this->client->send($request);
+
+ $data = $this->processReqRes($verification, $request, $response, true);
+
+ if(!isset($data['status'])){
+ throw new Exception\Exception('unexpected response from API');
+ }
+
+ //verify API returns text status on success
+ if(!is_numeric($data['status'])){
+ return $verification;
+ }
+
+ //normalize errors (client vrs server)
+ switch($data['status']){
+ case '5':
+ $e = new Exception\Server($data['error_text'], $data['status']);
+ break;
+ default:
+ $e = new Exception\Request($data['error_text'], $data['status']);
+ break;
+ }
+
+ $e->setEntity($verification);
+ throw $e;
+ }
+
+ public function cancel($verification)
+ {
+ return $this->control($verification, 'cancel');
+ }
+
+ public function trigger($verification)
+ {
+ return $this->control($verification, 'trigger_next_event');
+ }
+
+ public function check($verification, $code, $ip = null)
+ {
+ if(!($verification instanceof Verification)){
+ $verification = new Verification($verification);
+ }
+
+ $params = [
+ 'request_id' => $verification->getRequestId(),
+ 'code' => $code
+ ];
+
+ if(!is_null($ip)){
+ $params['ip'] = $ip;
+ }
+
+ $request = $this->getRequest($params, 'check');
+ $response = $this->client->send($request);
+
+ $data = $this->processReqRes($verification, $request, $response, false);
+ return $this->checkError($verification, $data);
+ }
+
+ public function serialize(Verification $verification)
+ {
+ return serialize($verification);
+ }
+
+ public function unserialize($verification)
+ {
+ if(is_string($verification)){
+ $verification = unserialize($verification);
+ }
+
+ if(!($verification instanceof Verification)){
+ throw new \InvalidArgumentException('expected verification object or serialize verification object');
+ }
+
+ $verification->setClient($this);
+ return $verification;
+ }
+
+ protected function control($verification, $cmd)
+ {
+ if(!($verification instanceof Verification)){
+ $verification = new Verification($verification);
+ }
+
+ $params = [
+ 'request_id' => $verification->getRequestId(),
+ 'cmd' => $cmd
+ ];
+
+ $request = $this->getRequest($params, 'control');
+ $response = $this->client->send($request);
+
+ $data = $this->processReqRes($verification, $request, $response, false);
+ return $this->checkError($verification, $data);
+ }
+
+ protected function checkError(Verification $verification, $data)
+ {
+ if(!isset($data['status'])){
+ throw new Exception\Exception('unexpected response from API');
+ }
+
+ //normalize errors (client vrs server)
+ switch($data['status']){
+ case '0':
+ return $verification;
+ case '5':
+ $e = new Exception\Server($data['error_text'], $data['status']);
+ break;
+ default:
+ $e = new Exception\Request($data['error_text'], $data['status']);
+ break;
+ }
+
+ $e->setEntity($verification);
+ throw $e;
+ }
+
+ protected function processReqRes(Verification $verification, RequestInterface $req, ResponseInterface $res, $replace = true)
+ {
+ $verification->setClient($this);
+
+ if($replace || !$verification->getRequest()){
+ $verification->setRequest($req);
+ }
+
+ if($replace || !$verification->getResponse()) {
+ $verification->setResponse($res);
+ return $verification->getResponseData();
+ }
+
+ if($res->getBody()->isSeekable()){
+ $res->getBody()->rewind();
+ }
+
+ return json_decode($res->getBody()->getContents(), true);
+ }
+
+ protected function getRequest($params, $path = null)
+ {
+ if(!is_null($path)){
+ $path = '/verify/' . $path . '/json';
+ } else {
+ $path = '/verify/json';
+ }
+
+ $request = new Request(
+ $this->getClient()->getApiUrl() . $path,
+ 'POST',
+ 'php://temp',
+ [
+ 'content-type' => 'application/json'
+ ]
+ );
+
+ $request->getBody()->write(json_encode($params));
+ return $request;
+ }
+
+ /**
+ * @param $array
+ * @return Verification
+ */
+ protected function createVerificationFromArray($array)
+ {
+ if(!is_array($array)){
+ throw new \RuntimeException('verification must implement `' . VerificationInterface::class . '` or be an array`');
+ }
+
+ foreach(['number', 'brand'] as $param){
+ if(!isset($array[$param])){
+ throw new \InvalidArgumentException('missing expected key `' . $param . '`');
+ }
+ }
+
+ $number = $array['number'];
+ $brand = $array['brand'];
+
+ unset($array['number']);
+ unset($array['brand']);
+
+ return new Verification($number, $brand, $array);
+ }
+}
diff --git a/vendor/nexmo/client/src/Verify/Verification.php b/vendor/nexmo/client/src/Verify/Verification.php
new file mode 100644
index 00000000..9fee6ab9
--- /dev/null
+++ b/vendor/nexmo/client/src/Verify/Verification.php
@@ -0,0 +1,596 @@
+dirty = false;
+ $this->requestData['request_id'] = $idOrNumber;
+ } else {
+ $this->dirty = true;
+ $this->requestData['number'] = $idOrNumber;
+ $this->requestData['brand'] = $brand;
+ $this->requestData = array_merge($this->requestData, $additional);
+ }
+ }
+
+ /**
+ * Allow Verification to have actions.
+ *
+ * @param Client $client Verify Client
+ * @return $this
+ */
+ public function setClient(Client $client)
+ {
+ $this->client = $client;
+ return $this;
+ }
+
+ /**
+ * @return Client
+ */
+ protected function useClient()
+ {
+ if(isset($this->client)){
+ return $this->client;
+ }
+
+ throw new \RuntimeException('can not act on the verification directly unless a verify client has been set');
+ }
+
+ /**
+ * Check if the code is correct. Unlike the method it proxies, an invalid code does not throw an exception.
+ *
+ * @uses \Nexmo\Verify\Client::check()
+ * @param string $code Numeric code provided by the user.
+ * @param null|string $ip IP address to be used for the verification.
+ * @return bool Code is valid.
+ * @throws RequestException
+ */
+ public function check($code, $ip = null)
+ {
+ try {
+ $this->useClient()->check($this, $code, $ip);
+ return true;
+ } catch(RequestException $e) {
+ if($e->getCode() == 16 || $e->getCode() == 17){
+ return false;
+ }
+
+ throw $e;
+ }
+ }
+
+ /**
+ * Cancel the verification.
+ *
+ * @uses \Nexmo\Verify\Client::cancel()
+ */
+ public function cancel()
+ {
+ $this->useClient()->cancel($this);
+ }
+
+ /**
+ * Trigger the next verification.
+ *
+ * @uses \Nexmo\Verify\Client::trigger()
+ */
+ public function trigger()
+ {
+ $this->useClient()->trigger($this);
+ }
+
+ /**
+ * Update Verification from the API.
+ *
+ * @uses \Nexmo\Verify\Client::search()
+ */
+ public function sync()
+ {
+ $this->useClient()->search($this);
+ }
+
+ /**
+ * Check if the user provided data has sent to the API yet.
+ *
+ * @return bool
+ */
+ public function isDirty()
+ {
+ return $this->dirty;
+ }
+
+ /**
+ * If do not set number in international format or you are not sure if number is correctly formatted, set country
+ * with the two-character country code. For example, GB, US. Verify works out the international phone number for
+ * you.
+ * @link https://docs.nexmo.com/verify/api-reference/api-reference#vrequest
+ *
+ * Can only be set before the verification is created.
+ * @uses \Nexmo\Entity\RequestArrayTrait::setRequestData
+ *
+ * @param $country
+ * @return $this
+ * @throws \Exception
+ */
+ public function setCountry($country)
+ {
+ return $this->setRequestData('country', $country);
+ }
+
+ /**
+ * An 11 character alphanumeric string to specify the SenderID for SMS sent by Verify. Depending on the destination
+ * of the phone number you are applying, restrictions may apply. By default, sender_id is VERIFY.
+ * @link https://docs.nexmo.com/verify/api-reference/api-reference#vrequest
+ *
+ * Can only be set before the verification is created.
+ * @uses \Nexmo\Entity\RequestArrayTrait::setRequestData
+ *
+ * @param $id
+ * @return $this
+ * @throws \Exception
+ */
+ public function setSenderId($id)
+ {
+ return $this->setRequestData('sender_id', $id);
+ }
+
+ /**
+ * The length of the PIN. Possible values are 6 or 4 characters. The default value is 4.
+ * @link https://docs.nexmo.com/verify/api-reference/api-reference#vrequest
+ *
+ * Can only be set before the verification is created.
+ * @uses \Nexmo\Entity\RequestArrayTrait::setRequestData
+ *
+ * @param $length
+ * @return $this
+ * @throws \Exception
+ */
+ public function setCodeLength($length)
+ {
+ return $this->setRequestData('code_length', $length);
+ }
+
+ /**
+ * By default, TTS are generated in the locale that matches number. For example, the TTS for a 33* number is sent in
+ * French. Use this parameter to explicitly control the language, accent and gender used for the Verify request. The
+ * default language is en-us.
+ * @link https://docs.nexmo.com/verify/api-reference/api-reference#vrequest
+ *
+ * Can only be set before the verification is created.
+ * @uses \Nexmo\Entity\RequestArrayTrait::setRequestData
+ *
+ * @param $language
+ * @return $this
+ * @throws \Exception
+ */
+ public function setLanguage($language)
+ {
+ return $this->setRequestData('lg', $language);
+ }
+
+ /**
+ * Restrict verification to a certain network type. Possible values are:
+ * - All (Default)
+ * - Mobile
+ * - Landline
+ *
+ * Note: contact support@nexmo.com to enable this feature.
+ * @link https://docs.nexmo.com/verify/api-reference/api-reference#vrequest
+ *
+ * Can only be set before the verification is created.
+ * @uses \Nexmo\Entity\RequestArrayTrait::setRequestData
+ *
+ * @param $type
+ * @return $this
+ * @throws \Exception
+ */
+ public function setRequireType($type)
+ {
+ return $this->setRequestData('require_type', $type);
+ }
+
+ /**
+ * The PIN validity time from generation. This is an integer value between 30 and 3600 seconds. The default is 300
+ * seconds. When specified together, pin_expiry must be an integer multiple of next_event_wait. Otherwise,
+ * pin_expiry is set to next_event_wait.
+ * @link https://docs.nexmo.com/verify/api-reference/api-reference#vrequest
+ *
+ * Can only be set before the verification is created.
+ * @uses \Nexmo\Entity\RequestArrayTrait::setRequestData
+ *
+ * @param $time
+ * @return $this
+ * @throws \Exception
+ */
+ public function setPinExpiry($time)
+ {
+ return $this->setRequestData('pin_expiry', $time);
+ }
+
+ /**
+ * An integer value between 60 and 900 seconds inclusive that specifies the wait time between attempts to deliver
+ * the PIN. Verify calculates the default value based on the average time taken by users to complete verification.
+ * @link https://docs.nexmo.com/verify/api-reference/api-reference#vrequest
+ *
+ * Can only be set before the verification is created.
+ * @uses \Nexmo\Entity\RequestArrayTrait::setRequestData
+ *
+ * @param $time
+ * @return $this
+ * @throws \Exception
+ */
+ public function setWaitTime($time)
+ {
+ return $this->setRequestData('next_event_wait', $time);
+ }
+
+ /**
+ * Get the verification request id, if available.
+ *
+ * @uses \Nexmo\Verify\Verification::proxyArrayAccess()
+ *
+ * @return string|null
+ */
+ public function getRequestId()
+ {
+ return $this->proxyArrayAccess('request_id');
+ }
+
+ /**
+ * Get the number verified / to be verified.
+ *
+ * @see \Nexmo\Verify\Verification::__construct()
+ * @uses \Nexmo\Verify\Verification::proxyArrayAccess()
+ *
+ * @return string|null
+ */
+ public function getNumber()
+ {
+ return $this->proxyArrayAccess('number');
+ }
+
+ /**
+ * Get the account id, if available.
+ *
+ * Only available after a searching for a verification.
+ * @see \Nexmo\Verify\Client::search();
+ *
+ * However still @uses \Nexmo\Verify\Verification::proxyArrayAccess()
+ *
+ * @return string|null
+ */
+ public function getAccountId()
+ {
+ return $this->proxyArrayAccess('account_id');
+ }
+
+ /**
+ * Get the sender id, if available.
+ *
+ * @see \Nexmo\Verify\Verification::setSenderId();
+ * @see \Nexmo\Verify\Client::search();
+ *
+ * @uses \Nexmo\Verify\Verification::proxyArrayAccess()
+ *
+ * @return string|null
+ */
+ public function getSenderId()
+ {
+ return $this->proxyArrayAccess('sender_id');
+ }
+
+ /**
+ * Get the price of the verification, if available.
+ *
+ * Only available after a searching for a verification.
+ * @see \Nexmo\Verify\Client::search();
+ *
+ * However still @uses \Nexmo\Verify\Verification::proxyArrayAccess()
+ *
+ * @return string|null
+ */
+ public function getPrice()
+ {
+ return $this->proxyArrayAccess('price');
+ }
+
+ /**
+ * Get the currency used to price the verification, if available.
+ *
+ * Only available after a searching for a verification.
+ * @see \Nexmo\Verify\Client::search();
+ *
+ * However still @uses \Nexmo\Verify\Verification::proxyArrayAccess()
+ *
+ * @return string|null
+ */
+ public function getCurrency()
+ {
+ return $this->proxyArrayAccess('currency');
+ }
+
+ /**
+ * Get the status of the verification, if available.
+ *
+ * Only available after a searching for a verification.
+ * @see \Nexmo\Verify\Client::search();
+ *
+ * However still @uses \Nexmo\Verify\Verification::proxyArrayAccess()
+ *
+ * @return string|null
+ */
+ public function getStatus()
+ {
+ return $this->proxyArrayAccess('status');
+ }
+
+ /**
+ * Get an array of verification checks, if available. Will return an empty array if no check have been made, or if
+ * the data is not available.
+ *
+ * Only available after a searching for a verification.
+ * @see \Nexmo\Verify\Client::search();
+ *
+ * However still @uses \Nexmo\Verify\Verification::proxyArrayAccess()
+ *
+ * @return \Nexmo\Verify\Check[]|\Nexmo\Verify\Check
+ */
+ public function getChecks()
+ {
+ $checks = $this->proxyArrayAccess('checks');
+ if(!$checks){
+ return [];
+ }
+
+ foreach($checks as $i => $check) {
+ $checks[$i] = new Check($check);
+ }
+
+ return $checks;
+ }
+
+ /**
+ * Get the date the verification started.
+ *
+ * Only available after a searching for a verification.
+ * @see \Nexmo\Verify\Client::search();
+ *
+ * However still @uses \Nexmo\Verify\Verification::proxyArrayAccessDate()
+ *
+ * @return \DateTime|null
+ */
+ public function getSubmitted()
+ {
+ return $this->proxyArrayAccessDate('date_submitted');
+ }
+
+ /**
+ * Get the date the verification stopped.
+ *
+ * Only available after a searching for a verification.
+ * @see \Nexmo\Verify\Client::search();
+ *
+ * However still @uses \Nexmo\Verify\Verification::proxyArrayAccessDate()
+ *
+ * @return \DateTime|null
+ */
+ public function getFinalized()
+ {
+ return $this->proxyArrayAccessDate('date_finalized');
+ }
+
+ /**
+ * Get the date of the first verification event.
+ *
+ * Only available after a searching for a verification.
+ * @see \Nexmo\Verify\Client::search();
+ *
+ * However still @uses \Nexmo\Verify\Verification::proxyArrayAccessDate()
+ *
+ * @return \DateTime|null
+ */
+ public function getFirstEvent()
+ {
+ return $this->proxyArrayAccessDate('first_event_date');
+ }
+
+ /**
+ * Get the date of the last verification event.
+ *
+ * Only available after a searching for a verification.
+ * @see \Nexmo\Verify\Client::search();
+ *
+ * However still @uses \Nexmo\Verify\Verification::proxyArrayAccessDate()
+ *
+ * @return \DateTime|null
+ */
+ public function getLastEvent()
+ {
+ return $this->proxyArrayAccessDate('last_event_date');
+ }
+
+ /**
+ * Proxies `proxyArrayAccess()` and returns a DateTime if the parameter is found.
+ * @uses \Nexmo\Verify\Verification::proxyArrayAccess()
+ *
+ * @param string $param Parameter to look for.
+ * @return \DateTime
+ */
+ protected function proxyArrayAccessDate($param)
+ {
+ $date = $this->proxyArrayAccess($param);
+ if($date) {
+ return new \DateTime($date);
+ }
+ }
+
+ /**
+ * Simply proxies array access to check for a parameter in the response, request, or user provided data.
+ *
+ * @uses \Nexmo\Verify\Verification::offsetGet();
+ * @uses \Nexmo\Verify\Verification::offsetExists();
+ *
+ * @param string $param Parameter to look for.
+ * @return mixed
+ */
+ protected function proxyArrayAccess($param)
+ {
+ if(isset($this[$param])){
+ return $this[$param];
+ }
+ }
+
+ /**
+ * Allow the object to access the data from the API response, a sent API request, or the user set data that the
+ * request will be created from - in that order.
+ *
+ * @param mixed $offset
+ * @return bool
+ * @throws \Exception
+ */
+ public function offsetExists($offset)
+ {
+ $response = $this->getResponseData();
+ $request = $this->getRequestData();
+ $dirty = $this->requestData;
+ return isset($response[$offset]) || isset($request[$offset]) || isset($dirty[$offset]);
+ }
+
+ /**
+ * Allow the object to access the data from the API response, a sent API request, or the user set data that the
+ * request will be created from - in that order.
+ *
+ * @param mixed $offset
+ * @return mixed
+ * @throws \Exception
+ */
+ public function offsetGet($offset)
+ {
+ $response = $this->getResponseData();
+ $request = $this->getRequestData();
+ $dirty = $this->requestData;
+
+ if(isset($response[$offset])){
+ return $response[$offset];
+ }
+
+ if(isset($request[$offset])){
+ return $request[$offset];
+ }
+
+ if(isset($dirty[$offset])){
+ return $dirty[$offset];
+ }
+ }
+
+ /**
+ * All properties are read only.
+ *
+ * @param mixed $offset
+ * @param mixed $value
+ */
+ public function offsetSet($offset, $value)
+ {
+ throw $this->getReadOnlyException($offset);
+ }
+
+ /**
+ * All properties are read only.
+ *
+ * @param mixed $offset
+ */
+ public function offsetUnset($offset)
+ {
+ throw $this->getReadOnlyException($offset);
+ }
+
+ /**
+ * All properties are read only.
+ *
+ * @param $offset
+ * @return \RuntimeException
+ */
+ protected function getReadOnlyException($offset)
+ {
+ return new \RuntimeException(sprintf(
+ 'can not modify `%s` using array access',
+ $offset
+ ));
+ }
+
+ public function serialize()
+ {
+ $data = [
+ 'requestData' => $this->requestData
+ ];
+
+ if($request = $this->getRequest()){
+ $data['request'] = \Zend\Diactoros\Request\Serializer::toString($request);
+ }
+
+ if($response = $this->getResponse()){
+ $data['response'] = \Zend\Diactoros\Response\Serializer::toString($response);
+ }
+
+ return serialize($data);
+ }
+
+ public function unserialize($serialized)
+ {
+ $data = unserialize($serialized);
+
+ $this->requestData = $data['requestData'];
+
+ if(isset($data['request'])){
+ $this->request = \Zend\Diactoros\Request\Serializer::fromString($data['request']);
+ }
+
+ if(isset($data['response'])){
+ $this->response = \Zend\Diactoros\Response\Serializer::fromString($data['response']);
+ }
+ }
+
+
+}
\ No newline at end of file
diff --git a/vendor/nexmo/client/src/Verify/VerificationInterface.php b/vendor/nexmo/client/src/Verify/VerificationInterface.php
new file mode 100644
index 00000000..cad2e8fa
--- /dev/null
+++ b/vendor/nexmo/client/src/Verify/VerificationInterface.php
@@ -0,0 +1,22 @@
+params['answer_url'] = $url;
+ $this->params['to'] = $to;
+
+ if(!is_null($from)){
+ $this->params['from'] = $from;
+ }
+ }
+
+ public function setAnswer($url, $method = null)
+ {
+ $this->params['answer_url'] = $url;
+ if(!is_null($method)){
+ $this->params['answer_method'] = $method;
+ } else {
+ unset($this->params['answer_method']);
+ }
+
+ return $this;
+ }
+
+ public function setError($url, $method = null)
+ {
+ $this->params['error_url'] = $url;
+ if(!is_null($method)){
+ $this->params['error_method'] = $method;
+ } else {
+ unset($this->params['error_method']);
+ }
+
+ return $this;
+ }
+
+ public function setStatus($url, $method = null)
+ {
+ $this->params['status_url'] = $url;
+ if(!is_null($method)){
+ $this->params['status_method'] = $method;
+ } else {
+ unset($this->params['status_method']);
+ }
+
+ return $this;
+ }
+
+
+ public function setMachineDetection($hangup = true, $timeout = null)
+ {
+ $this->params['machine_detection'] = ($hangup ? 'hangup' : 'true');
+ if(!is_null($timeout)){
+ $this->params['machine_timeout'] = (int) $timeout;
+ } else {
+ unset($this->params['machine_timeout']);
+ }
+
+ return $this;
+ }
+
+ /**
+ * @return string
+ */
+ public function getURI()
+ {
+ return '/call/json';
+ }
+
+}
\ No newline at end of file
diff --git a/vendor/nexmo/client/src/Voice/Call/Inbound.php b/vendor/nexmo/client/src/Voice/Call/Inbound.php
new file mode 100644
index 00000000..2166d004
--- /dev/null
+++ b/vendor/nexmo/client/src/Voice/Call/Inbound.php
@@ -0,0 +1,15 @@
+data['call-id'];
+ }
+
+ public function getTo()
+ {
+ return $this->data['to'];
+ }
+
+ public function getStatus()
+ {
+ return $this->data['status'];
+ }
+
+ public function getPrice()
+ {
+ return $this->data['call-price'];
+ }
+
+ public function getRate()
+ {
+ return $this->data['call-rate'];
+ }
+
+ public function getDuration()
+ {
+ return $this->data['call-duration'];
+ }
+
+ public function getCreated()
+ {
+ return \DateTime::createFromFormat(self::TIME_FORMAT, $this->data['call-request']);
+ }
+
+ public function getStart()
+ {
+ if(!isset($this->data['call-start'])){
+ return null;
+ }
+
+ return \DateTime::createFromFormat(self::TIME_FORMAT, $this->data['call-start']);
+ }
+
+ public function getEnd()
+ {
+ if(!isset($this->data['call-end'])){
+ return null;
+ }
+
+ return \DateTime::createFromFormat(self::TIME_FORMAT, $this->data['call-end']);
+ }
+
+ public function getNetwork()
+ {
+ return $this->data['network-code'];
+ }
+
+}
\ No newline at end of file
diff --git a/vendor/nexmo/client/src/Voice/Message/Message.php b/vendor/nexmo/client/src/Voice/Message/Message.php
new file mode 100644
index 00000000..3986944d
--- /dev/null
+++ b/vendor/nexmo/client/src/Voice/Message/Message.php
@@ -0,0 +1,73 @@
+params['text'] = $text;
+ $this->params['to'] = $to;
+ $this->params['from'] = $from;
+ }
+
+ public function setLanguage($lang)
+ {
+ $this->params['lg'] = $lang;
+ return $this;
+ }
+
+ public function setVoice($voice)
+ {
+ $this->params['voice'] = $voice;
+ return $this;
+ }
+
+ public function setRepeat($count)
+ {
+ $this->params['repeat'] = (int) $count;
+ return $this;
+ }
+ public function setCallback($url, $method = null)
+ {
+ $this->params['callback'] = $url;
+ if(!is_null($method)){
+ $this->params['callback_method'] = $method;
+ } else {
+ unset($this->params['callback_method']);
+ }
+
+ return $this;
+ }
+
+ public function setMachineDetection($hangup = true, $timeout = null)
+ {
+ $this->params['machine_detection'] = ($hangup ? 'hangup' : 'true');
+ if(!is_null($timeout)){
+ $this->params['machine_timeout'] = (int) $timeout;
+ } else {
+ unset($this->params['machine_timeout']);
+ }
+
+ return $this;
+ }
+
+ /**
+ * @return string
+ */
+ public function getURI()
+ {
+ return '/tts/json';
+ }
+
+}
\ No newline at end of file
diff --git a/vendor/nikic/php-parser/.travis.yml b/vendor/nikic/php-parser/.travis.yml
index ee8eba99..b6abb965 100644
--- a/vendor/nikic/php-parser/.travis.yml
+++ b/vendor/nikic/php-parser/.travis.yml
@@ -1,5 +1,5 @@
language: php
-dist: trusty
+dist: xenial
sudo: false
cache:
@@ -10,6 +10,7 @@ php:
- 7.0
- 7.1
- 7.2
+ - 7.3
- nightly
install:
diff --git a/vendor/nikic/php-parser/CHANGELOG.md b/vendor/nikic/php-parser/CHANGELOG.md
index 4a3f0063..4210eeb2 100644
--- a/vendor/nikic/php-parser/CHANGELOG.md
+++ b/vendor/nikic/php-parser/CHANGELOG.md
@@ -1,8 +1,20 @@
-Version 4.1.1-dev
+Version 4.1.2-dev
-----------------
Nothing yet.
+Version 4.1.1 (2018-12-26)
+--------------------------
+
+### Fixed
+
+* Fix "undefined offset" notice when parsing specific malformed code (#551).
+* Remove assertion when pretty printing anonymous class with a name (#554).
+
+### Added
+
+* Support error recovery for missing return type (`function foo() : {}`) (#544).
+
Version 4.1.0 (2018-10-10)
--------------------------
@@ -17,7 +29,7 @@ Version 4.1.0 (2018-10-10)
and some cases which we do not expect to occur in practice (such as flexible doc strings being
nested within each other through abuse of variable-variable interpolation syntax) may not be
recognized correctly.
-* Added `DONT_TRAVERSER_CURRENT_AND_CHILDREN` to `NodeTraverser` to skip both traversal of child
+* Added `DONT_TRAVERSE_CURRENT_AND_CHILDREN` to `NodeTraverser` to skip both traversal of child
nodes, and prevent subsequent visitors from visiting the current node.
Version 4.0.4 (2018-09-18)
diff --git a/vendor/nikic/php-parser/README.md b/vendor/nikic/php-parser/README.md
index 5ae789f9..e62748eb 100644
--- a/vendor/nikic/php-parser/README.md
+++ b/vendor/nikic/php-parser/README.md
@@ -3,7 +3,7 @@ PHP Parser
[](https://travis-ci.org/nikic/PHP-Parser) [](https://coveralls.io/github/nikic/PHP-Parser?branch=master)
-This is a PHP 5.2 to PHP 7.2 parser written in PHP. Its purpose is to simplify static code analysis and
+This is a PHP 5.2 to PHP 7.3 parser written in PHP. Its purpose is to simplify static code analysis and
manipulation.
[**Documentation for version 4.x**][doc_master] (stable; for running on PHP >= 7.0; for parsing PHP 5.2 to PHP 7.3).
diff --git a/vendor/nikic/php-parser/doc/0_Introduction.markdown b/vendor/nikic/php-parser/doc/0_Introduction.markdown
index 240f7fde..abc40f2b 100644
--- a/vendor/nikic/php-parser/doc/0_Introduction.markdown
+++ b/vendor/nikic/php-parser/doc/0_Introduction.markdown
@@ -1,7 +1,7 @@
Introduction
============
-This project is a PHP 5.2 to PHP 7.2 parser **written in PHP itself**.
+This project is a PHP 5.2 to PHP 7.3 parser **written in PHP itself**.
What is this for?
-----------------
@@ -26,11 +26,11 @@ programmatic PHP code analysis are incidentally PHP developers, not C developers
What can it parse?
------------------
-The parser supports parsing PHP 5.2-7.2.
+The parser supports parsing PHP 5.2-7.3.
As the parser is based on the tokens returned by `token_get_all` (which is only able to lex the PHP
version it runs on), additionally a wrapper for emulating tokens from newer versions is provided.
-This allows to parse PHP 7.2 source code running on PHP 5.5, for example. This emulation is somewhat
+This allows to parse PHP 7.3 source code running on PHP 7.0, for example. This emulation is somewhat
hacky and not perfect, but it should work well on any sane code.
What output does it produce?
diff --git a/vendor/nikic/php-parser/doc/2_Usage_of_basic_components.markdown b/vendor/nikic/php-parser/doc/2_Usage_of_basic_components.markdown
index 462b5637..9a809ec8 100644
--- a/vendor/nikic/php-parser/doc/2_Usage_of_basic_components.markdown
+++ b/vendor/nikic/php-parser/doc/2_Usage_of_basic_components.markdown
@@ -339,7 +339,8 @@ All four methods can either return the changed node or not return at all (i.e. `
case the current node is not changed.
The `enterNode()` method can additionally return the value `NodeTraverser::DONT_TRAVERSE_CHILDREN`,
-which instructs the traverser to skip all children of the current node.
+which instructs the traverser to skip all children of the current node. To furthermore prevent subsequent
+visitors from visiting the current node, `NodeTraverser::DONT_TRAVERSE_CURRENT_AND_CHILDREN` can be used instead.
The `leaveNode()` method can additionally return the value `NodeTraverser::REMOVE_NODE`, in which
case the current node will be removed from the parent array. Furthermore it is possible to return
diff --git a/vendor/nikic/php-parser/doc/component/JSON_representation.markdown b/vendor/nikic/php-parser/doc/component/JSON_representation.markdown
index a4d39335..47c3429c 100644
--- a/vendor/nikic/php-parser/doc/component/JSON_representation.markdown
+++ b/vendor/nikic/php-parser/doc/component/JSON_representation.markdown
@@ -116,8 +116,8 @@ The JSON representation may be converted back into an AST using the `JsonDecoder
```php
decode($json);
+$jsonDecoder = new PhpParser\JsonDecoder();
+$ast = $jsonDecoder->decode($json);
```
Note that not all ASTs can be represented using JSON. In particular:
@@ -128,4 +128,4 @@ Note that not all ASTs can be represented using JSON. In particular:
If the node tree is not representable in JSON, the initial `json_encode()` call will fail.
-From the command line, a JSON dump can be obtained using `vendor/bin/php-parse -j file.php`.
\ No newline at end of file
+From the command line, a JSON dump can be obtained using `vendor/bin/php-parse -j file.php`.
diff --git a/vendor/nikic/php-parser/doc/component/Walking_the_AST.markdown b/vendor/nikic/php-parser/doc/component/Walking_the_AST.markdown
index fd979d5a..69af1e83 100644
--- a/vendor/nikic/php-parser/doc/component/Walking_the_AST.markdown
+++ b/vendor/nikic/php-parser/doc/component/Walking_the_AST.markdown
@@ -215,7 +215,7 @@ once you found it:
private $class = null;
public function enterNode(Node $node) {
if ($node instanceof Node\Stmt\Class_ &&
- $node->namespaceName->toString() === 'Foo\Bar\Baz'
+ $node->namespacedName->toString() === 'Foo\Bar\Baz'
) {
$this->class = $node;
return NodeTraverser::STOP_TRAVERSAL;
@@ -235,7 +235,7 @@ A single traverser can be used with multiple visitors:
$traverser = new NodeTraverser;
$traverser->addVisitor($visitorA);
$traverser->addVisitor($visitorB);
-$stmts = $traverser->traverser($stmts);
+$stmts = $traverser->traverse($stmts);
```
It is important to understand that if a traverser is run with multiple visitors, the visitors will
@@ -281,6 +281,8 @@ special enterNode/leaveNode return values:
* If *any* visitor returns `DONT_TRAVERSE_CHILDREN`, the children will be skipped for *all*
visitors.
+ * If *any* visitor returns `DONT_TRAVERSE_CURRENT_AND_CHILDREN`, the children will be skipped for *all*
+ visitors, and all *subsequent* visitors will not visit the current node.
* If *any* visitor returns `STOP_TRAVERSAL`, traversal is stopped for *all* visitors.
* If a visitor returns a replacement node, subsequent visitors will be passed the replacement node,
not the original one.
@@ -305,7 +307,7 @@ $nodeFinder = new NodeFinder;
$classes = $nodeFinder->findInstanceOf($stmts, Node\Stmt\Class_::class);
// Find all classes that extend another class
-$extendingClasses = $nodeFinder->findInstanceOf($stmts, function(Node $node) {
+$extendingClasses = $nodeFinder->find($stmts, function(Node $node) {
return $node instanceof Node\Stmt\Class_
&& $node->extends !== null;
});
@@ -332,4 +334,4 @@ reverse direction: When working on a node, you might want to check if the parent
certain property.
PHP-Parser does not add parent (or sibling) references to nodes by itself, but you can easily
-emulate this with a visitor. See the [FAQ](FAQ.markdown) for more information.
\ No newline at end of file
+emulate this with a visitor. See the [FAQ](FAQ.markdown) for more information.
diff --git a/vendor/nikic/php-parser/grammar/php7.y b/vendor/nikic/php-parser/grammar/php7.y
index f7d32ef4..681fda0a 100644
--- a/vendor/nikic/php-parser/grammar/php7.y
+++ b/vendor/nikic/php-parser/grammar/php7.y
@@ -477,6 +477,7 @@ optional_param_type:
optional_return_type:
/* empty */ { $$ = null; }
| ':' type_expr { $$ = $2; }
+ | ':' error { $$ = null; }
;
argument_list:
@@ -958,6 +959,7 @@ array_pair_list:
comma_or_error:
','
| error
+ { /* do nothing -- prevent default action of $$=$1. See #551. */ }
;
inner_array_pair_list:
diff --git a/vendor/nikic/php-parser/lib/PhpParser/Internal/PrintableNewAnonClassNode.php b/vendor/nikic/php-parser/lib/PhpParser/Internal/PrintableNewAnonClassNode.php
index dcacbfb6..cf27fccf 100644
--- a/vendor/nikic/php-parser/lib/PhpParser/Internal/PrintableNewAnonClassNode.php
+++ b/vendor/nikic/php-parser/lib/PhpParser/Internal/PrintableNewAnonClassNode.php
@@ -39,6 +39,8 @@ class PrintableNewAnonClassNode extends Expr
public static function fromNewNode(Expr\New_ $newNode) {
$class = $newNode->class;
assert($class instanceof Node\Stmt\Class_);
+ // We don't assert that $class->name is null here, to allow consumers to assign unique names
+ // to anonymous classes for their own purposes. We simplify ignore the name here.
assert($class->name === null);
return new self(
$newNode->args, $class->extends, $class->implements,
diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Case_.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Case_.php
index 30528509..81952be0 100644
--- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Case_.php
+++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Case_.php
@@ -6,7 +6,7 @@ use PhpParser\Node;
class Case_ extends Node\Stmt
{
- /** @var null|Node\Expr $cond Condition (null for default) */
+ /** @var null|Node\Expr Condition (null for default) */
public $cond;
/** @var Node\Stmt[] Statements */
public $stmts;
diff --git a/vendor/nikic/php-parser/lib/PhpParser/Parser/Php7.php b/vendor/nikic/php-parser/lib/PhpParser/Parser/Php7.php
index 768da721..b34ee824 100644
--- a/vendor/nikic/php-parser/lib/PhpParser/Parser/Php7.php
+++ b/vendor/nikic/php-parser/lib/PhpParser/Parser/Php7.php
@@ -18,7 +18,7 @@ use PhpParser\Node\Stmt;
class Php7 extends \PhpParser\ParserAbstract
{
protected $tokenToSymbolMapSize = 392;
- protected $actionTableSize = 940;
+ protected $actionTableSize = 938;
protected $gotoTableSize = 486;
protected $invalidSymbol = 157;
@@ -235,98 +235,98 @@ class Php7 extends \PhpParser\ParserAbstract
protected $action = array(
586, 587, 588, 589, 590, 218, 591, 592, 593, 629,
630, 665, 32, 102, 103, 104, 105, 106, 107, 108,
- 109, 110, 111, 112, 113,-32766,-32766,-32766, 881, 882,
- 883, 880, 879, 878, 0,-32766,-32766,-32766,-32766,-32766,
- -32766, 663, 824, 117, 24,-32766, 428,-32766,-32766,-32766,
- -32766,-32766, 594, 914, 916,-32766, 9,-32766,-32766,-32766,
- -32766,-32766,-32766, 857, 250, 350, 595, 596, 597, 598,
- 599, 600, 601, 119, 250, 661, 881, 882, 883, 880,
- 879, 878, 602, 603, 604, 605, 606, 607, 608, 609,
+ 109, 110, 111, 112, 113,-32766,-32766,-32766, 882, 883,
+ 884, 881, 880, 879, 0,-32766,-32766,-32766,-32766,-32766,
+ -32766, 663, 824, 117, 355,-32766, 428,-32766,-32766,-32766,
+ -32766,-32766, 594, 915, 917,-32766, 354,-32766,-32766,-32766,
+ -32766,-32766,-32766, 858, 800, 388, 595, 596, 597, 598,
+ 599, 600, 601, 353, 486, 661, 882, 883, 884, 881,
+ 880, 879, 602, 603, 604, 605, 606, 607, 608, 609,
610, 611, 612, 632, 633, 634, 635, 636, 624, 625,
626, 627, 628, 613, 614, 615, 616, 617, 618, 619,
655, 656, 657, 658, 659, 660, 620, 621, 622, 623,
- 653, 644, 642, 643, 639, 640, 800, 631, 637, 638,
+ 653, 644, 642, 643, 639, 640, 350, 631, 637, 638,
645, 646, 648, 647, 649, 650, 45, 46, 405, 47,
- 48, 641, 652, 651, -233, 49, 50, 231, 51,-32767,
+ 48, 641, 652, 651, -233, 49, 50, 299, 51,-32767,
-32767,-32767,-32767, 93, 94, 95, 96, 97,-32766,-32766,
- -32766, 42, -451, 25, -293, -293, 828, 829, 98, 99,
- 100, 260, 241, 230, -453, 1047, 828, 829,-32766, 1013,
- 873, 52, 53, 486, 101, 670, 242, 54, -238, 55,
+ -32766, 42, -452, 25, -294, -294, 1051, 217, 98, 99,
+ 100, 260, 241, 266, -454, 1048, 670, 295,-32766, 1014,
+ 874, 52, 53, 801, 101, 389, 292, 54, 834, 55,
223, 224, 56, 57, 58, 59, 60, 61, 62, 63,
- -452, 25, 234, 64, 357,-32766,-32766,-32766, 990, 1014,
- 1015, 407, -271, 1047, -488, 665, 265, 1013,-32766,-32766,
- -32766, 746, 248, -451, 250,-32766, 420,-32766,-32766,-32766,
- -32766, 388, -258, 1078, 277, -453, 365, -451,-32766, 1077,
- -32766,-32766,-32766, 116, -451, 801, 291, 68, 665, -453,
- 428, 292, 267, 1065, 417, 418, -453, -489, -456, 373,
- 997, -452, 557, 419, 420, 1050, 1019, 1020, 1021, 1022,
- 1016, 1017, 245, 764, -451, -452, 217, 429, 1023, 1018,
- 362, 295, -452, 1047, -455, 66, 1009, 257,-32766, 262,
- 267, 406, -136, -136, -136, -4, 746, 686, 687, 299,
- 668, 735, 266, 1090, 37, 20, 408, -136, 409, -136,
- 410, -136, 411, -136, 429, 412, 229, 362, 490, 38,
- 39, 358, 359, 355, 40, 413, 828, 829, 65, 663,
- 44, 290, 669, 414, 415, -451, -492, 33, 1047, 416,
- 122, 346, 721, 769, 360, 361, 353, 1099, -91, -451,
- 1100, 389,-32766,-32766,-32766, 354, -451, 121, 665, -488,
- 267, 28, 226, 379, 1047, 228, 406, 746, 748, 555,
- -136, 990,-32766, 219,-32766,-32766, 735, -258, 233, 37,
- 20, 408, 351, 409, -495, 410, -495, 411, 665, 451,
+ -453, 25, 234, 64, 357,-32766,-32766,-32766, 991, 1015,
+ 1016, 407, -272, 1048, -489, 250, 490, 1014,-32766,-32766,
+ -32766, 746, 248, -452, 250,-32766, 420,-32766,-32766,-32766,
+ -32766, 451, -490, 1079, 379, -454, 365, -452,-32766, 1078,
+ -32766,-32766,-32766, 116, -452, 1100, 291, 68, 1101, -454,
+ 373, 277, 267, 557, 417, 418, -454, 119, -457, 9,
+ 998, -453, 24, 419, 420, 1066, 1020, 1021, 1022, 1023,
+ 1017, 1018, 245, 764, -452, -453, 265, 429, 1024, 1019,
+ 362, 665, -453, 356, -456, 66, 1010, 257, 1028, 262,
+ 267, 406, -136, -136, -136, -4, 746,-32766,-32766, 250,
+ 668, 735,-32766, 1091, 37, 20, 408, -136, 409, -136,
+ 410, -136, 411, -136, 74, 412, 229, 828, 829, 38,
+ 39, 358, 359, 669, 40, 413, 828, 829, 65, 231,
+ 44, 290, 242, 414, 415, -452, -492, 33, 1048, 416,
+ 219, 663, 721, 769, 360, 361, 114, 429, -238, -452,
+ 362, 134,-32766,-32766,-32766, 131, -452, 127, 665, -489,
+ 121, 28, 226, 122, 1048, 228, 406, 746, 748, 555,
+ -136, 991,-32766, 120,-32766,-32766, 735, -490, 233, 37,
+ 20, 408, 351, 409, -496, 410, -496, 411, 686, 687,
412, 249, 232, 428, 38, 39, 358, 359, 342, 40,
- 413, 125, -489, 65, 256, 294, 290, 665, 414, 415,
- 25, 30, 118, 74, 416, 267, 356, 678, 769, 360,
- 361, 568, 1047, 428, 25, 127, 1013, 540, 123,-32766,
- -32766,-32766, -176, 834, 124, -177, 1047, 406, 279, 746,
- 1013, 267, 428, 748, 555, -4, 1027, 735, 665, 474,
- 37, 20, 408, 281, 409, 990, 410, 115, 411,-32766,
- -32766, 412, -218, -218, -218, 38, 39, 358, 359, 990,
- 40, 413, 419, 420, 65, -491, 225, 290, 229, 414,
- 415, -492, 569, 428, 114, 416, 419, 420, 721, 769,
- 360, 361, 131, 541, 68, 133, 362, 130, 317, 267,
- 859, 134, 227, 529, 530, 997, 517, 21, 68, 406,
- 95, 96, 97, 267, 748, 555, -218, 120, 665, 735,
- 665, 129, 37, 20, 408, 745, 409, 244, 410, -82,
+ 413, 828, 829, 65, 256, 294, 290, 665, 414, 415,
+ 25, 665, 118, 125, 416, 267, 115, 678, 769, 360,
+ 361, 568, 1048, -91, 25, 133, 1014, 540, 123,-32766,
+ -32766,-32766, 346, 835, 124, 569, 1048, 406, 279, 746,
+ 1014, 267, 428, 748, 555, -4, 428, 735, 665, 474,
+ 37, 20, 408, 129, 409, 991, 410, 745, 411, 517,
+ 21, 412, -218, -218, -218, 38, 39, 358, 359, 991,
+ 40, 413, 419, 420, 65, 243, 227, 290, 229, 414,
+ 415, -492, 1048, 428, 30, 416, 419, 420, 721, 769,
+ 360, 361, 281, 541, 68, -259, 362, 101, -177, 267,
+ 860, -82, 225, 230, 572, 998, 529, 530, 68, 406,
+ 95, 96, 97, 267, 748, 555, -218, -176, 665, 735,
+ 665, 760, 37, 20, 408, -493, 409, 241, 410, 537,
411, 686, 687, 412, -217, -217, -217, 38, 39, 358,
- 359, 572, 40, 413, 665, 760, 65, 241, 746, 290,
- 101, 414, 415, 428, 43, 428, 1066, 416, 398, 8,
- 721, 769, 360, 361, 508, 509, 828, 829, 128, 75,
- 76, 77, 858, 578, 665, 1101, 570, -176, -291, 428,
- -177, 537, 666, 1047, 523, 663, 748, 555, -217, 31,
+ 359, 43, 40, 413, 665, 665, 65, 128, 746, 290,
+ -292, 414, 415, 428, 549, 428, 665, 416, 666, 267,
+ 721, 769, 360, 361, 398, 8, 130, 317, 888, 75,
+ 76, 77, 508, 509, 828, 829, 570, 663, 668, 428,
+ 428, 859, 578, 1048, 455, 1102, 748, 555, -217, 31,
123, 78, 79, 80, 81, 82, 83, 84, 85, 86,
87, 88, 89, 90, 91, 92, 93, 94, 95, 96,
- 97, 98, 99, 100, 887, 241, 990, 746, 406, 668,
- -491, 455, 460,-32766, 518, 532, -80, 101, 735, 533,
- 370, 37, 20, 408, 549, 409, 377, 410, 10, 411,
- 507, 990, 412, 770, 524, 566, 38, 39, 358, 746,
- 771, 40, 413, 261, 1029, 65, 264, 1026, 290, 12,
- 267, 293, 373, -410, 258, 5, 416, 970, 347, 0,
- 335, 348, 331, 259, 0, 0, 0, 563, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 406, 0, 0,
- 0, 0, 0, 0, 0, 748, 555, 735, 330, 324,
- 37, 20, 408, 457, 409, 762, 410, 853, 411, 556,
- 870, 412, 726, 577, 36, 38, 39, 358, 746, 406,
- 40, 413, 35, 576, 65, 803, 863, 290, 866, 735,
- 787, 865, 37, 20, 408, 416, 409, 862, 410, 782,
- 411, 724, 795, 412, 784, 854, 561, 38, 39, 358,
- 746, 794, 40, 413, 864, 793, 65, 558, 341, 290,
- 340, 560, 276, 275, 748, 555, 571, 416, 567, 565,
- 564, 559, 514, 792, 753, 763, 755, 689, 562, 978,
- 766, 1097, 1048, 722, 1096, 1098, 681, 768, 406, 746,
- 680, 690, 767, 691, 688, 1095, 786, 555, 735, 1063,
- 1041, 37, 20, 408, 1055, 409, 1060, 410, 573, 411,
- 41, 34, 412, 27, 26, 23, 38, 39, 358, -454,
- 406, 40, 413, -455, -456, 65, -478, -480, 290, 237,
- 735, 345, 343, 37, 20, 408, 416, 409, 278, 410,
- 240, 411, 239, 238, 412, 222, 221, 135, 38, 39,
- 358, 132, 126, 40, 413, 73, 72, 65, 71, 406,
- 290, 70, 69, 67, 1028, 748, 555, 954, 416, 735,
- 957, 548, 37, 20, 408, 503, 409, 484, 410, 313,
- 411, 252, 22, 412, 18, 13, -236, 38, 39, 358,
- 982, 835, 40, 413, 1011, 953, 65, 748, 555, 290,
- -32766,-32766,-32766, 1001, 546, 403, 396, 416, 394, 390,
- 314, 19, 17, 16, -91, 15, 14, -233, -234, 0,
- -32766, -422,-32766,-32766,-32766,-32766,-32766,-32766,-32767,-32767,
- -32767,-32767,-32767, 1010, 1093, 1054, 748, 555, 1040, 1039
+ 97, 98, 99, 100,-32766, 241, 991, 746, 406, 460,
+ 532, 518, -80, 523, 370, 377, 507, 101, 735, 1067,
+ 10, 37, 20, 408, 533, 409, 524, 410, 991, 411,
+ -259, 264, 412, -177, 770, 561, 38, 39, 358, 746,
+ 771, 40, 413, 261, 12, 65, 293, 373, 290, 1030,
+ 267, 258, -176, 1027, 259, -411, 416, 5, 556, 971,
+ -493, 0, 0, 0, 0, 0, 0, 562, 0, 0,
+ 0, 0, 0, 0, 0, 347, 0, 406, 335, 854,
+ 348, 331, 330, 0, 324, 748, 555, 735, 457, 871,
+ 37, 20, 408, 762, 409, 726, 410, 577, 411, 558,
+ 36, 412, 35, 576, 803, 38, 39, 358, 746, 406,
+ 40, 413, 864, 867, 65, 787, 866, 290, 863, 735,
+ 782, 724, 37, 20, 408, 416, 409, 795, 410, 784,
+ 411, 855, 794, 412, 865, 793, 563, 38, 39, 358,
+ 746, 341, 40, 413, 340, 560, 65, 276, 275, 290,
+ 571, 567, 565, 564, 748, 555, 559, 416, 792, 753,
+ 763, 755, 689, 979, 766, 722, 1042, 1097, 566, 1099,
+ 681, 768, 680, 690, 767, 691, 688, 1096, 406, 746,
+ 1049, 1098, 1056, 1061, 1064, 573, 748, 555, 735, 955,
+ 41, 37, 20, 408, 34, 409, 27, 410, 26, 411,
+ 23, -455, 412, -456, -457, -479, 38, 39, 358, -481,
+ 406, 40, 413, 237, 345, 65, 343, 278, 290, 240,
+ 735, 239, 238, 37, 20, 408, 416, 409, 222, 410,
+ 221, 411, 135, 132, 412, 126, 73, 72, 38, 39,
+ 358, 71, 70, 40, 413, 69, 67, 65, 958, 406,
+ 290, 548, 503, 484, 313, 786, 555, 252, 416, 735,
+ 22, 18, 37, 20, 408, 13, 409, -236, 410, 983,
+ 411, 836, 1012, 412, 954, 1002, 546, 38, 39, 358,
+ 403, 396, 40, 413, 394, 390, 65, 748, 555, 290,
+ -32766,-32766,-32766, 314, 19, 17, -91, 416, 16, 15,
+ 14, -233, -234, 0, -423, 0, 514, 1011, 1094, 1055,
+ -32766, 1041,-32766,-32766,-32766,-32766,-32766,-32766,-32767,-32767,
+ -32767,-32767,-32767, 1040, 0, 1029, 748, 555
);
protected $actionCheck = array(
@@ -336,101 +336,101 @@ class Php7 extends \PhpParser\ParserAbstract
114, 115, 116, 117, 0, 8, 9, 10, 8, 9,
10, 77, 1, 13, 7, 28, 112, 30, 31, 32,
33, 34, 54, 56, 57, 28, 7, 30, 31, 32,
- 33, 34, 35, 1, 28, 7, 68, 69, 70, 71,
- 72, 73, 74, 7, 28, 77, 112, 113, 114, 115,
+ 33, 34, 35, 1, 29, 29, 68, 69, 70, 71,
+ 72, 73, 74, 7, 1, 77, 112, 113, 114, 115,
116, 117, 84, 85, 86, 87, 88, 89, 90, 91,
92, 93, 94, 95, 96, 97, 98, 99, 100, 101,
102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
112, 113, 114, 115, 116, 117, 118, 119, 120, 121,
- 122, 123, 124, 125, 126, 127, 29, 129, 130, 131,
+ 122, 123, 124, 125, 126, 127, 7, 129, 130, 131,
132, 133, 134, 135, 136, 137, 2, 3, 4, 5,
6, 143, 144, 145, 152, 11, 12, 7, 14, 41,
42, 43, 44, 45, 46, 47, 48, 49, 8, 9,
- 10, 67, 67, 67, 102, 103, 130, 131, 50, 51,
- 52, 109, 54, 35, 67, 79, 130, 131, 28, 83,
- 118, 47, 48, 1, 66, 1, 7, 53, 152, 55,
+ 10, 67, 67, 67, 102, 103, 1, 94, 50, 51,
+ 52, 109, 54, 67, 67, 79, 1, 7, 28, 83,
+ 118, 47, 48, 148, 66, 149, 7, 53, 1, 55,
56, 57, 58, 59, 60, 61, 62, 63, 64, 65,
67, 67, 68, 69, 70, 8, 9, 10, 112, 75,
- 76, 77, 150, 79, 7, 77, 7, 83, 8, 9,
+ 76, 77, 150, 79, 7, 28, 48, 83, 8, 9,
10, 1, 128, 128, 28, 28, 130, 30, 31, 32,
- 33, 29, 7, 1, 7, 128, 102, 142, 28, 7,
- 30, 31, 32, 149, 149, 148, 112, 151, 77, 142,
- 112, 7, 156, 1, 120, 121, 149, 7, 151, 146,
- 1, 128, 149, 129, 130, 1, 132, 133, 134, 135,
- 136, 137, 138, 1, 67, 142, 94, 143, 144, 145,
- 146, 7, 149, 79, 151, 151, 1, 153, 8, 155,
- 156, 71, 72, 73, 74, 0, 1, 102, 103, 7,
- 79, 81, 67, 82, 84, 85, 86, 87, 88, 89,
- 90, 91, 92, 93, 143, 95, 35, 146, 48, 99,
- 100, 101, 102, 7, 104, 105, 130, 131, 108, 77,
- 67, 111, 148, 113, 114, 128, 7, 13, 79, 119,
- 29, 146, 122, 123, 124, 125, 7, 77, 152, 142,
- 80, 149, 8, 9, 10, 7, 149, 15, 77, 152,
- 156, 140, 141, 128, 79, 35, 71, 1, 148, 149,
- 150, 112, 28, 13, 30, 31, 81, 152, 35, 84,
- 85, 86, 123, 88, 152, 90, 154, 92, 77, 82,
+ 33, 82, 7, 1, 128, 128, 102, 142, 28, 7,
+ 30, 31, 32, 149, 149, 77, 112, 151, 80, 142,
+ 146, 7, 156, 149, 120, 121, 149, 7, 151, 7,
+ 1, 128, 7, 129, 130, 1, 132, 133, 134, 135,
+ 136, 137, 138, 1, 67, 142, 7, 143, 144, 145,
+ 146, 77, 149, 7, 151, 151, 1, 153, 139, 155,
+ 156, 71, 72, 73, 74, 0, 1, 8, 9, 28,
+ 79, 81, 8, 82, 84, 85, 86, 87, 88, 89,
+ 90, 91, 92, 93, 149, 95, 35, 130, 131, 99,
+ 100, 101, 102, 148, 104, 105, 130, 131, 108, 7,
+ 67, 111, 7, 113, 114, 128, 7, 13, 79, 119,
+ 13, 77, 122, 123, 124, 125, 15, 143, 152, 142,
+ 146, 15, 8, 9, 10, 15, 149, 15, 77, 152,
+ 15, 140, 141, 29, 79, 35, 71, 1, 148, 149,
+ 150, 112, 28, 15, 30, 31, 81, 152, 35, 84,
+ 85, 86, 123, 88, 152, 90, 154, 92, 102, 103,
95, 128, 35, 112, 99, 100, 101, 102, 103, 104,
- 105, 149, 152, 108, 109, 142, 111, 77, 113, 114,
- 67, 7, 149, 149, 119, 156, 7, 122, 123, 124,
- 125, 149, 79, 112, 67, 15, 83, 77, 147, 8,
- 9, 10, 7, 152, 149, 7, 79, 71, 143, 1,
- 83, 156, 112, 148, 149, 150, 139, 81, 77, 78,
- 84, 85, 86, 33, 88, 112, 90, 15, 92, 8,
- 9, 95, 96, 97, 98, 99, 100, 101, 102, 112,
- 104, 105, 129, 130, 108, 7, 35, 111, 35, 113,
- 114, 152, 29, 112, 15, 119, 129, 130, 122, 123,
- 124, 125, 15, 143, 151, 15, 146, 97, 98, 156,
- 150, 15, 35, 72, 73, 1, 72, 73, 151, 71,
- 47, 48, 49, 156, 148, 149, 150, 15, 77, 81,
- 77, 29, 84, 85, 86, 29, 88, 29, 90, 29,
+ 105, 130, 131, 108, 109, 142, 111, 77, 113, 114,
+ 67, 77, 149, 149, 119, 156, 15, 122, 123, 124,
+ 125, 149, 79, 152, 67, 15, 83, 77, 147, 8,
+ 9, 10, 146, 152, 149, 29, 79, 71, 143, 1,
+ 83, 156, 112, 148, 149, 150, 112, 81, 77, 78,
+ 84, 85, 86, 29, 88, 112, 90, 29, 92, 72,
+ 73, 95, 96, 97, 98, 99, 100, 101, 102, 112,
+ 104, 105, 129, 130, 108, 29, 35, 111, 35, 113,
+ 114, 152, 79, 112, 7, 119, 129, 130, 122, 123,
+ 124, 125, 33, 143, 151, 7, 146, 66, 7, 156,
+ 150, 29, 35, 35, 29, 1, 72, 73, 151, 71,
+ 47, 48, 49, 156, 148, 149, 150, 7, 77, 81,
+ 77, 35, 84, 85, 86, 7, 88, 54, 90, 74,
92, 102, 103, 95, 96, 97, 98, 99, 100, 101,
- 102, 29, 104, 105, 77, 35, 108, 54, 1, 111,
- 66, 113, 114, 112, 67, 112, 152, 119, 102, 103,
- 122, 123, 124, 125, 106, 107, 130, 131, 67, 8,
- 9, 10, 148, 149, 77, 80, 29, 152, 79, 112,
- 152, 74, 77, 79, 93, 77, 148, 149, 150, 28,
+ 102, 67, 104, 105, 77, 77, 108, 67, 1, 111,
+ 79, 113, 114, 112, 89, 112, 77, 119, 77, 156,
+ 122, 123, 124, 125, 102, 103, 97, 98, 79, 8,
+ 9, 10, 106, 107, 130, 131, 29, 77, 79, 112,
+ 112, 148, 149, 79, 82, 80, 148, 149, 150, 28,
147, 30, 31, 32, 33, 34, 35, 36, 37, 38,
39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
- 49, 50, 51, 52, 79, 54, 112, 1, 71, 79,
- 152, 82, 86, 82, 87, 91, 94, 66, 81, 96,
- 102, 84, 85, 86, 89, 88, 94, 90, 94, 92,
- 109, 112, 95, 123, 96, 29, 99, 100, 101, 1,
- 123, 104, 105, 110, 139, 108, 126, 139, 111, 142,
- 156, 142, 146, 142, 126, 142, 119, 153, 146, -1,
- 146, 146, 146, 127, -1, -1, -1, 29, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 71, -1, -1,
- -1, -1, -1, -1, -1, 148, 149, 81, 146, 146,
- 84, 85, 86, 146, 88, 147, 90, 148, 92, 149,
+ 49, 50, 51, 52, 82, 54, 112, 1, 71, 86,
+ 91, 87, 94, 93, 102, 94, 109, 66, 81, 152,
+ 94, 84, 85, 86, 96, 88, 96, 90, 112, 92,
+ 152, 126, 95, 152, 123, 29, 99, 100, 101, 1,
+ 123, 104, 105, 110, 142, 108, 142, 146, 111, 139,
+ 156, 126, 152, 139, 127, 142, 119, 142, 149, 153,
+ 152, -1, -1, -1, -1, -1, -1, 29, -1, -1,
+ -1, -1, -1, -1, -1, 146, -1, 71, 146, 148,
+ 146, 146, 146, -1, 146, 148, 149, 81, 146, 148,
+ 84, 85, 86, 147, 88, 148, 90, 148, 92, 149,
148, 95, 148, 148, 148, 99, 100, 101, 1, 71,
104, 105, 148, 148, 108, 148, 148, 111, 148, 81,
148, 148, 84, 85, 86, 119, 88, 148, 90, 148,
- 92, 148, 148, 95, 148, 148, 29, 99, 100, 101,
- 1, 148, 104, 105, 148, 150, 108, 149, 149, 111,
- 149, 149, 149, 149, 148, 149, 149, 119, 149, 149,
- 149, 149, 154, 150, 150, 150, 150, 150, 29, 150,
+ 92, 148, 148, 95, 148, 150, 29, 99, 100, 101,
+ 1, 149, 104, 105, 149, 149, 108, 149, 149, 111,
+ 149, 149, 149, 149, 148, 149, 149, 119, 150, 150,
+ 150, 150, 150, 150, 150, 150, 150, 150, 29, 150,
150, 150, 150, 150, 150, 150, 150, 150, 71, 1,
- 150, 150, 150, 150, 150, 150, 148, 149, 81, 150,
- 150, 84, 85, 86, 150, 88, 150, 90, 150, 92,
+ 150, 150, 150, 150, 150, 150, 148, 149, 81, 152,
+ 151, 84, 85, 86, 151, 88, 151, 90, 151, 92,
151, 151, 95, 151, 151, 151, 99, 100, 101, 151,
71, 104, 105, 151, 151, 108, 151, 151, 111, 151,
81, 151, 151, 84, 85, 86, 119, 88, 151, 90,
151, 92, 151, 151, 95, 151, 151, 151, 99, 100,
- 101, 151, 151, 104, 105, 151, 151, 108, 151, 71,
- 111, 151, 151, 151, 155, 148, 149, 152, 119, 81,
+ 101, 151, 151, 104, 105, 151, 151, 108, 152, 71,
+ 111, 152, 152, 152, 152, 148, 149, 152, 119, 81,
152, 152, 84, 85, 86, 152, 88, 152, 90, 152,
92, 152, 152, 95, 152, 152, 152, 99, 100, 101,
152, 152, 104, 105, 152, 152, 108, 148, 149, 111,
8, 9, 10, 152, 152, 152, 152, 119, 152, 152,
- 152, 152, 152, 152, 152, 152, 152, 152, 152, -1,
- 28, 153, 30, 31, 32, 33, 34, 35, 36, 37,
- 38, 39, 40, 154, 154, 154, 148, 149, 154, 154
+ 152, 152, 152, -1, 153, -1, 154, 154, 154, 154,
+ 28, 154, 30, 31, 32, 33, 34, 35, 36, 37,
+ 38, 39, 40, 154, -1, 155, 148, 149
);
protected $actionBase = array(
- 0, 220, 295, 366, 438, 285, 350, 606, -2, -2,
- -36, -2, -2, 749, 616, 616, 547, 616, 717, 648,
- 788, 788, 788, 281, 443, 441, 441, 467, 371, 441,
- 467, 311, 330, 138, -66, -66, -66, -66, -66, -66,
+ 0, 220, 295, 366, 438, 285, 350, 596, -2, -2,
+ -36, -2, -2, 648, 749, 749, 547, 749, 616, 717,
+ 788, 788, 788, 281, 443, 467, 467, 441, 371, 467,
+ 441, 334, 330, 468, -66, -66, -66, -66, -66, -66,
-66, -66, -66, -66, -66, -66, -66, -66, -66, -66,
-66, -66, -66, -66, -66, -66, -66, -66, -66, -66,
-66, -66, -66, -66, -66, -66, -66, -66, -66, -66,
@@ -440,49 +440,49 @@ class Php7 extends \PhpParser\ParserAbstract
-66, -66, -66, -66, -66, -66, -66, -66, -66, -66,
-66, -66, -66, -66, -66, -66, -66, -66, -66, -66,
-66, -66, -66, -66, -66, -66, -66, -66, -66, -66,
- -66, -66, -66, -66, -66, -66, 184, 184, 97, 182,
- 324, 729, 718, 725, 732, 733, 727, 715, 360, 645,
- 632, 492, 650, 654, 656, 649, 723, 618, 730, 719,
+ -66, -66, -66, -66, -66, -66, 175, 175, 35, 73,
+ 324, 715, 706, 711, 719, 723, 712, 647, 327, 637,
+ 640, 424, 626, 642, 643, 644, 710, 762, 718, 709,
561, 561, 561, 561, 561, 561, 561, 561, 561, 561,
- 561, 561, 561, 561, 561, 561, 280, 30, 451, 421,
+ 561, 561, 561, 561, 561, 561, 294, 30, 289, 421,
421, 421, 421, 421, 421, 421, 421, 421, 421, 421,
421, 421, 421, 421, 421, 421, 421, 421, 150, 150,
150, 344, 210, 207, 197, 17, 95, 27, 892, 892,
892, 892, 892, 108, 108, 108, 108, 357, 357, 343,
62, 96, 96, 96, 96, 96, 96, 96, 96, 96,
- 96, 96, 96, 96, 259, 463, 463, 36, 36, 36,
- 36, 504, 196, 499, 46, 307, 515, 709, 252, 252,
- 436, 107, 133, 118, 118, 118, 195, 539, 529, 529,
- 529, 529, 221, 221, 529, 529, 270, 264, 232, 95,
- 95, 263, 95, 95, 95, 429, 429, 429, 171, 113,
- 541, 171, 562, 622, 548, 623, 533, 605, 94, 522,
- 204, 528, 525, 204, 204, 204, 458, 434, 431, 762,
- 184, 521, 184, 184, 184, 184, 678, 184, 184, 184,
- 184, 184, 184, 202, 184, 41, 424, 97, 272, 272,
- 420, 272, 493, 235, 614, 425, 404, 493, 493, 493,
- 613, 611, 250, 225, -8, 609, 428, 456, 468, 329,
- 497, 497, 508, 508, 535, 510, 497, 497, 497, 497,
- 497, 664, 664, 508, 540, 508, 535, 659, 508, 510,
- 508, 508, 497, 508, 664, 510, 66, 339, 244, 274,
- 510, 348, 538, 497, 530, 530, 316, 508, 140, 508,
- 37, 546, 664, 664, 546, 179, 510, 209, 575, 565,
- 531, 558, 227, 498, 498, 58, 531, 409, 510, 498,
- 49, 540, 292, 498, 34, 712, 711, 500, 710, 660,
- 707, 681, 705, 560, 520, 527, 695, 694, 704, 662,
- 663, 496, 557, 469, 442, 523, 487, 668, 528, 516,
- 484, 484, 484, 487, 673, 484, 484, 484, 484, 484,
- 484, 484, 484, 779, 519, 536, 502, 553, 542, 342,
- 608, 518, 557, 557, 633, 768, 514, 505, 678, 751,
- 701, 574, 410, 759, 692, 658, 552, 526, 691, 758,
- 743, 612, 469, 742, 634, 501, 635, 557, 636, 484,
- 675, 676, 785, 784, 672, 781, 764, 757, 524, 637,
- 495, 780, 640, 739, 621, 620, 566, 763, 734, 756,
- 641, 754, 642, 564, 537, 766, 491, 680, 687, 619,
- 643, 644, 559, 477, 631, 630, 629, 700, 577, 761,
- 534, 760, 765, 582, 603, 480, 627, 486, 597, 696,
- 453, 507, 596, 594, 738, 626, 689, 593, 625, 752,
- 532, 516, 517, 543, 544, 545, 617, 753, 512, 591,
- 589, 583, 580, 624, 578, 0, 0, 0, 0, 0,
+ 96, 96, 96, 96, 259, 463, 463, 196, 196, 196,
+ 196, 504, 271, 187, 471, 149, 520, 780, 264, 264,
+ 444, 107, 133, 118, 118, 118, 286, 502, 526, 526,
+ 526, 526, 221, 221, 526, 526, 168, 165, 232, 95,
+ 95, 263, 95, 95, 95, 429, 429, 429, 204, 104,
+ 532, 204, 551, 617, 540, 618, 538, 595, 94, 539,
+ 403, 522, 544, 403, 403, 403, 466, 387, 434, 754,
+ 175, 523, 175, 175, 175, 175, 672, 175, 175, 175,
+ 175, 175, 175, 36, 175, 41, 433, 35, 272, 272,
+ 459, 272, 473, 106, 609, 510, 477, 473, 473, 473,
+ 608, 605, 225, 488, -8, 602, 491, 462, 329, 518,
+ 479, 479, 500, 500, 489, 486, 479, 479, 479, 479,
+ 479, 659, 659, 500, 499, 500, 489, 649, 500, 486,
+ 500, 500, 479, 500, 659, 486, 250, 66, 179, 170,
+ 486, 49, 535, 479, 515, 515, 37, 500, 322, 500,
+ 255, 537, 659, 659, 537, 325, 486, 269, 565, 559,
+ 517, 556, 244, 446, 446, 119, 517, 276, 486, 446,
+ 252, 499, 140, 446, 34, 705, 704, 472, 701, 653,
+ 700, 675, 696, 519, 521, 527, 689, 687, 695, 655,
+ 657, 428, 552, 331, 401, 525, 474, 660, 522, 511,
+ 431, 431, 431, 474, 663, 431, 431, 431, 431, 431,
+ 431, 431, 431, 763, 514, 533, 358, 548, 531, 345,
+ 560, 524, 552, 552, 625, 761, 516, 481, 672, 733,
+ 694, 564, 342, 752, 681, 645, 546, 545, 680, 751,
+ 732, 606, 331, 730, 627, 480, 629, 552, 630, 431,
+ 664, 668, 779, 767, 662, 765, 758, 743, 542, 631,
+ 505, 764, 632, 729, 614, 613, 562, 757, 725, 742,
+ 633, 739, 634, 557, 534, 760, 530, 673, 676, 612,
+ 635, 636, 541, 340, 641, 624, 623, 692, 566, 756,
+ 529, 753, 759, 577, 594, 410, 622, 336, 593, 691,
+ 406, 455, 591, 589, 727, 621, 678, 583, 620, 734,
+ 528, 511, 512, 543, 536, 465, 611, 738, 475, 582,
+ 580, 578, 575, 619, 574, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 134, 134, 134, 134, -2, -2, -2, 0,
@@ -506,28 +506,28 @@ class Php7 extends \PhpParser\ParserAbstract
561, 561, 561, 561, 561, 561, 561, 561, 561, 561,
561, 561, 561, 561, 561, 561, 561, 561, 561, 561,
561, 561, 561, 561, -3, 561, 561, -3, 561, 561,
- 561, 561, 561, 561, 118, 118, 118, 118, 171, 171,
- 171, -84, 171, 171, 171, 171, 171, 171, 171, 171,
- 171, 171, 171, 171, 171, 171, 118, 118, 171, 171,
- 171, 171, 171, 171, -84, 171, 221, 221, 221, 204,
- 204, 171, 0, 0, 0, 0, 0, 497, 221, 171,
- 171, 171, 171, 0, 0, 171, 171, 540, 204, 0,
- 0, 0, 0, 0, 0, 0, 497, 497, 497, 0,
- 497, 221, 0, 272, 184, 400, 400, 400, 400, 0,
- 497, 0, 540, 497, 0, 0, 0, 0, 0, 0,
- 510, 0, 664, 0, 0, 0, 0, 508, 0, 0,
- 0, 0, 0, 0, 0, 0, 540, 0, 0, 0,
- 0, 540, 0, 484, 0, 505, 0, 0, 484, 484,
- 484, 505, 505, 0, 0, 0, 505
+ 561, 561, 561, 561, 118, 118, 118, 118, 204, 204,
+ 204, -84, 204, 204, 204, 204, 204, 204, 204, 204,
+ 204, 204, 204, 204, 204, 204, 118, 118, 204, 204,
+ 204, 204, 204, 204, 204, -84, 221, 221, 221, 403,
+ 403, 204, 0, 0, 0, 0, 0, 479, 221, 204,
+ 204, 204, 204, 0, 0, 204, 204, 499, 403, 0,
+ 0, 0, 0, 0, 0, 0, 479, 479, 479, 0,
+ 479, 221, 0, 272, 175, 469, 469, 469, 469, 0,
+ 479, 0, 499, 479, 0, 0, 0, 0, 0, 0,
+ 486, 0, 659, 0, 0, 0, 0, 500, 0, 0,
+ 0, 0, 0, 0, 0, 0, 499, 0, 0, 0,
+ 0, 499, 0, 431, 0, 481, 0, 0, 431, 431,
+ 431, 481, 481, 0, 0, 0, 481
);
protected $actionDefault = array(
3,32767,32767,32767,32767,32767,32767,32767,32767, 91,
32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,
- 32767,32767,32767,32767, 93, 504, 504, 494,32767, 504,
- 494,32767,32767,32767, 312, 312, 312,32767, 449, 449,
- 449, 449, 449, 449, 449,32767,32767,32767,32767,32767,
- 391,32767,32767,32767,32767,32767,32767,32767,32767,32767,
+ 32767,32767,32767,32767, 93, 505, 505, 495,32767, 505,
+ 495,32767,32767,32767, 313, 313, 313,32767, 450, 450,
+ 450, 450, 450, 450, 450,32767,32767,32767,32767,32767,
+ 392,32767,32767,32767,32767,32767,32767,32767,32767,32767,
32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,
32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,
32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,
@@ -536,50 +536,50 @@ class Php7 extends \PhpParser\ParserAbstract
32767,32767,32767,32767,32767,32767,32767,32767,32767, 91,
32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,
32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,
- 501,32767,32767,32767,32767,32767,32767,32767,32767,32767,
+ 502,32767,32767,32767,32767,32767,32767,32767,32767,32767,
32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,
- 374, 375, 377, 378, 311, 450, 257, 500, 310, 129,
- 268, 259, 210, 308, 242, 133, 339, 392, 341, 390,
- 394, 340, 317, 321, 322, 323, 324, 325, 326, 327,
- 328, 329, 330, 331, 332, 315, 316, 393, 371, 370,
- 369, 337, 338, 314, 342, 344, 314, 343, 360, 361,
- 358, 359, 362, 363, 364, 365, 366,32767,32767,32767,
+ 375, 376, 378, 379, 312, 451, 258, 501, 311, 129,
+ 269, 260, 210, 309, 242, 133, 340, 393, 342, 391,
+ 395, 341, 318, 322, 323, 324, 325, 326, 327, 328,
+ 329, 330, 331, 332, 333, 316, 317, 394, 372, 371,
+ 370, 338, 339, 315, 343, 345, 315, 344, 361, 362,
+ 359, 360, 363, 364, 365, 366, 367,32767,32767,32767,
32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,
- 32767, 93,32767,32767,32767, 351, 352, 249, 249, 249,
- 249,32767, 249, 294,32767,32767,32767,32767,32767,32767,
- 32767, 443, 368, 346, 347, 345,32767, 421,32767,32767,
- 32767,32767,32767, 423,32767, 91,32767,32767,32767, 334,
- 336, 415, 503, 318, 502,32767,32767, 93,32767,32767,
- 32767,32767,32767,32767,32767,32767,32767,32767, 418,32767,
- 32767, 409, 91,32767,32767, 91, 173, 229, 231, 178,
- 32767, 426,32767,32767,32767,32767,32767,32767,32767,32767,
+ 32767, 93,32767,32767,32767, 352, 353, 249, 249, 249,
+ 249,32767, 249,32767, 295,32767,32767,32767,32767,32767,
+ 32767, 444, 369, 347, 348, 346,32767, 422,32767,32767,
+ 32767,32767,32767, 424,32767, 91,32767,32767,32767, 335,
+ 337, 416, 504, 319, 503,32767,32767, 93,32767,32767,
+ 32767,32767,32767,32767,32767,32767,32767,32767, 419,32767,
+ 32767, 410, 91,32767,32767, 91, 173, 229, 231, 178,
+ 32767, 427,32767,32767,32767,32767,32767,32767,32767,32767,
32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,
- 32767,32767, 356, 511,32767, 451,32767, 348, 349, 350,
- 32767,32767, 451, 451, 451,32767, 451,32767, 451, 451,
+ 32767,32767, 357, 512,32767, 452,32767, 349, 350, 351,
+ 32767,32767, 452, 452, 452,32767, 452,32767, 452, 452,
32767,32767,32767,32767,32767, 178,32767,32767,32767,32767,
- 93, 424, 424, 91, 91, 91, 91, 419,32767, 178,
+ 93, 425, 425, 91, 91, 91, 91, 420,32767, 178,
32767,32767,32767,32767,32767, 178, 90, 90, 90, 90,
178, 90, 193,32767, 191, 191, 90,32767, 92,32767,
- 92, 195,32767, 465, 195, 90, 178, 90, 215, 215,
- 400, 180, 92, 251, 251, 92, 400, 90, 178, 251,
+ 92, 195,32767, 466, 195, 90, 178, 90, 215, 215,
+ 401, 180, 92, 251, 251, 92, 401, 90, 178, 251,
90,32767, 90, 251,32767,32767,32767, 84,32767,32767,
32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,
- 32767,32767, 411,32767, 431,32767, 444, 463, 409,32767,
- 354, 355, 357,32767, 453, 379, 380, 381, 382, 383,
- 384, 385, 387,32767, 414,32767,32767, 86, 120, 267,
- 32767, 509, 86, 412,32767, 509,32767,32767,32767,32767,
+ 32767,32767, 412,32767, 432,32767, 445, 464, 410,32767,
+ 355, 356, 358,32767, 454, 380, 381, 382, 383, 384,
+ 385, 386, 388,32767, 415,32767,32767, 86, 120, 268,
+ 32767, 510, 86, 413,32767, 510,32767,32767,32767,32767,
32767,32767,32767,32767,32767,32767, 86, 86,32767,32767,
- 32767,32767, 490,32767, 510,32767, 451, 413,32767, 353,
- 427, 470,32767,32767, 452,32767,32767,32767, 86,32767,
- 32767,32767,32767,32767,32767,32767,32767,32767, 431,32767,
- 32767,32767,32767,32767,32767, 451,32767,32767,32767,32767,
- 32767,32767,32767, 307,32767,32767,32767,32767,32767,32767,
- 32767,32767, 451,32767,32767, 241,32767,32767,32767,32767,
+ 32767,32767, 491,32767, 511,32767, 452, 414,32767, 354,
+ 428, 471,32767,32767, 453,32767,32767,32767, 86,32767,
+ 32767,32767,32767,32767,32767,32767,32767,32767, 432,32767,
+ 32767,32767,32767,32767,32767, 452,32767,32767,32767,32767,
+ 32767,32767,32767, 308,32767,32767,32767,32767,32767,32767,
+ 32767,32767, 452,32767,32767, 241,32767,32767,32767,32767,
32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,
- 84, 60,32767, 287,32767,32767,32767,32767,32767,32767,
- 32767,32767,32767,32767,32767, 135, 135, 3, 270, 3,
- 270, 135, 135, 135, 270, 270, 135, 135, 135, 135,
- 135, 135, 135, 168, 223, 226, 215, 215, 279, 135,
+ 84, 60,32767, 288,32767,32767,32767,32767,32767,32767,
+ 32767,32767,32767,32767,32767, 135, 135, 3, 271, 3,
+ 271, 135, 135, 135, 271, 271, 135, 135, 135, 135,
+ 135, 135, 135, 168, 223, 226, 215, 215, 280, 135,
135
);
@@ -588,7 +588,7 @@ class Php7 extends \PhpParser\ParserAbstract
167, 164, 164, 164, 164, 165, 165, 165, 165, 165,
165, 165, 160, 161, 162, 163, 179, 177, 180, 430,
431, 322, 432, 435, 436, 437, 438, 439, 440, 441,
- 442, 901, 137, 141, 142, 143, 144, 145, 139, 146,
+ 442, 902, 137, 141, 142, 143, 144, 145, 139, 146,
147, 150, 176, 178, 181, 198, 201, 202, 204, 205,
207, 208, 209, 210, 211, 212, 213, 214, 215, 216,
235, 236, 253, 254, 255, 327, 328, 329, 479, 183,
@@ -597,42 +597,42 @@ class Php7 extends \PhpParser\ParserAbstract
171, 154, 155, 156, 172, 157, 200, 138, 173, 158,
174, 175, 159, 542, 203, 447, 551, 203, 743, 444,
304, 308, 459, 482, 483, 485, 444, 493, 496, 519,
- 1087, 1087, 987, 481, 452, 452, 452, 472, 452, 698,
- 472, 677, 692, 779, 779, 779, 779, 1087, 467, 773,
+ 1088, 1088, 988, 481, 452, 452, 452, 472, 452, 698,
+ 472, 677, 692, 779, 779, 779, 779, 1088, 467, 773,
780, 452, 433, 433, 433, 285, 433, 433, 433, 433,
433, 433, 433, 433, 433, 433, 433, 433, 433, 434,
434, 434, 676, 434, 434, 434, 434, 434, 434, 434,
- 434, 434, 434, 434, 434, 434, 480, 869, 554, 319,
- 664, 263, 536, 867, 321, 988, 247, 502, 282, 452,
- 452, 515, 516, 1057, 1058, 466, 488, 452, 452, 452,
- 3, 4, 465, 989, 1043, 712, 785, 575, 504, 506,
- 837, 453, 520, 535, 538, 813, 545, 553, 809, 498,
- 498, 1012, 477, 1012, 1012, 1012, 1012, 1012, 1012, 1012,
- 1012, 1012, 1012, 1012, 1012, 1012, 703, 675, 976, 765,
- 738, 977, 739, 1086, 1086, 499, 501, 547, 802, 783,
- 783, 781, 783, 574, 679, 445, 811, 806, 473, 1079,
- 1086, 876, 1102, 777, 316, 550, 478, 1067, 492, 703,
- 302, 684, 703, 734, 729, 730, 744, 1089, 685, 731,
- 682, 732, 733, 683, 877, 737, 306, 449, 521, 470,
- 948, 833, 458, 821, 334, 522, 338, 468, 325, 325,
+ 434, 434, 434, 434, 434, 434, 480, 870, 554, 319,
+ 664, 877, 536, 868, 321, 989, 712, 502, 282, 452,
+ 452, 515, 516, 1058, 1059, 466, 488, 452, 452, 452,
+ 785, 263, 465, 990, 1044, 878, 247, 575, 504, 506,
+ 838, 453, 520, 535, 538, 813, 545, 553, 809, 498,
+ 498, 1013, 477, 1013, 1013, 1013, 1013, 1013, 1013, 1013,
+ 1013, 1013, 1013, 1013, 1013, 1013, 703, 675, 977, 765,
+ 738, 978, 739, 1087, 1087, 499, 501, 547, 802, 783,
+ 783, 781, 783, 574, 679, 445, 811, 806, 473, 478,
+ 1087, 492, 1103, 777, 316, 550, 3, 4, 1080, 703,
+ 1068, 684, 703, 734, 729, 730, 744, 1090, 685, 731,
+ 682, 732, 733, 683, 302, 737, 306, 449, 521, 470,
+ 949, 833, 458, 821, 334, 522, 338, 468, 325, 325,
269, 270, 272, 476, 332, 273, 333, 274, 336, 505,
- 339, 525, 1056, 391, 826, 289, 539, 816, 816, 1074,
- 694, 694, 510, 283, 312, 11, 704, 704, 704, 706,
- 693, 991, 286, 287, 827, 827, 827, 827, 991, 827,
- 696, 827, 699, 579, 1062, 1062, 526, 827, 842, 846,
- 449, 984, 1053, 708, 790, 991, 991, 991, 991, 1053,
- 979, 991, 991, 384, 399, 886, 1064, 1064, 707, 695,
- 841, 495, 845, 0, 0, 751, 0, 788, 752, 0,
- 0, 0, 0, 0, 0, 1049, 818, 0, 778, 0,
- 0, 0, 0, 0, 0, 0, 0, 986, 884, 0,
- 0, 711, 464, 983, 0, 0, 0, 0, 844, 0,
- 0, 1051, 1051, 844, 0, 0, 0, 0, 0, 0,
+ 339, 525, 1057, 391, 826, 289, 539, 816, 816, 1075,
+ 694, 694, 510, 283, 699, 11, 704, 704, 704, 706,
+ 693, 992, 286, 287, 827, 827, 827, 827, 992, 827,
+ 827, 312, 696, 579, 1063, 1063, 526, 827, 843, 847,
+ 449, 985, 1054, 708, 790, 992, 992, 992, 992, 1054,
+ 980, 992, 992, 384, 399, 887, 1065, 1065, 707, 695,
+ 842, 495, 846, 0, 0, 751, 0, 788, 752, 0,
+ 0, 0, 0, 0, 0, 1050, 818, 0, 778, 0,
+ 0, 0, 0, 0, 0, 0, 0, 987, 885, 0,
+ 0, 711, 464, 984, 0, 0, 0, 0, 845, 0,
+ 0, 1052, 1052, 845, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 446, 462,
0, 0, 0, 0, 0, 0, 0, 0, 0, 446,
0, 462, 0, 0, 305, 0, 450, 372, 0, 374,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 702, 0, 1094
+ 0, 0, 0, 702, 0, 1095
);
protected $gotoCheck = array(
@@ -655,23 +655,23 @@ class Php7 extends \PhpParser\ParserAbstract
135, 135, 135, 135, 135, 135, 135, 135, 135, 137,
137, 137, 17, 137, 137, 137, 137, 137, 137, 137,
137, 137, 137, 137, 137, 137, 7, 7, 7, 69,
- 5, 134, 7, 7, 69, 92, 134, 73, 69, 10,
+ 5, 111, 7, 7, 69, 92, 36, 73, 69, 10,
10, 73, 73, 141, 141, 10, 10, 10, 10, 10,
- 37, 37, 39, 92, 92, 36, 40, 39, 39, 39,
+ 40, 134, 39, 92, 92, 111, 134, 39, 39, 39,
94, 10, 39, 39, 39, 39, 39, 39, 39, 86,
86, 86, 10, 86, 86, 86, 86, 86, 86, 86,
86, 86, 86, 86, 86, 86, 26, 16, 67, 67,
55, 67, 55, 147, 147, 68, 68, 68, 16, 16,
- 16, 16, 16, 16, 13, 16, 16, 16, 136, 146,
- 147, 111, 12, 76, 76, 76, 2, 143, 2, 26,
- 52, 13, 26, 13, 13, 13, 13, 147, 13, 13,
- 13, 13, 13, 13, 111, 13, 65, 12, 54, 53,
+ 16, 16, 16, 16, 13, 16, 16, 16, 136, 2,
+ 147, 2, 12, 76, 76, 76, 37, 37, 146, 26,
+ 143, 13, 26, 13, 13, 13, 13, 147, 13, 13,
+ 13, 13, 13, 13, 52, 13, 65, 12, 54, 53,
118, 90, 65, 88, 56, 56, 56, 65, 56, 56,
56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
56, 12, 139, 65, 91, 20, 12, 85, 85, 85,
- 26, 26, 24, 11, 19, 65, 26, 26, 26, 26,
+ 26, 26, 24, 11, 30, 65, 26, 26, 26, 26,
26, 63, 80, 80, 63, 63, 63, 63, 63, 63,
- 28, 63, 30, 82, 8, 8, 23, 63, 96, 99,
+ 63, 19, 28, 82, 8, 8, 23, 63, 96, 99,
12, 127, 97, 32, 79, 63, 63, 63, 63, 97,
124, 63, 63, 71, 122, 114, 97, 97, 14, 14,
14, 72, 14, -1, -1, 63, -1, 14, 63, -1,
@@ -688,40 +688,40 @@ class Php7 extends \PhpParser\ParserAbstract
);
protected $gotoBase = array(
- 0, 0, -281, 0, 0, 180, 0, 181, 106, 0,
- -141, 54, 6, -19, 11, -253, 245, 170, 139, 45,
- 69, 0, 0, 15, 56, 0, -10, 0, 58, 0,
- 75, 0, 10, -23, 0, 0, 206, -369, 0, -344,
- 197, 0, 0, 0, 0, 0, 93, 0, 0, 81,
- 0, 0, 243, 77, 80, 235, 87, 0, 0, 0,
+ 0, 0, -288, 0, 0, 180, 0, 181, 106, 0,
+ -141, 54, 6, -19, 11, -253, 245, 170, 139, 62,
+ 69, 0, 0, 15, 56, 0, -10, 0, 60, 0,
+ 57, 0, 10, -23, 0, 0, 187, -303, 0, -344,
+ 191, 0, 0, 0, 0, 0, 93, 0, 0, 81,
+ 0, 0, 257, 77, 80, 235, 87, 0, 0, 0,
0, 0, 0, 107, 0, -63, 0, -70, 17, -205,
0, -2, -3, -363, 0, -115, 14, 0, 0, 9,
-234, 0, 36, 0, 0, 110, 12, 0, 61, 0,
- 57, 74, -169, 0, 196, 0, 63, 128, 0, 5,
+ 58, 74, -169, 0, 196, 0, 63, 128, 0, 5,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 51, 0, 0, 19, 0, 0, 0, 59, 0,
+ 0, -29, 0, 0, 19, 0, 0, 0, 59, 0,
0, 0, -22, 0, 18, 0, 0, 16, 0, 0,
- 0, 0, 0, 0, -66, -65, 242, -48, 0, 73,
- 0, -90, 0, 247, 0, 0, 240, 7, -116, 0,
+ 0, 0, 0, 0, -46, -65, 242, -48, 0, 73,
+ 0, -90, 0, 250, 0, 0, 249, 7, -116, 0,
0
);
protected $gotoDefault = array(
-32768, 404, 582, 2, 583, 654, 662, 527, 421, 552,
- 422, 448, 323, 736, 890, 756, 718, 719, 720, 309,
+ 422, 448, 323, 736, 891, 756, 718, 719, 720, 309,
349, 300, 307, 511, 500, 395, 705, 368, 697, 392,
700, 367, 709, 136, 528, 400, 713, 1, 715, 454,
747, 297, 723, 298, 531, 725, 461, 727, 728, 303,
- 310, 311, 894, 469, 497, 740, 206, 463, 741, 296,
- 742, 750, 320, 301, 378, 401, 315, 871, 487, 318,
- 363, 381, 494, 489, 471, 998, 775, 387, 376, 789,
+ 310, 311, 895, 469, 497, 740, 206, 463, 741, 296,
+ 742, 750, 320, 301, 378, 401, 315, 872, 487, 318,
+ 363, 381, 494, 489, 471, 999, 775, 387, 376, 789,
284, 797, 580, 805, 808, 423, 424, 385, 820, 386,
- 831, 825, 1006, 380, 836, 369, 843, 1038, 371, 847,
- 220, 850, 344, 512, 337, 855, 856, 6, 861, 543,
- 544, 7, 243, 397, 885, 513, 366, 900, 352, 967,
- 969, 456, 393, 980, 375, 534, 402, 985, 1042, 364,
+ 831, 825, 1007, 380, 837, 369, 844, 1039, 371, 848,
+ 220, 851, 344, 512, 337, 856, 857, 6, 862, 543,
+ 544, 7, 244, 397, 886, 513, 366, 901, 352, 968,
+ 970, 456, 393, 981, 375, 534, 402, 986, 1043, 364,
425, 382, 271, 288, 246, 426, 443, 251, 427, 383,
- 1045, 1052, 326, 1068, 268, 29, 1080, 1088, 280, 475,
+ 1046, 1053, 326, 1069, 268, 29, 1081, 1089, 280, 475,
491
);
@@ -751,13 +751,13 @@ class Php7 extends \PhpParser\ParserAbstract
82, 45, 45, 41, 41, 83, 43, 43, 84, 42,
42, 44, 44, 54, 54, 54, 54, 68, 68, 87,
87, 88, 88, 88, 90, 90, 91, 91, 91, 89,
- 89, 69, 69, 92, 92, 93, 93, 94, 94, 94,
- 50, 95, 95, 96, 51, 98, 98, 99, 99, 100,
- 100, 73, 101, 101, 101, 101, 101, 106, 106, 107,
- 107, 108, 108, 108, 108, 108, 109, 110, 110, 105,
- 105, 102, 102, 104, 104, 112, 112, 111, 111, 111,
- 111, 111, 111, 103, 113, 113, 115, 114, 114, 52,
- 116, 116, 46, 46, 33, 33, 33, 33, 33, 33,
+ 89, 69, 69, 69, 92, 92, 93, 93, 94, 94,
+ 94, 50, 95, 95, 96, 51, 98, 98, 99, 99,
+ 100, 100, 73, 101, 101, 101, 101, 101, 106, 106,
+ 107, 107, 108, 108, 108, 108, 108, 109, 110, 110,
+ 105, 105, 102, 102, 104, 104, 112, 112, 111, 111,
+ 111, 111, 111, 111, 103, 113, 113, 115, 114, 114,
+ 52, 116, 116, 46, 46, 33, 33, 33, 33, 33,
33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
@@ -765,20 +765,20 @@ class Php7 extends \PhpParser\ParserAbstract
33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
- 33, 33, 33, 33, 33, 33, 33, 123, 117, 117,
- 122, 122, 125, 126, 126, 127, 128, 128, 128, 75,
- 75, 63, 63, 63, 118, 118, 118, 130, 130, 119,
- 119, 121, 121, 121, 124, 124, 135, 135, 135, 86,
- 137, 137, 137, 120, 120, 120, 120, 120, 120, 120,
- 120, 120, 120, 120, 120, 120, 120, 120, 120, 49,
- 49, 133, 133, 133, 129, 129, 129, 138, 138, 138,
- 138, 138, 138, 56, 56, 56, 97, 97, 97, 97,
- 141, 140, 132, 132, 132, 132, 132, 132, 131, 131,
- 131, 139, 139, 139, 139, 85, 142, 142, 143, 143,
- 143, 143, 143, 143, 143, 136, 145, 145, 144, 144,
- 146, 146, 146, 146, 146, 134, 134, 134, 134, 148,
- 149, 147, 147, 147, 147, 147, 147, 147, 150, 150,
- 150, 150
+ 33, 33, 33, 33, 33, 33, 33, 33, 123, 117,
+ 117, 122, 122, 125, 126, 126, 127, 128, 128, 128,
+ 75, 75, 63, 63, 63, 118, 118, 118, 130, 130,
+ 119, 119, 121, 121, 121, 124, 124, 135, 135, 135,
+ 86, 137, 137, 137, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 49, 49, 133, 133, 133, 129, 129, 129, 138, 138,
+ 138, 138, 138, 138, 56, 56, 56, 97, 97, 97,
+ 97, 141, 140, 132, 132, 132, 132, 132, 132, 131,
+ 131, 131, 139, 139, 139, 139, 85, 142, 142, 143,
+ 143, 143, 143, 143, 143, 143, 136, 145, 145, 144,
+ 144, 146, 146, 146, 146, 146, 134, 134, 134, 134,
+ 148, 149, 147, 147, 147, 147, 147, 147, 147, 150,
+ 150, 150, 150
);
protected $ruleToLength = array(
@@ -807,34 +807,34 @@ class Php7 extends \PhpParser\ParserAbstract
1, 1, 4, 0, 2, 5, 0, 2, 6, 0,
2, 0, 3, 1, 2, 1, 1, 2, 0, 1,
3, 4, 6, 4, 1, 2, 1, 1, 1, 0,
- 1, 0, 2, 2, 4, 1, 3, 1, 2, 2,
- 2, 3, 1, 1, 2, 3, 1, 1, 3, 2,
- 0, 1, 3, 4, 9, 3, 1, 1, 3, 0,
- 2, 4, 5, 4, 4, 4, 3, 1, 1, 1,
- 1, 1, 1, 0, 1, 1, 2, 1, 1, 1,
- 1, 1, 1, 2, 1, 3, 1, 1, 3, 2,
- 3, 1, 0, 1, 1, 3, 3, 3, 4, 1,
- 2, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 2, 2, 2, 2, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+ 1, 0, 2, 2, 2, 4, 1, 3, 1, 2,
+ 2, 2, 3, 1, 1, 2, 3, 1, 1, 3,
+ 2, 0, 1, 3, 4, 9, 3, 1, 1, 3,
+ 0, 2, 4, 5, 4, 4, 4, 3, 1, 1,
+ 1, 1, 1, 1, 0, 1, 1, 2, 1, 1,
+ 1, 1, 1, 1, 2, 1, 3, 1, 1, 3,
+ 2, 3, 1, 0, 1, 1, 3, 3, 3, 4,
+ 1, 2, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 2, 2, 2, 2, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 5,
- 4, 3, 4, 4, 2, 2, 4, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 1, 3,
- 2, 1, 2, 4, 2, 8, 9, 7, 3, 2,
- 0, 4, 2, 1, 3, 2, 2, 2, 4, 1,
- 1, 1, 2, 3, 1, 1, 1, 1, 1, 0,
- 3, 0, 1, 1, 0, 1, 1, 3, 3, 3,
- 4, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 3, 2, 3, 3, 0,
- 1, 1, 3, 1, 1, 3, 1, 1, 4, 4,
- 4, 1, 4, 1, 1, 3, 1, 4, 2, 2,
- 1, 3, 1, 4, 4, 3, 3, 3, 1, 3,
- 1, 1, 3, 1, 1, 4, 3, 1, 1, 2,
- 1, 3, 4, 3, 0, 1, 1, 1, 3, 1,
- 3, 1, 4, 2, 0, 2, 2, 1, 2, 1,
- 1, 1, 4, 3, 3, 3, 6, 3, 1, 1,
- 2, 1
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 2, 2, 2, 2, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+ 5, 4, 3, 4, 4, 2, 2, 4, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 1,
+ 3, 2, 1, 2, 4, 2, 8, 9, 7, 3,
+ 2, 0, 4, 2, 1, 3, 2, 2, 2, 4,
+ 1, 1, 1, 2, 3, 1, 1, 1, 1, 1,
+ 0, 3, 0, 1, 1, 0, 1, 1, 3, 3,
+ 3, 4, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 3, 2, 3, 3,
+ 0, 1, 1, 3, 1, 1, 3, 1, 1, 4,
+ 4, 4, 1, 4, 1, 1, 3, 1, 4, 2,
+ 2, 1, 3, 1, 4, 4, 3, 3, 3, 1,
+ 3, 1, 1, 3, 1, 1, 4, 3, 1, 1,
+ 2, 1, 3, 4, 3, 0, 1, 1, 1, 3,
+ 1, 3, 1, 4, 2, 0, 2, 2, 1, 2,
+ 1, 1, 1, 4, 3, 3, 3, 6, 3, 1,
+ 1, 2, 1
);
protected function initReduceCallbacks() {
@@ -1617,195 +1617,195 @@ class Php7 extends \PhpParser\ParserAbstract
$this->semValue = $this->semStack[$stackPos-(2-2)];
},
253 => function ($stackPos) {
- $this->semValue = array();
+ $this->semValue = null;
},
254 => function ($stackPos) {
- $this->semValue = $this->semStack[$stackPos-(4-2)];
+ $this->semValue = array();
},
255 => function ($stackPos) {
- $this->semValue = array($this->semStack[$stackPos-(1-1)]);
+ $this->semValue = $this->semStack[$stackPos-(4-2)];
},
256 => function ($stackPos) {
- $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)];
+ $this->semValue = array($this->semStack[$stackPos-(1-1)]);
},
257 => function ($stackPos) {
- $this->semValue = new Node\Arg($this->semStack[$stackPos-(1-1)], false, false, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
+ $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)];
},
258 => function ($stackPos) {
- $this->semValue = new Node\Arg($this->semStack[$stackPos-(2-2)], true, false, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
+ $this->semValue = new Node\Arg($this->semStack[$stackPos-(1-1)], false, false, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
},
259 => function ($stackPos) {
- $this->semValue = new Node\Arg($this->semStack[$stackPos-(2-2)], false, true, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
+ $this->semValue = new Node\Arg($this->semStack[$stackPos-(2-2)], true, false, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
},
260 => function ($stackPos) {
- $this->semValue = $this->semStack[$stackPos-(2-1)];
+ $this->semValue = new Node\Arg($this->semStack[$stackPos-(2-2)], false, true, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
},
261 => function ($stackPos) {
- $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)];
+ $this->semValue = $this->semStack[$stackPos-(2-1)];
},
262 => function ($stackPos) {
- $this->semValue = array($this->semStack[$stackPos-(1-1)]);
+ $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)];
},
263 => function ($stackPos) {
- $this->semValue = new Expr\Variable($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
+ $this->semValue = array($this->semStack[$stackPos-(1-1)]);
},
264 => function ($stackPos) {
- $this->semValue = $this->semStack[$stackPos-(2-1)];
+ $this->semValue = new Expr\Variable($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
},
265 => function ($stackPos) {
- $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)];
+ $this->semValue = $this->semStack[$stackPos-(2-1)];
},
266 => function ($stackPos) {
- $this->semValue = array($this->semStack[$stackPos-(1-1)]);
+ $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)];
},
267 => function ($stackPos) {
- $this->semValue = new Stmt\StaticVar($this->semStack[$stackPos-(1-1)], null, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
+ $this->semValue = array($this->semStack[$stackPos-(1-1)]);
},
268 => function ($stackPos) {
- $this->semValue = new Stmt\StaticVar($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
+ $this->semValue = new Stmt\StaticVar($this->semStack[$stackPos-(1-1)], null, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
},
269 => function ($stackPos) {
- if ($this->semStack[$stackPos-(2-2)] !== null) { $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; }
+ $this->semValue = new Stmt\StaticVar($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
},
270 => function ($stackPos) {
- $this->semValue = array();
+ if ($this->semStack[$stackPos-(2-2)] !== null) { $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; }
},
271 => function ($stackPos) {
+ $this->semValue = array();
+ },
+ 272 => function ($stackPos) {
$startAttributes = $this->lookaheadStartAttributes; if (isset($startAttributes['comments'])) { $nop = new Stmt\Nop($startAttributes + $this->endAttributes); } else { $nop = null; };
if ($nop !== null) { $this->semStack[$stackPos-(1-1)][] = $nop; } $this->semValue = $this->semStack[$stackPos-(1-1)];
},
- 272 => function ($stackPos) {
+ 273 => function ($stackPos) {
$this->semValue = new Stmt\Property($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); $this->checkProperty($this->semValue, $stackPos-(3-1));
},
- 273 => function ($stackPos) {
+ 274 => function ($stackPos) {
$this->semValue = new Stmt\ClassConst($this->semStack[$stackPos-(4-3)], $this->semStack[$stackPos-(4-1)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); $this->checkClassConst($this->semValue, $stackPos-(4-1));
},
- 274 => function ($stackPos) {
+ 275 => function ($stackPos) {
$this->semValue = new Stmt\ClassMethod($this->semStack[$stackPos-(9-4)], ['type' => $this->semStack[$stackPos-(9-1)], 'byRef' => $this->semStack[$stackPos-(9-3)], 'params' => $this->semStack[$stackPos-(9-6)], 'returnType' => $this->semStack[$stackPos-(9-8)], 'stmts' => $this->semStack[$stackPos-(9-9)]], $this->startAttributeStack[$stackPos-(9-1)] + $this->endAttributes);
$this->checkClassMethod($this->semValue, $stackPos-(9-1));
},
- 275 => function ($stackPos) {
- $this->semValue = new Stmt\TraitUse($this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
- },
276 => function ($stackPos) {
- $this->semValue = null; /* will be skipped */
+ $this->semValue = new Stmt\TraitUse($this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
},
277 => function ($stackPos) {
- $this->semValue = array();
+ $this->semValue = null; /* will be skipped */
},
278 => function ($stackPos) {
- $this->semValue = $this->semStack[$stackPos-(3-2)];
+ $this->semValue = array();
},
279 => function ($stackPos) {
- $this->semValue = array();
+ $this->semValue = $this->semStack[$stackPos-(3-2)];
},
280 => function ($stackPos) {
- $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)];
+ $this->semValue = array();
},
281 => function ($stackPos) {
- $this->semValue = new Stmt\TraitUseAdaptation\Precedence($this->semStack[$stackPos-(4-1)][0], $this->semStack[$stackPos-(4-1)][1], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes);
+ $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)];
},
282 => function ($stackPos) {
- $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos-(5-1)][0], $this->semStack[$stackPos-(5-1)][1], $this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-4)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes);
+ $this->semValue = new Stmt\TraitUseAdaptation\Precedence($this->semStack[$stackPos-(4-1)][0], $this->semStack[$stackPos-(4-1)][1], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes);
},
283 => function ($stackPos) {
- $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos-(4-1)][0], $this->semStack[$stackPos-(4-1)][1], $this->semStack[$stackPos-(4-3)], null, $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes);
+ $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos-(5-1)][0], $this->semStack[$stackPos-(5-1)][1], $this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-4)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes);
},
284 => function ($stackPos) {
- $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos-(4-1)][0], $this->semStack[$stackPos-(4-1)][1], null, $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes);
+ $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos-(4-1)][0], $this->semStack[$stackPos-(4-1)][1], $this->semStack[$stackPos-(4-3)], null, $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes);
},
285 => function ($stackPos) {
$this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos-(4-1)][0], $this->semStack[$stackPos-(4-1)][1], null, $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes);
},
286 => function ($stackPos) {
- $this->semValue = array($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)]);
+ $this->semValue = new Stmt\TraitUseAdaptation\Alias($this->semStack[$stackPos-(4-1)][0], $this->semStack[$stackPos-(4-1)][1], null, $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes);
},
287 => function ($stackPos) {
- $this->semValue = $this->semStack[$stackPos-(1-1)];
+ $this->semValue = array($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)]);
},
288 => function ($stackPos) {
- $this->semValue = array(null, $this->semStack[$stackPos-(1-1)]);
+ $this->semValue = $this->semStack[$stackPos-(1-1)];
},
289 => function ($stackPos) {
- $this->semValue = null;
+ $this->semValue = array(null, $this->semStack[$stackPos-(1-1)]);
},
290 => function ($stackPos) {
- $this->semValue = $this->semStack[$stackPos-(1-1)];
+ $this->semValue = null;
},
291 => function ($stackPos) {
$this->semValue = $this->semStack[$stackPos-(1-1)];
},
292 => function ($stackPos) {
- $this->semValue = 0;
+ $this->semValue = $this->semStack[$stackPos-(1-1)];
},
293 => function ($stackPos) {
$this->semValue = 0;
},
294 => function ($stackPos) {
- $this->semValue = $this->semStack[$stackPos-(1-1)];
+ $this->semValue = 0;
},
295 => function ($stackPos) {
$this->semValue = $this->semStack[$stackPos-(1-1)];
},
296 => function ($stackPos) {
- $this->checkModifier($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $stackPos-(2-2)); $this->semValue = $this->semStack[$stackPos-(2-1)] | $this->semStack[$stackPos-(2-2)];
+ $this->semValue = $this->semStack[$stackPos-(1-1)];
},
297 => function ($stackPos) {
- $this->semValue = Stmt\Class_::MODIFIER_PUBLIC;
+ $this->checkModifier($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $stackPos-(2-2)); $this->semValue = $this->semStack[$stackPos-(2-1)] | $this->semStack[$stackPos-(2-2)];
},
298 => function ($stackPos) {
- $this->semValue = Stmt\Class_::MODIFIER_PROTECTED;
+ $this->semValue = Stmt\Class_::MODIFIER_PUBLIC;
},
299 => function ($stackPos) {
- $this->semValue = Stmt\Class_::MODIFIER_PRIVATE;
+ $this->semValue = Stmt\Class_::MODIFIER_PROTECTED;
},
300 => function ($stackPos) {
- $this->semValue = Stmt\Class_::MODIFIER_STATIC;
+ $this->semValue = Stmt\Class_::MODIFIER_PRIVATE;
},
301 => function ($stackPos) {
- $this->semValue = Stmt\Class_::MODIFIER_ABSTRACT;
+ $this->semValue = Stmt\Class_::MODIFIER_STATIC;
},
302 => function ($stackPos) {
- $this->semValue = Stmt\Class_::MODIFIER_FINAL;
+ $this->semValue = Stmt\Class_::MODIFIER_ABSTRACT;
},
303 => function ($stackPos) {
- $this->semValue = $this->semStack[$stackPos-(2-1)];
+ $this->semValue = Stmt\Class_::MODIFIER_FINAL;
},
304 => function ($stackPos) {
- $this->semValue = array($this->semStack[$stackPos-(1-1)]);
+ $this->semValue = $this->semStack[$stackPos-(2-1)];
},
305 => function ($stackPos) {
- $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)];
+ $this->semValue = array($this->semStack[$stackPos-(1-1)]);
},
306 => function ($stackPos) {
- $this->semValue = new Node\VarLikeIdentifier(substr($this->semStack[$stackPos-(1-1)], 1), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
+ $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)];
},
307 => function ($stackPos) {
- $this->semValue = new Stmt\PropertyProperty($this->semStack[$stackPos-(1-1)], null, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
+ $this->semValue = new Node\VarLikeIdentifier(substr($this->semStack[$stackPos-(1-1)], 1), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
},
308 => function ($stackPos) {
- $this->semValue = new Stmt\PropertyProperty($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
+ $this->semValue = new Stmt\PropertyProperty($this->semStack[$stackPos-(1-1)], null, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
},
309 => function ($stackPos) {
- $this->semValue = $this->semStack[$stackPos-(2-1)];
+ $this->semValue = new Stmt\PropertyProperty($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
},
310 => function ($stackPos) {
- $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)];
+ $this->semValue = $this->semStack[$stackPos-(2-1)];
},
311 => function ($stackPos) {
- $this->semValue = array($this->semStack[$stackPos-(1-1)]);
+ $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)];
},
312 => function ($stackPos) {
- $this->semValue = array();
+ $this->semValue = array($this->semStack[$stackPos-(1-1)]);
},
313 => function ($stackPos) {
- $this->semValue = $this->semStack[$stackPos-(1-1)];
+ $this->semValue = array();
},
314 => function ($stackPos) {
$this->semValue = $this->semStack[$stackPos-(1-1)];
},
315 => function ($stackPos) {
- $this->semValue = new Expr\Assign($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
+ $this->semValue = $this->semStack[$stackPos-(1-1)];
},
316 => function ($stackPos) {
$this->semValue = new Expr\Assign($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
@@ -1814,434 +1814,434 @@ class Php7 extends \PhpParser\ParserAbstract
$this->semValue = new Expr\Assign($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
},
318 => function ($stackPos) {
- $this->semValue = new Expr\AssignRef($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes);
+ $this->semValue = new Expr\Assign($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
},
319 => function ($stackPos) {
- $this->semValue = $this->semStack[$stackPos-(1-1)];
+ $this->semValue = new Expr\AssignRef($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes);
},
320 => function ($stackPos) {
- $this->semValue = new Expr\Clone_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
+ $this->semValue = $this->semStack[$stackPos-(1-1)];
},
321 => function ($stackPos) {
- $this->semValue = new Expr\AssignOp\Plus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
+ $this->semValue = new Expr\Clone_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
},
322 => function ($stackPos) {
- $this->semValue = new Expr\AssignOp\Minus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
+ $this->semValue = new Expr\AssignOp\Plus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
},
323 => function ($stackPos) {
- $this->semValue = new Expr\AssignOp\Mul($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
+ $this->semValue = new Expr\AssignOp\Minus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
},
324 => function ($stackPos) {
- $this->semValue = new Expr\AssignOp\Div($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
+ $this->semValue = new Expr\AssignOp\Mul($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
},
325 => function ($stackPos) {
- $this->semValue = new Expr\AssignOp\Concat($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
+ $this->semValue = new Expr\AssignOp\Div($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
},
326 => function ($stackPos) {
- $this->semValue = new Expr\AssignOp\Mod($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
+ $this->semValue = new Expr\AssignOp\Concat($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
},
327 => function ($stackPos) {
- $this->semValue = new Expr\AssignOp\BitwiseAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
+ $this->semValue = new Expr\AssignOp\Mod($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
},
328 => function ($stackPos) {
- $this->semValue = new Expr\AssignOp\BitwiseOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
+ $this->semValue = new Expr\AssignOp\BitwiseAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
},
329 => function ($stackPos) {
- $this->semValue = new Expr\AssignOp\BitwiseXor($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
+ $this->semValue = new Expr\AssignOp\BitwiseOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
},
330 => function ($stackPos) {
- $this->semValue = new Expr\AssignOp\ShiftLeft($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
+ $this->semValue = new Expr\AssignOp\BitwiseXor($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
},
331 => function ($stackPos) {
- $this->semValue = new Expr\AssignOp\ShiftRight($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
+ $this->semValue = new Expr\AssignOp\ShiftLeft($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
},
332 => function ($stackPos) {
- $this->semValue = new Expr\AssignOp\Pow($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
+ $this->semValue = new Expr\AssignOp\ShiftRight($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
},
333 => function ($stackPos) {
- $this->semValue = new Expr\PostInc($this->semStack[$stackPos-(2-1)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
+ $this->semValue = new Expr\AssignOp\Pow($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
},
334 => function ($stackPos) {
- $this->semValue = new Expr\PreInc($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
+ $this->semValue = new Expr\PostInc($this->semStack[$stackPos-(2-1)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
},
335 => function ($stackPos) {
- $this->semValue = new Expr\PostDec($this->semStack[$stackPos-(2-1)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
+ $this->semValue = new Expr\PreInc($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
},
336 => function ($stackPos) {
- $this->semValue = new Expr\PreDec($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
+ $this->semValue = new Expr\PostDec($this->semStack[$stackPos-(2-1)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
},
337 => function ($stackPos) {
- $this->semValue = new Expr\BinaryOp\BooleanOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
+ $this->semValue = new Expr\PreDec($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
},
338 => function ($stackPos) {
- $this->semValue = new Expr\BinaryOp\BooleanAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
+ $this->semValue = new Expr\BinaryOp\BooleanOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
},
339 => function ($stackPos) {
- $this->semValue = new Expr\BinaryOp\LogicalOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
+ $this->semValue = new Expr\BinaryOp\BooleanAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
},
340 => function ($stackPos) {
- $this->semValue = new Expr\BinaryOp\LogicalAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
+ $this->semValue = new Expr\BinaryOp\LogicalOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
},
341 => function ($stackPos) {
- $this->semValue = new Expr\BinaryOp\LogicalXor($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
+ $this->semValue = new Expr\BinaryOp\LogicalAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
},
342 => function ($stackPos) {
- $this->semValue = new Expr\BinaryOp\BitwiseOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
+ $this->semValue = new Expr\BinaryOp\LogicalXor($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
},
343 => function ($stackPos) {
- $this->semValue = new Expr\BinaryOp\BitwiseAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
+ $this->semValue = new Expr\BinaryOp\BitwiseOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
},
344 => function ($stackPos) {
- $this->semValue = new Expr\BinaryOp\BitwiseXor($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
+ $this->semValue = new Expr\BinaryOp\BitwiseAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
},
345 => function ($stackPos) {
- $this->semValue = new Expr\BinaryOp\Concat($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
+ $this->semValue = new Expr\BinaryOp\BitwiseXor($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
},
346 => function ($stackPos) {
- $this->semValue = new Expr\BinaryOp\Plus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
+ $this->semValue = new Expr\BinaryOp\Concat($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
},
347 => function ($stackPos) {
- $this->semValue = new Expr\BinaryOp\Minus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
+ $this->semValue = new Expr\BinaryOp\Plus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
},
348 => function ($stackPos) {
- $this->semValue = new Expr\BinaryOp\Mul($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
+ $this->semValue = new Expr\BinaryOp\Minus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
},
349 => function ($stackPos) {
- $this->semValue = new Expr\BinaryOp\Div($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
+ $this->semValue = new Expr\BinaryOp\Mul($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
},
350 => function ($stackPos) {
- $this->semValue = new Expr\BinaryOp\Mod($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
+ $this->semValue = new Expr\BinaryOp\Div($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
},
351 => function ($stackPos) {
- $this->semValue = new Expr\BinaryOp\ShiftLeft($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
+ $this->semValue = new Expr\BinaryOp\Mod($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
},
352 => function ($stackPos) {
- $this->semValue = new Expr\BinaryOp\ShiftRight($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
+ $this->semValue = new Expr\BinaryOp\ShiftLeft($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
},
353 => function ($stackPos) {
- $this->semValue = new Expr\BinaryOp\Pow($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
+ $this->semValue = new Expr\BinaryOp\ShiftRight($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
},
354 => function ($stackPos) {
- $this->semValue = new Expr\UnaryPlus($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
+ $this->semValue = new Expr\BinaryOp\Pow($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
},
355 => function ($stackPos) {
- $this->semValue = new Expr\UnaryMinus($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
+ $this->semValue = new Expr\UnaryPlus($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
},
356 => function ($stackPos) {
- $this->semValue = new Expr\BooleanNot($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
+ $this->semValue = new Expr\UnaryMinus($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
},
357 => function ($stackPos) {
- $this->semValue = new Expr\BitwiseNot($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
+ $this->semValue = new Expr\BooleanNot($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
},
358 => function ($stackPos) {
- $this->semValue = new Expr\BinaryOp\Identical($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
+ $this->semValue = new Expr\BitwiseNot($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
},
359 => function ($stackPos) {
- $this->semValue = new Expr\BinaryOp\NotIdentical($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
+ $this->semValue = new Expr\BinaryOp\Identical($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
},
360 => function ($stackPos) {
- $this->semValue = new Expr\BinaryOp\Equal($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
+ $this->semValue = new Expr\BinaryOp\NotIdentical($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
},
361 => function ($stackPos) {
- $this->semValue = new Expr\BinaryOp\NotEqual($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
+ $this->semValue = new Expr\BinaryOp\Equal($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
},
362 => function ($stackPos) {
- $this->semValue = new Expr\BinaryOp\Spaceship($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
+ $this->semValue = new Expr\BinaryOp\NotEqual($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
},
363 => function ($stackPos) {
- $this->semValue = new Expr\BinaryOp\Smaller($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
+ $this->semValue = new Expr\BinaryOp\Spaceship($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
},
364 => function ($stackPos) {
- $this->semValue = new Expr\BinaryOp\SmallerOrEqual($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
+ $this->semValue = new Expr\BinaryOp\Smaller($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
},
365 => function ($stackPos) {
- $this->semValue = new Expr\BinaryOp\Greater($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
+ $this->semValue = new Expr\BinaryOp\SmallerOrEqual($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
},
366 => function ($stackPos) {
- $this->semValue = new Expr\BinaryOp\GreaterOrEqual($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
+ $this->semValue = new Expr\BinaryOp\Greater($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
},
367 => function ($stackPos) {
- $this->semValue = new Expr\Instanceof_($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
+ $this->semValue = new Expr\BinaryOp\GreaterOrEqual($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
},
368 => function ($stackPos) {
- $this->semValue = $this->semStack[$stackPos-(3-2)];
+ $this->semValue = new Expr\Instanceof_($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
},
369 => function ($stackPos) {
- $this->semValue = new Expr\Ternary($this->semStack[$stackPos-(5-1)], $this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-5)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes);
+ $this->semValue = $this->semStack[$stackPos-(3-2)];
},
370 => function ($stackPos) {
- $this->semValue = new Expr\Ternary($this->semStack[$stackPos-(4-1)], null, $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes);
+ $this->semValue = new Expr\Ternary($this->semStack[$stackPos-(5-1)], $this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-5)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes);
},
371 => function ($stackPos) {
- $this->semValue = new Expr\BinaryOp\Coalesce($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
+ $this->semValue = new Expr\Ternary($this->semStack[$stackPos-(4-1)], null, $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes);
},
372 => function ($stackPos) {
- $this->semValue = new Expr\Isset_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes);
+ $this->semValue = new Expr\BinaryOp\Coalesce($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
},
373 => function ($stackPos) {
- $this->semValue = new Expr\Empty_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes);
+ $this->semValue = new Expr\Isset_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes);
},
374 => function ($stackPos) {
- $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_INCLUDE, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
+ $this->semValue = new Expr\Empty_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes);
},
375 => function ($stackPos) {
- $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_INCLUDE_ONCE, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
+ $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_INCLUDE, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
},
376 => function ($stackPos) {
- $this->semValue = new Expr\Eval_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes);
+ $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_INCLUDE_ONCE, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
},
377 => function ($stackPos) {
- $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_REQUIRE, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
+ $this->semValue = new Expr\Eval_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes);
},
378 => function ($stackPos) {
- $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_REQUIRE_ONCE, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
+ $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_REQUIRE, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
},
379 => function ($stackPos) {
- $this->semValue = new Expr\Cast\Int_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
+ $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_REQUIRE_ONCE, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
},
380 => function ($stackPos) {
- $this->semValue = new Expr\Cast\Double($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
+ $this->semValue = new Expr\Cast\Int_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
},
381 => function ($stackPos) {
- $this->semValue = new Expr\Cast\String_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
+ $this->semValue = new Expr\Cast\Double($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
},
382 => function ($stackPos) {
- $this->semValue = new Expr\Cast\Array_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
+ $this->semValue = new Expr\Cast\String_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
},
383 => function ($stackPos) {
- $this->semValue = new Expr\Cast\Object_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
+ $this->semValue = new Expr\Cast\Array_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
},
384 => function ($stackPos) {
- $this->semValue = new Expr\Cast\Bool_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
+ $this->semValue = new Expr\Cast\Object_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
},
385 => function ($stackPos) {
- $this->semValue = new Expr\Cast\Unset_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
+ $this->semValue = new Expr\Cast\Bool_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
},
386 => function ($stackPos) {
+ $this->semValue = new Expr\Cast\Unset_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
+ },
+ 387 => function ($stackPos) {
$attrs = $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes;
$attrs['kind'] = strtolower($this->semStack[$stackPos-(2-1)]) === 'exit' ? Expr\Exit_::KIND_EXIT : Expr\Exit_::KIND_DIE;
$this->semValue = new Expr\Exit_($this->semStack[$stackPos-(2-2)], $attrs);
},
- 387 => function ($stackPos) {
+ 388 => function ($stackPos) {
$this->semValue = new Expr\ErrorSuppress($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
},
- 388 => function ($stackPos) {
+ 389 => function ($stackPos) {
$this->semValue = $this->semStack[$stackPos-(1-1)];
},
- 389 => function ($stackPos) {
+ 390 => function ($stackPos) {
$this->semValue = new Expr\ShellExec($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
},
- 390 => function ($stackPos) {
+ 391 => function ($stackPos) {
$this->semValue = new Expr\Print_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
},
- 391 => function ($stackPos) {
+ 392 => function ($stackPos) {
$this->semValue = new Expr\Yield_(null, null, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
},
- 392 => function ($stackPos) {
+ 393 => function ($stackPos) {
$this->semValue = new Expr\Yield_($this->semStack[$stackPos-(2-2)], null, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
},
- 393 => function ($stackPos) {
+ 394 => function ($stackPos) {
$this->semValue = new Expr\Yield_($this->semStack[$stackPos-(4-4)], $this->semStack[$stackPos-(4-2)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes);
},
- 394 => function ($stackPos) {
+ 395 => function ($stackPos) {
$this->semValue = new Expr\YieldFrom($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
},
- 395 => function ($stackPos) {
+ 396 => function ($stackPos) {
$this->semValue = new Expr\Closure(['static' => false, 'byRef' => $this->semStack[$stackPos-(8-2)], 'params' => $this->semStack[$stackPos-(8-4)], 'uses' => $this->semStack[$stackPos-(8-6)], 'returnType' => $this->semStack[$stackPos-(8-7)], 'stmts' => $this->semStack[$stackPos-(8-8)]], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes);
},
- 396 => function ($stackPos) {
+ 397 => function ($stackPos) {
$this->semValue = new Expr\Closure(['static' => true, 'byRef' => $this->semStack[$stackPos-(9-3)], 'params' => $this->semStack[$stackPos-(9-5)], 'uses' => $this->semStack[$stackPos-(9-7)], 'returnType' => $this->semStack[$stackPos-(9-8)], 'stmts' => $this->semStack[$stackPos-(9-9)]], $this->startAttributeStack[$stackPos-(9-1)] + $this->endAttributes);
},
- 397 => function ($stackPos) {
+ 398 => function ($stackPos) {
$this->semValue = array(new Stmt\Class_(null, ['type' => 0, 'extends' => $this->semStack[$stackPos-(7-3)], 'implements' => $this->semStack[$stackPos-(7-4)], 'stmts' => $this->semStack[$stackPos-(7-6)]], $this->startAttributeStack[$stackPos-(7-1)] + $this->endAttributes), $this->semStack[$stackPos-(7-2)]);
$this->checkClass($this->semValue[0], -1);
},
- 398 => function ($stackPos) {
- $this->semValue = new Expr\New_($this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
- },
399 => function ($stackPos) {
- list($class, $ctorArgs) = $this->semStack[$stackPos-(2-2)]; $this->semValue = new Expr\New_($class, $ctorArgs, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
+ $this->semValue = new Expr\New_($this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
},
400 => function ($stackPos) {
- $this->semValue = array();
+ list($class, $ctorArgs) = $this->semStack[$stackPos-(2-2)]; $this->semValue = new Expr\New_($class, $ctorArgs, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
},
401 => function ($stackPos) {
- $this->semValue = $this->semStack[$stackPos-(4-3)];
+ $this->semValue = array();
},
402 => function ($stackPos) {
- $this->semValue = $this->semStack[$stackPos-(2-1)];
+ $this->semValue = $this->semStack[$stackPos-(4-3)];
},
403 => function ($stackPos) {
- $this->semValue = array($this->semStack[$stackPos-(1-1)]);
+ $this->semValue = $this->semStack[$stackPos-(2-1)];
},
404 => function ($stackPos) {
- $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)];
+ $this->semValue = array($this->semStack[$stackPos-(1-1)]);
},
405 => function ($stackPos) {
- $this->semValue = new Expr\ClosureUse($this->semStack[$stackPos-(2-2)], $this->semStack[$stackPos-(2-1)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
+ $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)];
},
406 => function ($stackPos) {
- $this->semValue = new Expr\FuncCall($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
+ $this->semValue = new Expr\ClosureUse($this->semStack[$stackPos-(2-2)], $this->semStack[$stackPos-(2-1)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
},
407 => function ($stackPos) {
$this->semValue = new Expr\FuncCall($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
},
408 => function ($stackPos) {
- $this->semValue = new Expr\StaticCall($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes);
+ $this->semValue = new Expr\FuncCall($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
},
409 => function ($stackPos) {
- $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
+ $this->semValue = new Expr\StaticCall($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes);
},
410 => function ($stackPos) {
- $this->semValue = $this->semStack[$stackPos-(1-1)];
+ $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
},
411 => function ($stackPos) {
- $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
+ $this->semValue = $this->semStack[$stackPos-(1-1)];
},
412 => function ($stackPos) {
- $this->semValue = new Name\FullyQualified($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
+ $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
},
413 => function ($stackPos) {
- $this->semValue = new Name\Relative($this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
+ $this->semValue = new Name\FullyQualified($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
},
414 => function ($stackPos) {
- $this->semValue = $this->semStack[$stackPos-(1-1)];
+ $this->semValue = new Name\Relative($this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
},
415 => function ($stackPos) {
$this->semValue = $this->semStack[$stackPos-(1-1)];
},
416 => function ($stackPos) {
- $this->semValue = new Expr\Error($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); $this->errorState = 2;
+ $this->semValue = $this->semStack[$stackPos-(1-1)];
},
417 => function ($stackPos) {
- $this->semValue = $this->semStack[$stackPos-(1-1)];
+ $this->semValue = new Expr\Error($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); $this->errorState = 2;
},
418 => function ($stackPos) {
$this->semValue = $this->semStack[$stackPos-(1-1)];
},
419 => function ($stackPos) {
- $this->semValue = null;
+ $this->semValue = $this->semStack[$stackPos-(1-1)];
},
420 => function ($stackPos) {
- $this->semValue = $this->semStack[$stackPos-(3-2)];
+ $this->semValue = null;
},
421 => function ($stackPos) {
- $this->semValue = array();
+ $this->semValue = $this->semStack[$stackPos-(3-2)];
},
422 => function ($stackPos) {
- $this->semValue = array(new Scalar\EncapsedStringPart(Scalar\String_::parseEscapeSequences($this->semStack[$stackPos-(1-1)], '`'), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes));
+ $this->semValue = array();
},
423 => function ($stackPos) {
- foreach ($this->semStack[$stackPos-(1-1)] as $s) { if ($s instanceof Node\Scalar\EncapsedStringPart) { $s->value = Node\Scalar\String_::parseEscapeSequences($s->value, '`', true); } }; $this->semValue = $this->semStack[$stackPos-(1-1)];
+ $this->semValue = array(new Scalar\EncapsedStringPart(Scalar\String_::parseEscapeSequences($this->semStack[$stackPos-(1-1)], '`'), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes));
},
424 => function ($stackPos) {
- $this->semValue = array();
+ foreach ($this->semStack[$stackPos-(1-1)] as $s) { if ($s instanceof Node\Scalar\EncapsedStringPart) { $s->value = Node\Scalar\String_::parseEscapeSequences($s->value, '`', true); } }; $this->semValue = $this->semStack[$stackPos-(1-1)];
},
425 => function ($stackPos) {
- $this->semValue = $this->semStack[$stackPos-(1-1)];
+ $this->semValue = array();
},
426 => function ($stackPos) {
- $this->semValue = new Expr\ConstFetch($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
+ $this->semValue = $this->semStack[$stackPos-(1-1)];
},
427 => function ($stackPos) {
- $this->semValue = new Expr\ClassConstFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
+ $this->semValue = new Expr\ConstFetch($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
},
428 => function ($stackPos) {
- $this->semValue = new Expr\ClassConstFetch($this->semStack[$stackPos-(3-1)], new Expr\Error($this->startAttributeStack[$stackPos-(3-3)] + $this->endAttributeStack[$stackPos-(3-3)]), $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); $this->errorState = 2;
+ $this->semValue = new Expr\ClassConstFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
},
429 => function ($stackPos) {
+ $this->semValue = new Expr\ClassConstFetch($this->semStack[$stackPos-(3-1)], new Expr\Error($this->startAttributeStack[$stackPos-(3-3)] + $this->endAttributeStack[$stackPos-(3-3)]), $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); $this->errorState = 2;
+ },
+ 430 => function ($stackPos) {
$attrs = $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes; $attrs['kind'] = Expr\Array_::KIND_SHORT;
$this->semValue = new Expr\Array_($this->semStack[$stackPos-(3-2)], $attrs);
},
- 430 => function ($stackPos) {
+ 431 => function ($stackPos) {
$attrs = $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes; $attrs['kind'] = Expr\Array_::KIND_LONG;
$this->semValue = new Expr\Array_($this->semStack[$stackPos-(4-3)], $attrs);
},
- 431 => function ($stackPos) {
+ 432 => function ($stackPos) {
$this->semValue = $this->semStack[$stackPos-(1-1)];
},
- 432 => function ($stackPos) {
+ 433 => function ($stackPos) {
$attrs = $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes; $attrs['kind'] = ($this->semStack[$stackPos-(1-1)][0] === "'" || ($this->semStack[$stackPos-(1-1)][1] === "'" && ($this->semStack[$stackPos-(1-1)][0] === 'b' || $this->semStack[$stackPos-(1-1)][0] === 'B')) ? Scalar\String_::KIND_SINGLE_QUOTED : Scalar\String_::KIND_DOUBLE_QUOTED);
$this->semValue = new Scalar\String_(Scalar\String_::parse($this->semStack[$stackPos-(1-1)]), $attrs);
},
- 433 => function ($stackPos) {
- $this->semValue = $this->parseLNumber($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
- },
434 => function ($stackPos) {
- $this->semValue = new Scalar\DNumber(Scalar\DNumber::parse($this->semStack[$stackPos-(1-1)]), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
+ $this->semValue = $this->parseLNumber($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
},
435 => function ($stackPos) {
- $this->semValue = new Scalar\MagicConst\Line($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
+ $this->semValue = new Scalar\DNumber(Scalar\DNumber::parse($this->semStack[$stackPos-(1-1)]), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
},
436 => function ($stackPos) {
- $this->semValue = new Scalar\MagicConst\File($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
+ $this->semValue = new Scalar\MagicConst\Line($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
},
437 => function ($stackPos) {
- $this->semValue = new Scalar\MagicConst\Dir($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
+ $this->semValue = new Scalar\MagicConst\File($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
},
438 => function ($stackPos) {
- $this->semValue = new Scalar\MagicConst\Class_($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
+ $this->semValue = new Scalar\MagicConst\Dir($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
},
439 => function ($stackPos) {
- $this->semValue = new Scalar\MagicConst\Trait_($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
+ $this->semValue = new Scalar\MagicConst\Class_($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
},
440 => function ($stackPos) {
- $this->semValue = new Scalar\MagicConst\Method($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
+ $this->semValue = new Scalar\MagicConst\Trait_($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
},
441 => function ($stackPos) {
- $this->semValue = new Scalar\MagicConst\Function_($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
+ $this->semValue = new Scalar\MagicConst\Method($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
},
442 => function ($stackPos) {
- $this->semValue = new Scalar\MagicConst\Namespace_($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
+ $this->semValue = new Scalar\MagicConst\Function_($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
},
443 => function ($stackPos) {
- $this->semValue = $this->semStack[$stackPos-(1-1)];
+ $this->semValue = new Scalar\MagicConst\Namespace_($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
},
444 => function ($stackPos) {
$this->semValue = $this->semStack[$stackPos-(1-1)];
},
445 => function ($stackPos) {
- $this->semValue = $this->parseDocString($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes, $this->startAttributeStack[$stackPos-(3-3)] + $this->endAttributeStack[$stackPos-(3-3)], true);
+ $this->semValue = $this->semStack[$stackPos-(1-1)];
},
446 => function ($stackPos) {
- $this->semValue = $this->parseDocString($this->semStack[$stackPos-(2-1)], '', $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes, $this->startAttributeStack[$stackPos-(2-2)] + $this->endAttributeStack[$stackPos-(2-2)], true);
+ $this->semValue = $this->parseDocString($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes, $this->startAttributeStack[$stackPos-(3-3)] + $this->endAttributeStack[$stackPos-(3-3)], true);
},
447 => function ($stackPos) {
- $attrs = $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes; $attrs['kind'] = Scalar\String_::KIND_DOUBLE_QUOTED;
- foreach ($this->semStack[$stackPos-(3-2)] as $s) { if ($s instanceof Node\Scalar\EncapsedStringPart) { $s->value = Node\Scalar\String_::parseEscapeSequences($s->value, '"', true); } }; $this->semValue = new Scalar\Encapsed($this->semStack[$stackPos-(3-2)], $attrs);
+ $this->semValue = $this->parseDocString($this->semStack[$stackPos-(2-1)], '', $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes, $this->startAttributeStack[$stackPos-(2-2)] + $this->endAttributeStack[$stackPos-(2-2)], true);
},
448 => function ($stackPos) {
- $this->semValue = $this->parseDocString($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes, $this->startAttributeStack[$stackPos-(3-3)] + $this->endAttributeStack[$stackPos-(3-3)], true);
+ $attrs = $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes; $attrs['kind'] = Scalar\String_::KIND_DOUBLE_QUOTED;
+ foreach ($this->semStack[$stackPos-(3-2)] as $s) { if ($s instanceof Node\Scalar\EncapsedStringPart) { $s->value = Node\Scalar\String_::parseEscapeSequences($s->value, '"', true); } }; $this->semValue = new Scalar\Encapsed($this->semStack[$stackPos-(3-2)], $attrs);
},
449 => function ($stackPos) {
- $this->semValue = null;
+ $this->semValue = $this->parseDocString($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes, $this->startAttributeStack[$stackPos-(3-3)] + $this->endAttributeStack[$stackPos-(3-3)], true);
},
450 => function ($stackPos) {
- $this->semValue = $this->semStack[$stackPos-(1-1)];
+ $this->semValue = null;
},
451 => function ($stackPos) {
$this->semValue = $this->semStack[$stackPos-(1-1)];
},
452 => function ($stackPos) {
- $this->semValue = $this->semStack[$stackPos-(3-2)];
+ $this->semValue = $this->semStack[$stackPos-(1-1)];
},
453 => function ($stackPos) {
- $this->semValue = $this->semStack[$stackPos-(1-1)];
+ $this->semValue = $this->semStack[$stackPos-(3-2)];
},
454 => function ($stackPos) {
$this->semValue = $this->semStack[$stackPos-(1-1)];
},
455 => function ($stackPos) {
- $this->semValue = $this->semStack[$stackPos-(3-2)];
+ $this->semValue = $this->semStack[$stackPos-(1-1)];
},
456 => function ($stackPos) {
- $this->semValue = $this->semStack[$stackPos-(1-1)];
+ $this->semValue = $this->semStack[$stackPos-(3-2)];
},
457 => function ($stackPos) {
- $this->semValue = new Expr\Variable($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
+ $this->semValue = $this->semStack[$stackPos-(1-1)];
},
458 => function ($stackPos) {
- $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes);
+ $this->semValue = new Expr\Variable($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
},
459 => function ($stackPos) {
$this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes);
@@ -2250,186 +2250,189 @@ class Php7 extends \PhpParser\ParserAbstract
$this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes);
},
461 => function ($stackPos) {
- $this->semValue = $this->semStack[$stackPos-(1-1)];
+ $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes);
},
462 => function ($stackPos) {
- $this->semValue = new Expr\MethodCall($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes);
+ $this->semValue = $this->semStack[$stackPos-(1-1)];
},
463 => function ($stackPos) {
- $this->semValue = $this->semStack[$stackPos-(1-1)];
+ $this->semValue = new Expr\MethodCall($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes);
},
464 => function ($stackPos) {
$this->semValue = $this->semStack[$stackPos-(1-1)];
},
465 => function ($stackPos) {
- $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
+ $this->semValue = $this->semStack[$stackPos-(1-1)];
},
466 => function ($stackPos) {
- $this->semValue = substr($this->semStack[$stackPos-(1-1)], 1);
+ $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
},
467 => function ($stackPos) {
- $this->semValue = $this->semStack[$stackPos-(4-3)];
+ $this->semValue = substr($this->semStack[$stackPos-(1-1)], 1);
},
468 => function ($stackPos) {
- $this->semValue = new Expr\Variable($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
+ $this->semValue = $this->semStack[$stackPos-(4-3)];
},
469 => function ($stackPos) {
- $this->semValue = new Expr\Error($this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); $this->errorState = 2;
+ $this->semValue = new Expr\Variable($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
},
470 => function ($stackPos) {
- $var = $this->semStack[$stackPos-(1-1)]; $this->semValue = \is_string($var) ? new Node\VarLikeIdentifier($var, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes) : $var;
+ $this->semValue = new Expr\Error($this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); $this->errorState = 2;
},
471 => function ($stackPos) {
- $this->semValue = new Expr\StaticPropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
+ $var = $this->semStack[$stackPos-(1-1)]; $this->semValue = \is_string($var) ? new Node\VarLikeIdentifier($var, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes) : $var;
},
472 => function ($stackPos) {
- $this->semValue = new Expr\Variable($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
+ $this->semValue = new Expr\StaticPropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
},
473 => function ($stackPos) {
- $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes);
+ $this->semValue = new Expr\Variable($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
},
474 => function ($stackPos) {
$this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes);
},
475 => function ($stackPos) {
- $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
+ $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes);
},
476 => function ($stackPos) {
- $this->semValue = new Expr\StaticPropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
+ $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
},
477 => function ($stackPos) {
$this->semValue = new Expr\StaticPropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
},
478 => function ($stackPos) {
- $this->semValue = $this->semStack[$stackPos-(1-1)];
+ $this->semValue = new Expr\StaticPropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
},
479 => function ($stackPos) {
- $this->semValue = $this->semStack[$stackPos-(3-2)];
+ $this->semValue = $this->semStack[$stackPos-(1-1)];
},
480 => function ($stackPos) {
- $this->semValue = new Expr\Variable($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
+ $this->semValue = $this->semStack[$stackPos-(3-2)];
},
481 => function ($stackPos) {
- $this->semValue = $this->semStack[$stackPos-(1-1)];
+ $this->semValue = new Expr\Variable($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
},
482 => function ($stackPos) {
- $this->semValue = $this->semStack[$stackPos-(3-2)];
+ $this->semValue = $this->semStack[$stackPos-(1-1)];
},
483 => function ($stackPos) {
- $this->semValue = new Expr\Variable($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
+ $this->semValue = $this->semStack[$stackPos-(3-2)];
},
484 => function ($stackPos) {
- $this->semValue = new Expr\Error($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); $this->errorState = 2;
+ $this->semValue = new Expr\Variable($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
},
485 => function ($stackPos) {
- $this->semValue = new Expr\List_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes);
+ $this->semValue = new Expr\Error($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); $this->errorState = 2;
},
486 => function ($stackPos) {
- $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)];
+ $this->semValue = new Expr\List_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes);
},
487 => function ($stackPos) {
- $this->semValue = array($this->semStack[$stackPos-(1-1)]);
+ $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)];
},
488 => function ($stackPos) {
- $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(1-1)], null, false, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
+ $this->semValue = array($this->semStack[$stackPos-(1-1)]);
},
489 => function ($stackPos) {
- $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(2-2)], null, true, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
+ $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(1-1)], null, false, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
},
490 => function ($stackPos) {
- $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(1-1)], null, false, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
+ $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(2-2)], null, true, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
},
491 => function ($stackPos) {
- $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(3-3)], $this->semStack[$stackPos-(3-1)], false, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
+ $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(1-1)], null, false, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
},
492 => function ($stackPos) {
- $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(4-4)], $this->semStack[$stackPos-(4-1)], true, $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes);
+ $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(3-3)], $this->semStack[$stackPos-(3-1)], false, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
},
493 => function ($stackPos) {
- $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(3-3)], $this->semStack[$stackPos-(3-1)], false, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
+ $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(4-4)], $this->semStack[$stackPos-(4-1)], true, $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes);
},
494 => function ($stackPos) {
- $this->semValue = null;
+ $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(3-3)], $this->semStack[$stackPos-(3-1)], false, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
},
495 => function ($stackPos) {
- $this->semValue = $this->semStack[$stackPos-(1-1)]; $end = count($this->semValue)-1; if ($this->semValue[$end] === null) array_pop($this->semValue);
+ $this->semValue = null;
},
496 => function ($stackPos) {
- $this->semValue = $this->semStack[$stackPos];
+ $this->semValue = $this->semStack[$stackPos-(1-1)]; $end = count($this->semValue)-1; if ($this->semValue[$end] === null) array_pop($this->semValue);
},
497 => function ($stackPos) {
$this->semValue = $this->semStack[$stackPos];
},
498 => function ($stackPos) {
- $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)];
+ /* do nothing -- prevent default action of $$=$this->semStack[$1]. See $551. */
},
499 => function ($stackPos) {
- $this->semValue = array($this->semStack[$stackPos-(1-1)]);
+ $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)];
},
500 => function ($stackPos) {
- $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(3-3)], $this->semStack[$stackPos-(3-1)], false, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
+ $this->semValue = array($this->semStack[$stackPos-(1-1)]);
},
501 => function ($stackPos) {
- $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(1-1)], null, false, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
+ $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(3-3)], $this->semStack[$stackPos-(3-1)], false, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
},
502 => function ($stackPos) {
- $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(4-4)], $this->semStack[$stackPos-(4-1)], true, $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes);
+ $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(1-1)], null, false, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
},
503 => function ($stackPos) {
- $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(2-2)], null, true, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
+ $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(4-4)], $this->semStack[$stackPos-(4-1)], true, $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes);
},
504 => function ($stackPos) {
- $this->semValue = null;
+ $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(2-2)], null, true, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
},
505 => function ($stackPos) {
- $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)];
+ $this->semValue = null;
},
506 => function ($stackPos) {
$this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)];
},
507 => function ($stackPos) {
- $this->semValue = array($this->semStack[$stackPos-(1-1)]);
+ $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)];
},
508 => function ($stackPos) {
- $this->semValue = array($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)]);
+ $this->semValue = array($this->semStack[$stackPos-(1-1)]);
},
509 => function ($stackPos) {
- $this->semValue = new Scalar\EncapsedStringPart($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
+ $this->semValue = array($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)]);
},
510 => function ($stackPos) {
- $this->semValue = new Expr\Variable($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
+ $this->semValue = new Scalar\EncapsedStringPart($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
},
511 => function ($stackPos) {
- $this->semValue = $this->semStack[$stackPos-(1-1)];
+ $this->semValue = new Expr\Variable($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
},
512 => function ($stackPos) {
- $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes);
+ $this->semValue = $this->semStack[$stackPos-(1-1)];
},
513 => function ($stackPos) {
- $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
+ $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes);
},
514 => function ($stackPos) {
- $this->semValue = new Expr\Variable($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
+ $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
},
515 => function ($stackPos) {
$this->semValue = new Expr\Variable($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
},
516 => function ($stackPos) {
- $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(6-2)], $this->semStack[$stackPos-(6-4)], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes);
+ $this->semValue = new Expr\Variable($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes);
},
517 => function ($stackPos) {
- $this->semValue = $this->semStack[$stackPos-(3-2)];
+ $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(6-2)], $this->semStack[$stackPos-(6-4)], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes);
},
518 => function ($stackPos) {
- $this->semValue = new Scalar\String_($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
+ $this->semValue = $this->semStack[$stackPos-(3-2)];
},
519 => function ($stackPos) {
- $this->semValue = $this->parseNumString($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
+ $this->semValue = new Scalar\String_($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
},
520 => function ($stackPos) {
- $this->semValue = $this->parseNumString('-' . $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
+ $this->semValue = $this->parseNumString($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes);
},
521 => function ($stackPos) {
+ $this->semValue = $this->parseNumString('-' . $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes);
+ },
+ 522 => function ($stackPos) {
$this->semValue = $this->semStack[$stackPos-(1-1)];
},
];
diff --git a/vendor/nikic/php-parser/test/code/parser/errorHandling/recovery.test b/vendor/nikic/php-parser/test/code/parser/errorHandling/recovery.test
index 67c0ffee..fdb5ed28 100644
--- a/vendor/nikic/php-parser/test/code/parser/errorHandling/recovery.test
+++ b/vendor/nikic/php-parser/test/code/parser/errorHandling/recovery.test
@@ -1373,4 +1373,37 @@ array(
)
)
)
-)
\ No newline at end of file
+)
+-----
+getPath(), -1)) {
- throw new \LogicException('URI path cannot end with a slash.');
+ $uri = $uri->withPath(rtrim($uri->getPath(), '/'));
}
$this->uri = $uri;
diff --git a/vendor/php-http/client-common/src/Plugin/CookiePlugin.php b/vendor/php-http/client-common/src/Plugin/CookiePlugin.php
index 59ee90da..523628f1 100644
--- a/vendor/php-http/client-common/src/Plugin/CookiePlugin.php
+++ b/vendor/php-http/client-common/src/Plugin/CookiePlugin.php
@@ -38,6 +38,7 @@ final class CookiePlugin implements Plugin
*/
public function handleRequest(RequestInterface $request, callable $next, callable $first)
{
+ $cookies = [];
foreach ($this->cookieJar->getCookies() as $cookie) {
if ($cookie->isExpired()) {
continue;
@@ -55,7 +56,11 @@ final class CookiePlugin implements Plugin
continue;
}
- $request = $request->withAddedHeader('Cookie', sprintf('%s=%s', $cookie->getName(), $cookie->getValue()));
+ $cookies[] = sprintf('%s=%s', $cookie->getName(), $cookie->getValue());
+ }
+
+ if (!empty($cookies)) {
+ $request = $request->withAddedHeader('Cookie', implode('; ', array_unique($cookies)));
}
return $next($request)->then(function (ResponseInterface $response) use ($request) {
diff --git a/vendor/php-http/discovery/CHANGELOG.md b/vendor/php-http/discovery/CHANGELOG.md
index 00c5136b..ee43ffd2 100644
--- a/vendor/php-http/discovery/CHANGELOG.md
+++ b/vendor/php-http/discovery/CHANGELOG.md
@@ -1,5 +1,34 @@
# Change Log
+## 1.5.2 - 2018-12-31
+
+Corrected mistakes in 1.5.1. The different between 1.5.2 and 1.5.0 is that
+we removed some PHP 7 code.
+
+## 1.5.1 - 2018-12-31
+
+This version added new features by mistake. These are reverted in 1.5.2.
+
+Do not use 1.5.1.
+
+### Fixed
+
+- Removed PHP 7 code
+
+## 1.5.0 - 2018-12-30
+
+### Added
+
+- Support for `nyholm/psr7` version 1.0.
+- `ClassDiscovery::safeClassExists` which will help Magento users.
+- Support for HTTPlug 2.0
+- Support for Buzz 1.0
+- Better error message when nothing found by introducing a new exception: `NoCandidateFoundException`.
+
+### Fixed
+
+- Fixed condition evaluation, it should stop after first invalid condition.
+
## 1.4.0 - 2018-02-06
### Added
diff --git a/vendor/php-http/discovery/composer.json b/vendor/php-http/discovery/composer.json
index 128af59a..97141f3b 100644
--- a/vendor/php-http/discovery/composer.json
+++ b/vendor/php-http/discovery/composer.json
@@ -14,7 +14,7 @@
"php": "^5.5 || ^7.0"
},
"require-dev": {
- "php-http/httplug": "^1.0",
+ "php-http/httplug": "^1.0|^2.0",
"php-http/message-factory": "^1.0",
"puli/composer-plugin": "1.0.0-beta10",
"phpspec/phpspec": "^2.4",
@@ -40,9 +40,12 @@
},
"extra": {
"branch-alias": {
- "dev-master": "1.3-dev"
+ "dev-master": "1.5-dev"
}
},
+ "conflict": {
+ "nyholm/psr7": "<1.0"
+ },
"prefer-stable": true,
"minimum-stability": "beta"
}
diff --git a/vendor/php-http/discovery/src/ClassDiscovery.php b/vendor/php-http/discovery/src/ClassDiscovery.php
index 760df6b7..40e2d1c5 100644
--- a/vendor/php-http/discovery/src/ClassDiscovery.php
+++ b/vendor/php-http/discovery/src/ClassDiscovery.php
@@ -4,6 +4,7 @@ namespace Http\Discovery;
use Http\Discovery\Exception\ClassInstantiationFailedException;
use Http\Discovery\Exception\DiscoveryFailedException;
+use Http\Discovery\Exception\NoCandidateFoundException;
use Http\Discovery\Exception\StrategyUnavailableException;
/**
@@ -70,6 +71,8 @@ abstract class ClassDiscovery
return $candidate['class'];
}
+
+ $exceptions[] = new NoCandidateFoundException($strategy, $candidates);
}
throw DiscoveryFailedException::create($exceptions);
@@ -161,20 +164,23 @@ abstract class ClassDiscovery
{
if (is_string($condition)) {
// Should be extended for functions, extensions???
- return class_exists($condition);
- } elseif (is_callable($condition)) {
- return $condition();
- } elseif (is_bool($condition)) {
+ return self::safeClassExists($condition);
+ }
+ if (is_callable($condition)) {
+ return (bool) $condition();
+ }
+ if (is_bool($condition)) {
return $condition;
- } elseif (is_array($condition)) {
- $evaluatedCondition = true;
-
- // Immediately stop execution if the condition is false
- for ($i = 0; $i < count($condition) && false !== $evaluatedCondition; ++$i) {
- $evaluatedCondition &= static::evaluateCondition($condition[$i]);
+ }
+ if (is_array($condition)) {
+ foreach ($condition as $c) {
+ if (false === static::evaluateCondition($c)) {
+ // Immediately stop execution if the condition is false
+ return false;
+ }
}
- return $evaluatedCondition;
+ return true;
}
return false;
@@ -205,4 +211,25 @@ abstract class ClassDiscovery
throw new ClassInstantiationFailedException('Could not instantiate class because parameter is neither a callable nor a string');
}
+
+ /**
+ * We want to do a "safe" version of PHP's "class_exists" because Magento has a bug
+ * (or they call it a "feature"). Magento is throwing an exception if you do class_exists()
+ * on a class that ends with "Factory" and if that file does not exits.
+ *
+ * This function will catch all potential exceptions and make sure it returns a boolean.
+ *
+ * @param string $class
+ * @param bool $autoload
+ *
+ * @return bool
+ */
+ public static function safeClassExists($class)
+ {
+ try {
+ return class_exists($class);
+ } catch (\Exception $e) {
+ return false;
+ }
+ }
}
diff --git a/vendor/php-http/discovery/src/Exception/NoCandidateFoundException.php b/vendor/php-http/discovery/src/Exception/NoCandidateFoundException.php
new file mode 100644
index 00000000..240b5688
--- /dev/null
+++ b/vendor/php-http/discovery/src/Exception/NoCandidateFoundException.php
@@ -0,0 +1,35 @@
+
+ */
+final class NoCandidateFoundException extends \Exception implements Exception
+{
+ /**
+ * @param string $strategy
+ * @param array $candidates
+ */
+ public function __construct($strategy, array $candidates)
+ {
+ $classes = array_map(
+ function ($a) {
+ return $a['class'];
+ },
+ $candidates
+ );
+
+ $message = sprintf(
+ 'No valid candidate found using strategy "%s". We tested the following candidates: %s.',
+ $strategy,
+ implode(', ', $classes)
+ );
+
+ parent::__construct($message);
+ }
+}
diff --git a/vendor/php-http/discovery/src/Strategy/CommonClassesStrategy.php b/vendor/php-http/discovery/src/Strategy/CommonClassesStrategy.php
index 31a39656..eff2c0a6 100644
--- a/vendor/php-http/discovery/src/Strategy/CommonClassesStrategy.php
+++ b/vendor/php-http/discovery/src/Strategy/CommonClassesStrategy.php
@@ -5,6 +5,7 @@ namespace Http\Discovery\Strategy;
use GuzzleHttp\Psr7\Request as GuzzleRequest;
use Http\Client\HttpAsyncClient;
use Http\Client\HttpClient;
+use Http\Discovery\MessageFactoryDiscovery;
use Http\Message\MessageFactory;
use Http\Message\MessageFactory\GuzzleMessageFactory;
use Http\Message\StreamFactory;
@@ -28,10 +29,7 @@ use Http\Adapter\Buzz\Client as Buzz;
use Http\Adapter\Cake\Client as Cake;
use Http\Adapter\Zend\Client as Zend;
use Http\Adapter\Artax\Client as Artax;
-use Nyholm\Psr7\Request as NyholmRequest;
-use Nyholm\Psr7\Factory\MessageFactory as NyholmMessageFactory;
-use Nyholm\Psr7\Factory\StreamFactory as NyholmStreamFactory;
-use Nyholm\Psr7\Factory\UriFactory as NyholmUriFactory;
+use Nyholm\Psr7\Factory\HttplugFactory as NyholmHttplugFactory;
/**
* @internal
@@ -45,19 +43,19 @@ final class CommonClassesStrategy implements DiscoveryStrategy
*/
private static $classes = [
MessageFactory::class => [
- ['class' => NyholmMessageFactory::class, 'condition' => [NyholmRequest::class, NyholmMessageFactory::class]],
+ ['class' => NyholmHttplugFactory::class, 'condition' => [NyholmHttplugFactory::class]],
['class' => GuzzleMessageFactory::class, 'condition' => [GuzzleRequest::class, GuzzleMessageFactory::class]],
['class' => DiactorosMessageFactory::class, 'condition' => [DiactorosRequest::class, DiactorosMessageFactory::class]],
['class' => SlimMessageFactory::class, 'condition' => [SlimRequest::class, SlimMessageFactory::class]],
],
StreamFactory::class => [
- ['class' => NyholmStreamFactory::class, 'condition' => [NyholmRequest::class, NyholmStreamFactory::class]],
+ ['class' => NyholmHttplugFactory::class, 'condition' => [NyholmHttplugFactory::class]],
['class' => GuzzleStreamFactory::class, 'condition' => [GuzzleRequest::class, GuzzleStreamFactory::class]],
['class' => DiactorosStreamFactory::class, 'condition' => [DiactorosRequest::class, DiactorosStreamFactory::class]],
['class' => SlimStreamFactory::class, 'condition' => [SlimRequest::class, SlimStreamFactory::class]],
],
UriFactory::class => [
- ['class' => NyholmUriFactory::class, 'condition' => [NyholmRequest::class, NyholmUriFactory::class]],
+ ['class' => NyholmHttplugFactory::class, 'condition' => [NyholmHttplugFactory::class]],
['class' => GuzzleUriFactory::class, 'condition' => [GuzzleRequest::class, GuzzleUriFactory::class]],
['class' => DiactorosUriFactory::class, 'condition' => [DiactorosRequest::class, DiactorosUriFactory::class]],
['class' => SlimUriFactory::class, 'condition' => [SlimRequest::class, SlimUriFactory::class]],
@@ -77,6 +75,10 @@ final class CommonClassesStrategy implements DiscoveryStrategy
['class' => Cake::class, 'condition' => Cake::class],
['class' => Zend::class, 'condition' => Zend::class],
['class' => Artax::class, 'condition' => Artax::class],
+ [
+ 'class' => [self::class, 'buzzInstantiate'],
+ 'condition' => [\Buzz\Client\FileGetContents::class, \Buzz\Message\ResponseBuilder::class],
+ ],
],
];
@@ -91,4 +93,9 @@ final class CommonClassesStrategy implements DiscoveryStrategy
return [];
}
+
+ public static function buzzInstantiate()
+ {
+ return new \Buzz\Client\FileGetContents(MessageFactoryDiscovery::find());
+ }
}
diff --git a/vendor/php-http/discovery/src/Strategy/PuliBetaStrategy.php b/vendor/php-http/discovery/src/Strategy/PuliBetaStrategy.php
index 2666fb37..c1e1fb7e 100644
--- a/vendor/php-http/discovery/src/Strategy/PuliBetaStrategy.php
+++ b/vendor/php-http/discovery/src/Strategy/PuliBetaStrategy.php
@@ -2,6 +2,7 @@
namespace Http\Discovery\Strategy;
+use Http\Discovery\ClassDiscovery;
use Http\Discovery\Exception\PuliUnavailableException;
use Puli\Discovery\Api\Discovery;
use Puli\GeneratedPuliFactory;
@@ -41,7 +42,7 @@ class PuliBetaStrategy implements DiscoveryStrategy
$puliFactoryClass = PULI_FACTORY_CLASS;
- if (!class_exists($puliFactoryClass)) {
+ if (!ClassDiscovery::safeClassExists($puliFactoryClass)) {
throw new PuliUnavailableException('Puli Factory class does not exist');
}
diff --git a/vendor/php-http/message/CHANGELOG.md b/vendor/php-http/message/CHANGELOG.md
index fb6ee575..48319fd0 100644
--- a/vendor/php-http/message/CHANGELOG.md
+++ b/vendor/php-http/message/CHANGELOG.md
@@ -1,9 +1,31 @@
# Change Log
+All notable changes to this project will be documented in this file.
+
+The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
+and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
+
+
## Unreleased
-## 1.7.0 - 2018-08-15
+## [1.7.2] - 2018-10-30
+
+### Fixed
+
+- FilteredStream uses `@trigger_error` instead of throwing exceptions to not
+ break careless users. You still need to fix your stream code to respect
+ `isSeekable`. Seeking does not work as expected, and we will add exceptions
+ in version 2.
+
+## [1.7.1] - 2018-10-29
+
+### Fixed
+
+- FilteredStream is not actually seekable
+
+
+## [1.7.0] - 2018-08-15
### Fixed
@@ -15,7 +37,8 @@
- Dropped tests on HHVM
-## 1.6.0 - 2017-07-05
+
+## [1.6.0] - 2017-07-05
### Added
@@ -23,9 +46,10 @@
### Fixed
-- Fix curl command of CurlFormatter when there is an user-agent header
+- Fix curl command of CurlFormatter when there is an user-agent header
+
-## 1.5.0 - 2017-02-14
+## [1.5.0] - 2017-02-14
### Added
@@ -36,7 +60,7 @@
### Fixed
- FilteredStream::getSize returns null because the contents size is unknown.
-- Stream factories does not rewinds streams. The previous behavior was not coherent between factories and inputs.
+- Stream factories does not rewinds streams. The previous behavior was not coherent between factories and inputs.
### Deprecated
@@ -44,14 +68,14 @@
- FilteredStream::getWriteFilter We did not implement writing to the streams at all. And if we do, the filter is an internal information and should not be used by consuming code.
-## 1.4.1 - 2016-12-16
+## [1.4.1] - 2016-12-16
### Fixed
- Cookie::matchPath Cookie with root path (`/`) will not match sub path (e.g. `/cookie`).
-## 1.4.0 - 2016-10-20
+## [1.4.0] - 2016-10-20
### Added
@@ -60,7 +84,7 @@
- cUrlFormatter to be able to redo the request with a cURL command
-## 1.3.1 - 2016-07-15
+## [1.3.1] - 2016-07-15
### Fixed
@@ -69,7 +93,7 @@
- FullHttpMessageFormatter rewinds streams after they are read
-## 1.3.0 - 2016-07-14
+## [1.3.0] - 2016-07-14
### Added
@@ -80,7 +104,7 @@
- #41: Response builder broke header value
-## 1.2.0 - 2016-03-29
+## [1.2.0] - 2016-03-29
### Added
@@ -100,7 +124,7 @@
- Matching authenitcation method, use RequestConditional instead
-## 1.1.0 - 2016-02-25
+## [1.1.0] - 2016-02-25
### Added
@@ -113,10 +137,10 @@
- Fix casting string on a FilteredStream not filtering the output
-## 1.0.0 - 2016-01-27
+## [1.0.0] - 2016-01-27
-## 0.2.0 - 2015-12-29
+## [0.2.0] - 2015-12-29
### Added
@@ -125,7 +149,7 @@
- [Apigen](http://www.apigen.org/) configuration
-## 0.1.2 - 2015-12-26
+## [0.1.2] - 2015-12-26
### Added
@@ -136,7 +160,7 @@
- Chunk filter namespace in Dechunk stream
-## 0.1.1 - 2015-12-25
+## [0.1.1] - 2015-12-25
### Added
@@ -151,3 +175,20 @@
- Encoding
- Message decorator
- Message factory (Guzzle, Diactoros)
+
+
+[Unreleased]: https://github.com/php-http/message/compare/v1.7.1...HEAD
+[1.7.1]: https://github.com/php-http/message/compare/1.7.0...v1.7.1
+[1.7.0]: https://github.com/php-http/message/compare/1.6.0...1.7.0
+[1.6.0]: https://github.com/php-http/message/compare/1.5.0...1.6.0
+[1.5.0]: https://github.com/php-http/message/compare/v1.4.1...1.5.0
+[1.4.1]: https://github.com/php-http/message/compare/v1.4.0...v1.4.1
+[1.4.0]: https://github.com/php-http/message/compare/v1.3.1...v1.4.0
+[1.3.1]: https://github.com/php-http/message/compare/v1.3.0...v1.3.1
+[1.3.0]: https://github.com/php-http/message/compare/v1.2.0...v1.3.0
+[1.2.0]: https://github.com/php-http/message/compare/v1.1.0...v1.2.0
+[1.1.0]: https://github.com/php-http/message/compare/v1.0.0...v1.1.0
+[1.0.0]: https://github.com/php-http/message/compare/0.2.0...v1.0.0
+[0.2.0]: https://github.com/php-http/message/compare/v0.1.2...0.2.0
+[0.1.2]: https://github.com/php-http/message/compare/v0.1.1...v0.1.2
+[0.1.1]: https://github.com/php-http/message/compare/v0.1.0...v0.1.1
diff --git a/vendor/php-http/message/src/Encoding/CompressStream.php b/vendor/php-http/message/src/Encoding/CompressStream.php
index d1013dc1..eeec6e03 100644
--- a/vendor/php-http/message/src/Encoding/CompressStream.php
+++ b/vendor/php-http/message/src/Encoding/CompressStream.php
@@ -2,6 +2,7 @@
namespace Http\Message\Encoding;
+use Clue\StreamFilter as Filter;
use Psr\Http\Message\StreamInterface;
/**
@@ -21,7 +22,10 @@ class CompressStream extends FilteredStream
throw new \RuntimeException('The zlib extension must be enabled to use this stream');
}
- parent::__construct($stream, ['window' => 15, 'level' => $level], ['window' => 15]);
+ parent::__construct($stream, ['window' => 15, 'level' => $level]);
+
+ // @deprecated will be removed in 2.0
+ $this->writeFilterCallback = Filter\fun($this->writeFilter(), ['window' => 15]);
}
/**
diff --git a/vendor/php-http/message/src/Encoding/DecompressStream.php b/vendor/php-http/message/src/Encoding/DecompressStream.php
index 4e3a723e..9a950ea9 100644
--- a/vendor/php-http/message/src/Encoding/DecompressStream.php
+++ b/vendor/php-http/message/src/Encoding/DecompressStream.php
@@ -2,6 +2,7 @@
namespace Http\Message\Encoding;
+use Clue\StreamFilter as Filter;
use Psr\Http\Message\StreamInterface;
/**
@@ -21,7 +22,10 @@ class DecompressStream extends FilteredStream
throw new \RuntimeException('The zlib extension must be enabled to use this stream');
}
- parent::__construct($stream, ['window' => 15], ['window' => 15, 'level' => $level]);
+ parent::__construct($stream, ['window' => 15]);
+
+ // @deprecated will be removed in 2.0
+ $this->writeFilterCallback = Filter\fun($this->writeFilter(), ['window' => 15, 'level' => $level]);
}
/**
diff --git a/vendor/php-http/message/src/Encoding/DeflateStream.php b/vendor/php-http/message/src/Encoding/DeflateStream.php
index 1d7344ba..f7ce8e2d 100644
--- a/vendor/php-http/message/src/Encoding/DeflateStream.php
+++ b/vendor/php-http/message/src/Encoding/DeflateStream.php
@@ -2,6 +2,7 @@
namespace Http\Message\Encoding;
+use Clue\StreamFilter as Filter;
use Psr\Http\Message\StreamInterface;
/**
@@ -17,7 +18,10 @@ class DeflateStream extends FilteredStream
*/
public function __construct(StreamInterface $stream, $level = -1)
{
- parent::__construct($stream, ['window' => -15, 'level' => $level], ['window' => -15]);
+ parent::__construct($stream, ['window' => -15, 'level' => $level]);
+
+ // @deprecated will be removed in 2.0
+ $this->writeFilterCallback = Filter\fun($this->writeFilter(), ['window' => -15]);
}
/**
diff --git a/vendor/php-http/message/src/Encoding/FilteredStream.php b/vendor/php-http/message/src/Encoding/FilteredStream.php
index d9b0fa86..7e5713e8 100644
--- a/vendor/php-http/message/src/Encoding/FilteredStream.php
+++ b/vendor/php-http/message/src/Encoding/FilteredStream.php
@@ -15,7 +15,10 @@ abstract class FilteredStream implements StreamInterface
{
const BUFFER_SIZE = 8192;
- use StreamDecorator;
+ use StreamDecorator {
+ rewind as private doRewind;
+ seek as private doSeek;
+ }
/**
* @var callable
@@ -146,11 +149,11 @@ abstract class FilteredStream implements StreamInterface
}
/**
- * {@inheritdoc}
+ * Always returns null because we can't tell the size of a stream when we filter.
*/
public function getSize()
{
- return;
+ return null;
}
/**
@@ -161,6 +164,34 @@ abstract class FilteredStream implements StreamInterface
return $this->getContents();
}
+ /**
+ * Filtered streams are not seekable.
+ *
+ * We would need to buffer and process everything to allow seeking.
+ */
+ public function isSeekable()
+ {
+ return false;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function rewind()
+ {
+ @trigger_error('Filtered streams are not seekable. This method will start raising an exception in the next major version', E_USER_DEPRECATED);
+ $this->doRewind();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function seek($offset, $whence = SEEK_SET)
+ {
+ @trigger_error('Filtered streams are not seekable. This method will start raising an exception in the next major version', E_USER_DEPRECATED);
+ $this->doSeek($offset, $whence);
+ }
+
/**
* Returns the read filter name.
*
diff --git a/vendor/php-http/message/src/Encoding/GzipDecodeStream.php b/vendor/php-http/message/src/Encoding/GzipDecodeStream.php
index 4f958edc..19a2b8f0 100644
--- a/vendor/php-http/message/src/Encoding/GzipDecodeStream.php
+++ b/vendor/php-http/message/src/Encoding/GzipDecodeStream.php
@@ -2,6 +2,7 @@
namespace Http\Message\Encoding;
+use Clue\StreamFilter as Filter;
use Psr\Http\Message\StreamInterface;
/**
@@ -21,7 +22,10 @@ class GzipDecodeStream extends FilteredStream
throw new \RuntimeException('The zlib extension must be enabled to use this stream');
}
- parent::__construct($stream, ['window' => 31], ['window' => 31, 'level' => $level]);
+ parent::__construct($stream, ['window' => 31]);
+
+ // @deprecated will be removed in 2.0
+ $this->writeFilterCallback = Filter\fun($this->writeFilter(), ['window' => 31, 'level' => $level]);
}
/**
diff --git a/vendor/php-http/message/src/Encoding/GzipEncodeStream.php b/vendor/php-http/message/src/Encoding/GzipEncodeStream.php
index 1066eec0..8555d4ae 100644
--- a/vendor/php-http/message/src/Encoding/GzipEncodeStream.php
+++ b/vendor/php-http/message/src/Encoding/GzipEncodeStream.php
@@ -2,6 +2,7 @@
namespace Http\Message\Encoding;
+use Clue\StreamFilter as Filter;
use Psr\Http\Message\StreamInterface;
/**
@@ -21,7 +22,10 @@ class GzipEncodeStream extends FilteredStream
throw new \RuntimeException('The zlib extension must be enabled to use this stream');
}
- parent::__construct($stream, ['window' => 31, 'level' => $level], ['window' => 31]);
+ parent::__construct($stream, ['window' => 31, 'level' => $level]);
+
+ // @deprecated will be removed in 2.0
+ $this->writeFilterCallback = Filter\fun($this->writeFilter(), ['window' => 31]);
}
/**
diff --git a/vendor/php-http/message/src/Encoding/InflateStream.php b/vendor/php-http/message/src/Encoding/InflateStream.php
index 70702304..863b73de 100644
--- a/vendor/php-http/message/src/Encoding/InflateStream.php
+++ b/vendor/php-http/message/src/Encoding/InflateStream.php
@@ -2,6 +2,7 @@
namespace Http\Message\Encoding;
+use Clue\StreamFilter as Filter;
use Psr\Http\Message\StreamInterface;
/**
@@ -21,7 +22,10 @@ class InflateStream extends FilteredStream
throw new \RuntimeException('The zlib extension must be enabled to use this stream');
}
- parent::__construct($stream, ['window' => -15], ['window' => -15, 'level' => $level]);
+ parent::__construct($stream, ['window' => -15]);
+
+ // @deprecated will be removed in 2.0
+ $this->writeFilterCallback = Filter\fun($this->writeFilter(), ['window' => -15, 'level' => $level]);
}
/**
diff --git a/vendor/psr/log/Psr/Log/Test/LoggerInterfaceTest.php b/vendor/psr/log/Psr/Log/Test/LoggerInterfaceTest.php
index a0391a52..4b861c3e 100644
--- a/vendor/psr/log/Psr/Log/Test/LoggerInterfaceTest.php
+++ b/vendor/psr/log/Psr/Log/Test/LoggerInterfaceTest.php
@@ -101,6 +101,9 @@ abstract class LoggerInterfaceTest extends \PHPUnit_Framework_TestCase
public function testContextCanContainAnything()
{
+ $closed = fopen('php://memory', 'r');
+ fclose($closed);
+
$context = array(
'bool' => true,
'null' => null,
@@ -110,6 +113,7 @@ abstract class LoggerInterfaceTest extends \PHPUnit_Framework_TestCase
'nested' => array('with object' => new DummyTest),
'object' => new \DateTime,
'resource' => fopen('php://memory', 'r'),
+ 'closed' => $closed,
);
$this->getLogger()->warning('Crazy context data', $context);
diff --git a/vendor/psr/log/Psr/Log/Test/TestLogger.php b/vendor/psr/log/Psr/Log/Test/TestLogger.php
new file mode 100644
index 00000000..0cdffe4f
--- /dev/null
+++ b/vendor/psr/log/Psr/Log/Test/TestLogger.php
@@ -0,0 +1,146 @@
+ $level,
+ 'message' => $message,
+ 'context' => $context,
+ ];
+
+ $this->recordsByLevel[$record['level']][] = $record;
+ $this->records[] = $record;
+ }
+
+ public function hasRecords($level)
+ {
+ return isset($this->recordsByLevel[$level]);
+ }
+
+ public function hasRecord($record, $level)
+ {
+ if (is_string($record)) {
+ $record = ['message' => $record];
+ }
+ return $this->hasRecordThatPasses(function ($rec) use ($record) {
+ if ($rec['message'] !== $record['message']) {
+ return false;
+ }
+ if (isset($record['context']) && $rec['context'] !== $record['context']) {
+ return false;
+ }
+ return true;
+ }, $level);
+ }
+
+ public function hasRecordThatContains($message, $level)
+ {
+ return $this->hasRecordThatPasses(function ($rec) use ($message) {
+ return strpos($rec['message'], $message) !== false;
+ }, $level);
+ }
+
+ public function hasRecordThatMatches($regex, $level)
+ {
+ return $this->hasRecordThatPasses(function ($rec) use ($regex) {
+ return preg_match($regex, $rec['message']) > 0;
+ }, $level);
+ }
+
+ public function hasRecordThatPasses(callable $predicate, $level)
+ {
+ if (!isset($this->recordsByLevel[$level])) {
+ return false;
+ }
+ foreach ($this->recordsByLevel[$level] as $i => $rec) {
+ if (call_user_func($predicate, $rec, $i)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public function __call($method, $args)
+ {
+ if (preg_match('/(.*)(Debug|Info|Notice|Warning|Error|Critical|Alert|Emergency)(.*)/', $method, $matches) > 0) {
+ $genericMethod = $matches[1] . ('Records' !== $matches[3] ? 'Record' : '') . $matches[3];
+ $level = strtolower($matches[2]);
+ if (method_exists($this, $genericMethod)) {
+ $args[] = $level;
+ return call_user_func_array([$this, $genericMethod], $args);
+ }
+ }
+ throw new \BadMethodCallException('Call to undefined method ' . get_class($this) . '::' . $method . '()');
+ }
+
+ public function reset()
+ {
+ $this->records = [];
+ }
+}
diff --git a/vendor/psr/log/README.md b/vendor/psr/log/README.md
index 574bc1cb..5571a25e 100644
--- a/vendor/psr/log/README.md
+++ b/vendor/psr/log/README.md
@@ -7,6 +7,13 @@ This repository holds all interfaces/classes/traits related to
Note that this is not a logger of its own. It is merely an interface that
describes a logger. See the specification for more details.
+Installation
+------------
+
+```bash
+composer require psr/log
+```
+
Usage
-----
diff --git a/vendor/ralouphie/getallheaders/.gitignore b/vendor/ralouphie/getallheaders/.gitignore
new file mode 100644
index 00000000..1324e7d3
--- /dev/null
+++ b/vendor/ralouphie/getallheaders/.gitignore
@@ -0,0 +1,5 @@
+.idea
+.DS_store
+/vendor/
+composer.phar
+composer.lock
diff --git a/vendor/ralouphie/getallheaders/.travis.yml b/vendor/ralouphie/getallheaders/.travis.yml
new file mode 100644
index 00000000..f45b55fa
--- /dev/null
+++ b/vendor/ralouphie/getallheaders/.travis.yml
@@ -0,0 +1,18 @@
+language: php
+
+php:
+ - 5.3
+ - 5.4
+ - 5.5
+ - 5.6
+ - 7.0
+
+before_script:
+ - composer install
+
+script:
+ - mkdir -p build/logs
+ - php vendor/bin/phpunit -c phpunit.xml
+
+after_script:
+ - php vendor/bin/coveralls -v
\ No newline at end of file
diff --git a/vendor/ralouphie/getallheaders/LICENSE b/vendor/ralouphie/getallheaders/LICENSE
new file mode 100644
index 00000000..be5540c2
--- /dev/null
+++ b/vendor/ralouphie/getallheaders/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2014 Ralph Khattar
+
+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/ralouphie/getallheaders/README.md b/vendor/ralouphie/getallheaders/README.md
new file mode 100644
index 00000000..f3329d66
--- /dev/null
+++ b/vendor/ralouphie/getallheaders/README.md
@@ -0,0 +1,19 @@
+getallheaders
+=============
+
+PHP `getallheaders()` polyfill. Compatible with PHP >= 5.3.
+
+[](https://travis-ci.org/ralouphie/getallheaders)
+[](https://coveralls.io/r/ralouphie/getallheaders?branch=master)
+[](https://packagist.org/packages/ralouphie/getallheaders)
+[](https://packagist.org/packages/ralouphie/getallheaders)
+[](https://packagist.org/packages/ralouphie/getallheaders)
+
+
+This is a simple polyfill for [`getallheaders()`](http://www.php.net/manual/en/function.getallheaders.php).
+
+## Install
+
+```
+composer require ralouphie/getallheaders
+```
diff --git a/vendor/ralouphie/getallheaders/composer.json b/vendor/ralouphie/getallheaders/composer.json
new file mode 100644
index 00000000..5a0d595c
--- /dev/null
+++ b/vendor/ralouphie/getallheaders/composer.json
@@ -0,0 +1,21 @@
+{
+ "name": "ralouphie/getallheaders",
+ "description": "A polyfill for getallheaders.",
+ "license": "MIT",
+ "authors": [
+ {
+ "name": "Ralph Khattar",
+ "email": "ralph.khattar@gmail.com"
+ }
+ ],
+ "require": {
+ "php": ">=5.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "~3.7.0",
+ "satooshi/php-coveralls": ">=1.0"
+ },
+ "autoload": {
+ "files": ["src/getallheaders.php"]
+ }
+}
\ No newline at end of file
diff --git a/vendor/ralouphie/getallheaders/phpunit.xml b/vendor/ralouphie/getallheaders/phpunit.xml
new file mode 100644
index 00000000..7255b23d
--- /dev/null
+++ b/vendor/ralouphie/getallheaders/phpunit.xml
@@ -0,0 +1,22 @@
+
+
+
+ ./tests
+
+
+
+
+ src
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/vendor/ralouphie/getallheaders/src/getallheaders.php b/vendor/ralouphie/getallheaders/src/getallheaders.php
new file mode 100644
index 00000000..c7285a5b
--- /dev/null
+++ b/vendor/ralouphie/getallheaders/src/getallheaders.php
@@ -0,0 +1,46 @@
+ 'Content-Type',
+ 'CONTENT_LENGTH' => 'Content-Length',
+ 'CONTENT_MD5' => 'Content-Md5',
+ );
+
+ foreach ($_SERVER as $key => $value) {
+ if (substr($key, 0, 5) === 'HTTP_') {
+ $key = substr($key, 5);
+ if (!isset($copy_server[$key]) || !isset($_SERVER[$key])) {
+ $key = str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', $key))));
+ $headers[$key] = $value;
+ }
+ } elseif (isset($copy_server[$key])) {
+ $headers[$copy_server[$key]] = $value;
+ }
+ }
+
+ if (!isset($headers['Authorization'])) {
+ if (isset($_SERVER['REDIRECT_HTTP_AUTHORIZATION'])) {
+ $headers['Authorization'] = $_SERVER['REDIRECT_HTTP_AUTHORIZATION'];
+ } elseif (isset($_SERVER['PHP_AUTH_USER'])) {
+ $basic_pass = isset($_SERVER['PHP_AUTH_PW']) ? $_SERVER['PHP_AUTH_PW'] : '';
+ $headers['Authorization'] = 'Basic ' . base64_encode($_SERVER['PHP_AUTH_USER'] . ':' . $basic_pass);
+ } elseif (isset($_SERVER['PHP_AUTH_DIGEST'])) {
+ $headers['Authorization'] = $_SERVER['PHP_AUTH_DIGEST'];
+ }
+ }
+
+ return $headers;
+ }
+
+}
diff --git a/vendor/ralouphie/getallheaders/tests/GetAllHeadersTest.php b/vendor/ralouphie/getallheaders/tests/GetAllHeadersTest.php
new file mode 100644
index 00000000..8e3d1790
--- /dev/null
+++ b/vendor/ralouphie/getallheaders/tests/GetAllHeadersTest.php
@@ -0,0 +1,121 @@
+ $val) {
+ $_SERVER[$key] = $val;
+ }
+ $result = getallheaders();
+ $this->assertEquals($expected, $result, "Error testing $test_type works.");
+ }
+
+ public function testWorksData()
+ {
+ return array(
+ array(
+ 'normal case',
+ array(
+ 'Key-One' => 'foo',
+ 'Key-Two' => 'bar',
+ 'Another-Key-For-Testing' => 'baz'
+ ),
+ array(
+ 'HTTP_KEY_ONE' => 'foo',
+ 'HTTP_KEY_TWO' => 'bar',
+ 'HTTP_ANOTHER_KEY_FOR_TESTING' => 'baz'
+ )
+ ),
+ array(
+ 'Content-Type',
+ array(
+ 'Content-Type' => 'two'
+ ),
+ array(
+ 'HTTP_CONTENT_TYPE' => 'one',
+ 'CONTENT_TYPE' => 'two'
+ )
+ ),
+ array(
+ 'Content-Length',
+ array(
+ 'Content-Length' => '222'
+ ),
+ array(
+ 'CONTENT_LENGTH' => '222',
+ 'HTTP_CONTENT_LENGTH' => '111'
+ )
+ ),
+ array(
+ 'Content-Length (HTTP_CONTENT_LENGTH only)',
+ array(
+ 'Content-Length' => '111'
+ ),
+ array(
+ 'HTTP_CONTENT_LENGTH' => '111'
+ )
+ ),
+ array(
+ 'Content-MD5',
+ array(
+ 'Content-Md5' => 'aef123'
+ ),
+ array(
+ 'CONTENT_MD5' => 'aef123',
+ 'HTTP_CONTENT_MD5' => 'fea321'
+ )
+ ),
+ array(
+ 'Content-MD5 (HTTP_CONTENT_MD5 only)',
+ array(
+ 'Content-Md5' => 'f123'
+ ),
+ array(
+ 'HTTP_CONTENT_MD5' => 'f123'
+ )
+ ),
+ array(
+ 'Authorization (normal)',
+ array(
+ 'Authorization' => 'testing'
+ ),
+ array(
+ 'HTTP_AUTHORIZATION' => 'testing',
+ )
+ ),
+ array(
+ 'Authorization (redirect)',
+ array(
+ 'Authorization' => 'testing redirect'
+ ),
+ array(
+ 'REDIRECT_HTTP_AUTHORIZATION' => 'testing redirect',
+ )
+ ),
+ array(
+ 'Authorization (PHP_AUTH_USER + PHP_AUTH_PW)',
+ array(
+ 'Authorization' => 'Basic ' . base64_encode('foo:bar')
+ ),
+ array(
+ 'PHP_AUTH_USER' => 'foo',
+ 'PHP_AUTH_PW' => 'bar'
+ )
+ ),
+ array(
+ 'Authorization (PHP_AUTH_DIGEST)',
+ array(
+ 'Authorization' => 'example-digest'
+ ),
+ array(
+ 'PHP_AUTH_DIGEST' => 'example-digest'
+ )
+ )
+ );
+ }
+}
diff --git a/vendor/symfony/console/Application.php b/vendor/symfony/console/Application.php
index 3ef76b3f..9030da64 100644
--- a/vendor/symfony/console/Application.php
+++ b/vendor/symfony/console/Application.php
@@ -753,12 +753,20 @@ class Application
do {
$message = trim($e->getMessage());
if ('' === $message || OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) {
- $title = sprintf(' [%s%s] ', \get_class($e), 0 !== ($code = $e->getCode()) ? ' ('.$code.')' : '');
+ $class = \get_class($e);
+ $class = 'c' === $class[0] && 0 === strpos($class, "class@anonymous\0") ? get_parent_class($class).'@anonymous' : $class;
+ $title = sprintf(' [%s%s] ', $class, 0 !== ($code = $e->getCode()) ? ' ('.$code.')' : '');
$len = Helper::strlen($title);
} else {
$len = 0;
}
+ if (false !== strpos($message, "class@anonymous\0")) {
+ $message = preg_replace_callback('/class@anonymous\x00.*?\.php0x?[0-9a-fA-F]++/', function ($m) {
+ return \class_exists($m[0], false) ? get_parent_class($m[0]).'@anonymous' : $m[0];
+ }, $message);
+ }
+
$width = $this->terminal->getWidth() ? $this->terminal->getWidth() - 1 : PHP_INT_MAX;
$lines = array();
foreach ('' !== $message ? preg_split('/\r?\n/', $message) : array() as $line) {
@@ -793,6 +801,13 @@ class Application
// exception related properties
$trace = $e->getTrace();
+ array_unshift($trace, array(
+ 'function' => '',
+ 'file' => $e->getFile() ?: 'n/a',
+ 'line' => $e->getLine() ?: 'n/a',
+ 'args' => array(),
+ ));
+
for ($i = 0, $count = \count($trace); $i < $count; ++$i) {
$class = isset($trace[$i]['class']) ? $trace[$i]['class'] : '';
$type = isset($trace[$i]['type']) ? $trace[$i]['type'] : '';
diff --git a/vendor/symfony/console/CHANGELOG.md b/vendor/symfony/console/CHANGELOG.md
index 7682feb5..b9175109 100644
--- a/vendor/symfony/console/CHANGELOG.md
+++ b/vendor/symfony/console/CHANGELOG.md
@@ -1,6 +1,17 @@
CHANGELOG
=========
+4.2.0
+-----
+
+ * allowed passing commands as `array($process, 'ENV_VAR' => 'value')` to
+ `ProcessHelper::run()` to pass environment variables
+ * deprecated passing a command as a string to `ProcessHelper::run()`,
+ pass it the command as an array of its arguments instead
+ * made the `ProcessHelper` class final
+ * added `WrappableOutputFormatterInterface::formatAndWrap()` (implemented in `OutputFormatter`)
+ * added `capture_stderr_separately` option to `CommandTester::execute()`
+
4.1.0
-----
diff --git a/vendor/symfony/console/Command/Command.php b/vendor/symfony/console/Command/Command.php
index 3bf2f3a5..0e238473 100644
--- a/vendor/symfony/console/Command/Command.php
+++ b/vendor/symfony/console/Command/Command.php
@@ -301,14 +301,13 @@ class Command
$this->definition->addOptions($this->application->getDefinition()->getOptions());
+ $this->applicationDefinitionMerged = true;
+
if ($mergeArgs) {
$currentArguments = $this->definition->getArguments();
$this->definition->setArguments($this->application->getDefinition()->getArguments());
$this->definition->addArguments($currentArguments);
- }
- $this->applicationDefinitionMerged = true;
- if ($mergeArgs) {
$this->applicationDefinitionMergedWithArgs = true;
}
}
@@ -361,10 +360,12 @@ class Command
/**
* Adds an argument.
*
- * @param string $name The argument name
- * @param int $mode The argument mode: InputArgument::REQUIRED or InputArgument::OPTIONAL
- * @param string $description A description text
- * @param mixed $default The default value (for InputArgument::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|string[]|null $default The default value (for self::OPTIONAL mode only)
+ *
+ * @throws InvalidArgumentException When argument mode is not valid
*
* @return $this
*/
@@ -378,11 +379,13 @@ class Command
/**
* Adds an option.
*
- * @param string $name The option name
- * @param string $shortcut The shortcut (can be null)
- * @param int $mode The option mode: One of the InputOption::VALUE_* constants
- * @param string $description A description text
- * @param mixed $default The default value (must be null for InputOption::VALUE_NONE)
+ * @param string $name The option name
+ * @param string|array $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)
+ *
+ * @throws InvalidArgumentException If option mode is invalid or incompatible
*
* @return $this
*/
diff --git a/vendor/symfony/console/Command/LockableTrait.php b/vendor/symfony/console/Command/LockableTrait.php
index 6c634ce4..f4ebe45b 100644
--- a/vendor/symfony/console/Command/LockableTrait.php
+++ b/vendor/symfony/console/Command/LockableTrait.php
@@ -12,7 +12,6 @@
namespace Symfony\Component\Console\Command;
use Symfony\Component\Console\Exception\LogicException;
-use Symfony\Component\Console\Exception\RuntimeException;
use Symfony\Component\Lock\Factory;
use Symfony\Component\Lock\Lock;
use Symfony\Component\Lock\Store\FlockStore;
@@ -36,7 +35,7 @@ trait LockableTrait
private function lock($name = null, $blocking = false)
{
if (!class_exists(SemaphoreStore::class)) {
- throw new RuntimeException('To enable the locking feature you must install the symfony/lock component.');
+ throw new LogicException('To enable the locking feature you must install the symfony/lock component.');
}
if (null !== $this->lock) {
diff --git a/vendor/symfony/console/Exception/ExceptionInterface.php b/vendor/symfony/console/Exception/ExceptionInterface.php
index 491cc4c6..1624e13d 100644
--- a/vendor/symfony/console/Exception/ExceptionInterface.php
+++ b/vendor/symfony/console/Exception/ExceptionInterface.php
@@ -16,6 +16,6 @@ namespace Symfony\Component\Console\Exception;
*
* @author Jérôme Tamarelle
*/
-interface ExceptionInterface
+interface ExceptionInterface extends \Throwable
{
}
diff --git a/vendor/symfony/console/Formatter/OutputFormatter.php b/vendor/symfony/console/Formatter/OutputFormatter.php
index eebac82e..fd3bbd12 100644
--- a/vendor/symfony/console/Formatter/OutputFormatter.php
+++ b/vendor/symfony/console/Formatter/OutputFormatter.php
@@ -17,8 +17,9 @@ use Symfony\Component\Console\Exception\InvalidArgumentException;
* Formatter class for console output.
*
* @author Konstantin Kudryashov
+ * @author Roland Franssen
*/
-class OutputFormatter implements OutputFormatterInterface
+class OutputFormatter implements WrappableOutputFormatterInterface
{
private $decorated;
private $styles = array();
@@ -130,10 +131,18 @@ class OutputFormatter implements OutputFormatterInterface
*/
public function format($message)
{
- $message = (string) $message;
+ return $this->formatAndWrap((string) $message, 0);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function formatAndWrap(string $message, int $width)
+ {
$offset = 0;
$output = '';
$tagRegex = '[a-z][a-z0-9,_=;-]*+';
+ $currentLineLength = 0;
preg_match_all("#<(($tagRegex) | /($tagRegex)?)>#ix", $message, $matches, PREG_OFFSET_CAPTURE);
foreach ($matches[0] as $i => $match) {
$pos = $match[1];
@@ -144,7 +153,7 @@ class OutputFormatter implements OutputFormatterInterface
}
// add the text up to the next tag
- $output .= $this->applyCurrentStyle(substr($message, $offset, $pos - $offset));
+ $output .= $this->applyCurrentStyle(substr($message, $offset, $pos - $offset), $output, $width, $currentLineLength);
$offset = $pos + \strlen($text);
// opening tag?
@@ -158,7 +167,7 @@ class OutputFormatter implements OutputFormatterInterface
// >
$this->styleStack->pop();
} elseif (false === $style = $this->createStyleFromString(strtolower($tag))) {
- $output .= $this->applyCurrentStyle($text);
+ $output .= $this->applyCurrentStyle($text, $output, $width, $currentLineLength);
} elseif ($open) {
$this->styleStack->push($style);
} else {
@@ -166,7 +175,7 @@ class OutputFormatter implements OutputFormatterInterface
}
}
- $output .= $this->applyCurrentStyle(substr($message, $offset));
+ $output .= $this->applyCurrentStyle(substr($message, $offset), $output, $width, $currentLineLength);
if (false !== strpos($output, "\0")) {
return strtr($output, array("\0" => '\\', '\\<' => '<'));
@@ -223,8 +232,46 @@ class OutputFormatter implements OutputFormatterInterface
/**
* Applies current style from stack to text, if must be applied.
*/
- private function applyCurrentStyle(string $text): string
+ private function applyCurrentStyle(string $text, string $current, int $width, int &$currentLineLength): string
{
- return $this->isDecorated() && \strlen($text) > 0 ? $this->styleStack->getCurrent()->apply($text) : $text;
+ if ('' === $text) {
+ return '';
+ }
+
+ if (!$width) {
+ return $this->isDecorated() ? $this->styleStack->getCurrent()->apply($text) : $text;
+ }
+
+ if (!$currentLineLength && '' !== $current) {
+ $text = ltrim($text);
+ }
+
+ if ($currentLineLength) {
+ $prefix = substr($text, 0, $i = $width - $currentLineLength)."\n";
+ $text = substr($text, $i);
+ } else {
+ $prefix = '';
+ }
+
+ preg_match('~(\\n)$~', $text, $matches);
+ $text = $prefix.preg_replace('~([^\\n]{'.$width.'})\\ *~', "\$1\n", $text);
+ $text = rtrim($text, "\n").($matches[1] ?? '');
+
+ if (!$currentLineLength && '' !== $current && "\n" !== substr($current, -1)) {
+ $text = "\n".$text;
+ }
+
+ $lines = explode("\n", $text);
+ if ($width === $currentLineLength = \strlen(end($lines))) {
+ $currentLineLength = 0;
+ }
+
+ if ($this->isDecorated()) {
+ foreach ($lines as $i => $line) {
+ $lines[$i] = $this->styleStack->getCurrent()->apply($line);
+ }
+ }
+
+ return implode("\n", $lines);
}
}
diff --git a/vendor/symfony/console/Formatter/OutputFormatterStyleStack.php b/vendor/symfony/console/Formatter/OutputFormatterStyleStack.php
index 9e7283c2..7ca93035 100644
--- a/vendor/symfony/console/Formatter/OutputFormatterStyleStack.php
+++ b/vendor/symfony/console/Formatter/OutputFormatterStyleStack.php
@@ -12,11 +12,12 @@
namespace Symfony\Component\Console\Formatter;
use Symfony\Component\Console\Exception\InvalidArgumentException;
+use Symfony\Contracts\Service\ResetInterface;
/**
* @author Jean-François Simon
*/
-class OutputFormatterStyleStack
+class OutputFormatterStyleStack implements ResetInterface
{
/**
* @var OutputFormatterStyleInterface[]
diff --git a/vendor/symfony/console/Formatter/WrappableOutputFormatterInterface.php b/vendor/symfony/console/Formatter/WrappableOutputFormatterInterface.php
new file mode 100644
index 00000000..6694053f
--- /dev/null
+++ b/vendor/symfony/console/Formatter/WrappableOutputFormatterInterface.php
@@ -0,0 +1,25 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Console\Formatter;
+
+/**
+ * Formatter interface for console output that supports word wrapping.
+ *
+ * @author Roland Franssen
+ */
+interface WrappableOutputFormatterInterface extends OutputFormatterInterface
+{
+ /**
+ * Formats a message according to the given styles, wrapping at `$width` (0 means no wrapping).
+ */
+ public function formatAndWrap(string $message, int $width);
+}
diff --git a/vendor/symfony/console/Helper/ProcessHelper.php b/vendor/symfony/console/Helper/ProcessHelper.php
index 666f114a..e0720c13 100644
--- a/vendor/symfony/console/Helper/ProcessHelper.php
+++ b/vendor/symfony/console/Helper/ProcessHelper.php
@@ -20,18 +20,20 @@ use Symfony\Component\Process\Process;
* The ProcessHelper class provides helpers to run external processes.
*
* @author Fabien Potencier
+ *
+ * @final since Symfony 4.2
*/
class ProcessHelper extends Helper
{
/**
* Runs an external process.
*
- * @param OutputInterface $output An OutputInterface instance
- * @param string|array|Process $cmd An instance of Process or an array of arguments to escape and run 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 int $verbosity The threshold for verbosity
+ * @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
*
* @return Process The process that ran
*/
@@ -44,9 +46,22 @@ class ProcessHelper extends Helper
$formatter = $this->getHelperSet()->get('debug_formatter');
if ($cmd instanceof Process) {
- $process = $cmd;
- } else {
+ $cmd = array($cmd);
+ }
+
+ 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);
+ $cmd = array(\method_exists(Process::class, 'fromShellCommandline') ? Process::fromShellCommandline($cmd) : new Process($cmd));
+ }
+
+ if (\is_string($cmd[0] ?? null)) {
$process = new Process($cmd);
+ $cmd = array();
+ } elseif (($cmd[0] ?? null) instanceof Process) {
+ $process = $cmd[0];
+ unset($cmd[0]);
+ } else {
+ throw new \InvalidArgumentException(sprintf('Invalid command provided to "%s()": the command should an array whose first is element is either the path to the binary to run of a "Process" object.', __METHOD__));
}
if ($verbosity <= $output->getVerbosity()) {
@@ -57,7 +72,7 @@ class ProcessHelper extends Helper
$callback = $this->wrapCallback($output, $process, $callback);
}
- $process->run($callback);
+ $process->run($callback, $cmd);
if ($verbosity <= $output->getVerbosity()) {
$message = $process->isSuccessful() ? 'Command ran successfully' : sprintf('%s Command did not run successfully', $process->getExitCode());
diff --git a/vendor/symfony/console/Helper/QuestionHelper.php b/vendor/symfony/console/Helper/QuestionHelper.php
index 5e6ef03e..53af6fe9 100644
--- a/vendor/symfony/console/Helper/QuestionHelper.php
+++ b/vendor/symfony/console/Helper/QuestionHelper.php
@@ -47,13 +47,23 @@ class QuestionHelper extends Helper
}
if (!$input->isInteractive()) {
- if ($question instanceof ChoiceQuestion) {
+ $default = $question->getDefault();
+
+ if (null !== $default && $question instanceof ChoiceQuestion) {
$choices = $question->getChoices();
- return $choices[$question->getDefault()];
+ 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 $question->getDefault();
+ return $default;
}
if ($input instanceof StreamableInputInterface && $stream = $input->getStream()) {
diff --git a/vendor/symfony/console/Helper/Table.php b/vendor/symfony/console/Helper/Table.php
index 95775484..14974529 100644
--- a/vendor/symfony/console/Helper/Table.php
+++ b/vendor/symfony/console/Helper/Table.php
@@ -13,6 +13,7 @@ namespace Symfony\Component\Console\Helper;
use Symfony\Component\Console\Exception\InvalidArgumentException;
use Symfony\Component\Console\Exception\RuntimeException;
+use Symfony\Component\Console\Formatter\WrappableOutputFormatterInterface;
use Symfony\Component\Console\Output\ConsoleSectionOutput;
use Symfony\Component\Console\Output\OutputInterface;
@@ -34,6 +35,9 @@ class Table
private const BORDER_OUTSIDE = 0;
private const BORDER_INSIDE = 1;
+ private $headerTitle;
+ private $footerTitle;
+
/**
* Table headers.
*/
@@ -77,6 +81,7 @@ class Table
* @var array
*/
private $columnWidths = array();
+ private $columnMaxWidths = array();
private static $styles;
@@ -180,11 +185,7 @@ class Table
*/
public function getColumnStyle($columnIndex)
{
- if (isset($this->columnStyles[$columnIndex])) {
- return $this->columnStyles[$columnIndex];
- }
-
- return $this->getStyle();
+ return $this->columnStyles[$columnIndex] ?? $this->getStyle();
}
/**
@@ -219,6 +220,25 @@ class Table
return $this;
}
+ /**
+ * Sets the maximum width of a column.
+ *
+ * Any cell within this column which contents exceeds the specified width will be wrapped into multiple lines, while
+ * formatted strings are preserved.
+ *
+ * @return $this
+ */
+ public function setColumnMaxWidth(int $columnIndex, int $width): self
+ {
+ if (!$this->output->getFormatter() instanceof WrappableOutputFormatterInterface) {
+ throw new \LogicException(sprintf('Setting a maximum column width is only supported when using a "%s" formatter, got "%s".', WrappableOutputFormatterInterface::class, \get_class($this->output->getFormatter())));
+ }
+
+ $this->columnMaxWidths[$columnIndex] = $width;
+
+ return $this;
+ }
+
public function setHeaders(array $headers)
{
$headers = array_values($headers);
@@ -290,6 +310,20 @@ class Table
return $this;
}
+ public function setHeaderTitle(?string $title): self
+ {
+ $this->headerTitle = $title;
+
+ return $this;
+ }
+
+ public function setFooterTitle(?string $title): self
+ {
+ $this->footerTitle = $title;
+
+ return $this;
+ }
+
/**
* Renders table to output.
*
@@ -330,15 +364,17 @@ class Table
}
if ($isHeader || $isFirstRow) {
- $this->renderRowSeparator($isFirstRow ? self::SEPARATOR_TOP_BOTTOM : self::SEPARATOR_TOP);
if ($isFirstRow) {
+ $this->renderRowSeparator(self::SEPARATOR_TOP_BOTTOM);
$isFirstRow = false;
+ } else {
+ $this->renderRowSeparator(self::SEPARATOR_TOP, $this->headerTitle, $this->style->getHeaderTitleFormat());
}
}
$this->renderRow($row, $isHeader ? $this->style->getCellHeaderFormat() : $this->style->getCellRowFormat());
}
- $this->renderRowSeparator(self::SEPARATOR_BOTTOM);
+ $this->renderRowSeparator(self::SEPARATOR_BOTTOM, $this->footerTitle, $this->style->getFooterTitleFormat());
$this->cleanup();
$this->rendered = true;
@@ -351,7 +387,7 @@ class Table
*
* +-----+-----------+-------+
*/
- private function renderRowSeparator(int $type = self::SEPARATOR_MID)
+ private function renderRowSeparator(int $type = self::SEPARATOR_MID, string $title = null, string $titleFormat = null)
{
if (0 === $count = $this->numberOfColumns) {
return;
@@ -379,6 +415,23 @@ class Table
$markup .= $column === $count - 1 ? $rightChar : $midChar;
}
+ if (null !== $title) {
+ $titleLength = Helper::strlenWithoutDecoration($formatter = $this->output->getFormatter(), $formattedTitle = sprintf($titleFormat, $title));
+ $markupLength = Helper::strlen($markup);
+ if ($titleLength > $limit = $markupLength - 4) {
+ $titleLength = $limit;
+ $formatLength = Helper::strlenWithoutDecoration($formatter, sprintf($titleFormat, ''));
+ $formattedTitle = sprintf($titleFormat, Helper::substr($title, 0, $limit - $formatLength - 3).'...');
+ }
+
+ $titleStart = ($markupLength - $titleLength) / 2;
+ if (false === mb_detect_encoding($markup, null, true)) {
+ $markup = substr_replace($markup, $formattedTitle, $titleStart, $titleLength);
+ } else {
+ $markup = mb_substr($markup, 0, $titleStart).$formattedTitle.mb_substr($markup, $titleStart + $titleLength);
+ }
+ }
+
$this->output->writeln(sprintf($this->style->getBorderFormat(), $markup));
}
@@ -461,12 +514,17 @@ class Table
private function buildTableRows($rows)
{
+ /** @var WrappableOutputFormatterInterface $formatter */
+ $formatter = $this->output->getFormatter();
$unmergedRows = array();
for ($rowKey = 0; $rowKey < \count($rows); ++$rowKey) {
$rows = $this->fillNextRows($rows, $rowKey);
// Remove any new line breaks and replace it with a new line
foreach ($rows[$rowKey] as $column => $cell) {
+ if (isset($this->columnMaxWidths[$column]) && Helper::strlenWithoutDecoration($formatter, $cell) > $this->columnMaxWidths[$column]) {
+ $cell = $formatter->formatAndWrap($cell, $this->columnMaxWidths[$column]);
+ }
if (!strstr($cell, "\n")) {
continue;
}
@@ -674,8 +732,9 @@ class Table
}
$columnWidth = isset($this->columnWidths[$column]) ? $this->columnWidths[$column] : 0;
+ $cellWidth = max($cellWidth, $columnWidth);
- return max($cellWidth, $columnWidth);
+ return isset($this->columnMaxWidths[$column]) ? min($this->columnMaxWidths[$column], $cellWidth) : $cellWidth;
}
/**
diff --git a/vendor/symfony/console/Helper/TableStyle.php b/vendor/symfony/console/Helper/TableStyle.php
index 0536713a..f8ecc2d9 100644
--- a/vendor/symfony/console/Helper/TableStyle.php
+++ b/vendor/symfony/console/Helper/TableStyle.php
@@ -40,6 +40,8 @@ class TableStyle
private $crossingTopLeftBottomChar = '+';
private $crossingTopMidBottomChar = '+';
private $crossingTopRightBottomChar = '+';
+ private $headerTitleFormat = ' %s >';
+ private $footerTitleFormat = ' %s >';
private $cellHeaderFormat = '%s ';
private $cellRowFormat = '%s';
private $cellRowContentFormat = ' %s ';
@@ -276,7 +278,7 @@ class TableStyle
/**
* Gets crossing character.
*
- * @return string $crossingChar
+ * @return string
*/
public function getCrossingChar()
{
@@ -429,4 +431,28 @@ class TableStyle
{
return $this->padType;
}
+
+ public function getHeaderTitleFormat(): string
+ {
+ return $this->headerTitleFormat;
+ }
+
+ public function setHeaderTitleFormat(string $format): self
+ {
+ $this->headerTitleFormat = $format;
+
+ return $this;
+ }
+
+ public function getFooterTitleFormat(): string
+ {
+ return $this->footerTitleFormat;
+ }
+
+ public function setFooterTitleFormat(string $format): self
+ {
+ $this->footerTitleFormat = $format;
+
+ return $this;
+ }
}
diff --git a/vendor/symfony/console/Input/InputAwareInterface.php b/vendor/symfony/console/Input/InputAwareInterface.php
index d0f11e98..5a288de5 100644
--- a/vendor/symfony/console/Input/InputAwareInterface.php
+++ b/vendor/symfony/console/Input/InputAwareInterface.php
@@ -21,8 +21,6 @@ interface InputAwareInterface
{
/**
* Sets the Console Input.
- *
- * @param InputInterface
*/
public function setInput(InputInterface $input);
}
diff --git a/vendor/symfony/console/Input/InputOption.php b/vendor/symfony/console/Input/InputOption.php
index 174e871a..3ba84cd7 100644
--- a/vendor/symfony/console/Input/InputOption.php
+++ b/vendor/symfony/console/Input/InputOption.php
@@ -33,11 +33,11 @@ class InputOption
private $description;
/**
- * @param string $name The option name
- * @param string|array $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[]|bool|null $default The default value (must be null for self::VALUE_NONE)
+ * @param string $name The option name
+ * @param string|array $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)
*
* @throws InvalidArgumentException If option mode is invalid or incompatible
*/
@@ -149,7 +149,7 @@ class InputOption
/**
* Sets the default value.
*
- * @param string|string[]|bool|null $default The default value
+ * @param string|string[]|int|bool|null $default The default value
*
* @throws LogicException When incorrect default value is given
*/
@@ -173,7 +173,7 @@ class InputOption
/**
* Returns the default value.
*
- * @return string|string[]|bool|null The default value
+ * @return string|string[]|int|bool|null The default value
*/
public function getDefault()
{
diff --git a/vendor/symfony/console/Output/StreamOutput.php b/vendor/symfony/console/Output/StreamOutput.php
index fe8632b3..43f7a2f2 100644
--- a/vendor/symfony/console/Output/StreamOutput.php
+++ b/vendor/symfony/console/Output/StreamOutput.php
@@ -70,7 +70,11 @@ class StreamOutput extends Output
*/
protected function doWrite($message, $newline)
{
- if (false === @fwrite($this->stream, $message) || ($newline && (false === @fwrite($this->stream, PHP_EOL)))) {
+ if ($newline) {
+ $message .= PHP_EOL;
+ }
+
+ if (false === @fwrite($this->stream, $message)) {
// should never happen
throw new RuntimeException('Unable to write output.');
}
diff --git a/vendor/symfony/console/Question/Question.php b/vendor/symfony/console/Question/Question.php
index 593e9f1e..eac82cfa 100644
--- a/vendor/symfony/console/Question/Question.php
+++ b/vendor/symfony/console/Question/Question.php
@@ -141,7 +141,7 @@ class Question
}
if (null !== $values && !\is_array($values) && !$values instanceof \Traversable) {
- throw new InvalidArgumentException('Autocompleter values can be either an array, `null` or a `Traversable` object.');
+ throw new InvalidArgumentException('Autocompleter values can be either an array, "null" or a "Traversable" object.');
}
if ($this->hidden) {
diff --git a/vendor/symfony/console/Tester/ApplicationTester.php b/vendor/symfony/console/Tester/ApplicationTester.php
index 3ae31152..24976f08 100644
--- a/vendor/symfony/console/Tester/ApplicationTester.php
+++ b/vendor/symfony/console/Tester/ApplicationTester.php
@@ -13,8 +13,6 @@ namespace Symfony\Component\Console\Tester;
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Input\ArrayInput;
-use Symfony\Component\Console\Output\ConsoleOutput;
-use Symfony\Component\Console\Output\StreamOutput;
/**
* Eases the testing of console applications.
@@ -33,7 +31,6 @@ class ApplicationTester
private $application;
private $input;
private $statusCode;
- private $captureStreamsIndependently = false;
public function __construct(Application $application)
{
@@ -69,36 +66,7 @@ class ApplicationTester
putenv('SHELL_INTERACTIVE=1');
}
- $this->captureStreamsIndependently = array_key_exists('capture_stderr_separately', $options) && $options['capture_stderr_separately'];
- if (!$this->captureStreamsIndependently) {
- $this->output = new StreamOutput(fopen('php://memory', 'w', false));
- if (isset($options['decorated'])) {
- $this->output->setDecorated($options['decorated']);
- }
- if (isset($options['verbosity'])) {
- $this->output->setVerbosity($options['verbosity']);
- }
- } else {
- $this->output = new ConsoleOutput(
- isset($options['verbosity']) ? $options['verbosity'] : ConsoleOutput::VERBOSITY_NORMAL,
- isset($options['decorated']) ? $options['decorated'] : null
- );
-
- $errorOutput = new StreamOutput(fopen('php://memory', 'w', false));
- $errorOutput->setFormatter($this->output->getFormatter());
- $errorOutput->setVerbosity($this->output->getVerbosity());
- $errorOutput->setDecorated($this->output->isDecorated());
-
- $reflectedOutput = new \ReflectionObject($this->output);
- $strErrProperty = $reflectedOutput->getProperty('stderr');
- $strErrProperty->setAccessible(true);
- $strErrProperty->setValue($this->output, $errorOutput);
-
- $reflectedParent = $reflectedOutput->getParentClass();
- $streamProperty = $reflectedParent->getProperty('stream');
- $streamProperty->setAccessible(true);
- $streamProperty->setValue($this->output, fopen('php://memory', 'w', false));
- }
+ $this->initOutput($options);
$this->statusCode = $this->application->run($this->input, $this->output);
@@ -106,28 +74,4 @@ class ApplicationTester
return $this->statusCode;
}
-
- /**
- * Gets the output written to STDERR by the application.
- *
- * @param bool $normalize Whether to normalize end of lines to \n or not
- *
- * @return string
- */
- public function getErrorOutput($normalize = false)
- {
- if (!$this->captureStreamsIndependently) {
- throw new \LogicException('The error output is not available when the tester is run without "capture_stderr_separately" option set.');
- }
-
- rewind($this->output->getErrorOutput()->getStream());
-
- $display = stream_get_contents($this->output->getErrorOutput()->getStream());
-
- if ($normalize) {
- $display = str_replace(PHP_EOL, "\n", $display);
- }
-
- return $display;
- }
}
diff --git a/vendor/symfony/console/Tester/CommandTester.php b/vendor/symfony/console/Tester/CommandTester.php
index ecdc40c0..c5b178f2 100644
--- a/vendor/symfony/console/Tester/CommandTester.php
+++ b/vendor/symfony/console/Tester/CommandTester.php
@@ -13,7 +13,6 @@ namespace Symfony\Component\Console\Tester;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\ArrayInput;
-use Symfony\Component\Console\Output\StreamOutput;
/**
* Eases the testing of console commands.
@@ -39,9 +38,10 @@ class CommandTester
*
* Available execution options:
*
- * * interactive: Sets the input interactive flag
- * * decorated: Sets the output decorated flag
- * * verbosity: Sets the output verbosity flag
+ * * interactive: Sets the input interactive flag
+ * * decorated: Sets the output decorated flag
+ * * verbosity: Sets the output verbosity flag
+ * * capture_stderr_separately: Make output of stdOut and stdErr separately available
*
* @param array $input An array of command arguments and options
* @param array $options An array of execution options
@@ -68,12 +68,12 @@ class CommandTester
$this->input->setInteractive($options['interactive']);
}
- $this->output = new StreamOutput(fopen('php://memory', 'w', false));
- $this->output->setDecorated(isset($options['decorated']) ? $options['decorated'] : false);
- if (isset($options['verbosity'])) {
- $this->output->setVerbosity($options['verbosity']);
+ if (!isset($options['decorated'])) {
+ $options['decorated'] = false;
}
+ $this->initOutput($options);
+
return $this->statusCode = $this->command->run($this->input, $this->output);
}
}
diff --git a/vendor/symfony/console/Tester/TesterTrait.php b/vendor/symfony/console/Tester/TesterTrait.php
index 4e1e0795..508a61b6 100644
--- a/vendor/symfony/console/Tester/TesterTrait.php
+++ b/vendor/symfony/console/Tester/TesterTrait.php
@@ -12,19 +12,19 @@
namespace Symfony\Component\Console\Tester;
use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\ConsoleOutput;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Output\StreamOutput;
/**
* @author Amrouche Hamza
- *
- * @internal
*/
trait TesterTrait
{
/** @var StreamOutput */
private $output;
private $inputs = array();
+ private $captureStreamsIndependently = false;
/**
* Gets the display returned by the last execution of the command or application.
@@ -46,6 +46,30 @@ trait TesterTrait
return $display;
}
+ /**
+ * Gets the output written to STDERR by the application.
+ *
+ * @param bool $normalize Whether to normalize end of lines to \n or not
+ *
+ * @return string
+ */
+ public function getErrorOutput($normalize = false)
+ {
+ if (!$this->captureStreamsIndependently) {
+ throw new \LogicException('The error output is not available when the tester is run without "capture_stderr_separately" option set.');
+ }
+
+ rewind($this->output->getErrorOutput()->getStream());
+
+ $display = stream_get_contents($this->output->getErrorOutput()->getStream());
+
+ if ($normalize) {
+ $display = str_replace(PHP_EOL, "\n", $display);
+ }
+
+ return $display;
+ }
+
/**
* Gets the input instance used by the last execution of the command or application.
*
@@ -79,8 +103,8 @@ trait TesterTrait
/**
* Sets the user inputs.
*
- * @param $inputs array An array of strings representing each input
- * passed to the command input stream
+ * @param array $inputs An array of strings representing each input
+ * passed to the command input stream
*
* @return self
*/
@@ -91,6 +115,49 @@ trait TesterTrait
return $this;
}
+ /**
+ * Initializes the output property.
+ *
+ * Available options:
+ *
+ * * decorated: Sets the output decorated flag
+ * * verbosity: Sets the output verbosity flag
+ * * capture_stderr_separately: Make output of stdOut and stdErr separately available
+ */
+ private function initOutput(array $options)
+ {
+ $this->captureStreamsIndependently = array_key_exists('capture_stderr_separately', $options) && $options['capture_stderr_separately'];
+ if (!$this->captureStreamsIndependently) {
+ $this->output = new StreamOutput(fopen('php://memory', 'w', false));
+ if (isset($options['decorated'])) {
+ $this->output->setDecorated($options['decorated']);
+ }
+ if (isset($options['verbosity'])) {
+ $this->output->setVerbosity($options['verbosity']);
+ }
+ } else {
+ $this->output = new ConsoleOutput(
+ isset($options['verbosity']) ? $options['verbosity'] : ConsoleOutput::VERBOSITY_NORMAL,
+ isset($options['decorated']) ? $options['decorated'] : null
+ );
+
+ $errorOutput = new StreamOutput(fopen('php://memory', 'w', false));
+ $errorOutput->setFormatter($this->output->getFormatter());
+ $errorOutput->setVerbosity($this->output->getVerbosity());
+ $errorOutput->setDecorated($this->output->isDecorated());
+
+ $reflectedOutput = new \ReflectionObject($this->output);
+ $strErrProperty = $reflectedOutput->getProperty('stderr');
+ $strErrProperty->setAccessible(true);
+ $strErrProperty->setValue($this->output, $errorOutput);
+
+ $reflectedParent = $reflectedOutput->getParentClass();
+ $streamProperty = $reflectedParent->getProperty('stream');
+ $streamProperty->setAccessible(true);
+ $streamProperty->setValue($this->output, fopen('php://memory', 'w', false));
+ }
+ }
+
private static function createStream(array $inputs)
{
$stream = fopen('php://memory', 'r+', false);
diff --git a/vendor/symfony/console/Tests/ApplicationTest.php b/vendor/symfony/console/Tests/ApplicationTest.php
index f6494f45..d7b0451e 100644
--- a/vendor/symfony/console/Tests/ApplicationTest.php
+++ b/vendor/symfony/console/Tests/ApplicationTest.php
@@ -824,6 +824,56 @@ class ApplicationTest extends TestCase
$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(array('command' => 'foo'), array('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(array('command' => 'foo'), array('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(array('command' => 'foo'), array('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(array('command' => 'foo'), array('decorated' => false));
+ $this->assertContains('Dummy type "@anonymous" is invalid.', $tester->getDisplay(true));
+ }
+
public function testRun()
{
$application = new Application();
diff --git a/vendor/symfony/console/Tests/Formatter/OutputFormatterTest.php b/vendor/symfony/console/Tests/Formatter/OutputFormatterTest.php
index c1addbab..b51668cf 100644
--- a/vendor/symfony/console/Tests/Formatter/OutputFormatterTest.php
+++ b/vendor/symfony/console/Tests/Formatter/OutputFormatterTest.php
@@ -322,6 +322,25 @@ 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));
+
+ $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
diff --git a/vendor/symfony/console/Tests/Helper/ProcessHelperTest.php b/vendor/symfony/console/Tests/Helper/ProcessHelperTest.php
index 382c9f4c..829bc433 100644
--- a/vendor/symfony/console/Tests/Helper/ProcessHelperTest.php
+++ b/vendor/symfony/console/Tests/Helper/ProcessHelperTest.php
@@ -25,6 +25,10 @@ class ProcessHelperTest extends TestCase
*/
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(array(new DebugFormatterHelper())));
$output = $this->getOutputStream($verbosity);
@@ -41,7 +45,7 @@ class ProcessHelperTest extends TestCase
$executed = false;
$callback = function () use (&$executed) { $executed = true; };
- $helper->run($output, 'php -r "echo 42;"', null, $callback);
+ $helper->run($output, array('php', '-r', 'echo 42;'), null, $callback);
$this->assertTrue($executed);
}
@@ -81,12 +85,21 @@ EOT;
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') ? array(Process::class, 'fromShellCommandline') : function ($cmd) { return new Process($cmd); };
return array(
array('', 'php -r "echo 42;"', StreamOutput::VERBOSITY_VERBOSE, null),
@@ -100,7 +113,9 @@ EOT;
array($syntaxErrorOutputVerbose.$errorMessage.PHP_EOL, 'php -r "fwrite(STDERR, \'error message\');usleep(50000);fwrite(STDOUT, \'out message\');exit(252);"', StreamOutput::VERBOSITY_VERY_VERBOSE, $errorMessage),
array($syntaxErrorOutputDebug.$errorMessage.PHP_EOL, 'php -r "fwrite(STDERR, \'error message\');usleep(500000);fwrite(STDOUT, \'out message\');exit(252);"', StreamOutput::VERBOSITY_DEBUG, $errorMessage),
array($successOutputProcessDebug, array('php', '-r', 'echo 42;'), StreamOutput::VERBOSITY_DEBUG, null),
- array($successOutputDebug, new Process('php -r "echo 42;"'), StreamOutput::VERBOSITY_DEBUG, null),
+ array($successOutputDebug, $fromShellCommandline('php -r "echo 42;"'), StreamOutput::VERBOSITY_DEBUG, null),
+ array($successOutputProcessDebug, array(new Process(array('php', '-r', 'echo 42;'))), StreamOutput::VERBOSITY_DEBUG, null),
+ array($successOutputPhp, array($fromShellCommandline('php -r '.$PHP), 'PHP' => 'echo 42;'), StreamOutput::VERBOSITY_DEBUG, null),
);
}
diff --git a/vendor/symfony/console/Tests/Helper/QuestionHelperTest.php b/vendor/symfony/console/Tests/Helper/QuestionHelperTest.php
index 67d6981c..3cb9a099 100644
--- a/vendor/symfony/console/Tests/Helper/QuestionHelperTest.php
+++ b/vendor/symfony/console/Tests/Helper/QuestionHelperTest.php
@@ -89,6 +89,63 @@ class QuestionHelperTest extends AbstractQuestionHelperTest
$this->assertEquals('Superman', $questionHelper->ask($this->createStreamableInputInterfaceMock($inputStream, true), $this->createOutputInterface(), $question));
}
+ public function testAskChoiceNonInteractive()
+ {
+ $questionHelper = new QuestionHelper();
+
+ $helperSet = new HelperSet(array(new FormatterHelper()));
+ $questionHelper->setHelperSet($helperSet);
+ $inputStream = $this->getInputStream("\n1\n 1 \nFabien\n1\nFabien\n1\n0,2\n 0 , 2 \n\n\n");
+
+ $heroes = array('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(array('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(array('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(array('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));
+
+ 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();
diff --git a/vendor/symfony/console/Tests/Helper/TableTest.php b/vendor/symfony/console/Tests/Helper/TableTest.php
index 7a9a688a..eb67eedf 100644
--- a/vendor/symfony/console/Tests/Helper/TableTest.php
+++ b/vendor/symfony/console/Tests/Helper/TableTest.php
@@ -974,6 +974,109 @@ TABLE;
Table::getStyleDefinition('absent');
}
+ /**
+ * @dataProvider renderSetTitle
+ */
+ public function testSetTitle($headerTitle, $footerTitle, $style, $expected)
+ {
+ (new Table($output = $this->getOutputStream()))
+ ->setHeaderTitle($headerTitle)
+ ->setFooterTitle($footerTitle)
+ ->setHeaders(array('ISBN', 'Title', 'Author'))
+ ->setRows(array(
+ array('99921-58-10-7', 'Divine Comedy', 'Dante Alighieri'),
+ array('9971-5-0210-0', 'A Tale of Two Cities', 'Charles Dickens'),
+ array('960-425-059-0', 'The Lord of the Rings', 'J. R. R. Tolkien'),
+ array('80-902734-1-6', 'And Then There Were None', 'Agatha Christie'),
+ ))
+ ->setStyle($style)
+ ->render()
+ ;
+
+ $this->assertEquals($expected, $this->getOutputContent($output));
+ }
+
+ public function renderSetTitle()
+ {
+ return array(
+ array(
+ '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
+ ),
+ array(
+ '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
+ ),
+ array(
+ '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(array(
+ array('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 testBoxedStyleWithColspan()
{
$boxed = new TableStyle();
diff --git a/vendor/symfony/console/Tests/Tester/ApplicationTesterTest.php b/vendor/symfony/console/Tests/Tester/ApplicationTesterTest.php
index 71547e7b..49ef8029 100644
--- a/vendor/symfony/console/Tests/Tester/ApplicationTesterTest.php
+++ b/vendor/symfony/console/Tests/Tester/ApplicationTesterTest.php
@@ -90,4 +90,24 @@ class ApplicationTesterTest extends TestCase
{
$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(
+ array('command' => 'foo', 'foo' => 'bar'),
+ array('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
index 58eb8103..afaa2fcf 100644
--- a/vendor/symfony/console/Tests/Tester/CommandTesterTest.php
+++ b/vendor/symfony/console/Tests/Tester/CommandTesterTest.php
@@ -160,4 +160,23 @@ class CommandTesterTest extends TestCase
$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(
+ array('foo' => 'bar'),
+ array('capture_stderr_separately' => true)
+ );
+
+ $this->assertSame('foo', $tester->getErrorOutput());
+ }
}
diff --git a/vendor/symfony/console/composer.json b/vendor/symfony/console/composer.json
index d3aadfbc..ca1a9269 100644
--- a/vendor/symfony/console/composer.json
+++ b/vendor/symfony/console/composer.json
@@ -17,6 +17,7 @@
],
"require": {
"php": "^7.1.3",
+ "symfony/contracts": "^1.0",
"symfony/polyfill-mbstring": "~1.0"
},
"require-dev": {
@@ -46,7 +47,7 @@
"minimum-stability": "dev",
"extra": {
"branch-alias": {
- "dev-master": "4.1-dev"
+ "dev-master": "4.2-dev"
}
}
}
diff --git a/vendor/symfony/console/phpunit.xml.dist b/vendor/symfony/console/phpunit.xml.dist
index 32569d63..15e7e52a 100644
--- a/vendor/symfony/console/phpunit.xml.dist
+++ b/vendor/symfony/console/phpunit.xml.dist
@@ -1,7 +1,7 @@
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Contracts\Cache;
+
+use Psr\Cache\CacheItemInterface;
+use Psr\Cache\InvalidArgumentException;
+
+/**
+ * Covers most simple to advanced caching needs.
+ *
+ * @author Nicolas Grekas
+ */
+interface CacheInterface
+{
+ /**
+ * Fetches a value from the pool or computes it if not found.
+ *
+ * On cache misses, a callback is called that should return the missing value.
+ * This callback is given a PSR-6 CacheItemInterface instance corresponding to the
+ * requested key, that could be used e.g. for expiration control. It could also
+ * be an ItemInterface instance when its additional features are needed.
+ *
+ * @param string $key The key of the item to retrieve from the cache
+ * @param callable|CallbackInterface $callback Should return the computed value for the given key/item
+ * @param float|null $beta A float that, as it grows, controls the likeliness of triggering
+ * early expiration. 0 disables it, INF forces immediate expiration.
+ * The default (or providing null) is implementation dependent but should
+ * typically be 1.0, which should provide optimal stampede protection.
+ * See https://en.wikipedia.org/wiki/Cache_stampede#Probabilistic_early_expiration
+ * @param array &$metadata The metadata of the cached item {@see ItemInterface::getMetadata()}
+ *
+ * @return mixed The value corresponding to the provided key
+ *
+ * @throws InvalidArgumentException When $key is not valid or when $beta is negative
+ */
+ public function get(string $key, callable $callback, float $beta = null, array &$metadata = null);
+
+ /**
+ * Removes an item from the pool.
+ *
+ * @param string $key The key to delete
+ *
+ * @throws InvalidArgumentException When $key is not valid
+ *
+ * @return bool True if the item was successfully removed, false if there was any error
+ */
+ public function delete(string $key): bool;
+}
diff --git a/vendor/symfony/contracts/Cache/CacheTrait.php b/vendor/symfony/contracts/Cache/CacheTrait.php
new file mode 100644
index 00000000..d82d9653
--- /dev/null
+++ b/vendor/symfony/contracts/Cache/CacheTrait.php
@@ -0,0 +1,71 @@
+
+ *
+ * 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;
+
+/**
+ * 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)
+ {
+ 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() : array();
+
+ if (!$recompute && $metadata) {
+ $expiry = $metadata[ItemInterface::METADATA_EXPIRY] ?? false;
+ $ctime = $metadata[ItemInterface::METADATA_CTIME] ?? false;
+
+ if ($recompute = $ctime && $expiry && $expiry <= microtime(true) - $ctime / 1000 * $beta * log(random_int(1, PHP_INT_MAX) / PHP_INT_MAX)) {
+ // force applying defaultLifetime to expiry
+ $item->expiresAt(null);
+ }
+ }
+
+ if ($recompute) {
+ $save = true;
+ $item->set($callback($item, $save));
+ if ($save) {
+ $pool->save($item);
+ }
+ }
+
+ return $item->get();
+ }
+}
diff --git a/vendor/symfony/contracts/Cache/CallbackInterface.php b/vendor/symfony/contracts/Cache/CallbackInterface.php
new file mode 100644
index 00000000..7dae2aac
--- /dev/null
+++ b/vendor/symfony/contracts/Cache/CallbackInterface.php
@@ -0,0 +1,30 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Contracts\Cache;
+
+use Psr\Cache\CacheItemInterface;
+
+/**
+ * Computes and returns the cached value of an item.
+ *
+ * @author Nicolas Grekas
+ */
+interface CallbackInterface
+{
+ /**
+ * @param CacheItemInterface|ItemInterface $item The item to compute the value for
+ * @param bool &$save Should be set to false when the value should not be saved in the pool
+ *
+ * @return mixed The computed value for the passed item
+ */
+ public function __invoke(CacheItemInterface $item, bool &$save);
+}
diff --git a/vendor/symfony/contracts/Cache/ItemInterface.php b/vendor/symfony/contracts/Cache/ItemInterface.php
new file mode 100644
index 00000000..4884a2ff
--- /dev/null
+++ b/vendor/symfony/contracts/Cache/ItemInterface.php
@@ -0,0 +1,60 @@
+
+ *
+ * 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/TagAwareCacheInterface.php b/vendor/symfony/contracts/Cache/TagAwareCacheInterface.php
new file mode 100644
index 00000000..7c4cf111
--- /dev/null
+++ b/vendor/symfony/contracts/Cache/TagAwareCacheInterface.php
@@ -0,0 +1,38 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Contracts\Cache;
+
+use Psr\Cache\InvalidArgumentException;
+
+/**
+ * Allows invalidating cached items using tags.
+ *
+ * @author Nicolas Grekas
+ */
+interface TagAwareCacheInterface extends CacheInterface
+{
+ /**
+ * Invalidates cached items using tags.
+ *
+ * When implemented on a PSR-6 pool, invalidation should not apply
+ * to deferred items. Instead, they should be committed as usual.
+ * This allows replacing old tagged values by new ones without
+ * race conditions.
+ *
+ * @param string[] $tags An array of tags to invalidate
+ *
+ * @return bool True on success
+ *
+ * @throws InvalidArgumentException When $tags is not valid
+ */
+ public function invalidateTags(array $tags);
+}
diff --git a/vendor/symfony/contracts/LICENSE b/vendor/symfony/contracts/LICENSE
new file mode 100644
index 00000000..ad399a79
--- /dev/null
+++ b/vendor/symfony/contracts/LICENSE
@@ -0,0 +1,19 @@
+Copyright (c) 2018 Fabien Potencier
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is furnished
+to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/vendor/symfony/contracts/README.md b/vendor/symfony/contracts/README.md
new file mode 100644
index 00000000..9cb73af2
--- /dev/null
+++ b/vendor/symfony/contracts/README.md
@@ -0,0 +1,70 @@
+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, etc.;
+ * 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/*-contracts-implementation`
+convention (e.g. `"provide": { "symfony/cache-contracts-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.
+
+### Why isn't this package split into several packages?
+
+Putting all interfaces in one package eases discoverability and dependency
+management. Instead of dealing with a myriad of small packages and the
+corresponding matrix of versions, you just need to deal with one package and one
+version. Also when using IDE autocompletion or just reading the source code, it
+makes it easier to figure out which contracts are provided.
+
+There are two downsides to this approach: you may have unused files in your
+`vendor/` directory, and in the future, it will be impossible to use two
+different sub-namespaces in different major versions of the package. For the
+"unused files" downside, it has no practical consequences: their file sizes are
+very small, and there is no performance overhead at all since they are never
+loaded. For major versions, this package follows the Symfony BC + deprecation
+policies, with an additional restriction to never remove deprecated interfaces.
+
+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/ResetInterface.php b/vendor/symfony/contracts/Service/ResetInterface.php
new file mode 100644
index 00000000..1af1075e
--- /dev/null
+++ b/vendor/symfony/contracts/Service/ResetInterface.php
@@ -0,0 +1,30 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Contracts\Service;
+
+/**
+ * Provides a way to reset an object to its initial state.
+ *
+ * When calling the "reset()" method on an object, it should be put back to its
+ * initial state. This usually means clearing any internal buffers and forwarding
+ * the call to internal dependencies. All properties of the object should be put
+ * back to the same state it had when it was first ready to use.
+ *
+ * This method could be called, for example, to recycle objects that are used as
+ * services, so that they can be used to handle several requests in the same
+ * process loop (note that we advise making your services stateless instead of
+ * implementing this interface when possible.)
+ */
+interface ResetInterface
+{
+ public function reset();
+}
diff --git a/vendor/symfony/contracts/Service/ServiceLocatorTrait.php b/vendor/symfony/contracts/Service/ServiceLocatorTrait.php
new file mode 100644
index 00000000..8ffa2b4f
--- /dev/null
+++ b/vendor/symfony/contracts/Service/ServiceLocatorTrait.php
@@ -0,0 +1,97 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Contracts\Service;
+
+use Psr\Container\ContainerExceptionInterface;
+use Psr\Container\NotFoundExceptionInterface;
+
+/**
+ * A trait to help implement PSR-11 service locators.
+ *
+ * @author Robin Chalas
+ * @author Nicolas Grekas
+ */
+trait ServiceLocatorTrait
+{
+ private $factories;
+ private $loading = array();
+
+ /**
+ * @param callable[] $factories
+ */
+ public function __construct(array $factories)
+ {
+ $this->factories = $factories;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function has($id)
+ {
+ return isset($this->factories[$id]);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get($id)
+ {
+ if (!isset($this->factories[$id])) {
+ throw $this->createNotFoundException($id);
+ }
+
+ if (isset($this->loading[$id])) {
+ $ids = array_values($this->loading);
+ $ids = \array_slice($this->loading, array_search($id, $ids));
+ $ids[] = $id;
+
+ throw $this->createCircularReferenceException($id, $ids);
+ }
+
+ $this->loading[$id] = $id;
+ try {
+ return $this->factories[$id]($this);
+ } finally {
+ unset($this->loading[$id]);
+ }
+ }
+
+ private function createNotFoundException(string $id): NotFoundExceptionInterface
+ {
+ if (!$alternatives = array_keys($this->factories)) {
+ $message = 'is empty...';
+ } else {
+ $last = array_pop($alternatives);
+ if ($alternatives) {
+ $message = sprintf('only knows about the "%s" and "%s" services.', implode('", "', $alternatives), $last);
+ } else {
+ $message = sprintf('only knows about the "%s" service.', $last);
+ }
+ }
+
+ if ($this->loading) {
+ $message = sprintf('The service "%s" has a dependency on a non-existent service "%s". This locator %s', end($this->loading), $id, $message);
+ } else {
+ $message = sprintf('Service "%s" not found: the current service locator %s', $id, $message);
+ }
+
+ return new class($message) extends \InvalidArgumentException implements NotFoundExceptionInterface {
+ };
+ }
+
+ private function createCircularReferenceException(string $id, array $path): ContainerExceptionInterface
+ {
+ return new class(sprintf('Circular reference detected for service "%s", path: "%s".', $id, implode(' -> ', $path))) extends \RuntimeException implements ContainerExceptionInterface {
+ };
+ }
+}
diff --git a/vendor/symfony/contracts/Service/ServiceSubscriberInterface.php b/vendor/symfony/contracts/Service/ServiceSubscriberInterface.php
new file mode 100644
index 00000000..cffccadb
--- /dev/null
+++ b/vendor/symfony/contracts/Service/ServiceSubscriberInterface.php
@@ -0,0 +1,53 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Contracts\Service;
+
+/**
+ * A ServiceSubscriber exposes its dependencies via the static {@link getSubscribedServices} method.
+ *
+ * The getSubscribedServices method returns an array of service types required by such instances,
+ * optionally keyed by the service names used internally. Service types that start with an interrogation
+ * mark "?" are optional, while the other ones are mandatory service dependencies.
+ *
+ * The injected service locators SHOULD NOT allow access to any other services not specified by the method.
+ *
+ * It is expected that ServiceSubscriber instances consume PSR-11-based service locators internally.
+ * This interface does not dictate any injection method for these service locators, although constructor
+ * injection is recommended.
+ *
+ * @author Nicolas Grekas
+ */
+interface ServiceSubscriberInterface
+{
+ /**
+ * Returns an array of service types required by such instances, optionally keyed by the service names used internally.
+ *
+ * For mandatory dependencies:
+ *
+ * * array('logger' => 'Psr\Log\LoggerInterface') means the objects use the "logger" name
+ * internally to fetch a service which must implement Psr\Log\LoggerInterface.
+ * * array('loggers' => 'Psr\Log\LoggerInterface[]') means the objects use the "loggers" name
+ * internally to fetch an iterable of Psr\Log\LoggerInterface instances.
+ * * array('Psr\Log\LoggerInterface') is a shortcut for
+ * * array('Psr\Log\LoggerInterface' => 'Psr\Log\LoggerInterface')
+ *
+ * otherwise:
+ *
+ * * array('logger' => '?Psr\Log\LoggerInterface') denotes an optional dependency
+ * * array('loggers' => '?Psr\Log\LoggerInterface[]') denotes an optional iterable dependency
+ * * array('?Psr\Log\LoggerInterface') is a shortcut for
+ * * array('Psr\Log\LoggerInterface' => '?Psr\Log\LoggerInterface')
+ *
+ * @return array The required service types, optionally keyed by service names
+ */
+ public static function getSubscribedServices();
+}
diff --git a/vendor/symfony/contracts/Service/ServiceSubscriberTrait.php b/vendor/symfony/contracts/Service/ServiceSubscriberTrait.php
new file mode 100644
index 00000000..457ffb26
--- /dev/null
+++ b/vendor/symfony/contracts/Service/ServiceSubscriberTrait.php
@@ -0,0 +1,61 @@
+
+ *
+ * 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(array('parent', __FUNCTION__)) ? parent::getSubscribedServices() : array();
+
+ 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(array('parent', __FUNCTION__))) {
+ return parent::setContainer($container);
+ }
+ }
+}
diff --git a/vendor/symfony/contracts/Tests/Cache/CacheTraitTest.php b/vendor/symfony/contracts/Tests/Cache/CacheTraitTest.php
new file mode 100644
index 00000000..5134a933
--- /dev/null
+++ b/vendor/symfony/contracts/Tests/Cache/CacheTraitTest.php
@@ -0,0 +1,165 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Contracts\Tests\Cache;
+
+use PHPUnit\Framework\TestCase;
+use Psr\Cache\CacheItemInterface;
+use Psr\Cache\CacheItemPoolInterface;
+use Symfony\Contracts\Cache\CacheTrait;
+
+/**
+ * @author Tobias Nyholm
+ */
+class CacheTraitTest extends TestCase
+{
+ public function testSave()
+ {
+ $item = $this->getMockBuilder(CacheItemInterface::class)->getMock();
+ $item->method('set')
+ ->willReturn($item);
+ $item->method('isHit')
+ ->willReturn(false);
+
+ $item->expects($this->once())
+ ->method('set')
+ ->with('computed data');
+
+ $cache = $this->getMockBuilder(TestPool::class)
+ ->setMethods(array('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(array('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(array('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(array('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 = array())
+ {
+ }
+
+ public function getItem($key)
+ {
+ }
+
+ public function getItems(array $key = array())
+ {
+ }
+
+ public function saveDeferred(CacheItemInterface $item)
+ {
+ }
+
+ public function save(CacheItemInterface $item)
+ {
+ }
+
+ public function commit()
+ {
+ }
+
+ public function clear()
+ {
+ }
+}
diff --git a/vendor/symfony/contracts/Tests/Service/ServiceLocatorTest.php b/vendor/symfony/contracts/Tests/Service/ServiceLocatorTest.php
new file mode 100644
index 00000000..265af909
--- /dev/null
+++ b/vendor/symfony/contracts/Tests/Service/ServiceLocatorTest.php
@@ -0,0 +1,94 @@
+
+ *
+ * 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;
+
+class ServiceLocatorTest extends TestCase
+{
+ public function getServiceLocator(array $factories)
+ {
+ return new class($factories) implements ContainerInterface {
+ use ServiceLocatorTrait;
+ };
+ }
+
+ public function testHas()
+ {
+ $locator = $this->getServiceLocator(array(
+ 'foo' => function () { return 'bar'; },
+ 'bar' => function () { return 'baz'; },
+ function () { return 'dummy'; },
+ ));
+
+ $this->assertTrue($locator->has('foo'));
+ $this->assertTrue($locator->has('bar'));
+ $this->assertFalse($locator->has('dummy'));
+ }
+
+ public function testGet()
+ {
+ $locator = $this->getServiceLocator(array(
+ 'foo' => function () { return 'bar'; },
+ 'bar' => function () { return 'baz'; },
+ ));
+
+ $this->assertSame('bar', $locator->get('foo'));
+ $this->assertSame('baz', $locator->get('bar'));
+ }
+
+ public function testGetDoesNotMemoize()
+ {
+ $i = 0;
+ $locator = $this->getServiceLocator(array(
+ 'foo' => function () use (&$i) {
+ ++$i;
+
+ return 'bar';
+ },
+ ));
+
+ $this->assertSame('bar', $locator->get('foo'));
+ $this->assertSame('bar', $locator->get('foo'));
+ $this->assertSame(2, $i);
+ }
+
+ /**
+ * @expectedException \Psr\Container\NotFoundExceptionInterface
+ * @expectedExceptionMessage The service "foo" has a dependency on a non-existent service "bar". This locator only knows about the "foo" service.
+ */
+ public function testThrowsOnUndefinedInternalService()
+ {
+ $locator = $this->getServiceLocator(array(
+ 'foo' => function () use (&$locator) { return $locator->get('bar'); },
+ ));
+
+ $locator->get('foo');
+ }
+
+ /**
+ * @expectedException \Psr\Container\ContainerExceptionInterface
+ * @expectedExceptionMessage Circular reference detected for service "bar", path: "bar -> baz -> bar".
+ */
+ public function testThrowsOnCircularReference()
+ {
+ $locator = $this->getServiceLocator(array(
+ 'foo' => function () use (&$locator) { return $locator->get('bar'); },
+ 'bar' => function () use (&$locator) { return $locator->get('baz'); },
+ 'baz' => function () use (&$locator) { return $locator->get('bar'); },
+ ));
+
+ $locator->get('foo');
+ }
+}
diff --git a/vendor/symfony/contracts/Tests/Service/ServiceSubscriberTraitTest.php b/vendor/symfony/contracts/Tests/Service/ServiceSubscriberTraitTest.php
new file mode 100644
index 00000000..c7742c65
--- /dev/null
+++ b/vendor/symfony/contracts/Tests/Service/ServiceSubscriberTraitTest.php
@@ -0,0 +1,65 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Contracts\Tests\Service;
+
+use PHPUnit\Framework\TestCase;
+use Psr\Container\ContainerInterface;
+use Symfony\Contracts\Service\ServiceLocatorTrait;
+use Symfony\Contracts\Service\ServiceSubscriberInterface;
+use Symfony\Contracts\Service\ServiceSubscriberTrait;
+
+class ServiceSubscriberTraitTest extends TestCase
+{
+ public function testMethodsOnParentsAndChildrenAreIgnoredInGetSubscribedServices()
+ {
+ $expected = array(TestService::class.'::aService' => '?Symfony\Contracts\Tests\Service\Service2');
+
+ $this->assertEquals($expected, ChildTestService::getSubscribedServices());
+ }
+
+ public function testSetContainerIsCalledOnParent()
+ {
+ $container = new class(array()) 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/Tests/Translation/TranslatorTest.php b/vendor/symfony/contracts/Tests/Translation/TranslatorTest.php
new file mode 100644
index 00000000..a3b67dfe
--- /dev/null
+++ b/vendor/symfony/contracts/Tests/Translation/TranslatorTest.php
@@ -0,0 +1,353 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Contracts\Tests\Translation;
+
+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, array('%count%' => $number)));
+ }
+
+ /**
+ * @dataProvider getTransChoiceTests
+ */
+ public function testTransChoiceWithDefaultLocale($expected, $id, $number)
+ {
+ \Locale::setDefault('en');
+
+ $translator = $this->getTranslator();
+
+ $this->assertEquals($expected, $translator->trans($id, array('%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 array(
+ array('Symfony is great!', 'Symfony is great!', array()),
+ array('Symfony is awesome!', 'Symfony is %what%!', array('%what%' => 'awesome')),
+ );
+ }
+
+ public function getTransChoiceTests()
+ {
+ return array(
+ array('There are no apples', '{0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples', 0),
+ array('There is one apple', '{0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples', 1),
+ array('There are 10 apples', '{0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples', 10),
+ array('There are 0 apples', 'There is 1 apple|There are %count% apples', 0),
+ array('There is 1 apple', 'There is 1 apple|There are %count% apples', 1),
+ array('There are 10 apples', 'There is 1 apple|There are %count% apples', 10),
+ // custom validation messages may be coded with a fixed value
+ array('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', array('%count%' => $number)));
+ }
+
+ public function getInternal()
+ {
+ return array(
+ array('foo', 3, '{1,2, 3 ,4}'),
+ array('bar', 10, '{1,2, 3 ,4}'),
+ array('bar', 3, '[1,2]'),
+ array('foo', 1, '[1,2]'),
+ array('foo', 2, '[1,2]'),
+ array('bar', 1, ']1,2['),
+ array('bar', 2, ']1,2['),
+ array('foo', log(0), '[-Inf,2['),
+ array('foo', -log(0), '[-2,+Inf]'),
+ );
+ }
+
+ /**
+ * @dataProvider getChooseTests
+ */
+ public function testChoose($expected, $id, $number)
+ {
+ $translator = $this->getTranslator();
+
+ $this->assertEquals($expected, $translator->trans($id, array('%count%' => $number)));
+ }
+
+ public function testReturnMessageIfExactlyOneStandardRuleIsGiven()
+ {
+ $translator = $this->getTranslator();
+
+ $this->assertEquals('There are two apples', $translator->trans('There are two apples', array('%count%' => 2)));
+ }
+
+ /**
+ * @dataProvider getNonMatchingMessages
+ * @expectedException \InvalidArgumentException
+ */
+ public function testThrowExceptionIfMatchingMessageCannotBeFound($id, $number)
+ {
+ $translator = $this->getTranslator();
+
+ $translator->trans($id, array('%count%' => $number));
+ }
+
+ public function getNonMatchingMessages()
+ {
+ return array(
+ array('{0} There are no apples|{1} There is one apple', 2),
+ array('{1} There is one apple|]1,Inf] There are %count% apples', 0),
+ array('{1} There is one apple|]2,Inf] There are %count% apples', 2),
+ array('{0} There are no apples|There is one apple', 2),
+ );
+ }
+
+ public function getChooseTests()
+ {
+ return array(
+ array('There are no apples', '{0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples', 0),
+ array('There are no apples', '{0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples', 0),
+ array('There are no apples', '{0}There are no apples|{1} There is one apple|]1,Inf] There are %count% apples', 0),
+
+ array('There is one apple', '{0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples', 1),
+
+ array('There are 10 apples', '{0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples', 10),
+ array('There are 10 apples', '{0} There are no apples|{1} There is one apple|]1,Inf]There are %count% apples', 10),
+ array('There are 10 apples', '{0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples', 10),
+
+ array('There are 0 apples', 'There is one apple|There are %count% apples', 0),
+ array('There is one apple', 'There is one apple|There are %count% apples', 1),
+ array('There are 10 apples', 'There is one apple|There are %count% apples', 10),
+
+ array('There are 0 apples', 'one: There is one apple|more: There are %count% apples', 0),
+ array('There is one apple', 'one: There is one apple|more: There are %count% apples', 1),
+ array('There are 10 apples', 'one: There is one apple|more: There are %count% apples', 10),
+
+ array('There are no apples', '{0} There are no apples|one: There is one apple|more: There are %count% apples', 0),
+ array('There is one apple', '{0} There are no apples|one: There is one apple|more: There are %count% apples', 1),
+ array('There are 10 apples', '{0} There are no apples|one: There is one apple|more: There are %count% apples', 10),
+
+ array('', '{0}|{1} There is one apple|]1,Inf] There are %count% apples', 0),
+ array('', '{0} There are no apples|{1}|]1,Inf] There are %count% apples', 1),
+
+ // Indexed only tests which are Gettext PoFile* compatible strings.
+ array('There are 0 apples', 'There is one apple|There are %count% apples', 0),
+ array('There is one apple', 'There is one apple|There are %count% apples', 1),
+ array('There are 2 apples', 'There is one apple|There are %count% apples', 2),
+
+ // Tests for float numbers
+ array('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),
+ array('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),
+ array('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),
+ array('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),
+ array('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),
+ array('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
+ array("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
+ array("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),
+ array("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
+ array('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
+ array('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
+ array('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
+ array("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
+ array('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
+ array('', '|', 1),
+ // Empty plural set (3 plural forms) from a .PO file
+ array('', '||', 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 array(
+ array('1', array('ay', 'bo', 'cgg', 'dz', 'id', 'ja', 'jbo', 'ka', 'kk', 'km', 'ko', 'ky')),
+ array('2', array('nl', 'fr', 'en', 'de', 'de_GE', 'hy', 'hy_AM')),
+ array('3', array('be', 'bs', 'cs', 'hr')),
+ array('4', array('cy', 'mt', 'sl')),
+ array('6', array('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 array(
+ array('1', array('fa')),
+ array('2', array('jbo')),
+ array('3', array('cbs')),
+ array('4', array('gd', 'kw')),
+ array('5', array('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 = array();
+ 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/LocaleAwareInterface.php b/vendor/symfony/contracts/Translation/LocaleAwareInterface.php
new file mode 100644
index 00000000..dbd8894f
--- /dev/null
+++ b/vendor/symfony/contracts/Translation/LocaleAwareInterface.php
@@ -0,0 +1,31 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Contracts\Translation;
+
+interface LocaleAwareInterface
+{
+ /**
+ * Sets the current locale.
+ *
+ * @param string $locale The locale
+ *
+ * @throws \InvalidArgumentException If the locale contains invalid characters
+ */
+ public function setLocale($locale);
+
+ /**
+ * Returns the current locale.
+ *
+ * @return string The locale
+ */
+ public function getLocale();
+}
diff --git a/vendor/symfony/contracts/Translation/TranslatorInterface.php b/vendor/symfony/contracts/Translation/TranslatorInterface.php
new file mode 100644
index 00000000..2bdc415c
--- /dev/null
+++ b/vendor/symfony/contracts/Translation/TranslatorInterface.php
@@ -0,0 +1,65 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Contracts\Translation;
+
+/**
+ * @author Fabien Potencier
+ */
+interface TranslatorInterface
+{
+ /**
+ * Translates the given message.
+ *
+ * When a number is provided as a parameter named "%count%", the message is parsed for plural
+ * forms and a translation is chosen according to this number using the following rules:
+ *
+ * Given a message with different plural translations separated by a
+ * pipe (|), this method returns the correct portion of the message based
+ * on the given number, locale and the pluralization rules in the message
+ * itself.
+ *
+ * The message supports two different types of pluralization rules:
+ *
+ * interval: {0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples
+ * indexed: There is one apple|There are %count% apples
+ *
+ * The indexed solution can also contain labels (e.g. one: There is one apple).
+ * This is purely for making the translations more clear - it does not
+ * affect the functionality.
+ *
+ * The two methods can also be mixed:
+ * {0} There are no apples|one: There is one apple|more: There are %count% apples
+ *
+ * An interval can represent a finite set of numbers:
+ * {1,2,3,4}
+ *
+ * An interval can represent numbers between two numbers:
+ * [1, +Inf]
+ * ]-1,2[
+ *
+ * The left delimiter can be [ (inclusive) or ] (exclusive).
+ * The right delimiter can be [ (exclusive) or ] (inclusive).
+ * Beside numbers, you can use -Inf and +Inf for the infinite.
+ *
+ * @see https://en.wikipedia.org/wiki/ISO_31-11
+ *
+ * @param string $id The message id (may also be an object that can be cast to string)
+ * @param array $parameters An array of parameters for the message
+ * @param string|null $domain The domain for the message or null to use the default
+ * @param string|null $locale The locale or null to use the default
+ *
+ * @return string The translated string
+ *
+ * @throws \InvalidArgumentException If the locale contains invalid characters
+ */
+ public function trans($id, array $parameters = array(), $domain = null, $locale = null);
+}
diff --git a/vendor/symfony/contracts/Translation/TranslatorTrait.php b/vendor/symfony/contracts/Translation/TranslatorTrait.php
new file mode 100644
index 00000000..4e53fbd4
--- /dev/null
+++ b/vendor/symfony/contracts/Translation/TranslatorTrait.php
@@ -0,0 +1,255 @@
+
+ *
+ * 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 = array(), $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 = array();
+ 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 = array();
+ 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/composer.json b/vendor/symfony/contracts/composer.json
new file mode 100644
index 00000000..2f198a0c
--- /dev/null
+++ b/vendor/symfony/contracts/composer.json
@@ -0,0 +1,44 @@
+{
+ "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"
+ },
+ "suggest": {
+ "psr/cache": "When using the Cache contracts",
+ "psr/container": "When using the Service contracts",
+ "symfony/cache-contracts-implementation": "",
+ "symfony/service-contracts-implementation": "",
+ "symfony/translation-contracts-implementation": ""
+ },
+ "autoload": {
+ "psr-4": { "Symfony\\Contracts\\": "" },
+ "exclude-from-classmap": [
+ "**/Tests/"
+ ]
+ },
+ "minimum-stability": "dev",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0-dev"
+ }
+ }
+}
diff --git a/vendor/symfony/contracts/phpunit.xml.dist b/vendor/symfony/contracts/phpunit.xml.dist
new file mode 100644
index 00000000..e222d9f5
--- /dev/null
+++ b/vendor/symfony/contracts/phpunit.xml.dist
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+ ./Tests/
+
+
+
+
+
+ ./
+
+ ./Tests
+ ./vendor
+
+
+
+
+
diff --git a/vendor/symfony/css-selector/Exception/ExceptionInterface.php b/vendor/symfony/css-selector/Exception/ExceptionInterface.php
index e4c5ae1b..9e259006 100644
--- a/vendor/symfony/css-selector/Exception/ExceptionInterface.php
+++ b/vendor/symfony/css-selector/Exception/ExceptionInterface.php
@@ -19,6 +19,6 @@ namespace Symfony\Component\CssSelector\Exception;
*
* @author Jean-François Simon
*/
-interface ExceptionInterface
+interface ExceptionInterface extends \Throwable
{
}
diff --git a/vendor/symfony/css-selector/composer.json b/vendor/symfony/css-selector/composer.json
index e2ed078e..ebe7d0d5 100644
--- a/vendor/symfony/css-selector/composer.json
+++ b/vendor/symfony/css-selector/composer.json
@@ -31,7 +31,7 @@
"minimum-stability": "dev",
"extra": {
"branch-alias": {
- "dev-master": "4.1-dev"
+ "dev-master": "4.2-dev"
}
}
}
diff --git a/vendor/symfony/css-selector/phpunit.xml.dist b/vendor/symfony/css-selector/phpunit.xml.dist
index 65ff1827..a8e537ef 100644
--- a/vendor/symfony/css-selector/phpunit.xml.dist
+++ b/vendor/symfony/css-selector/phpunit.xml.dist
@@ -1,7 +1,7 @@
* @author Christophe Coevoet
* @author Nicolas Grekas
+ * @author Guilhem Niot
*/
class DebugClassLoader
{
@@ -34,6 +37,7 @@ class DebugClassLoader
private static $deprecated = array();
private static $internal = array();
private static $internalMethods = array();
+ private static $annotatedParameters = array();
private static $darwinCache = array('/' => array('/', array()));
public function __construct(callable $classLoader)
@@ -137,14 +141,14 @@ class DebugClassLoader
try {
if ($this->isFinder && !isset($this->loaded[$class])) {
$this->loaded[$class] = true;
- if ($file = $this->classLoader[0]->findFile($class) ?: false) {
- $wasCached = \function_exists('opcache_is_script_cached') && @opcache_is_script_cached($file);
-
+ if (!$file = $this->classLoader[0]->findFile($class) ?: false) {
+ // no-op
+ } elseif (\function_exists('opcache_is_script_cached') && @opcache_is_script_cached($file)) {
require $file;
- if ($wasCached) {
- return;
- }
+ return;
+ } else {
+ require $file;
}
} else {
\call_user_func($this->classLoader, $class);
@@ -260,11 +264,12 @@ class DebugClassLoader
return $deprecations;
}
- // Inherit @final and @internal annotations for methods
+ // Inherit @final, @internal and @param annotations for methods
self::$finalMethods[$class] = array();
self::$internalMethods[$class] = array();
+ self::$annotatedParameters[$class] = array();
foreach ($parentAndOwnInterfaces as $use) {
- foreach (array('finalMethods', 'internalMethods') as $property) {
+ foreach (array('finalMethods', 'internalMethods', 'annotatedParameters') as $property) {
if (isset(self::${$property}[$use])) {
self::${$property}[$class] = self::${$property}[$class] ? self::${$property}[$use] + self::${$property}[$class] : self::${$property}[$use];
}
@@ -288,15 +293,52 @@ class DebugClassLoader
}
}
- // Detect method annotations
- if (false === $doc = $method->getDocComment()) {
+ // To read method annotations
+ $doc = $method->getDocComment();
+
+ if (isset(self::$annotatedParameters[$class][$method->name])) {
+ $definedParameters = array();
+ foreach ($method->getParameters() as $parameter) {
+ $definedParameters[$parameter->name] = true;
+ }
+
+ foreach (self::$annotatedParameters[$class][$method->name] as $parameterName => $deprecation) {
+ if (!isset($definedParameters[$parameterName]) && !($doc && preg_match("/\\n\\s+\\* @param (.*?)(?<= )\\\${$parameterName}\\b/", $doc))) {
+ $deprecations[] = sprintf($deprecation, $class);
+ }
+ }
+ }
+
+ if (!$doc) {
continue;
}
+ $finalOrInternal = false;
+
foreach (array('final', 'internal') as $annotation) {
if (false !== \strpos($doc, $annotation) && preg_match('#\n\s+\* @'.$annotation.'(?:( .+?)\.?)?\r?\n\s+\*(?: @|/$)#s', $doc, $notice)) {
$message = isset($notice[1]) ? preg_replace('#\s*\r?\n \* +#', ' ', $notice[1]) : '';
self::${$annotation.'Methods'}[$class][$method->name] = array($class, $message);
+ $finalOrInternal = true;
+ }
+ }
+
+ if ($finalOrInternal || $method->isConstructor() || false === \strpos($doc, '@param') || StatelessInvocation::class === $class) {
+ continue;
+ }
+ if (!preg_match_all('#\n\s+\* @param (.*?)(?<= )\$([a-zA-Z0-9_\x7f-\xff]++)#', $doc, $matches, PREG_SET_ORDER)) {
+ continue;
+ }
+ if (!isset(self::$annotatedParameters[$class][$method->name])) {
+ $definedParameters = array();
+ foreach ($method->getParameters() as $parameter) {
+ $definedParameters[$parameter->name] = true;
+ }
+ }
+ foreach ($matches as list(, $parameterType, $parameterName)) {
+ if (!isset($definedParameters[$parameterName])) {
+ $parameterType = trim($parameterType);
+ self::$annotatedParameters[$class][$method->name][$parameterName] = sprintf('The "%%s::%s()" method will require a new "%s$%s" argument in the next major version of its parent class "%s", not defining it is deprecated.', $method->name, $parameterType ? $parameterType.' ' : '', $parameterName, $method->class);
}
}
}
diff --git a/vendor/symfony/debug/ErrorHandler.php b/vendor/symfony/debug/ErrorHandler.php
index caffd541..ecae93db 100644
--- a/vendor/symfony/debug/ErrorHandler.php
+++ b/vendor/symfony/debug/ErrorHandler.php
@@ -15,6 +15,7 @@ use Psr\Log\LoggerInterface;
use Psr\Log\LogLevel;
use Symfony\Component\Debug\Exception\FatalErrorException;
use Symfony\Component\Debug\Exception\FatalThrowableError;
+use Symfony\Component\Debug\Exception\FlattenException;
use Symfony\Component\Debug\Exception\OutOfMemoryException;
use Symfony\Component\Debug\Exception\SilencedErrorContext;
use Symfony\Component\Debug\FatalErrorHandler\ClassNotFoundFatalErrorHandler;
@@ -405,15 +406,19 @@ class ErrorHandler
$context = $e;
}
- $logMessage = $this->levels[$type].': '.$message;
+ if (false !== strpos($message, "class@anonymous\0")) {
+ $logMessage = $this->levels[$type].': '.(new FlattenException())->setMessage($message)->getMessage();
+ } else {
+ $logMessage = $this->levels[$type].': '.$message;
+ }
if (null !== self::$toStringException) {
$errorAsException = self::$toStringException;
self::$toStringException = null;
} elseif (!$throw && !($type & $level)) {
if (!isset(self::$silencedErrorCache[$id = $file.':'.$line])) {
- $lightTrace = $this->tracedErrors & $type ? $this->cleanTrace(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 3), $type, $file, $line, false) : array();
- $errorAsException = new SilencedErrorContext($type, $file, $line, $lightTrace);
+ $lightTrace = $this->tracedErrors & $type ? $this->cleanTrace(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 5), $type, $file, $line, false) : array();
+ $errorAsException = new SilencedErrorContext($type, $file, $line, isset($lightTrace[1]) ? array($lightTrace[0]) : $lightTrace);
} elseif (isset(self::$silencedErrorCache[$id][$message])) {
$lightTrace = null;
$errorAsException = self::$silencedErrorCache[$id][$message];
@@ -436,7 +441,6 @@ class ErrorHandler
} else {
$errorAsException = new \ErrorException($logMessage, 0, $type, $file, $line);
- // Clean the trace by removing function arguments and the first frames added by the error handler itself.
if ($throw || $this->tracedErrors & $type) {
$backtrace = $errorAsException->getTrace();
$lightTrace = $this->cleanTrace($backtrace, $type, $file, $line, $throw);
@@ -518,21 +522,24 @@ class ErrorHandler
$handlerException = null;
if (($this->loggedErrors & $type) || $exception instanceof FatalThrowableError) {
+ if (false !== strpos($message = $exception->getMessage(), "class@anonymous\0")) {
+ $message = (new FlattenException())->setMessage($message)->getMessage();
+ }
if ($exception instanceof FatalErrorException) {
if ($exception instanceof FatalThrowableError) {
$error = array(
'type' => $type,
- 'message' => $message = $exception->getMessage(),
+ 'message' => $message,
'file' => $exception->getFile(),
'line' => $exception->getLine(),
);
} else {
- $message = 'Fatal '.$exception->getMessage();
+ $message = 'Fatal '.$message;
}
} elseif ($exception instanceof \ErrorException) {
- $message = 'Uncaught '.$exception->getMessage();
+ $message = 'Uncaught '.$message;
} else {
- $message = 'Uncaught Exception: '.$exception->getMessage();
+ $message = 'Uncaught Exception: '.$message;
}
}
if ($this->loggedErrors & $type) {
@@ -661,6 +668,9 @@ class ErrorHandler
);
}
+ /**
+ * Cleans the trace by removing function arguments and the frames added by the error handler and DebugClassLoader.
+ */
private function cleanTrace($backtrace, $type, $file, $line, $throw)
{
$lightTrace = $backtrace;
@@ -671,6 +681,13 @@ class ErrorHandler
break;
}
}
+ if (class_exists(DebugClassLoader::class, false)) {
+ for ($i = \count($lightTrace) - 2; 0 < $i; --$i) {
+ if (DebugClassLoader::class === ($lightTrace[$i]['class'] ?? null)) {
+ array_splice($lightTrace, --$i, 2);
+ }
+ }
+ }
if (!($throw || $this->scopedErrors & $type)) {
for ($i = 0; isset($lightTrace[$i]); ++$i) {
unset($lightTrace[$i]['args'], $lightTrace[$i]['object']);
diff --git a/vendor/symfony/debug/Exception/FlattenException.php b/vendor/symfony/debug/Exception/FlattenException.php
index b091b55b..f85522ce 100644
--- a/vendor/symfony/debug/Exception/FlattenException.php
+++ b/vendor/symfony/debug/Exception/FlattenException.php
@@ -90,9 +90,14 @@ class FlattenException
return $this->statusCode;
}
+ /**
+ * @return $this
+ */
public function setStatusCode($code)
{
$this->statusCode = $code;
+
+ return $this;
}
public function getHeaders()
@@ -100,9 +105,14 @@ class FlattenException
return $this->headers;
}
+ /**
+ * @return $this
+ */
public function setHeaders(array $headers)
{
$this->headers = $headers;
+
+ return $this;
}
public function getClass()
@@ -110,9 +120,14 @@ class FlattenException
return $this->class;
}
+ /**
+ * @return $this
+ */
public function setClass($class)
{
- $this->class = $class;
+ $this->class = 'c' === $class[0] && 0 === strpos($class, "class@anonymous\0") ? get_parent_class($class).'@anonymous' : $class;
+
+ return $this;
}
public function getFile()
@@ -120,9 +135,14 @@ class FlattenException
return $this->file;
}
+ /**
+ * @return $this
+ */
public function setFile($file)
{
$this->file = $file;
+
+ return $this;
}
public function getLine()
@@ -130,9 +150,14 @@ class FlattenException
return $this->line;
}
+ /**
+ * @return $this
+ */
public function setLine($line)
{
$this->line = $line;
+
+ return $this;
}
public function getMessage()
@@ -140,9 +165,20 @@ class FlattenException
return $this->message;
}
+ /**
+ * @return $this
+ */
public function setMessage($message)
{
+ if (false !== strpos($message, "class@anonymous\0")) {
+ $message = preg_replace_callback('/class@anonymous\x00.*?\.php0x?[0-9a-fA-F]++/', function ($m) {
+ return \class_exists($m[0], false) ? get_parent_class($m[0]).'@anonymous' : $m[0];
+ }, $message);
+ }
+
$this->message = $message;
+
+ return $this;
}
public function getCode()
@@ -150,9 +186,14 @@ class FlattenException
return $this->code;
}
+ /**
+ * @return $this
+ */
public function setCode($code)
{
$this->code = $code;
+
+ return $this;
}
public function getPrevious()
@@ -160,9 +201,14 @@ class FlattenException
return $this->previous;
}
+ /**
+ * @return $this
+ */
public function setPrevious(self $previous)
{
$this->previous = $previous;
+
+ return $this;
}
public function getAllPrevious()
@@ -191,11 +237,14 @@ class FlattenException
$this->setTraceFromThrowable($exception);
}
- public function setTraceFromThrowable(\Throwable $throwable): void
+ public function setTraceFromThrowable(\Throwable $throwable)
{
- $this->setTrace($throwable->getTrace(), $throwable->getFile(), $throwable->getLine());
+ return $this->setTrace($throwable->getTrace(), $throwable->getFile(), $throwable->getLine());
}
+ /**
+ * @return $this
+ */
public function setTrace($trace, $file, $line)
{
$this->trace = array();
@@ -229,6 +278,8 @@ class FlattenException
'args' => isset($entry['args']) ? $this->flattenArgs($entry['args']) : array(),
);
}
+
+ return $this;
}
private function flattenArgs($args, $level = 0, &$count = 0)
diff --git a/vendor/symfony/debug/ExceptionHandler.php b/vendor/symfony/debug/ExceptionHandler.php
index 1845bc88..ea666b1a 100644
--- a/vendor/symfony/debug/ExceptionHandler.php
+++ b/vendor/symfony/debug/ExceptionHandler.php
@@ -253,7 +253,8 @@ EOF
} catch (\Exception $e) {
// something nasty happened and we cannot throw an exception anymore
if ($this->debug) {
- $title = sprintf('Exception thrown when handling an exception (%s: %s)', \get_class($e), $this->escapeHtml($e->getMessage()));
+ $e = FlattenException::create($e);
+ $title = sprintf('Exception thrown when handling an exception (%s: %s)', $e->getClass(), $this->escapeHtml($e->getMessage()));
} else {
$title = 'Whoops, looks like something went wrong.';
}
diff --git a/vendor/symfony/debug/Tests/DebugClassLoaderTest.php b/vendor/symfony/debug/Tests/DebugClassLoaderTest.php
index 4a237554..c7e03fbe 100644
--- a/vendor/symfony/debug/Tests/DebugClassLoaderTest.php
+++ b/vendor/symfony/debug/Tests/DebugClassLoaderTest.php
@@ -273,6 +273,24 @@ class DebugClassLoaderTest extends TestCase
));
}
+ public function testExtendedMethodDefinesNewParameters()
+ {
+ $deprecations = array();
+ set_error_handler(function ($type, $msg) use (&$deprecations) { $deprecations[] = $msg; });
+ $e = error_reporting(E_USER_DEPRECATED);
+
+ class_exists(__NAMESPACE__.'\\Fixtures\SubClassWithAnnotatedParameters', true);
+
+ error_reporting($e);
+ restore_error_handler();
+
+ $this->assertSame(array(
+ 'The "Symfony\Component\Debug\Tests\Fixtures\SubClassWithAnnotatedParameters::quzMethod()" method will require a new "Quz $quz" argument in the next major version of its parent class "Symfony\Component\Debug\Tests\Fixtures\ClassWithAnnotatedParameters", not defining it is deprecated.',
+ 'The "Symfony\Component\Debug\Tests\Fixtures\SubClassWithAnnotatedParameters::whereAmI()" method will require a new "bool $matrix" argument in the next major version of its parent class "Symfony\Component\Debug\Tests\Fixtures\InterfaceWithAnnotatedParameters", not defining it is deprecated.',
+ 'The "Symfony\Component\Debug\Tests\Fixtures\SubClassWithAnnotatedParameters::isSymfony()" method will require a new "true $yes" argument in the next major version of its parent class "Symfony\Component\Debug\Tests\Fixtures\ClassWithAnnotatedParameters", not defining it is deprecated.',
+ ), $deprecations);
+ }
+
public function testUseTraitWithInternalMethod()
{
$deprecations = array();
diff --git a/vendor/symfony/debug/Tests/Exception/FlattenExceptionTest.php b/vendor/symfony/debug/Tests/Exception/FlattenExceptionTest.php
index 4bac1609..5b77b999 100644
--- a/vendor/symfony/debug/Tests/Exception/FlattenExceptionTest.php
+++ b/vendor/symfony/debug/Tests/Exception/FlattenExceptionTest.php
@@ -333,6 +333,19 @@ class FlattenExceptionTest extends TestCase
$this->assertNotContains('*value1*', $serializeTrace);
}
+ public function testAnonymousClass()
+ {
+ $flattened = FlattenException::create(new class() extends \RuntimeException {
+ });
+
+ $this->assertSame('RuntimeException@anonymous', $flattened->getClass());
+
+ $flattened = FlattenException::create(new \Exception(sprintf('Class "%s" blah.', \get_class(new class() extends \RuntimeException {
+ }))));
+
+ $this->assertSame('Class "RuntimeException@anonymous" blah.', $flattened->getMessage());
+ }
+
private function createException($foo)
{
return new \Exception();
diff --git a/vendor/symfony/debug/Tests/Fixtures/ClassWithAnnotatedParameters.php b/vendor/symfony/debug/Tests/Fixtures/ClassWithAnnotatedParameters.php
new file mode 100644
index 00000000..d6eec9aa
--- /dev/null
+++ b/vendor/symfony/debug/Tests/Fixtures/ClassWithAnnotatedParameters.php
@@ -0,0 +1,34 @@
+
preProcess($eventName);
- $this->preDispatch($eventName, $event);
-
- $e = $this->stopwatch->start($eventName, 'section');
-
- $this->dispatcher->dispatch($eventName, $event);
-
- if ($e->isStarted()) {
- $e->stop();
+ try {
+ $this->preDispatch($eventName, $event);
+ try {
+ $e = $this->stopwatch->start($eventName, 'section');
+ try {
+ $this->dispatcher->dispatch($eventName, $event);
+ } finally {
+ if ($e->isStarted()) {
+ $e->stop();
+ }
+ }
+ } finally {
+ $this->postDispatch($eventName, $event);
+ }
+ } finally {
+ $this->postProcess($eventName);
}
- $this->postDispatch($eventName, $event);
- $this->postProcess($eventName);
-
return $event;
}
@@ -230,7 +235,7 @@ class TraceableEventDispatcher implements TraceableEventDispatcherInterface
*/
public function __call($method, $arguments)
{
- return \call_user_func_array(array($this->dispatcher, $method), $arguments);
+ return $this->dispatcher->{$method}(...$arguments);
}
/**
@@ -263,7 +268,7 @@ class TraceableEventDispatcher implements TraceableEventDispatcherInterface
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);
diff --git a/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcherInterface.php b/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcherInterface.php
index d716f191..cd4d7470 100644
--- a/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcherInterface.php
+++ b/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcherInterface.php
@@ -12,13 +12,14 @@
namespace Symfony\Component\EventDispatcher\Debug;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
+use Symfony\Contracts\Service\ResetInterface;
/**
* @deprecated since Symfony 4.1
*
* @author Fabien Potencier
*/
-interface TraceableEventDispatcherInterface extends EventDispatcherInterface
+interface TraceableEventDispatcherInterface extends EventDispatcherInterface, ResetInterface
{
/**
* Gets the called listeners.
@@ -33,9 +34,4 @@ interface TraceableEventDispatcherInterface extends EventDispatcherInterface
* @return array An array of not called listeners
*/
public function getNotCalledListeners();
-
- /**
- * Resets the trace.
- */
- public function reset();
}
diff --git a/vendor/symfony/event-dispatcher/Debug/WrappedListener.php b/vendor/symfony/event-dispatcher/Debug/WrappedListener.php
index 2d8126a6..d49f69de 100644
--- a/vendor/symfony/event-dispatcher/Debug/WrappedListener.php
+++ b/vendor/symfony/event-dispatcher/Debug/WrappedListener.php
@@ -34,7 +34,6 @@ class WrappedListener
public function __construct($listener, $name, Stopwatch $stopwatch, EventDispatcherInterface $dispatcher = null)
{
$this->listener = $listener;
- $this->name = $name;
$this->stopwatch = $stopwatch;
$this->dispatcher = $dispatcher;
$this->called = false;
@@ -44,7 +43,15 @@ class WrappedListener
$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';
+ $r = new \ReflectionFunction($listener);
+ if (false !== strpos($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 {
diff --git a/vendor/symfony/event-dispatcher/GenericEvent.php b/vendor/symfony/event-dispatcher/GenericEvent.php
index 95c99408..f0be7e18 100644
--- a/vendor/symfony/event-dispatcher/GenericEvent.php
+++ b/vendor/symfony/event-dispatcher/GenericEvent.php
@@ -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()
{
diff --git a/vendor/symfony/event-dispatcher/Tests/AbstractEventDispatcherTest.php b/vendor/symfony/event-dispatcher/Tests/AbstractEventDispatcherTest.php
index 9997a7b0..6d377d11 100644
--- a/vendor/symfony/event-dispatcher/Tests/AbstractEventDispatcherTest.php
+++ b/vendor/symfony/event-dispatcher/Tests/AbstractEventDispatcherTest.php
@@ -426,7 +426,7 @@ class TestEventSubscriberWithPriorities implements EventSubscriberInterface
return array(
'pre.foo' => array('preFoo', 10),
'post.foo' => array('postFoo'),
- );
+ );
}
}
diff --git a/vendor/symfony/event-dispatcher/Tests/Debug/WrappedListenerTest.php b/vendor/symfony/event-dispatcher/Tests/Debug/WrappedListenerTest.php
new file mode 100644
index 00000000..f743f148
--- /dev/null
+++ b/vendor/symfony/event-dispatcher/Tests/Debug/WrappedListenerTest.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\EventDispatcher\Tests\Debug;
+
+use PHPUnit\Framework\TestCase;
+use Symfony\Component\EventDispatcher\Debug\WrappedListener;
+use Symfony\Component\EventDispatcher\EventDispatcherInterface;
+use Symfony\Component\Stopwatch\Stopwatch;
+
+class WrappedListenerTest extends TestCase
+{
+ /**
+ * @dataProvider provideListenersToDescribe
+ */
+ public function testListenerDescription(callable $listener, $expected)
+ {
+ $wrappedListener = new WrappedListener($listener, null, $this->getMockBuilder(Stopwatch::class)->getMock(), $this->getMockBuilder(EventDispatcherInterface::class)->getMock());
+
+ $this->assertStringMatchesFormat($expected, $wrappedListener->getPretty());
+ }
+
+ public function provideListenersToDescribe()
+ {
+ $listeners = array(
+ array(new FooListener(), 'Symfony\Component\EventDispatcher\Tests\Debug\FooListener::__invoke'),
+ array(array(new FooListener(), 'listen'), 'Symfony\Component\EventDispatcher\Tests\Debug\FooListener::listen'),
+ array(array('Symfony\Component\EventDispatcher\Tests\Debug\FooListener', 'listenStatic'), 'Symfony\Component\EventDispatcher\Tests\Debug\FooListener::listenStatic'),
+ array('var_dump', 'var_dump'),
+ array(function () {}, 'closure'),
+ );
+
+ if (\PHP_VERSION_ID >= 70100) {
+ $listeners[] = array(\Closure::fromCallable(array(new FooListener(), 'listen')), 'Symfony\Component\EventDispatcher\Tests\Debug\FooListener::listen');
+ $listeners[] = array(\Closure::fromCallable(array('Symfony\Component\EventDispatcher\Tests\Debug\FooListener', 'listenStatic')), 'Symfony\Component\EventDispatcher\Tests\Debug\FooListener::listenStatic');
+ $listeners[] = array(\Closure::fromCallable(function () {}), 'closure');
+ }
+
+ return $listeners;
+ }
+}
+
+class FooListener
+{
+ public function listen()
+ {
+ }
+
+ public function __invoke()
+ {
+ }
+
+ public static function listenStatic()
+ {
+ }
+}
diff --git a/vendor/symfony/event-dispatcher/Tests/GenericEventTest.php b/vendor/symfony/event-dispatcher/Tests/GenericEventTest.php
index 9cf68c98..b63f69df 100644
--- a/vendor/symfony/event-dispatcher/Tests/GenericEventTest.php
+++ b/vendor/symfony/event-dispatcher/Tests/GenericEventTest.php
@@ -31,8 +31,6 @@ class GenericEventTest extends TestCase
*/
protected function setUp()
{
- parent::setUp();
-
$this->subject = new \stdClass();
$this->event = new GenericEvent($this->subject, array('name' => 'Event'));
}
@@ -44,8 +42,6 @@ class GenericEventTest extends TestCase
{
$this->subject = null;
$this->event = null;
-
- parent::tearDown();
}
public function testConstruct()
diff --git a/vendor/symfony/event-dispatcher/composer.json b/vendor/symfony/event-dispatcher/composer.json
index 12ee5327..6c75dfbb 100644
--- a/vendor/symfony/event-dispatcher/composer.json
+++ b/vendor/symfony/event-dispatcher/composer.json
@@ -16,7 +16,8 @@
}
],
"require": {
- "php": "^7.1.3"
+ "php": "^7.1.3",
+ "symfony/contracts": "^1.0"
},
"require-dev": {
"symfony/dependency-injection": "~3.4|~4.0",
@@ -41,7 +42,7 @@
"minimum-stability": "dev",
"extra": {
"branch-alias": {
- "dev-master": "4.1-dev"
+ "dev-master": "4.2-dev"
}
}
}
diff --git a/vendor/symfony/event-dispatcher/phpunit.xml.dist b/vendor/symfony/event-dispatcher/phpunit.xml.dist
index b3ad1bdf..f2eb1692 100644
--- a/vendor/symfony/event-dispatcher/phpunit.xml.dist
+++ b/vendor/symfony/event-dispatcher/phpunit.xml.dist
@@ -1,7 +1,7 @@
depth('> 1') // the Finder will start matching at level 1.
* $finder->depth('< 3') // the Finder will descend at most 3 levels of directories below the starting point.
+ * $finder->depth(['>= 1', '< 3'])
*
- * @param string|int $level The depth level expression
+ * @param string|int|string[]|int[] $levels The depth level expression or an array of depth levels
*
* @return $this
*
* @see DepthRangeFilterIterator
* @see NumberComparator
*/
- public function depth($level)
+ public function depth($levels)
{
- $this->depths[] = new Comparator\NumberComparator($level);
+ foreach ((array) $levels as $level) {
+ $this->depths[] = new Comparator\NumberComparator($level);
+ }
return $this;
}
@@ -131,8 +135,9 @@ class Finder implements \IteratorAggregate, \Countable
* $finder->date('until 2 days ago');
* $finder->date('> now - 2 hours');
* $finder->date('>= 2005-10-15');
+ * $finder->date(['>= 2005-10-15', '<= 2006-05-27']);
*
- * @param string $date A date range string
+ * @param string|string[] $dates A date range string or an array of date ranges
*
* @return $this
*
@@ -140,9 +145,11 @@ class Finder implements \IteratorAggregate, \Countable
* @see DateRangeFilterIterator
* @see DateComparator
*/
- public function date($date)
+ public function date($dates)
{
- $this->dates[] = new Comparator\DateComparator($date);
+ foreach ((array) $dates as $date) {
+ $this->dates[] = new Comparator\DateComparator($date);
+ }
return $this;
}
@@ -155,16 +162,17 @@ class Finder implements \IteratorAggregate, \Countable
* $finder->name('*.php')
* $finder->name('/\.php$/') // same as above
* $finder->name('test.php')
+ * $finder->name(['test.py', 'test.php'])
*
- * @param string $pattern A pattern (a regexp, a glob, or a string)
+ * @param string|string[] $patterns A pattern (a regexp, a glob, or a string) or an array of patterns
*
* @return $this
*
* @see FilenameFilterIterator
*/
- public function name($pattern)
+ public function name($patterns)
{
- $this->names[] = $pattern;
+ $this->names = \array_merge($this->names, (array) $patterns);
return $this;
}
@@ -172,15 +180,15 @@ class Finder implements \IteratorAggregate, \Countable
/**
* Adds rules that files must not match.
*
- * @param string $pattern A pattern (a regexp, a glob, or a string)
+ * @param string|string[] $patterns A pattern (a regexp, a glob, or a string) or an array of patterns
*
* @return $this
*
* @see FilenameFilterIterator
*/
- public function notName($pattern)
+ public function notName($patterns)
{
- $this->notNames[] = $pattern;
+ $this->notNames = \array_merge($this->notNames, (array) $patterns);
return $this;
}
@@ -192,16 +200,17 @@ class Finder implements \IteratorAggregate, \Countable
*
* $finder->contains('Lorem ipsum')
* $finder->contains('/Lorem ipsum/i')
+ * $finder->contains(['dolor', '/ipsum/i'])
*
- * @param string $pattern A pattern (string or regexp)
+ * @param string|string[] $patterns A pattern (string or regexp) or an array of patterns
*
* @return $this
*
* @see FilecontentFilterIterator
*/
- public function contains($pattern)
+ public function contains($patterns)
{
- $this->contains[] = $pattern;
+ $this->contains = \array_merge($this->contains, (array) $patterns);
return $this;
}
@@ -213,16 +222,17 @@ class Finder implements \IteratorAggregate, \Countable
*
* $finder->notContains('Lorem ipsum')
* $finder->notContains('/Lorem ipsum/i')
+ * $finder->notContains(['lorem', '/dolor/i'])
*
- * @param string $pattern A pattern (string or regexp)
+ * @param string|string[] $patterns A pattern (string or regexp) or an array of patterns
*
* @return $this
*
* @see FilecontentFilterIterator
*/
- public function notContains($pattern)
+ public function notContains($patterns)
{
- $this->notContains[] = $pattern;
+ $this->notContains = \array_merge($this->notContains, (array) $patterns);
return $this;
}
@@ -234,18 +244,19 @@ class Finder implements \IteratorAggregate, \Countable
*
* $finder->path('some/special/dir')
* $finder->path('/some\/special\/dir/') // same as above
+ * $finder->path(['some dir', 'another/dir'])
*
* Use only / as dirname separator.
*
- * @param string $pattern A pattern (a regexp or a string)
+ * @param string|string[] $patterns A pattern (a regexp or a string) or an array of patterns
*
* @return $this
*
* @see FilenameFilterIterator
*/
- public function path($pattern)
+ public function path($patterns)
{
- $this->paths[] = $pattern;
+ $this->paths = \array_merge($this->paths, (array) $patterns);
return $this;
}
@@ -257,18 +268,19 @@ class Finder implements \IteratorAggregate, \Countable
*
* $finder->notPath('some/special/dir')
* $finder->notPath('/some\/special\/dir/') // same as above
+ * $finder->notPath(['some/file.txt', 'another/file.log'])
*
* Use only / as dirname separator.
*
- * @param string $pattern A pattern (a regexp or a string)
+ * @param string|string[] $patterns A pattern (a regexp or a string) or an array of patterns
*
* @return $this
*
* @see FilenameFilterIterator
*/
- public function notPath($pattern)
+ public function notPath($patterns)
{
- $this->notPaths[] = $pattern;
+ $this->notPaths = \array_merge($this->notPaths, (array) $patterns);
return $this;
}
@@ -279,17 +291,20 @@ class Finder implements \IteratorAggregate, \Countable
* $finder->size('> 10K');
* $finder->size('<= 1Ki');
* $finder->size(4);
+ * $finder->size(['> 10K', '< 20K'])
*
- * @param string|int $size A size range string or an integer
+ * @param string|int|string[]|int[] $sizes A size range string or an integer or an array of size ranges
*
* @return $this
*
* @see SizeRangeFilterIterator
* @see NumberComparator
*/
- public function size($size)
+ public function size($sizes)
{
- $this->sizes[] = new Comparator\NumberComparator($size);
+ foreach ((array) $sizes as $size) {
+ $this->sizes[] = new Comparator\NumberComparator($size);
+ }
return $this;
}
@@ -397,13 +412,20 @@ class Finder implements \IteratorAggregate, \Countable
*
* This can be slow as all the matching files and directories must be retrieved for comparison.
*
+ * @param bool $useNaturalSort Whether to use natural sort or not, disabled by default
+ *
* @return $this
*
* @see SortableIterator
*/
- public function sortByName()
+ public function sortByName(/* bool $useNaturalSort = false */)
{
- $this->sort = Iterator\SortableIterator::SORT_BY_NAME;
+ if (\func_num_args() < 1 && __CLASS__ !== \get_class($this) && __CLASS__ !== (new \ReflectionMethod($this, __FUNCTION__))->getDeclaringClass()->getName() && !$this instanceof \PHPUnit\Framework\MockObject\MockObject && !$this instanceof \Prophecy\Prophecy\ProphecySubjectInterface) {
+ @trigger_error(sprintf('The "%s()" method will have a new "bool $useNaturalSort = false" argument in version 5.0, not defining it is deprecated since Symfony 4.2.', __METHOD__), E_USER_DEPRECATED);
+ }
+ $useNaturalSort = 0 < \func_num_args() && func_get_arg(0);
+
+ $this->sort = $useNaturalSort ? Iterator\SortableIterator::SORT_BY_NAME_NATURAL : Iterator\SortableIterator::SORT_BY_NAME;
return $this;
}
@@ -442,6 +464,18 @@ class Finder implements \IteratorAggregate, \Countable
return $this;
}
+ /**
+ * Reverses the sorting.
+ *
+ * @return $this
+ */
+ public function reverseSorting()
+ {
+ $this->reverseSorting = true;
+
+ return $this;
+ }
+
/**
* Sorts files and directories by the last inode changed time.
*
@@ -716,8 +750,8 @@ class Finder implements \IteratorAggregate, \Countable
$iterator = new Iterator\PathFilterIterator($iterator, $this->paths, $this->notPaths);
}
- if ($this->sort) {
- $iteratorAggregate = new Iterator\SortableIterator($iterator, $this->sort);
+ if ($this->sort || $this->reverseSorting) {
+ $iteratorAggregate = new Iterator\SortableIterator($iterator, $this->sort, $this->reverseSorting);
$iterator = $iteratorAggregate->getIterator();
}
diff --git a/vendor/symfony/finder/Iterator/SortableIterator.php b/vendor/symfony/finder/Iterator/SortableIterator.php
index 53f8e31c..41a8bd15 100644
--- a/vendor/symfony/finder/Iterator/SortableIterator.php
+++ b/vendor/symfony/finder/Iterator/SortableIterator.php
@@ -18,11 +18,13 @@ namespace Symfony\Component\Finder\Iterator;
*/
class SortableIterator implements \IteratorAggregate
{
+ const SORT_BY_NONE = 0;
const SORT_BY_NAME = 1;
const SORT_BY_TYPE = 2;
const SORT_BY_ACCESSED_TIME = 3;
const SORT_BY_CHANGED_TIME = 4;
const SORT_BY_MODIFIED_TIME = 5;
+ const SORT_BY_NAME_NATURAL = 6;
private $iterator;
private $sort;
@@ -33,38 +35,45 @@ class SortableIterator implements \IteratorAggregate
*
* @throws \InvalidArgumentException
*/
- public function __construct(\Traversable $iterator, $sort)
+ public function __construct(\Traversable $iterator, $sort, bool $reverseOrder = false)
{
$this->iterator = $iterator;
+ $order = $reverseOrder ? -1 : 1;
if (self::SORT_BY_NAME === $sort) {
- $this->sort = function ($a, $b) {
- return strcmp($a->getRealpath() ?: $a->getPathname(), $b->getRealpath() ?: $b->getPathname());
+ $this->sort = function ($a, $b) use ($order) {
+ return $order * strcmp($a->getRealpath() ?: $a->getPathname(), $b->getRealpath() ?: $b->getPathname());
+ };
+ } elseif (self::SORT_BY_NAME_NATURAL === $sort) {
+ $this->sort = function ($a, $b) use ($order) {
+ return $order * strnatcmp($a->getRealPath() ?: $a->getPathname(), $b->getRealPath() ?: $b->getPathname());
};
} elseif (self::SORT_BY_TYPE === $sort) {
- $this->sort = function ($a, $b) {
+ $this->sort = function ($a, $b) use ($order) {
if ($a->isDir() && $b->isFile()) {
- return -1;
+ return -$order;
} elseif ($a->isFile() && $b->isDir()) {
- return 1;
+ return $order;
}
- return strcmp($a->getRealpath() ?: $a->getPathname(), $b->getRealpath() ?: $b->getPathname());
+ return $order * strcmp($a->getRealpath() ?: $a->getPathname(), $b->getRealpath() ?: $b->getPathname());
};
} elseif (self::SORT_BY_ACCESSED_TIME === $sort) {
- $this->sort = function ($a, $b) {
- return $a->getATime() - $b->getATime();
+ $this->sort = function ($a, $b) use ($order) {
+ return $order * ($a->getATime() - $b->getATime());
};
} elseif (self::SORT_BY_CHANGED_TIME === $sort) {
- $this->sort = function ($a, $b) {
- return $a->getCTime() - $b->getCTime();
+ $this->sort = function ($a, $b) use ($order) {
+ return $order * ($a->getCTime() - $b->getCTime());
};
} elseif (self::SORT_BY_MODIFIED_TIME === $sort) {
- $this->sort = function ($a, $b) {
- return $a->getMTime() - $b->getMTime();
+ $this->sort = function ($a, $b) use ($order) {
+ return $order * ($a->getMTime() - $b->getMTime());
};
+ } elseif (self::SORT_BY_NONE === $sort) {
+ $this->sort = $order;
} elseif (\is_callable($sort)) {
- $this->sort = $sort;
+ $this->sort = $reverseOrder ? function ($a, $b) use ($sort) { return -\call_user_func($sort, $a, $b); } : $sort;
} else {
throw new \InvalidArgumentException('The SortableIterator takes a PHP callable or a valid built-in sort algorithm as an argument.');
}
@@ -72,8 +81,17 @@ class SortableIterator implements \IteratorAggregate
public function getIterator()
{
+ if (1 === $this->sort) {
+ return $this->iterator;
+ }
+
$array = iterator_to_array($this->iterator, true);
- uasort($array, $this->sort);
+
+ if (-1 === $this->sort) {
+ $array = array_reverse($array);
+ } else {
+ uasort($array, $this->sort);
+ }
return new \ArrayIterator($array);
}
diff --git a/vendor/symfony/finder/Tests/FinderTest.php b/vendor/symfony/finder/Tests/FinderTest.php
index fbdcc36e..74c11cea 100644
--- a/vendor/symfony/finder/Tests/FinderTest.php
+++ b/vendor/symfony/finder/Tests/FinderTest.php
@@ -24,33 +24,70 @@ class FinderTest extends Iterator\RealIteratorTestCase
{
$finder = $this->buildFinder();
$this->assertSame($finder, $finder->directories());
- $this->assertIterator($this->toAbsolute(array('foo', 'toto')), $finder->in(self::$tmpDir)->getIterator());
+ $this->assertIterator($this->toAbsolute(array('foo', 'qux', 'toto')), $finder->in(self::$tmpDir)->getIterator());
$finder = $this->buildFinder();
$finder->directories();
$finder->files();
$finder->directories();
- $this->assertIterator($this->toAbsolute(array('foo', 'toto')), $finder->in(self::$tmpDir)->getIterator());
+ $this->assertIterator($this->toAbsolute(array('foo', 'qux', 'toto')), $finder->in(self::$tmpDir)->getIterator());
}
public function testFiles()
{
$finder = $this->buildFinder();
$this->assertSame($finder, $finder->files());
- $this->assertIterator($this->toAbsolute(array('foo/bar.tmp', 'test.php', 'test.py', 'foo bar')), $finder->in(self::$tmpDir)->getIterator());
+ $this->assertIterator($this->toAbsolute(array('foo/bar.tmp',
+ 'test.php',
+ 'test.py',
+ 'foo bar',
+ 'qux/baz_100_1.py',
+ 'qux/baz_1_2.py',
+ 'qux_0_1.php',
+ 'qux_1000_1.php',
+ 'qux_1002_0.php',
+ 'qux_10_2.php',
+ 'qux_12_0.php',
+ 'qux_2_0.php',
+ )), $finder->in(self::$tmpDir)->getIterator());
$finder = $this->buildFinder();
$finder->files();
$finder->directories();
$finder->files();
- $this->assertIterator($this->toAbsolute(array('foo/bar.tmp', 'test.php', 'test.py', 'foo bar')), $finder->in(self::$tmpDir)->getIterator());
+ $this->assertIterator($this->toAbsolute(array('foo/bar.tmp',
+ 'test.php',
+ 'test.py',
+ 'foo bar',
+ 'qux/baz_100_1.py',
+ 'qux/baz_1_2.py',
+ 'qux_0_1.php',
+ 'qux_1000_1.php',
+ 'qux_1002_0.php',
+ 'qux_10_2.php',
+ 'qux_12_0.php',
+ 'qux_2_0.php',
+ )), $finder->in(self::$tmpDir)->getIterator());
}
public function testRemoveTrailingSlash()
{
$finder = $this->buildFinder();
- $expected = $this->toAbsolute(array('foo/bar.tmp', 'test.php', 'test.py', 'foo bar'));
+ $expected = $this->toAbsolute(array(
+ 'foo/bar.tmp',
+ 'test.php',
+ 'test.py',
+ 'foo bar',
+ 'qux/baz_100_1.py',
+ 'qux/baz_1_2.py',
+ 'qux_0_1.php',
+ 'qux_1000_1.php',
+ 'qux_1002_0.php',
+ 'qux_10_2.php',
+ 'qux_12_0.php',
+ 'qux_2_0.php',
+ ));
$in = self::$tmpDir.'//';
$this->assertIterator($expected, $finder->in($in)->files()->getIterator());
@@ -89,26 +126,73 @@ class FinderTest extends Iterator\RealIteratorTestCase
{
$finder = $this->buildFinder();
$this->assertSame($finder, $finder->depth('< 1'));
- $this->assertIterator($this->toAbsolute(array('foo', 'test.php', 'test.py', 'toto', 'foo bar')), $finder->in(self::$tmpDir)->getIterator());
+ $this->assertIterator($this->toAbsolute(array('foo',
+ 'test.php',
+ 'test.py',
+ 'toto',
+ 'foo bar',
+ 'qux',
+ 'qux_0_1.php',
+ 'qux_1000_1.php',
+ 'qux_1002_0.php',
+ 'qux_10_2.php',
+ 'qux_12_0.php',
+ 'qux_2_0.php',
+ )), $finder->in(self::$tmpDir)->getIterator());
$finder = $this->buildFinder();
$this->assertSame($finder, $finder->depth('<= 0'));
- $this->assertIterator($this->toAbsolute(array('foo', 'test.php', 'test.py', 'toto', 'foo bar')), $finder->in(self::$tmpDir)->getIterator());
+ $this->assertIterator($this->toAbsolute(array('foo',
+ 'test.php',
+ 'test.py',
+ 'toto',
+ 'foo bar',
+ 'qux',
+ 'qux_0_1.php',
+ 'qux_1000_1.php',
+ 'qux_1002_0.php',
+ 'qux_10_2.php',
+ 'qux_12_0.php',
+ 'qux_2_0.php',
+ )), $finder->in(self::$tmpDir)->getIterator());
$finder = $this->buildFinder();
$this->assertSame($finder, $finder->depth('>= 1'));
- $this->assertIterator($this->toAbsolute(array('foo/bar.tmp')), $finder->in(self::$tmpDir)->getIterator());
+ $this->assertIterator($this->toAbsolute(array(
+ 'foo/bar.tmp',
+ 'qux/baz_100_1.py',
+ 'qux/baz_1_2.py',
+ )), $finder->in(self::$tmpDir)->getIterator());
$finder = $this->buildFinder();
$finder->depth('< 1')->depth('>= 1');
$this->assertIterator(array(), $finder->in(self::$tmpDir)->getIterator());
}
+ public function testDepthWithArrayParam()
+ {
+ $finder = $this->buildFinder();
+ $finder->depth(array('>= 1', '< 2'));
+ $this->assertIterator($this->toAbsolute(array(
+ 'foo/bar.tmp',
+ 'qux/baz_100_1.py',
+ 'qux/baz_1_2.py',
+ )), $finder->in(self::$tmpDir)->getIterator());
+ }
+
public function testName()
{
$finder = $this->buildFinder();
$this->assertSame($finder, $finder->name('*.php'));
- $this->assertIterator($this->toAbsolute(array('test.php')), $finder->in(self::$tmpDir)->getIterator());
+ $this->assertIterator($this->toAbsolute(array(
+ 'test.php',
+ 'qux_0_1.php',
+ 'qux_1000_1.php',
+ 'qux_1002_0.php',
+ 'qux_10_2.php',
+ 'qux_12_0.php',
+ 'qux_2_0.php',
+ )), $finder->in(self::$tmpDir)->getIterator());
$finder = $this->buildFinder();
$finder->name('test.ph*');
@@ -121,23 +205,53 @@ class FinderTest extends Iterator\RealIteratorTestCase
$finder = $this->buildFinder();
$finder->name('~\\.php$~i');
- $this->assertIterator($this->toAbsolute(array('test.php')), $finder->in(self::$tmpDir)->getIterator());
+ $this->assertIterator($this->toAbsolute(array(
+ 'test.php',
+ 'qux_0_1.php',
+ 'qux_1000_1.php',
+ 'qux_1002_0.php',
+ 'qux_10_2.php',
+ 'qux_12_0.php',
+ 'qux_2_0.php',
+ )), $finder->in(self::$tmpDir)->getIterator());
$finder = $this->buildFinder();
$finder->name('test.p{hp,y}');
$this->assertIterator($this->toAbsolute(array('test.php', 'test.py')), $finder->in(self::$tmpDir)->getIterator());
}
+ public function testNameWithArrayParam()
+ {
+ $finder = $this->buildFinder();
+ $finder->name(array('test.php', 'test.py'));
+ $this->assertIterator($this->toAbsolute(array('test.php', 'test.py')), $finder->in(self::$tmpDir)->getIterator());
+ }
+
public function testNotName()
{
$finder = $this->buildFinder();
$this->assertSame($finder, $finder->notName('*.php'));
- $this->assertIterator($this->toAbsolute(array('foo', 'foo/bar.tmp', 'test.py', 'toto', 'foo bar')), $finder->in(self::$tmpDir)->getIterator());
+ $this->assertIterator($this->toAbsolute(array(
+ 'foo',
+ 'foo/bar.tmp',
+ 'test.py',
+ 'toto',
+ 'foo bar',
+ 'qux',
+ 'qux/baz_100_1.py',
+ 'qux/baz_1_2.py',
+ )), $finder->in(self::$tmpDir)->getIterator());
$finder = $this->buildFinder();
$finder->notName('*.php');
$finder->notName('*.py');
- $this->assertIterator($this->toAbsolute(array('foo', 'foo/bar.tmp', 'toto', 'foo bar')), $finder->in(self::$tmpDir)->getIterator());
+ $this->assertIterator($this->toAbsolute(array(
+ 'foo',
+ 'foo/bar.tmp',
+ 'toto',
+ 'foo bar',
+ 'qux',
+ )), $finder->in(self::$tmpDir)->getIterator());
$finder = $this->buildFinder();
$finder->name('test.ph*');
@@ -153,6 +267,19 @@ class FinderTest extends Iterator\RealIteratorTestCase
$this->assertIterator(array(), $finder->in(self::$tmpDir)->getIterator());
}
+ public function testNotNameWithArrayParam()
+ {
+ $finder = $this->buildFinder();
+ $finder->notName(array('*.php', '*.py'));
+ $this->assertIterator($this->toAbsolute(array(
+ 'foo',
+ 'foo/bar.tmp',
+ 'toto',
+ 'foo bar',
+ 'qux',
+ )), $finder->in(self::$tmpDir)->getIterator());
+ }
+
/**
* @dataProvider getRegexNameTestData
*/
@@ -160,7 +287,10 @@ class FinderTest extends Iterator\RealIteratorTestCase
{
$finder = $this->buildFinder();
$finder->name($regex);
- $this->assertIterator($this->toAbsolute(array('test.py', 'test.php')), $finder->in(self::$tmpDir)->getIterator());
+ $this->assertIterator($this->toAbsolute(array(
+ 'test.py',
+ 'test.php',
+ )), $finder->in(self::$tmpDir)->getIterator());
}
public function testSize()
@@ -170,6 +300,13 @@ class FinderTest extends Iterator\RealIteratorTestCase
$this->assertIterator($this->toAbsolute(array('test.php')), $finder->in(self::$tmpDir)->getIterator());
}
+ public function testSizeWithArrayParam()
+ {
+ $finder = $this->buildFinder();
+ $this->assertSame($finder, $finder->files()->size(array('< 1K', '> 500')));
+ $this->assertIterator($this->toAbsolute(array('test.php')), $finder->in(self::$tmpDir)->getIterator());
+ }
+
public function testDate()
{
$finder = $this->buildFinder();
@@ -177,83 +314,391 @@ class FinderTest extends Iterator\RealIteratorTestCase
$this->assertIterator($this->toAbsolute(array('foo/bar.tmp', 'test.php')), $finder->in(self::$tmpDir)->getIterator());
}
+ public function testDateWithArrayParam()
+ {
+ $finder = $this->buildFinder();
+ $this->assertSame($finder, $finder->files()->date(array('>= 2005-10-15', 'until last month')));
+ $this->assertIterator($this->toAbsolute(array('foo/bar.tmp', 'test.php')), $finder->in(self::$tmpDir)->getIterator());
+ }
+
public function testExclude()
{
$finder = $this->buildFinder();
$this->assertSame($finder, $finder->exclude('foo'));
- $this->assertIterator($this->toAbsolute(array('test.php', 'test.py', 'toto', 'foo bar')), $finder->in(self::$tmpDir)->getIterator());
+ $this->assertIterator($this->toAbsolute(array(
+ 'test.php',
+ 'test.py',
+ 'toto',
+ 'foo bar',
+ 'qux',
+ 'qux/baz_100_1.py',
+ 'qux/baz_1_2.py',
+ 'qux_0_1.php',
+ 'qux_1000_1.php',
+ 'qux_1002_0.php',
+ 'qux_10_2.php',
+ 'qux_12_0.php',
+ 'qux_2_0.php',
+ )), $finder->in(self::$tmpDir)->getIterator());
}
public function testIgnoreVCS()
{
$finder = $this->buildFinder();
$this->assertSame($finder, $finder->ignoreVCS(false)->ignoreDotFiles(false));
- $this->assertIterator($this->toAbsolute(array('.git', 'foo', 'foo/bar.tmp', 'test.php', 'test.py', 'toto', 'toto/.git', '.bar', '.foo', '.foo/.bar', '.foo/bar', 'foo bar')), $finder->in(self::$tmpDir)->getIterator());
+ $this->assertIterator($this->toAbsolute(array(
+ '.git',
+ 'foo',
+ 'foo/bar.tmp',
+ 'test.php',
+ 'test.py',
+ 'toto',
+ 'toto/.git',
+ '.bar',
+ '.foo',
+ '.foo/.bar',
+ '.foo/bar',
+ 'foo bar',
+ 'qux',
+ 'qux/baz_100_1.py',
+ 'qux/baz_1_2.py',
+ 'qux_0_1.php',
+ 'qux_1000_1.php',
+ 'qux_1002_0.php',
+ 'qux_10_2.php',
+ 'qux_12_0.php',
+ 'qux_2_0.php',
+ )), $finder->in(self::$tmpDir)->getIterator());
$finder = $this->buildFinder();
$finder->ignoreVCS(false)->ignoreVCS(false)->ignoreDotFiles(false);
- $this->assertIterator($this->toAbsolute(array('.git', 'foo', 'foo/bar.tmp', 'test.php', 'test.py', 'toto', 'toto/.git', '.bar', '.foo', '.foo/.bar', '.foo/bar', 'foo bar')), $finder->in(self::$tmpDir)->getIterator());
+ $this->assertIterator($this->toAbsolute(array(
+ '.git',
+ 'foo',
+ 'foo/bar.tmp',
+ 'test.php',
+ 'test.py',
+ 'toto',
+ 'toto/.git',
+ '.bar',
+ '.foo',
+ '.foo/.bar',
+ '.foo/bar',
+ 'foo bar',
+ 'qux',
+ 'qux/baz_100_1.py',
+ 'qux/baz_1_2.py',
+ 'qux_0_1.php',
+ 'qux_1000_1.php',
+ 'qux_1002_0.php',
+ 'qux_10_2.php',
+ 'qux_12_0.php',
+ 'qux_2_0.php',
+ )), $finder->in(self::$tmpDir)->getIterator());
$finder = $this->buildFinder();
$this->assertSame($finder, $finder->ignoreVCS(true)->ignoreDotFiles(false));
- $this->assertIterator($this->toAbsolute(array('foo', 'foo/bar.tmp', 'test.php', 'test.py', 'toto', '.bar', '.foo', '.foo/.bar', '.foo/bar', 'foo bar')), $finder->in(self::$tmpDir)->getIterator());
+ $this->assertIterator($this->toAbsolute(array(
+ 'foo',
+ 'foo/bar.tmp',
+ 'test.php',
+ 'test.py',
+ 'toto',
+ '.bar',
+ '.foo',
+ '.foo/.bar',
+ '.foo/bar',
+ 'foo bar',
+ 'qux',
+ 'qux/baz_100_1.py',
+ 'qux/baz_1_2.py',
+ 'qux_0_1.php',
+ 'qux_1000_1.php',
+ 'qux_1002_0.php',
+ 'qux_10_2.php',
+ 'qux_12_0.php',
+ 'qux_2_0.php',
+ )), $finder->in(self::$tmpDir)->getIterator());
}
public function testIgnoreDotFiles()
{
$finder = $this->buildFinder();
$this->assertSame($finder, $finder->ignoreDotFiles(false)->ignoreVCS(false));
- $this->assertIterator($this->toAbsolute(array('.git', '.bar', '.foo', '.foo/.bar', '.foo/bar', 'foo', 'foo/bar.tmp', 'test.php', 'test.py', 'toto', 'toto/.git', 'foo bar')), $finder->in(self::$tmpDir)->getIterator());
+ $this->assertIterator($this->toAbsolute(array(
+ '.git',
+ '.bar',
+ '.foo',
+ '.foo/.bar',
+ '.foo/bar',
+ 'foo',
+ 'foo/bar.tmp',
+ 'test.php',
+ 'test.py',
+ 'toto',
+ 'toto/.git',
+ 'foo bar',
+ 'qux',
+ 'qux/baz_100_1.py',
+ 'qux/baz_1_2.py',
+ 'qux_0_1.php',
+ 'qux_1000_1.php',
+ 'qux_1002_0.php',
+ 'qux_10_2.php',
+ 'qux_12_0.php',
+ 'qux_2_0.php',
+ )), $finder->in(self::$tmpDir)->getIterator());
$finder = $this->buildFinder();
$finder->ignoreDotFiles(false)->ignoreDotFiles(false)->ignoreVCS(false);
- $this->assertIterator($this->toAbsolute(array('.git', '.bar', '.foo', '.foo/.bar', '.foo/bar', 'foo', 'foo/bar.tmp', 'test.php', 'test.py', 'toto', 'toto/.git', 'foo bar')), $finder->in(self::$tmpDir)->getIterator());
+ $this->assertIterator($this->toAbsolute(array(
+ '.git',
+ '.bar',
+ '.foo',
+ '.foo/.bar',
+ '.foo/bar',
+ 'foo',
+ 'foo/bar.tmp',
+ 'test.php',
+ 'test.py',
+ 'toto',
+ 'toto/.git',
+ 'foo bar',
+ 'qux',
+ 'qux/baz_100_1.py',
+ 'qux/baz_1_2.py',
+ 'qux_0_1.php',
+ 'qux_1000_1.php',
+ 'qux_1002_0.php',
+ 'qux_10_2.php',
+ 'qux_12_0.php',
+ 'qux_2_0.php',
+ )), $finder->in(self::$tmpDir)->getIterator());
$finder = $this->buildFinder();
$this->assertSame($finder, $finder->ignoreDotFiles(true)->ignoreVCS(false));
- $this->assertIterator($this->toAbsolute(array('foo', 'foo/bar.tmp', 'test.php', 'test.py', 'toto', 'foo bar')), $finder->in(self::$tmpDir)->getIterator());
+ $this->assertIterator($this->toAbsolute(array(
+ 'foo',
+ 'foo/bar.tmp',
+ 'test.php',
+ 'test.py',
+ 'toto',
+ 'foo bar',
+ 'qux',
+ 'qux/baz_100_1.py',
+ 'qux/baz_1_2.py',
+ 'qux_0_1.php',
+ 'qux_1000_1.php',
+ 'qux_1002_0.php',
+ 'qux_10_2.php',
+ 'qux_12_0.php',
+ 'qux_2_0.php',
+ )), $finder->in(self::$tmpDir)->getIterator());
}
public function testSortByName()
{
$finder = $this->buildFinder();
$this->assertSame($finder, $finder->sortByName());
- $this->assertIterator($this->toAbsolute(array('foo', 'foo bar', 'foo/bar.tmp', 'test.php', 'test.py', 'toto')), $finder->in(self::$tmpDir)->getIterator());
+ $this->assertIterator($this->toAbsolute(array(
+ 'foo',
+ 'foo bar',
+ 'foo/bar.tmp',
+ 'qux',
+ 'qux/baz_100_1.py',
+ 'qux/baz_1_2.py',
+ 'qux_0_1.php',
+ 'qux_1000_1.php',
+ 'qux_1002_0.php',
+ 'qux_10_2.php',
+ 'qux_12_0.php',
+ 'qux_2_0.php',
+ 'test.php',
+ 'test.py',
+ 'toto',
+ )), $finder->in(self::$tmpDir)->getIterator());
}
public function testSortByType()
{
$finder = $this->buildFinder();
$this->assertSame($finder, $finder->sortByType());
- $this->assertIterator($this->toAbsolute(array('foo', 'foo bar', 'toto', 'foo/bar.tmp', 'test.php', 'test.py')), $finder->in(self::$tmpDir)->getIterator());
+ $this->assertIterator($this->toAbsolute(array(
+ 'foo',
+ 'foo bar',
+ 'toto',
+ 'foo/bar.tmp',
+ 'test.php',
+ 'test.py',
+ 'qux',
+ 'qux/baz_100_1.py',
+ 'qux/baz_1_2.py',
+ 'qux_0_1.php',
+ 'qux_1000_1.php',
+ 'qux_1002_0.php',
+ 'qux_10_2.php',
+ 'qux_12_0.php',
+ 'qux_2_0.php',
+ )), $finder->in(self::$tmpDir)->getIterator());
}
public function testSortByAccessedTime()
{
$finder = $this->buildFinder();
$this->assertSame($finder, $finder->sortByAccessedTime());
- $this->assertIterator($this->toAbsolute(array('foo/bar.tmp', 'test.php', 'toto', 'test.py', 'foo', 'foo bar')), $finder->in(self::$tmpDir)->getIterator());
+ $this->assertIterator($this->toAbsolute(array(
+ 'foo/bar.tmp',
+ 'test.php',
+ 'toto',
+ 'test.py',
+ 'foo',
+ 'foo bar',
+ 'qux',
+ 'qux/baz_100_1.py',
+ 'qux/baz_1_2.py',
+ 'qux_0_1.php',
+ 'qux_1000_1.php',
+ 'qux_1002_0.php',
+ 'qux_10_2.php',
+ 'qux_12_0.php',
+ 'qux_2_0.php',
+ )), $finder->in(self::$tmpDir)->getIterator());
}
public function testSortByChangedTime()
{
$finder = $this->buildFinder();
$this->assertSame($finder, $finder->sortByChangedTime());
- $this->assertIterator($this->toAbsolute(array('toto', 'test.py', 'test.php', 'foo/bar.tmp', 'foo', 'foo bar')), $finder->in(self::$tmpDir)->getIterator());
+ $this->assertIterator($this->toAbsolute(array(
+ 'toto',
+ 'test.py',
+ 'test.php',
+ 'foo/bar.tmp',
+ 'foo',
+ 'foo bar',
+ 'qux',
+ 'qux/baz_100_1.py',
+ 'qux/baz_1_2.py',
+ 'qux_0_1.php',
+ 'qux_1000_1.php',
+ 'qux_1002_0.php',
+ 'qux_10_2.php',
+ 'qux_12_0.php',
+ 'qux_2_0.php',
+ )), $finder->in(self::$tmpDir)->getIterator());
}
public function testSortByModifiedTime()
{
$finder = $this->buildFinder();
$this->assertSame($finder, $finder->sortByModifiedTime());
- $this->assertIterator($this->toAbsolute(array('foo/bar.tmp', 'test.php', 'toto', 'test.py', 'foo', 'foo bar')), $finder->in(self::$tmpDir)->getIterator());
+ $this->assertIterator($this->toAbsolute(array(
+ 'foo/bar.tmp',
+ 'test.php',
+ 'toto',
+ 'test.py',
+ 'foo',
+ 'foo bar',
+ 'qux',
+ 'qux/baz_100_1.py',
+ 'qux/baz_1_2.py',
+ 'qux_0_1.php',
+ 'qux_1000_1.php',
+ 'qux_1002_0.php',
+ 'qux_10_2.php',
+ 'qux_12_0.php',
+ 'qux_2_0.php',
+ )), $finder->in(self::$tmpDir)->getIterator());
+ }
+
+ public function testReverseSorting()
+ {
+ $finder = $this->buildFinder();
+ $this->assertSame($finder, $finder->sortByName());
+ $this->assertSame($finder, $finder->reverseSorting());
+ $this->assertOrderedIteratorInForeach($this->toAbsolute(array(
+ 'toto',
+ 'test.py',
+ 'test.php',
+ 'qux_2_0.php',
+ 'qux_12_0.php',
+ 'qux_10_2.php',
+ 'qux_1002_0.php',
+ 'qux_1000_1.php',
+ 'qux_0_1.php',
+ 'qux/baz_1_2.py',
+ 'qux/baz_100_1.py',
+ 'qux',
+ 'foo/bar.tmp',
+ 'foo bar',
+ 'foo',
+ )), $finder->in(self::$tmpDir)->getIterator());
+ }
+
+ public function testSortByNameNatural()
+ {
+ $finder = $this->buildFinder();
+ $this->assertSame($finder, $finder->sortByName(true));
+ $this->assertIterator($this->toAbsolute(array(
+ 'foo',
+ 'foo bar',
+ 'foo/bar.tmp',
+ 'qux',
+ 'qux/baz_100_1.py',
+ 'qux/baz_1_2.py',
+ 'qux_0_1.php',
+ 'qux_1000_1.php',
+ 'qux_1002_0.php',
+ 'qux_10_2.php',
+ 'qux_12_0.php',
+ 'qux_2_0.php',
+ 'test.php',
+ 'test.py',
+ 'toto',
+ )), $finder->in(self::$tmpDir)->getIterator());
+
+ $finder = $this->buildFinder();
+ $this->assertSame($finder, $finder->sortByName(false));
+ $this->assertIterator($this->toAbsolute(array(
+ 'foo',
+ 'foo bar',
+ 'foo/bar.tmp',
+ 'qux',
+ 'qux/baz_100_1.py',
+ 'qux/baz_1_2.py',
+ 'qux_0_1.php',
+ 'qux_1000_1.php',
+ 'qux_1002_0.php',
+ 'qux_10_2.php',
+ 'qux_12_0.php',
+ 'qux_2_0.php',
+ 'test.php',
+ 'test.py',
+ 'toto',
+ )), $finder->in(self::$tmpDir)->getIterator());
}
public function testSort()
{
$finder = $this->buildFinder();
$this->assertSame($finder, $finder->sort(function (\SplFileInfo $a, \SplFileInfo $b) { return strcmp($a->getRealPath(), $b->getRealPath()); }));
- $this->assertIterator($this->toAbsolute(array('foo', 'foo bar', 'foo/bar.tmp', 'test.php', 'test.py', 'toto')), $finder->in(self::$tmpDir)->getIterator());
+ $this->assertIterator($this->toAbsolute(array(
+ 'foo',
+ 'foo bar',
+ 'foo/bar.tmp',
+ 'test.php',
+ 'test.py',
+ 'toto',
+ 'qux',
+ 'qux/baz_100_1.py',
+ 'qux/baz_1_2.py',
+ 'qux_0_1.php',
+ 'qux_1000_1.php',
+ 'qux_1002_0.php',
+ 'qux_10_2.php',
+ 'qux_12_0.php',
+ 'qux_2_0.php',
+ )), $finder->in(self::$tmpDir)->getIterator());
}
public function testFilter()
@@ -271,7 +716,23 @@ class FinderTest extends Iterator\RealIteratorTestCase
$finder = $this->buildFinder();
$this->assertSame($finder, $finder->followLinks());
- $this->assertIterator($this->toAbsolute(array('foo', 'foo/bar.tmp', 'test.php', 'test.py', 'toto', 'foo bar')), $finder->in(self::$tmpDir)->getIterator());
+ $this->assertIterator($this->toAbsolute(array(
+ 'foo',
+ 'foo/bar.tmp',
+ 'test.php',
+ 'test.py',
+ 'toto',
+ 'foo bar',
+ 'qux',
+ 'qux/baz_100_1.py',
+ 'qux/baz_1_2.py',
+ 'qux_0_1.php',
+ 'qux_1000_1.php',
+ 'qux_1002_0.php',
+ 'qux_10_2.php',
+ 'qux_12_0.php',
+ 'qux_2_0.php',
+ )), $finder->in(self::$tmpDir)->getIterator());
}
public function testIn()
@@ -283,6 +744,12 @@ class FinderTest extends Iterator\RealIteratorTestCase
self::$tmpDir.\DIRECTORY_SEPARATOR.'test.php',
__DIR__.\DIRECTORY_SEPARATOR.'FinderTest.php',
__DIR__.\DIRECTORY_SEPARATOR.'GlobTest.php',
+ self::$tmpDir.\DIRECTORY_SEPARATOR.'qux_0_1.php',
+ self::$tmpDir.\DIRECTORY_SEPARATOR.'qux_1000_1.php',
+ self::$tmpDir.\DIRECTORY_SEPARATOR.'qux_1002_0.php',
+ self::$tmpDir.\DIRECTORY_SEPARATOR.'qux_10_2.php',
+ self::$tmpDir.\DIRECTORY_SEPARATOR.'qux_12_0.php',
+ self::$tmpDir.\DIRECTORY_SEPARATOR.'qux_2_0.php',
);
$this->assertIterator($expected, $iterator);
@@ -339,7 +806,7 @@ class FinderTest extends Iterator\RealIteratorTestCase
$dirs[] = (string) $dir;
}
- $expected = $this->toAbsolute(array('foo', 'toto'));
+ $expected = $this->toAbsolute(array('foo', 'qux', 'toto'));
sort($dirs);
sort($expected);
@@ -347,7 +814,7 @@ class FinderTest extends Iterator\RealIteratorTestCase
$this->assertEquals($expected, $dirs, 'implements the \IteratorAggregate interface');
$finder = $this->buildFinder();
- $this->assertEquals(2, iterator_count($finder->directories()->in(self::$tmpDir)), 'implements the \IteratorAggregate interface');
+ $this->assertEquals(3, iterator_count($finder->directories()->in(self::$tmpDir)), 'implements the \IteratorAggregate interface');
$finder = $this->buildFinder();
$a = iterator_to_array($finder->directories()->in(self::$tmpDir));
@@ -366,7 +833,7 @@ class FinderTest extends Iterator\RealIteratorTestCase
$paths[] = $file->getRelativePath();
}
- $ref = array('', '', '', '', 'foo', '');
+ $ref = array('', '', '', '', '', '', '', '', '', '', '', 'foo', 'qux', 'qux', '');
sort($ref);
sort($paths);
@@ -384,7 +851,23 @@ class FinderTest extends Iterator\RealIteratorTestCase
$paths[] = $file->getRelativePathname();
}
- $ref = array('test.php', 'toto', 'test.py', 'foo', 'foo'.\DIRECTORY_SEPARATOR.'bar.tmp', 'foo bar');
+ $ref = array(
+ 'test.php',
+ 'toto',
+ 'test.py',
+ 'foo',
+ 'foo'.\DIRECTORY_SEPARATOR.'bar.tmp',
+ 'foo bar',
+ 'qux',
+ 'qux'.\DIRECTORY_SEPARATOR.'baz_100_1.py',
+ 'qux'.\DIRECTORY_SEPARATOR.'baz_1_2.py',
+ 'qux_0_1.php',
+ 'qux_1000_1.php',
+ 'qux_1002_0.php',
+ 'qux_10_2.php',
+ 'qux_12_0.php',
+ 'qux_2_0.php',
+ );
sort($paths);
sort($ref);
@@ -402,7 +885,7 @@ class FinderTest extends Iterator\RealIteratorTestCase
$finder = $finder->append($finder1);
- $this->assertIterator($this->toAbsolute(array('foo', 'foo/bar.tmp', 'toto')), $finder->getIterator());
+ $this->assertIterator($this->toAbsolute(array('foo', 'foo/bar.tmp', 'qux', 'toto')), $finder->getIterator());
}
public function testAppendWithAnArray()
@@ -595,13 +1078,15 @@ class FinderTest extends Iterator\RealIteratorTestCase
array('lorem', 'foobar', array('lorem.txt')),
array('', 'lorem', array('dolor.txt', 'ipsum.txt')),
array('ipsum dolor sit amet', '/^IPSUM/m', array('lorem.txt')),
+ array(array('lorem', 'dolor'), array(), array('lorem.txt', 'ipsum.txt', 'dolor.txt')),
+ array('', array('lorem', 'ipsum'), array('dolor.txt')),
);
}
public function getRegexNameTestData()
{
return array(
- array('~.+\\.p.+~i'),
+ array('~.*t\\.p.+~i'),
array('~t.*s~i'),
);
}
@@ -661,6 +1146,33 @@ class FinderTest extends Iterator\RealIteratorTestCase
'with space'.\DIRECTORY_SEPARATOR.'foo.txt',
),
),
+ array(
+ '/^A/',
+ array('a.dat', 'abc.dat'),
+ array(
+ 'A',
+ 'A'.\DIRECTORY_SEPARATOR.'B',
+ 'A'.\DIRECTORY_SEPARATOR.'B'.\DIRECTORY_SEPARATOR.'C',
+ 'A'.\DIRECTORY_SEPARATOR.'B'.\DIRECTORY_SEPARATOR.'ab.dat',
+ ),
+ ),
+ array(
+ array('/^A/', 'one'),
+ 'foobar',
+ array(
+ 'A',
+ 'A'.\DIRECTORY_SEPARATOR.'B',
+ 'A'.\DIRECTORY_SEPARATOR.'B'.\DIRECTORY_SEPARATOR.'C',
+ 'A'.\DIRECTORY_SEPARATOR.'a.dat',
+ 'A'.\DIRECTORY_SEPARATOR.'B'.\DIRECTORY_SEPARATOR.'ab.dat',
+ 'A'.\DIRECTORY_SEPARATOR.'B'.\DIRECTORY_SEPARATOR.'C'.\DIRECTORY_SEPARATOR.'abc.dat',
+ 'one',
+ 'one'.\DIRECTORY_SEPARATOR.'a',
+ 'one'.\DIRECTORY_SEPARATOR.'b',
+ 'one'.\DIRECTORY_SEPARATOR.'b'.\DIRECTORY_SEPARATOR.'c.neon',
+ 'one'.\DIRECTORY_SEPARATOR.'b'.\DIRECTORY_SEPARATOR.'d.neon',
+ ),
+ ),
);
}
@@ -718,7 +1230,20 @@ class FinderTest extends Iterator\RealIteratorTestCase
chmod($testDir, 0333);
if (false === ($couldRead = is_readable($testDir))) {
- $this->assertIterator($this->toAbsolute(array('foo bar', 'test.php', 'test.py')), $finder->getIterator());
+ $this->assertIterator($this->toAbsolute(array(
+ 'foo bar',
+ 'test.php',
+ 'test.py',
+ 'qux/baz_100_1.py',
+ 'qux/baz_1_2.py',
+ 'qux_0_1.php',
+ 'qux_1000_1.php',
+ 'qux_1002_0.php',
+ 'qux_10_2.php',
+ 'qux_12_0.php',
+ 'qux_2_0.php',
+ )
+ ), $finder->getIterator());
}
// restore original permissions
@@ -730,8 +1255,26 @@ class FinderTest extends Iterator\RealIteratorTestCase
}
}
+ /**
+ * @group legacy
+ * @expectedDeprecation The "Symfony\Component\Finder\Finder::sortByName()" method will have a new "bool $useNaturalSort = false" argument in version 5.0, not defining it is deprecated since Symfony 4.2.
+ */
+ public function testInheritedClassCallSortByNameWithNoArguments()
+ {
+ $finderChild = new ClassThatInheritFinder();
+ $finderChild->sortByName();
+ }
+
protected function buildFinder()
{
return Finder::create();
}
}
+
+class ClassThatInheritFinder extends Finder
+{
+ public function sortByName()
+ {
+ parent::sortByName();
+ }
+}
diff --git a/vendor/symfony/finder/Tests/Iterator/DateRangeFilterIteratorTest.php b/vendor/symfony/finder/Tests/Iterator/DateRangeFilterIteratorTest.php
index 3226f706..ade1a41a 100644
--- a/vendor/symfony/finder/Tests/Iterator/DateRangeFilterIteratorTest.php
+++ b/vendor/symfony/finder/Tests/Iterator/DateRangeFilterIteratorTest.php
@@ -45,6 +45,15 @@ class DateRangeFilterIteratorTest extends RealIteratorTestCase
'.foo/.bar',
'foo bar',
'.foo/bar',
+ 'qux',
+ 'qux/baz_100_1.py',
+ 'qux/baz_1_2.py',
+ 'qux_0_1.php',
+ 'qux_1000_1.php',
+ 'qux_1002_0.php',
+ 'qux_10_2.php',
+ 'qux_12_0.php',
+ 'qux_2_0.php',
);
$since2MonthsAgo = array(
@@ -58,6 +67,15 @@ class DateRangeFilterIteratorTest extends RealIteratorTestCase
'.foo/.bar',
'foo bar',
'.foo/bar',
+ 'qux',
+ 'qux/baz_100_1.py',
+ 'qux/baz_1_2.py',
+ 'qux_0_1.php',
+ 'qux_1000_1.php',
+ 'qux_1002_0.php',
+ 'qux_10_2.php',
+ 'qux_12_0.php',
+ 'qux_2_0.php',
);
$untilLastMonth = array(
diff --git a/vendor/symfony/finder/Tests/Iterator/DepthRangeFilterIteratorTest.php b/vendor/symfony/finder/Tests/Iterator/DepthRangeFilterIteratorTest.php
index 2e901405..3a403cb9 100644
--- a/vendor/symfony/finder/Tests/Iterator/DepthRangeFilterIteratorTest.php
+++ b/vendor/symfony/finder/Tests/Iterator/DepthRangeFilterIteratorTest.php
@@ -41,6 +41,13 @@ class DepthRangeFilterIteratorTest extends RealIteratorTestCase
'.foo',
'.bar',
'foo bar',
+ 'qux',
+ 'qux_0_1.php',
+ 'qux_1000_1.php',
+ 'qux_1002_0.php',
+ 'qux_10_2.php',
+ 'qux_12_0.php',
+ 'qux_2_0.php',
);
$lessThanOrEqualTo1 = array(
@@ -56,6 +63,15 @@ class DepthRangeFilterIteratorTest extends RealIteratorTestCase
'.bar',
'foo bar',
'.foo/bar',
+ 'qux',
+ 'qux/baz_100_1.py',
+ 'qux/baz_1_2.py',
+ 'qux_0_1.php',
+ 'qux_1000_1.php',
+ 'qux_1002_0.php',
+ 'qux_10_2.php',
+ 'qux_12_0.php',
+ 'qux_2_0.php',
);
$graterThanOrEqualTo1 = array(
@@ -63,6 +79,8 @@ class DepthRangeFilterIteratorTest extends RealIteratorTestCase
'foo/bar.tmp',
'.foo/.bar',
'.foo/bar',
+ 'qux/baz_100_1.py',
+ 'qux/baz_1_2.py',
);
$equalTo1 = array(
@@ -70,6 +88,8 @@ class DepthRangeFilterIteratorTest extends RealIteratorTestCase
'foo/bar.tmp',
'.foo/.bar',
'.foo/bar',
+ 'qux/baz_100_1.py',
+ 'qux/baz_1_2.py',
);
return array(
diff --git a/vendor/symfony/finder/Tests/Iterator/ExcludeDirectoryFilterIteratorTest.php b/vendor/symfony/finder/Tests/Iterator/ExcludeDirectoryFilterIteratorTest.php
index fa192c31..c977b0cf 100644
--- a/vendor/symfony/finder/Tests/Iterator/ExcludeDirectoryFilterIteratorTest.php
+++ b/vendor/symfony/finder/Tests/Iterator/ExcludeDirectoryFilterIteratorTest.php
@@ -41,6 +41,15 @@ class ExcludeDirectoryFilterIteratorTest extends RealIteratorTestCase
'toto',
'toto/.git',
'foo bar',
+ 'qux',
+ 'qux/baz_100_1.py',
+ 'qux/baz_1_2.py',
+ 'qux_0_1.php',
+ 'qux_1000_1.php',
+ 'qux_1002_0.php',
+ 'qux_10_2.php',
+ 'qux_12_0.php',
+ 'qux_2_0.php',
);
$fo = array(
@@ -56,6 +65,15 @@ class ExcludeDirectoryFilterIteratorTest extends RealIteratorTestCase
'toto',
'toto/.git',
'foo bar',
+ 'qux',
+ 'qux/baz_100_1.py',
+ 'qux/baz_1_2.py',
+ 'qux_0_1.php',
+ 'qux_1000_1.php',
+ 'qux_1002_0.php',
+ 'qux_10_2.php',
+ 'qux_12_0.php',
+ 'qux_2_0.php',
);
$toto = array(
@@ -69,6 +87,15 @@ class ExcludeDirectoryFilterIteratorTest extends RealIteratorTestCase
'foo/bar.tmp',
'test.php',
'foo bar',
+ 'qux',
+ 'qux/baz_100_1.py',
+ 'qux/baz_1_2.py',
+ 'qux_0_1.php',
+ 'qux_1000_1.php',
+ 'qux_1002_0.php',
+ 'qux_10_2.php',
+ 'qux_12_0.php',
+ 'qux_2_0.php',
);
return array(
diff --git a/vendor/symfony/finder/Tests/Iterator/FileTypeFilterIteratorTest.php b/vendor/symfony/finder/Tests/Iterator/FileTypeFilterIteratorTest.php
index 4350b00c..0ecd8dfe 100644
--- a/vendor/symfony/finder/Tests/Iterator/FileTypeFilterIteratorTest.php
+++ b/vendor/symfony/finder/Tests/Iterator/FileTypeFilterIteratorTest.php
@@ -37,11 +37,20 @@ class FileTypeFilterIteratorTest extends RealIteratorTestCase
'.foo/.bar',
'.foo/bar',
'foo bar',
+ 'qux/baz_100_1.py',
+ 'qux/baz_1_2.py',
+ 'qux_0_1.php',
+ 'qux_1000_1.php',
+ 'qux_1002_0.php',
+ 'qux_10_2.php',
+ 'qux_12_0.php',
+ 'qux_2_0.php',
);
$onlyDirectories = array(
'.git',
'foo',
+ 'qux',
'toto',
'toto/.git',
'.foo',
diff --git a/vendor/symfony/finder/Tests/Iterator/RealIteratorTestCase.php b/vendor/symfony/finder/Tests/Iterator/RealIteratorTestCase.php
index b0223b78..9aa68ea2 100644
--- a/vendor/symfony/finder/Tests/Iterator/RealIteratorTestCase.php
+++ b/vendor/symfony/finder/Tests/Iterator/RealIteratorTestCase.php
@@ -33,6 +33,15 @@ abstract class RealIteratorTestCase extends IteratorTestCase
'toto/',
'toto/.git/',
'foo bar',
+ 'qux_0_1.php',
+ 'qux_2_0.php',
+ 'qux_10_2.php',
+ 'qux_12_0.php',
+ 'qux_1000_1.php',
+ 'qux_1002_0.php',
+ 'qux/',
+ 'qux/baz_1_2.py',
+ 'qux/baz_100_1.py',
);
self::$files = self::toAbsolute(self::$files);
diff --git a/vendor/symfony/finder/Tests/Iterator/SizeRangeFilterIteratorTest.php b/vendor/symfony/finder/Tests/Iterator/SizeRangeFilterIteratorTest.php
index 068fc7b0..0ee463c6 100644
--- a/vendor/symfony/finder/Tests/Iterator/SizeRangeFilterIteratorTest.php
+++ b/vendor/symfony/finder/Tests/Iterator/SizeRangeFilterIteratorTest.php
@@ -34,6 +34,7 @@ class SizeRangeFilterIteratorTest extends RealIteratorTestCase
'.foo',
'.git',
'foo',
+ 'qux',
'test.php',
'toto',
'toto/.git',
diff --git a/vendor/symfony/finder/Tests/Iterator/SortableIteratorTest.php b/vendor/symfony/finder/Tests/Iterator/SortableIteratorTest.php
index a35a12b5..33687c52 100644
--- a/vendor/symfony/finder/Tests/Iterator/SortableIteratorTest.php
+++ b/vendor/symfony/finder/Tests/Iterator/SortableIteratorTest.php
@@ -82,6 +82,15 @@ class SortableIteratorTest extends RealIteratorTestCase
'foo',
'foo bar',
'foo/bar.tmp',
+ 'qux',
+ 'qux/baz_100_1.py',
+ 'qux/baz_1_2.py',
+ 'qux_0_1.php',
+ 'qux_1000_1.php',
+ 'qux_1002_0.php',
+ 'qux_10_2.php',
+ 'qux_12_0.php',
+ 'qux_2_0.php',
'test.php',
'test.py',
'toto',
@@ -92,6 +101,7 @@ class SortableIteratorTest extends RealIteratorTestCase
'.foo',
'.git',
'foo',
+ 'qux',
'toto',
'toto/.git',
'.bar',
@@ -99,25 +109,18 @@ class SortableIteratorTest extends RealIteratorTestCase
'.foo/bar',
'foo bar',
'foo/bar.tmp',
+ 'qux/baz_100_1.py',
+ 'qux/baz_1_2.py',
+ 'qux_0_1.php',
+ 'qux_1000_1.php',
+ 'qux_1002_0.php',
+ 'qux_10_2.php',
+ 'qux_12_0.php',
+ 'qux_2_0.php',
'test.php',
'test.py',
);
- $customComparison = array(
- '.bar',
- '.foo',
- '.foo/.bar',
- '.foo/bar',
- '.git',
- 'foo',
- 'foo bar',
- 'foo/bar.tmp',
- 'test.php',
- 'test.py',
- 'toto',
- 'toto/.git',
- );
-
$sortByAccessedTime = array(
// For these two files the access time was set to 2005-10-15
array('foo/bar.tmp', 'test.php'),
@@ -132,6 +135,15 @@ class SortableIteratorTest extends RealIteratorTestCase
'toto',
'toto/.git',
'foo bar',
+ 'qux',
+ 'qux/baz_100_1.py',
+ 'qux/baz_1_2.py',
+ 'qux_0_1.php',
+ 'qux_1000_1.php',
+ 'qux_1002_0.php',
+ 'qux_10_2.php',
+ 'qux_12_0.php',
+ 'qux_2_0.php',
),
// This file was accessed after sleeping for 1 sec
array('.bar'),
@@ -149,6 +161,15 @@ class SortableIteratorTest extends RealIteratorTestCase
'toto',
'toto/.git',
'foo bar',
+ 'qux',
+ 'qux/baz_100_1.py',
+ 'qux/baz_1_2.py',
+ 'qux_0_1.php',
+ 'qux_1000_1.php',
+ 'qux_1002_0.php',
+ 'qux_10_2.php',
+ 'qux_12_0.php',
+ 'qux_2_0.php',
),
array('test.php'),
array('test.py'),
@@ -166,17 +187,75 @@ class SortableIteratorTest extends RealIteratorTestCase
'toto',
'toto/.git',
'foo bar',
+ 'qux',
+ 'qux/baz_100_1.py',
+ 'qux/baz_1_2.py',
+ 'qux_0_1.php',
+ 'qux_1000_1.php',
+ 'qux_1002_0.php',
+ 'qux_10_2.php',
+ 'qux_12_0.php',
+ 'qux_2_0.php',
),
array('test.php'),
array('test.py'),
);
+ $sortByNameNatural = array(
+ '.bar',
+ '.foo',
+ '.foo/.bar',
+ '.foo/bar',
+ '.git',
+ 'foo',
+ 'foo/bar.tmp',
+ 'foo bar',
+ 'qux',
+ 'qux/baz_1_2.py',
+ 'qux/baz_100_1.py',
+ 'qux_0_1.php',
+ 'qux_2_0.php',
+ 'qux_10_2.php',
+ 'qux_12_0.php',
+ 'qux_1000_1.php',
+ 'qux_1002_0.php',
+ 'test.php',
+ 'test.py',
+ 'toto',
+ 'toto/.git',
+ );
+
+ $customComparison = array(
+ '.bar',
+ '.foo',
+ '.foo/.bar',
+ '.foo/bar',
+ '.git',
+ 'foo',
+ 'foo bar',
+ 'foo/bar.tmp',
+ 'qux',
+ 'qux/baz_100_1.py',
+ 'qux/baz_1_2.py',
+ 'qux_0_1.php',
+ 'qux_1000_1.php',
+ 'qux_1002_0.php',
+ 'qux_10_2.php',
+ 'qux_12_0.php',
+ 'qux_2_0.php',
+ 'test.php',
+ 'test.py',
+ 'toto',
+ 'toto/.git',
+ );
+
return array(
array(SortableIterator::SORT_BY_NAME, $this->toAbsolute($sortByName)),
array(SortableIterator::SORT_BY_TYPE, $this->toAbsolute($sortByType)),
array(SortableIterator::SORT_BY_ACCESSED_TIME, $this->toAbsolute($sortByAccessedTime)),
array(SortableIterator::SORT_BY_CHANGED_TIME, $this->toAbsolute($sortByChangedTime)),
array(SortableIterator::SORT_BY_MODIFIED_TIME, $this->toAbsolute($sortByModifiedTime)),
+ array(SortableIterator::SORT_BY_NAME_NATURAL, $this->toAbsolute($sortByNameNatural)),
array(function (\SplFileInfo $a, \SplFileInfo $b) { return strcmp($a->getRealPath(), $b->getRealPath()); }, $this->toAbsolute($customComparison)),
);
}
diff --git a/vendor/symfony/finder/composer.json b/vendor/symfony/finder/composer.json
index dd37f2e0..37d34a5e 100644
--- a/vendor/symfony/finder/composer.json
+++ b/vendor/symfony/finder/composer.json
@@ -27,7 +27,7 @@
"minimum-stability": "dev",
"extra": {
"branch-alias": {
- "dev-master": "4.1-dev"
+ "dev-master": "4.2-dev"
}
}
}
diff --git a/vendor/symfony/finder/phpunit.xml.dist b/vendor/symfony/finder/phpunit.xml.dist
index 0e1a8669..078847af 100644
--- a/vendor/symfony/finder/phpunit.xml.dist
+++ b/vendor/symfony/finder/phpunit.xml.dist
@@ -1,7 +1,7 @@
\func_num_args()) {
+ @trigger_error(sprintf('The default value of the "$secure" and "$samesite" arguments of "%s"\'s constructor will respectively change from "false" to "null" and from "null" to "lax" in Symfony 5.0, you should define their values explicitly or use "Cookie::create()" instead.', __METHOD__), E_USER_DEPRECATED);
+ }
+
// from PHP source code
if (preg_match("/[=,; \t\r\n\013\014]/", $name)) {
throw new \InvalidArgumentException(sprintf('The cookie name "%s" contains invalid characters.', $name));
@@ -110,7 +120,9 @@ class Cookie
$this->httpOnly = $httpOnly;
$this->raw = $raw;
- if (null !== $sameSite) {
+ if ('' === $sameSite) {
+ $sameSite = null;
+ } elseif (null !== $sameSite) {
$sameSite = strtolower($sameSite);
}
@@ -232,7 +244,7 @@ class Cookie
*/
public function isSecure()
{
- return $this->secure;
+ return $this->secure ?? $this->secureDefault;
}
/**
@@ -274,4 +286,12 @@ class Cookie
{
return $this->sameSite;
}
+
+ /**
+ * @param bool $default The default value of the "secure" flag when it is set to null
+ */
+ public function setSecureDefault(bool $default): void
+ {
+ $this->secureDefault = $default;
+ }
}
diff --git a/vendor/symfony/http-foundation/HeaderUtils.php b/vendor/symfony/http-foundation/HeaderUtils.php
index 3ee50b87..637bc5be 100644
--- a/vendor/symfony/http-foundation/HeaderUtils.php
+++ b/vendor/symfony/http-foundation/HeaderUtils.php
@@ -18,6 +18,9 @@ namespace Symfony\Component\HttpFoundation;
*/
class HeaderUtils
{
+ public const DISPOSITION_ATTACHMENT = 'attachment';
+ public const DISPOSITION_INLINE = 'inline';
+
/**
* This class should not be instantiated.
*/
@@ -143,6 +146,54 @@ class HeaderUtils
return preg_replace('/\\\\(.)|"/', '$1', $s);
}
+ /**
+ * Generates a HTTP Content-Disposition field-value.
+ *
+ * @param string $disposition One of "inline" or "attachment"
+ * @param string $filename A unicode string
+ * @param string $filenameFallback A string containing only ASCII characters that
+ * is semantically equivalent to $filename. If the filename is already ASCII,
+ * it can be omitted, or just copied from $filename
+ *
+ * @return string A string suitable for use as a Content-Disposition field-value
+ *
+ * @throws \InvalidArgumentException
+ *
+ * @see RFC 6266
+ */
+ public static function makeDisposition(string $disposition, string $filename, string $filenameFallback = ''): string
+ {
+ if (!\in_array($disposition, array(self::DISPOSITION_ATTACHMENT, self::DISPOSITION_INLINE))) {
+ throw new \InvalidArgumentException(sprintf('The disposition must be either "%s" or "%s".', self::DISPOSITION_ATTACHMENT, self::DISPOSITION_INLINE));
+ }
+
+ if ('' === $filenameFallback) {
+ $filenameFallback = $filename;
+ }
+
+ // filenameFallback is not ASCII.
+ if (!preg_match('/^[\x20-\x7e]*$/', $filenameFallback)) {
+ throw new \InvalidArgumentException('The filename fallback must only contain ASCII characters.');
+ }
+
+ // percent characters aren't safe in fallback.
+ if (false !== strpos($filenameFallback, '%')) {
+ throw new \InvalidArgumentException('The filename fallback cannot contain the "%" character.');
+ }
+
+ // path separators aren't allowed in either.
+ if (false !== strpos($filename, '/') || false !== strpos($filename, '\\') || false !== strpos($filenameFallback, '/') || false !== strpos($filenameFallback, '\\')) {
+ throw new \InvalidArgumentException('The filename and the fallback cannot contain the "/" and "\\" characters.');
+ }
+
+ $params = array('filename' => $filenameFallback);
+ if ($filename !== $filenameFallback) {
+ $params['filename*'] = "utf-8''".rawurlencode($filename);
+ }
+
+ return $disposition.'; '.self::toString($params, ';');
+ }
+
private static function groupParts(array $matches, string $separators): array
{
$separator = $separators[0];
diff --git a/vendor/symfony/http-foundation/ParameterBag.php b/vendor/symfony/http-foundation/ParameterBag.php
index e3be0a9b..19d7ee91 100644
--- a/vendor/symfony/http-foundation/ParameterBag.php
+++ b/vendor/symfony/http-foundation/ParameterBag.php
@@ -174,7 +174,7 @@ class ParameterBag implements \IteratorAggregate, \Countable
* Returns the parameter value converted to boolean.
*
* @param string $key The parameter key
- * @param mixed $default The default value if the parameter key does not exist
+ * @param bool $default The default value if the parameter key does not exist
*
* @return bool The filtered value
*/
diff --git a/vendor/symfony/http-foundation/Request.php b/vendor/symfony/http-foundation/Request.php
index f0957328..51940b8d 100644
--- a/vendor/symfony/http-foundation/Request.php
+++ b/vendor/symfony/http-foundation/Request.php
@@ -545,10 +545,13 @@ class Request
$requestOrder = ini_get('request_order') ?: ini_get('variables_order');
$requestOrder = preg_replace('#[^cgp]#', '', strtolower($requestOrder)) ?: 'gp';
- $_REQUEST = array();
+ $_REQUEST = array(array());
+
foreach (str_split($requestOrder) as $order) {
- $_REQUEST = array_merge($_REQUEST, $request[$order]);
+ $_REQUEST[] = $request[$order];
}
+
+ $_REQUEST = array_merge(...$_REQUEST);
}
/**
@@ -1284,7 +1287,7 @@ class Request
{
$canonicalMimeType = null;
if (false !== $pos = strpos($mimeType, ';')) {
- $canonicalMimeType = substr($mimeType, 0, $pos);
+ $canonicalMimeType = trim(substr($mimeType, 0, $pos));
}
if (null === static::$formats) {
@@ -1448,7 +1451,7 @@ class Request
*
* @see https://tools.ietf.org/html/rfc7231#section-4.2.3
*
- * @return bool
+ * @return bool True for GET and HEAD, false otherwise
*/
public function isMethodCacheable()
{
@@ -1695,10 +1698,16 @@ class Request
$this->server->remove('IIS_WasUrlRewritten');
} elseif ($this->server->has('REQUEST_URI')) {
$requestUri = $this->server->get('REQUEST_URI');
+
// HTTP proxy reqs setup request URI with scheme and host [and port] + the URL path, only use URL path
- $schemeAndHttpHost = $this->getSchemeAndHttpHost();
- if (0 === strpos($requestUri, $schemeAndHttpHost)) {
- $requestUri = substr($requestUri, \strlen($schemeAndHttpHost));
+ $uriComponents = parse_url($requestUri);
+
+ if (isset($uriComponents['path'])) {
+ $requestUri = $uriComponents['path'];
+ }
+
+ if (isset($uriComponents['query'])) {
+ $requestUri .= '?'.$uriComponents['query'];
}
} elseif ($this->server->has('ORIG_PATH_INFO')) {
// IIS 5.0, PHP as CGI
diff --git a/vendor/symfony/http-foundation/RequestMatcher.php b/vendor/symfony/http-foundation/RequestMatcher.php
index 57fa48e4..ab9434f4 100644
--- a/vendor/symfony/http-foundation/RequestMatcher.php
+++ b/vendor/symfony/http-foundation/RequestMatcher.php
@@ -28,6 +28,11 @@ class RequestMatcher implements RequestMatcherInterface
*/
private $host;
+ /**
+ * @var int|null
+ */
+ private $port;
+
/**
* @var string[]
*/
@@ -56,13 +61,14 @@ class RequestMatcher implements RequestMatcherInterface
* @param array $attributes
* @param string|string[]|null $schemes
*/
- public function __construct(string $path = null, string $host = null, $methods = null, $ips = null, array $attributes = array(), $schemes = null)
+ public function __construct(string $path = null, string $host = null, $methods = null, $ips = null, array $attributes = array(), $schemes = null, int $port = null)
{
$this->matchPath($path);
$this->matchHost($host);
$this->matchMethod($methods);
$this->matchIps($ips);
$this->matchScheme($schemes);
+ $this->matchPort($port);
foreach ($attributes as $k => $v) {
$this->matchAttribute($k, $v);
@@ -89,6 +95,16 @@ class RequestMatcher implements RequestMatcherInterface
$this->host = $regexp;
}
+ /**
+ * Adds a check for the the URL port.
+ *
+ * @param int|null $port The port number to connect to
+ */
+ public function matchPort(int $port = null)
+ {
+ $this->port = $port;
+ }
+
/**
* Adds a check for the URL path info.
*
@@ -167,6 +183,10 @@ class RequestMatcher implements RequestMatcherInterface
return false;
}
+ if (null !== $this->port && 0 < $this->port && $request->getPort() !== $this->port) {
+ return false;
+ }
+
if (IpUtils::checkIp($request->getClientIp(), $this->ips)) {
return true;
}
diff --git a/vendor/symfony/http-foundation/Response.php b/vendor/symfony/http-foundation/Response.php
index 7f6ae7cd..7c962126 100644
--- a/vendor/symfony/http-foundation/Response.php
+++ b/vendor/symfony/http-foundation/Response.php
@@ -313,6 +313,12 @@ class Response
$this->ensureIEOverSSLCompatibility($request);
+ if ($request->isSecure()) {
+ foreach ($headers->getCookies() as $cookie) {
+ $cookie->setSecureDefault(true);
+ }
+ }
+
return $this;
}
@@ -330,8 +336,9 @@ class Response
// headers
foreach ($this->headers->allPreserveCaseWithoutCookies() as $name => $values) {
+ $replace = 0 === strcasecmp($name, 'Content-Type');
foreach ($values as $value) {
- header($name.': '.$value, false, $this->statusCode);
+ header($name.': '.$value, $replace, $this->statusCode);
}
}
@@ -933,7 +940,7 @@ class Response
public function setCache(array $options)
{
if ($diff = array_diff(array_keys($options), array('etag', 'last_modified', 'max_age', 's_maxage', 'private', 'public', 'immutable'))) {
- throw new \InvalidArgumentException(sprintf('Response does not support the following options: "%s".', implode('", "', array_values($diff))));
+ throw new \InvalidArgumentException(sprintf('Response does not support the following options: "%s".', implode('", "', $diff)));
}
if (isset($options['etag'])) {
diff --git a/vendor/symfony/http-foundation/ResponseHeaderBag.php b/vendor/symfony/http-foundation/ResponseHeaderBag.php
index ed2e0cfb..1141e8d9 100644
--- a/vendor/symfony/http-foundation/ResponseHeaderBag.php
+++ b/vendor/symfony/http-foundation/ResponseHeaderBag.php
@@ -247,55 +247,15 @@ class ResponseHeaderBag extends HeaderBag
*/
public function clearCookie($name, $path = '/', $domain = null, $secure = false, $httpOnly = true)
{
- $this->setCookie(new Cookie($name, null, 1, $path, $domain, $secure, $httpOnly));
+ $this->setCookie(new Cookie($name, null, 1, $path, $domain, $secure, $httpOnly, false, null));
}
/**
- * Generates a HTTP Content-Disposition field-value.
- *
- * @param string $disposition One of "inline" or "attachment"
- * @param string $filename A unicode string
- * @param string $filenameFallback A string containing only ASCII characters that
- * is semantically equivalent to $filename. If the filename is already ASCII,
- * it can be omitted, or just copied from $filename
- *
- * @return string A string suitable for use as a Content-Disposition field-value
- *
- * @throws \InvalidArgumentException
- *
- * @see RFC 6266
+ * @see HeaderUtils::makeDisposition()
*/
public function makeDisposition($disposition, $filename, $filenameFallback = '')
{
- if (!\in_array($disposition, array(self::DISPOSITION_ATTACHMENT, self::DISPOSITION_INLINE))) {
- throw new \InvalidArgumentException(sprintf('The disposition must be either "%s" or "%s".', self::DISPOSITION_ATTACHMENT, self::DISPOSITION_INLINE));
- }
-
- if ('' == $filenameFallback) {
- $filenameFallback = $filename;
- }
-
- // filenameFallback is not ASCII.
- if (!preg_match('/^[\x20-\x7e]*$/', $filenameFallback)) {
- throw new \InvalidArgumentException('The filename fallback must only contain ASCII characters.');
- }
-
- // percent characters aren't safe in fallback.
- if (false !== strpos($filenameFallback, '%')) {
- throw new \InvalidArgumentException('The filename fallback cannot contain the "%" character.');
- }
-
- // path separators aren't allowed in either.
- if (false !== strpos($filename, '/') || false !== strpos($filename, '\\') || false !== strpos($filenameFallback, '/') || false !== strpos($filenameFallback, '\\')) {
- throw new \InvalidArgumentException('The filename and the fallback cannot contain the "/" and "\\" characters.');
- }
-
- $params = array('filename' => $filenameFallback);
- if ($filename !== $filenameFallback) {
- $params['filename*'] = "utf-8''".rawurlencode($filename);
- }
-
- return $disposition.'; '.HeaderUtils::toString($params, ';');
+ return HeaderUtils::makeDisposition((string) $disposition, (string) $filename, (string) $filenameFallback);
}
/**
diff --git a/vendor/symfony/http-foundation/Session/SessionUtils.php b/vendor/symfony/http-foundation/Session/SessionUtils.php
new file mode 100644
index 00000000..91737c39
--- /dev/null
+++ b/vendor/symfony/http-foundation/Session/SessionUtils.php
@@ -0,0 +1,59 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\HttpFoundation\Session;
+
+/**
+ * Session utility functions.
+ *
+ * @author Nicolas Grekas
+ * @author Rémon van de Kamp
+ *
+ * @internal
+ */
+final class SessionUtils
+{
+ /**
+ * Finds the session header amongst the headers that are to be sent, removes it, and returns
+ * it so the caller can process it further.
+ */
+ public static function popSessionCookie(string $sessionName, string $sessionId): ?string
+ {
+ $sessionCookie = null;
+ $sessionCookiePrefix = sprintf(' %s=', urlencode($sessionName));
+ $sessionCookieWithId = sprintf('%s%s;', $sessionCookiePrefix, urlencode($sessionId));
+ $otherCookies = array();
+ foreach (headers_list() as $h) {
+ if (0 !== stripos($h, 'Set-Cookie:')) {
+ continue;
+ }
+ if (11 === strpos($h, $sessionCookiePrefix, 11)) {
+ $sessionCookie = $h;
+
+ if (11 !== strpos($h, $sessionCookieWithId, 11)) {
+ $otherCookies[] = $h;
+ }
+ } else {
+ $otherCookies[] = $h;
+ }
+ }
+ if (null === $sessionCookie) {
+ return null;
+ }
+
+ header_remove('Set-Cookie');
+ foreach ($otherCookies as $h) {
+ header($h, false);
+ }
+
+ return $sessionCookie;
+ }
+}
diff --git a/vendor/symfony/http-foundation/Session/Storage/Handler/AbstractSessionHandler.php b/vendor/symfony/http-foundation/Session/Storage/Handler/AbstractSessionHandler.php
index b1465716..95f11033 100644
--- a/vendor/symfony/http-foundation/Session/Storage/Handler/AbstractSessionHandler.php
+++ b/vendor/symfony/http-foundation/Session/Storage/Handler/AbstractSessionHandler.php
@@ -11,6 +11,8 @@
namespace Symfony\Component\HttpFoundation\Session\Storage\Handler;
+use Symfony\Component\HttpFoundation\Session\SessionUtils;
+
/**
* This abstract session handler provides a generic implementation
* of the PHP 7.0 SessionUpdateTimestampHandlerInterface,
@@ -117,35 +119,19 @@ abstract class AbstractSessionHandler implements \SessionHandlerInterface, \Sess
*/
public function destroy($sessionId)
{
- if (!headers_sent() && ini_get('session.use_cookies')) {
+ if (!headers_sent() && filter_var(ini_get('session.use_cookies'), FILTER_VALIDATE_BOOLEAN)) {
if (!$this->sessionName) {
throw new \LogicException(sprintf('Session name cannot be empty, did you forget to call "parent::open()" in "%s"?.', \get_class($this)));
}
- $sessionCookie = sprintf(' %s=', urlencode($this->sessionName));
- $sessionCookieWithId = sprintf('%s%s;', $sessionCookie, urlencode($sessionId));
- $sessionCookieFound = false;
- $otherCookies = array();
- foreach (headers_list() as $h) {
- if (0 !== stripos($h, 'Set-Cookie:')) {
- continue;
- }
- if (11 === strpos($h, $sessionCookie, 11)) {
- $sessionCookieFound = true;
-
- if (11 !== strpos($h, $sessionCookieWithId, 11)) {
- $otherCookies[] = $h;
- }
+ $cookie = SessionUtils::popSessionCookie($this->sessionName, $sessionId);
+ if (null === $cookie) {
+ if (\PHP_VERSION_ID < 70300) {
+ setcookie($this->sessionName, '', 0, ini_get('session.cookie_path'), ini_get('session.cookie_domain'), filter_var(ini_get('session.cookie_secure'), FILTER_VALIDATE_BOOLEAN), filter_var(ini_get('session.cookie_httponly'), FILTER_VALIDATE_BOOLEAN));
} else {
- $otherCookies[] = $h;
- }
- }
- if ($sessionCookieFound) {
- header_remove('Set-Cookie');
- foreach ($otherCookies as $h) {
- header($h, false);
+ $params = session_get_cookie_params();
+ unset($params['lifetime']);
+ setcookie($this->sessionName, '', $params);
}
- } else {
- setcookie($this->sessionName, '', 0, ini_get('session.cookie_path'), ini_get('session.cookie_domain'), ini_get('session.cookie_secure'), ini_get('session.cookie_httponly'));
}
}
diff --git a/vendor/symfony/http-foundation/Session/Storage/Handler/PdoSessionHandler.php b/vendor/symfony/http-foundation/Session/Storage/Handler/PdoSessionHandler.php
index dd1a263f..1bb647ef 100644
--- a/vendor/symfony/http-foundation/Session/Storage/Handler/PdoSessionHandler.php
+++ b/vendor/symfony/http-foundation/Session/Storage/Handler/PdoSessionHandler.php
@@ -637,7 +637,7 @@ class PdoSessionHandler extends AbstractSessionHandler
throw new \RuntimeException('Failed to read session: INSERT reported a duplicate id but next SELECT did not return any data.');
}
- if (!ini_get('session.use_strict_mode') && self::LOCK_TRANSACTIONAL === $this->lockMode && 'sqlite' !== $this->driver) {
+ if (!filter_var(ini_get('session.use_strict_mode'), FILTER_VALIDATE_BOOLEAN) && self::LOCK_TRANSACTIONAL === $this->lockMode && 'sqlite' !== $this->driver) {
// In strict mode, session fixation is not possible: new sessions always start with a unique
// random id, so that concurrency is not possible and this code path can be skipped.
// Exclusive-reading of non-existent rows does not block, so we need to do an insert to block
diff --git a/vendor/symfony/http-foundation/Session/Storage/Handler/RedisSessionHandler.php b/vendor/symfony/http-foundation/Session/Storage/Handler/RedisSessionHandler.php
index 36adf242..9c08ddcc 100644
--- a/vendor/symfony/http-foundation/Session/Storage/Handler/RedisSessionHandler.php
+++ b/vendor/symfony/http-foundation/Session/Storage/Handler/RedisSessionHandler.php
@@ -12,6 +12,7 @@
namespace Symfony\Component\HttpFoundation\Session\Storage\Handler;
use Predis\Response\ErrorInterface;
+use Symfony\Component\Cache\Traits\RedisClusterProxy;
use Symfony\Component\Cache\Traits\RedisProxy;
/**
@@ -45,7 +46,8 @@ class RedisSessionHandler extends AbstractSessionHandler
!$redis instanceof \RedisArray &&
!$redis instanceof \RedisCluster &&
!$redis instanceof \Predis\Client &&
- !$redis instanceof RedisProxy
+ !$redis instanceof RedisProxy &&
+ !$redis instanceof RedisClusterProxy
) {
throw new \InvalidArgumentException(sprintf('%s() expects parameter 1 to be Redis, RedisArray, RedisCluster or Predis\Client, %s given', __METHOD__, \is_object($redis) ? \get_class($redis) : \gettype($redis)));
}
diff --git a/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php b/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php
index dc4ce44b..156a0d45 100644
--- a/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php
+++ b/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php
@@ -12,6 +12,7 @@
namespace Symfony\Component\HttpFoundation\Session\Storage;
use Symfony\Component\HttpFoundation\Session\SessionBagInterface;
+use Symfony\Component\HttpFoundation\Session\SessionUtils;
use Symfony\Component\HttpFoundation\Session\Storage\Handler\StrictSessionHandler;
use Symfony\Component\HttpFoundation\Session\Storage\Proxy\AbstractProxy;
use Symfony\Component\HttpFoundation\Session\Storage\Proxy\SessionHandlerProxy;
@@ -48,6 +49,11 @@ class NativeSessionStorage implements SessionStorageInterface
*/
protected $metadataBag;
+ /**
+ * @var string|null
+ */
+ private $emulateSameSite;
+
/**
* Depending on how you want the storage driver to behave you probably
* want to override this constructor entirely.
@@ -67,6 +73,7 @@ class NativeSessionStorage implements SessionStorageInterface
* cookie_lifetime, "0"
* cookie_path, "/"
* cookie_secure, ""
+ * cookie_samesite, null
* gc_divisor, "100"
* gc_maxlifetime, "1440"
* gc_probability, "1"
@@ -134,7 +141,7 @@ class NativeSessionStorage implements SessionStorageInterface
throw new \RuntimeException('Failed to start the session: already started by PHP.');
}
- if (ini_get('session.use_cookies') && headers_sent($file, $line)) {
+ if (filter_var(ini_get('session.use_cookies'), FILTER_VALIDATE_BOOLEAN) && headers_sent($file, $line)) {
throw new \RuntimeException(sprintf('Failed to start the session because headers have already been sent by "%s" at line %d.', $file, $line));
}
@@ -143,6 +150,13 @@ class NativeSessionStorage implements SessionStorageInterface
throw new \RuntimeException('Failed to start the session');
}
+ if (null !== $this->emulateSameSite) {
+ $originalCookie = SessionUtils::popSessionCookie(session_name(), session_id());
+ if (null !== $originalCookie) {
+ header(sprintf('%s; SameSite=%s', $originalCookie, $this->emulateSameSite));
+ }
+ }
+
$this->loadSession();
return true;
@@ -208,6 +222,13 @@ class NativeSessionStorage implements SessionStorageInterface
// @see https://bugs.php.net/bug.php?id=70013
$this->loadSession();
+ if (null !== $this->emulateSameSite) {
+ $originalCookie = SessionUtils::popSessionCookie(session_name(), session_id());
+ if (null !== $originalCookie) {
+ header(sprintf('%s; SameSite=%s', $originalCookie, $this->emulateSameSite));
+ }
+ }
+
return $isRegenerated;
}
@@ -340,7 +361,7 @@ class NativeSessionStorage implements SessionStorageInterface
$validOptions = array_flip(array(
'cache_expire', 'cache_limiter', 'cookie_domain', 'cookie_httponly',
- 'cookie_lifetime', 'cookie_path', 'cookie_secure',
+ 'cookie_lifetime', 'cookie_path', 'cookie_secure', 'cookie_samesite',
'gc_divisor', 'gc_maxlifetime', 'gc_probability',
'lazy_write', 'name', 'referer_check',
'serialize_handler', 'use_strict_mode', 'use_cookies',
@@ -352,6 +373,12 @@ class NativeSessionStorage implements SessionStorageInterface
foreach ($options as $key => $value) {
if (isset($validOptions[$key])) {
+ if ('cookie_samesite' === $key && \PHP_VERSION_ID < 70300) {
+ // PHP < 7.3 does not support same_site cookies. We will emulate it in
+ // the start() method instead.
+ $this->emulateSameSite = $value;
+ continue;
+ }
ini_set('url_rewriter.tags' !== $key ? 'session.'.$key : $key, $value);
}
}
diff --git a/vendor/symfony/http-foundation/StreamedResponse.php b/vendor/symfony/http-foundation/StreamedResponse.php
index 40f785c8..06d053ea 100644
--- a/vendor/symfony/http-foundation/StreamedResponse.php
+++ b/vendor/symfony/http-foundation/StreamedResponse.php
@@ -17,7 +17,7 @@ namespace Symfony\Component\HttpFoundation;
* A StreamedResponse uses a callback for its content.
*
* The callback should use the standard PHP functions like echo
- * to stream the response back to the client. The flush() method
+ * to stream the response back to the client. The flush() function
* can also be used if needed.
*
* @see flush()
diff --git a/vendor/symfony/http-foundation/Tests/CookieTest.php b/vendor/symfony/http-foundation/Tests/CookieTest.php
index 390d42a6..44981dff 100644
--- a/vendor/symfony/http-foundation/Tests/CookieTest.php
+++ b/vendor/symfony/http-foundation/Tests/CookieTest.php
@@ -45,7 +45,7 @@ class CookieTest extends TestCase
*/
public function testInstantiationThrowsExceptionIfCookieNameContainsInvalidCharacters($name)
{
- new Cookie($name);
+ Cookie::create($name);
}
/**
@@ -53,12 +53,12 @@ class CookieTest extends TestCase
*/
public function testInvalidExpiration()
{
- new Cookie('MyCookie', 'foo', 'bar');
+ Cookie::create('MyCookie', 'foo', 'bar');
}
public function testNegativeExpirationIsNotPossible()
{
- $cookie = new Cookie('foo', 'bar', -100);
+ $cookie = Cookie::create('foo', 'bar', -100);
$this->assertSame(0, $cookie->getExpiresTime());
}
@@ -66,32 +66,32 @@ class CookieTest extends TestCase
public function testGetValue()
{
$value = 'MyValue';
- $cookie = new Cookie('MyCookie', $value);
+ $cookie = Cookie::create('MyCookie', $value);
$this->assertSame($value, $cookie->getValue(), '->getValue() returns the proper value');
}
public function testGetPath()
{
- $cookie = new Cookie('foo', 'bar');
+ $cookie = Cookie::create('foo', 'bar');
$this->assertSame('/', $cookie->getPath(), '->getPath() returns / as the default path');
}
public function testGetExpiresTime()
{
- $cookie = new Cookie('foo', 'bar');
+ $cookie = Cookie::create('foo', 'bar');
$this->assertEquals(0, $cookie->getExpiresTime(), '->getExpiresTime() returns the default expire date');
- $cookie = new Cookie('foo', 'bar', $expire = time() + 3600);
+ $cookie = Cookie::create('foo', 'bar', $expire = time() + 3600);
$this->assertEquals($expire, $cookie->getExpiresTime(), '->getExpiresTime() returns the expire date');
}
public function testGetExpiresTimeIsCastToInt()
{
- $cookie = new Cookie('foo', 'bar', 3600.9);
+ $cookie = Cookie::create('foo', 'bar', 3600.9);
$this->assertSame(3600, $cookie->getExpiresTime(), '->getExpiresTime() returns the expire date as an integer');
}
@@ -99,7 +99,7 @@ class CookieTest extends TestCase
public function testConstructorWithDateTime()
{
$expire = new \DateTime();
- $cookie = new Cookie('foo', 'bar', $expire);
+ $cookie = Cookie::create('foo', 'bar', $expire);
$this->assertEquals($expire->format('U'), $cookie->getExpiresTime(), '->getExpiresTime() returns the expire date');
}
@@ -107,7 +107,7 @@ class CookieTest extends TestCase
public function testConstructorWithDateTimeImmutable()
{
$expire = new \DateTimeImmutable();
- $cookie = new Cookie('foo', 'bar', $expire);
+ $cookie = Cookie::create('foo', 'bar', $expire);
$this->assertEquals($expire->format('U'), $cookie->getExpiresTime(), '->getExpiresTime() returns the expire date');
}
@@ -115,7 +115,7 @@ class CookieTest extends TestCase
public function testGetExpiresTimeWithStringValue()
{
$value = '+1 day';
- $cookie = new Cookie('foo', 'bar', $value);
+ $cookie = Cookie::create('foo', 'bar', $value);
$expire = strtotime($value);
$this->assertEquals($expire, $cookie->getExpiresTime(), '->getExpiresTime() returns the expire date', 1);
@@ -123,99 +123,99 @@ class CookieTest extends TestCase
public function testGetDomain()
{
- $cookie = new Cookie('foo', 'bar', 0, '/', '.myfoodomain.com');
+ $cookie = Cookie::create('foo', 'bar', 0, '/', '.myfoodomain.com');
$this->assertEquals('.myfoodomain.com', $cookie->getDomain(), '->getDomain() returns the domain name on which the cookie is valid');
}
public function testIsSecure()
{
- $cookie = new Cookie('foo', 'bar', 0, '/', '.myfoodomain.com', true);
+ $cookie = Cookie::create('foo', 'bar', 0, '/', '.myfoodomain.com', true);
$this->assertTrue($cookie->isSecure(), '->isSecure() returns whether the cookie is transmitted over HTTPS');
}
public function testIsHttpOnly()
{
- $cookie = new Cookie('foo', 'bar', 0, '/', '.myfoodomain.com', false, true);
+ $cookie = Cookie::create('foo', 'bar', 0, '/', '.myfoodomain.com', false, true);
$this->assertTrue($cookie->isHttpOnly(), '->isHttpOnly() returns whether the cookie is only transmitted over HTTP');
}
public function testCookieIsNotCleared()
{
- $cookie = new Cookie('foo', 'bar', time() + 3600 * 24);
+ $cookie = Cookie::create('foo', 'bar', time() + 3600 * 24);
$this->assertFalse($cookie->isCleared(), '->isCleared() returns false if the cookie did not expire yet');
}
public function testCookieIsCleared()
{
- $cookie = new Cookie('foo', 'bar', time() - 20);
+ $cookie = Cookie::create('foo', 'bar', time() - 20);
$this->assertTrue($cookie->isCleared(), '->isCleared() returns true if the cookie has expired');
- $cookie = new Cookie('foo', 'bar');
+ $cookie = Cookie::create('foo', 'bar');
$this->assertFalse($cookie->isCleared());
- $cookie = new Cookie('foo', 'bar', 0);
+ $cookie = Cookie::create('foo', 'bar');
$this->assertFalse($cookie->isCleared());
- $cookie = new Cookie('foo', 'bar', -1);
+ $cookie = Cookie::create('foo', 'bar', -1);
$this->assertFalse($cookie->isCleared());
}
public function testToString()
{
- $cookie = new Cookie('foo', 'bar', $expire = strtotime('Fri, 20-May-2011 15:25:52 GMT'), '/', '.myfoodomain.com', true);
+ $cookie = Cookie::create('foo', 'bar', $expire = strtotime('Fri, 20-May-2011 15:25:52 GMT'), '/', '.myfoodomain.com', true, true, false, null);
$this->assertEquals('foo=bar; expires=Fri, 20-May-2011 15:25:52 GMT; Max-Age=0; path=/; domain=.myfoodomain.com; secure; httponly', (string) $cookie, '->__toString() returns string representation of the cookie');
- $cookie = new Cookie('foo', 'bar with white spaces', strtotime('Fri, 20-May-2011 15:25:52 GMT'), '/', '.myfoodomain.com', true);
+ $cookie = Cookie::create('foo', 'bar with white spaces', strtotime('Fri, 20-May-2011 15:25:52 GMT'), '/', '.myfoodomain.com', true, true, false, null);
$this->assertEquals('foo=bar%20with%20white%20spaces; expires=Fri, 20-May-2011 15:25:52 GMT; Max-Age=0; path=/; domain=.myfoodomain.com; secure; httponly', (string) $cookie, '->__toString() encodes the value of the cookie according to RFC 3986 (white space = %20)');
- $cookie = new Cookie('foo', null, 1, '/admin/', '.myfoodomain.com');
+ $cookie = Cookie::create('foo', null, 1, '/admin/', '.myfoodomain.com', false, true, false, null);
$this->assertEquals('foo=deleted; expires='.gmdate('D, d-M-Y H:i:s T', $expire = time() - 31536001).'; Max-Age=0; path=/admin/; domain=.myfoodomain.com; httponly', (string) $cookie, '->__toString() returns string representation of a cleared cookie if value is NULL');
- $cookie = new Cookie('foo', 'bar', 0, '/', '');
- $this->assertEquals('foo=bar; path=/; httponly', (string) $cookie);
+ $cookie = Cookie::create('foo', 'bar');
+ $this->assertEquals('foo=bar; path=/; httponly; samesite=lax', (string) $cookie);
}
public function testRawCookie()
{
- $cookie = new Cookie('foo', 'b a r', 0, '/', null, false, false);
+ $cookie = Cookie::create('foo', 'b a r', 0, '/', null, false, false, false, null);
$this->assertFalse($cookie->isRaw());
$this->assertEquals('foo=b%20a%20r; path=/', (string) $cookie);
- $cookie = new Cookie('foo', 'b+a+r', 0, '/', null, false, false, true);
+ $cookie = Cookie::create('foo', 'b+a+r', 0, '/', null, false, false, true, null);
$this->assertTrue($cookie->isRaw());
$this->assertEquals('foo=b+a+r; path=/', (string) $cookie);
}
public function testGetMaxAge()
{
- $cookie = new Cookie('foo', 'bar');
+ $cookie = Cookie::create('foo', 'bar');
$this->assertEquals(0, $cookie->getMaxAge());
- $cookie = new Cookie('foo', 'bar', $expire = time() + 100);
+ $cookie = Cookie::create('foo', 'bar', $expire = time() + 100);
$this->assertEquals($expire - time(), $cookie->getMaxAge());
- $cookie = new Cookie('foo', 'bar', $expire = time() - 100);
+ $cookie = Cookie::create('foo', 'bar', $expire = time() - 100);
$this->assertEquals(0, $cookie->getMaxAge());
}
public function testFromString()
{
$cookie = Cookie::fromString('foo=bar; expires=Fri, 20-May-2011 15:25:52 GMT; path=/; domain=.myfoodomain.com; secure; httponly');
- $this->assertEquals(new Cookie('foo', 'bar', strtotime('Fri, 20-May-2011 15:25:52 GMT'), '/', '.myfoodomain.com', true, true, true), $cookie);
+ $this->assertEquals(Cookie::create('foo', 'bar', strtotime('Fri, 20-May-2011 15:25:52 GMT'), '/', '.myfoodomain.com', true, true, true, null), $cookie);
$cookie = Cookie::fromString('foo=bar', true);
- $this->assertEquals(new Cookie('foo', 'bar', 0, '/', null, false, false), $cookie);
+ $this->assertEquals(Cookie::create('foo', 'bar', 0, '/', null, false, false, false, null), $cookie);
$cookie = Cookie::fromString('foo', true);
- $this->assertEquals(new Cookie('foo', null, 0, '/', null, false, false), $cookie);
+ $this->assertEquals(Cookie::create('foo', null, 0, '/', null, false, false, false, null), $cookie);
}
public function testFromStringWithHttpOnly()
@@ -227,9 +227,27 @@ class CookieTest extends TestCase
$this->assertFalse($cookie->isHttpOnly());
}
- public function testSameSiteAttributeIsCaseInsensitive()
+ public function testSameSiteAttribute()
{
$cookie = new Cookie('foo', 'bar', 0, '/', null, false, true, false, 'Lax');
$this->assertEquals('lax', $cookie->getSameSite());
+
+ $cookie = new Cookie('foo', 'bar', 0, '/', null, false, true, false, '');
+ $this->assertNull($cookie->getSameSite());
+ }
+
+ public function testSetSecureDefault()
+ {
+ $cookie = Cookie::create('foo', 'bar');
+
+ $this->assertFalse($cookie->isSecure());
+
+ $cookie->setSecureDefault(true);
+
+ $this->assertTrue($cookie->isSecure());
+
+ $cookie->setSecureDefault(false);
+
+ $this->assertFalse($cookie->isSecure());
}
}
diff --git a/vendor/symfony/http-foundation/Tests/Fixtures/response-functional/common.inc b/vendor/symfony/http-foundation/Tests/Fixtures/response-functional/common.inc
index f9c40a9a..0bdf9e4b 100644
--- a/vendor/symfony/http-foundation/Tests/Fixtures/response-functional/common.inc
+++ b/vendor/symfony/http-foundation/Tests/Fixtures/response-functional/common.inc
@@ -22,7 +22,7 @@ error_reporting(-1);
ini_set('html_errors', 0);
ini_set('display_errors', 1);
-if (ini_get('xdebug.default_enable')) {
+if (filter_var(ini_get('xdebug.default_enable'), FILTER_VALIDATE_BOOLEAN)) {
xdebug_disable();
}
diff --git a/vendor/symfony/http-foundation/Tests/Fixtures/response-functional/cookie_max_age.php b/vendor/symfony/http-foundation/Tests/Fixtures/response-functional/cookie_max_age.php
index 8775a5cc..e18ce525 100644
--- a/vendor/symfony/http-foundation/Tests/Fixtures/response-functional/cookie_max_age.php
+++ b/vendor/symfony/http-foundation/Tests/Fixtures/response-functional/cookie_max_age.php
@@ -4,7 +4,7 @@ use Symfony\Component\HttpFoundation\Cookie;
$r = require __DIR__.'/common.inc';
-$r->headers->setCookie(new Cookie('foo', 'bar', 253402310800, '', null, false, false));
+$r->headers->setCookie(new Cookie('foo', 'bar', 253402310800, '', null, false, false, false, null));
$r->sendHeaders();
setcookie('foo2', 'bar', 253402310800, '/');
diff --git a/vendor/symfony/http-foundation/Tests/Fixtures/response-functional/cookie_raw_urlencode.php b/vendor/symfony/http-foundation/Tests/Fixtures/response-functional/cookie_raw_urlencode.php
index 2ca5b59f..00c022d9 100644
--- a/vendor/symfony/http-foundation/Tests/Fixtures/response-functional/cookie_raw_urlencode.php
+++ b/vendor/symfony/http-foundation/Tests/Fixtures/response-functional/cookie_raw_urlencode.php
@@ -6,7 +6,7 @@ $r = require __DIR__.'/common.inc';
$str = '?*():@&+$/%#[]';
-$r->headers->setCookie(new Cookie($str, $str, 0, '/', null, false, false, true));
+$r->headers->setCookie(new Cookie($str, $str, 0, '/', null, false, false, true, null));
$r->sendHeaders();
setrawcookie($str, $str, 0, '/', null, false, false);
diff --git a/vendor/symfony/http-foundation/Tests/Fixtures/response-functional/cookie_urlencode.php b/vendor/symfony/http-foundation/Tests/Fixtures/response-functional/cookie_urlencode.php
index 05b9af30..c0363b82 100644
--- a/vendor/symfony/http-foundation/Tests/Fixtures/response-functional/cookie_urlencode.php
+++ b/vendor/symfony/http-foundation/Tests/Fixtures/response-functional/cookie_urlencode.php
@@ -6,7 +6,7 @@ $r = require __DIR__.'/common.inc';
$str = '?*():@&+$/%#[]';
-$r->headers->setCookie(new Cookie($str, $str, 0, '', null, false, false));
+$r->headers->setCookie(new Cookie($str, $str, 0, '', null, false, false, false, null));
$r->sendHeaders();
setcookie($str, $str, 0, '/');
diff --git a/vendor/symfony/http-foundation/Tests/Fixtures/response-functional/invalid_cookie_name.php b/vendor/symfony/http-foundation/Tests/Fixtures/response-functional/invalid_cookie_name.php
index 3fe15718..0afaaa8a 100644
--- a/vendor/symfony/http-foundation/Tests/Fixtures/response-functional/invalid_cookie_name.php
+++ b/vendor/symfony/http-foundation/Tests/Fixtures/response-functional/invalid_cookie_name.php
@@ -5,7 +5,7 @@ use Symfony\Component\HttpFoundation\Cookie;
$r = require __DIR__.'/common.inc';
try {
- $r->headers->setCookie(new Cookie('Hello + world', 'hodor'));
+ $r->headers->setCookie(Cookie::create('Hello + world', 'hodor'));
} catch (\InvalidArgumentException $e) {
echo $e->getMessage();
}
diff --git a/vendor/symfony/http-foundation/Tests/HeaderUtilsTest.php b/vendor/symfony/http-foundation/Tests/HeaderUtilsTest.php
index 2f5fdc21..15efdf92 100644
--- a/vendor/symfony/http-foundation/Tests/HeaderUtilsTest.php
+++ b/vendor/symfony/http-foundation/Tests/HeaderUtilsTest.php
@@ -82,4 +82,53 @@ class HeaderUtilsTest extends TestCase
$this->assertEquals('foo "bar"', HeaderUtils::unquote('"foo \"\b\a\r\""'));
$this->assertEquals('foo \\ bar', HeaderUtils::unquote('"foo \\\\ bar"'));
}
+
+ /**
+ * @expectedException \InvalidArgumentException
+ */
+ public function testMakeDispositionInvalidDisposition()
+ {
+ HeaderUtils::makeDisposition('invalid', 'foo.html');
+ }
+
+ /**
+ * @dataProvider provideMakeDisposition
+ */
+ public function testMakeDisposition($disposition, $filename, $filenameFallback, $expected)
+ {
+ $this->assertEquals($expected, HeaderUtils::makeDisposition($disposition, $filename, $filenameFallback));
+ }
+
+ public function provideMakeDisposition()
+ {
+ return array(
+ array('attachment', 'foo.html', 'foo.html', 'attachment; filename=foo.html'),
+ array('attachment', 'foo.html', '', 'attachment; filename=foo.html'),
+ array('attachment', 'foo bar.html', '', 'attachment; filename="foo bar.html"'),
+ array('attachment', 'foo "bar".html', '', 'attachment; filename="foo \\"bar\\".html"'),
+ array('attachment', 'foo%20bar.html', 'foo bar.html', 'attachment; filename="foo bar.html"; filename*=utf-8\'\'foo%2520bar.html'),
+ array('attachment', 'föö.html', 'foo.html', 'attachment; filename=foo.html; filename*=utf-8\'\'f%C3%B6%C3%B6.html'),
+ );
+ }
+
+ /**
+ * @dataProvider provideMakeDispositionFail
+ * @expectedException \InvalidArgumentException
+ */
+ public function testMakeDispositionFail($disposition, $filename)
+ {
+ HeaderUtils::makeDisposition($disposition, $filename);
+ }
+
+ public function provideMakeDispositionFail()
+ {
+ return array(
+ array('attachment', 'foo%20bar.html'),
+ array('attachment', 'foo/bar.html'),
+ array('attachment', '/foo.html'),
+ array('attachment', 'foo\bar.html'),
+ array('attachment', '\foo.html'),
+ array('attachment', 'föö.html'),
+ );
+ }
}
diff --git a/vendor/symfony/http-foundation/Tests/RequestMatcherTest.php b/vendor/symfony/http-foundation/Tests/RequestMatcherTest.php
index 10d764a7..cc35ad63 100644
--- a/vendor/symfony/http-foundation/Tests/RequestMatcherTest.php
+++ b/vendor/symfony/http-foundation/Tests/RequestMatcherTest.php
@@ -78,6 +78,21 @@ class RequestMatcherTest extends TestCase
$this->assertSame($isMatch, $matcher->matches($request));
}
+ public function testPort()
+ {
+ $matcher = new RequestMatcher();
+ $request = Request::create('', 'get', array(), array(), array(), array('HTTP_HOST' => null, 'SERVER_PORT' => 8000));
+
+ $matcher->matchPort(8000);
+ $this->assertTrue($matcher->matches($request));
+
+ $matcher->matchPort(9000);
+ $this->assertFalse($matcher->matches($request));
+
+ $matcher = new RequestMatcher(null, null, null, null, array(), null, 8000);
+ $this->assertTrue($matcher->matches($request));
+ }
+
public function getHostData()
{
return array(
diff --git a/vendor/symfony/http-foundation/Tests/RequestTest.php b/vendor/symfony/http-foundation/Tests/RequestTest.php
index 52392add..0711c515 100644
--- a/vendor/symfony/http-foundation/Tests/RequestTest.php
+++ b/vendor/symfony/http-foundation/Tests/RequestTest.php
@@ -232,6 +232,55 @@ class RequestTest extends TestCase
$this->assertEquals(80, $request->getPort());
$this->assertEquals('test.com', $request->getHttpHost());
$this->assertFalse($request->isSecure());
+
+ // Fragment should not be included in the URI
+ $request = Request::create('http://test.com/foo#bar');
+ $this->assertEquals('http://test.com/foo', $request->getUri());
+ }
+
+ public function testCreateWithRequestUri()
+ {
+ $request = Request::create('http://test.com:80/foo');
+ $request->server->set('REQUEST_URI', 'http://test.com:80/foo');
+ $this->assertEquals('http://test.com/foo', $request->getUri());
+ $this->assertEquals('/foo', $request->getPathInfo());
+ $this->assertEquals('test.com', $request->getHost());
+ $this->assertEquals('test.com', $request->getHttpHost());
+ $this->assertEquals(80, $request->getPort());
+ $this->assertFalse($request->isSecure());
+
+ $request = Request::create('http://test.com:8080/foo');
+ $request->server->set('REQUEST_URI', 'http://test.com:8080/foo');
+ $this->assertEquals('http://test.com:8080/foo', $request->getUri());
+ $this->assertEquals('/foo', $request->getPathInfo());
+ $this->assertEquals('test.com', $request->getHost());
+ $this->assertEquals('test.com:8080', $request->getHttpHost());
+ $this->assertEquals(8080, $request->getPort());
+ $this->assertFalse($request->isSecure());
+
+ $request = Request::create('http://test.com/foo?bar=foo', 'GET', array('bar' => 'baz'));
+ $request->server->set('REQUEST_URI', 'http://test.com/foo?bar=foo');
+ $this->assertEquals('http://test.com/foo?bar=baz', $request->getUri());
+ $this->assertEquals('/foo', $request->getPathInfo());
+ $this->assertEquals('bar=baz', $request->getQueryString());
+ $this->assertEquals('test.com', $request->getHost());
+ $this->assertEquals('test.com', $request->getHttpHost());
+ $this->assertEquals(80, $request->getPort());
+ $this->assertFalse($request->isSecure());
+
+ $request = Request::create('https://test.com:443/foo');
+ $request->server->set('REQUEST_URI', 'https://test.com:443/foo');
+ $this->assertEquals('https://test.com/foo', $request->getUri());
+ $this->assertEquals('/foo', $request->getPathInfo());
+ $this->assertEquals('test.com', $request->getHost());
+ $this->assertEquals('test.com', $request->getHttpHost());
+ $this->assertEquals(443, $request->getPort());
+ $this->assertTrue($request->isSecure());
+
+ // Fragment should not be included in the URI
+ $request = Request::create('http://test.com/foo#bar');
+ $request->server->set('REQUEST_URI', 'http://test.com/foo#bar');
+ $this->assertEquals('http://test.com/foo', $request->getUri());
}
public function testCreateCheckPrecedence()
@@ -332,6 +381,9 @@ class RequestTest extends TestCase
{
$request = new Request();
$this->assertEquals('json', $request->getFormat('application/json; charset=utf-8'));
+ $this->assertEquals('json', $request->getFormat('application/json;charset=utf-8'));
+ $this->assertEquals('json', $request->getFormat('application/json ; charset=utf-8'));
+ $this->assertEquals('json', $request->getFormat('application/json ;charset=utf-8'));
}
/**
diff --git a/vendor/symfony/http-foundation/Tests/ResponseHeaderBagTest.php b/vendor/symfony/http-foundation/Tests/ResponseHeaderBagTest.php
index e987677d..f6ddb98e 100644
--- a/vendor/symfony/http-foundation/Tests/ResponseHeaderBagTest.php
+++ b/vendor/symfony/http-foundation/Tests/ResponseHeaderBagTest.php
@@ -110,9 +110,9 @@ class ResponseHeaderBagTest extends TestCase
public function testToStringIncludesCookieHeaders()
{
$bag = new ResponseHeaderBag(array());
- $bag->setCookie(new Cookie('foo', 'bar'));
+ $bag->setCookie(Cookie::create('foo', 'bar'));
- $this->assertSetCookieHeader('foo=bar; path=/; httponly', $bag);
+ $this->assertSetCookieHeader('foo=bar; path=/; httponly; samesite=lax', $bag);
$bag->clearCookie('foo');
@@ -154,24 +154,24 @@ class ResponseHeaderBagTest extends TestCase
public function testCookiesWithSameNames()
{
$bag = new ResponseHeaderBag();
- $bag->setCookie(new Cookie('foo', 'bar', 0, '/path/foo', 'foo.bar'));
- $bag->setCookie(new Cookie('foo', 'bar', 0, '/path/bar', 'foo.bar'));
- $bag->setCookie(new Cookie('foo', 'bar', 0, '/path/bar', 'bar.foo'));
- $bag->setCookie(new Cookie('foo', 'bar'));
+ $bag->setCookie(Cookie::create('foo', 'bar', 0, '/path/foo', 'foo.bar'));
+ $bag->setCookie(Cookie::create('foo', 'bar', 0, '/path/bar', 'foo.bar'));
+ $bag->setCookie(Cookie::create('foo', 'bar', 0, '/path/bar', 'bar.foo'));
+ $bag->setCookie(Cookie::create('foo', 'bar'));
$this->assertCount(4, $bag->getCookies());
- $this->assertEquals('foo=bar; path=/path/foo; domain=foo.bar; httponly', $bag->get('set-cookie'));
+ $this->assertEquals('foo=bar; path=/path/foo; domain=foo.bar; httponly; samesite=lax', $bag->get('set-cookie'));
$this->assertEquals(array(
- 'foo=bar; path=/path/foo; domain=foo.bar; httponly',
- 'foo=bar; path=/path/bar; domain=foo.bar; httponly',
- 'foo=bar; path=/path/bar; domain=bar.foo; httponly',
- 'foo=bar; path=/; httponly',
+ 'foo=bar; path=/path/foo; domain=foo.bar; httponly; samesite=lax',
+ 'foo=bar; path=/path/bar; domain=foo.bar; httponly; samesite=lax',
+ 'foo=bar; path=/path/bar; domain=bar.foo; httponly; samesite=lax',
+ 'foo=bar; path=/; httponly; samesite=lax',
), $bag->get('set-cookie', null, false));
- $this->assertSetCookieHeader('foo=bar; path=/path/foo; domain=foo.bar; httponly', $bag);
- $this->assertSetCookieHeader('foo=bar; path=/path/bar; domain=foo.bar; httponly', $bag);
- $this->assertSetCookieHeader('foo=bar; path=/path/bar; domain=bar.foo; httponly', $bag);
- $this->assertSetCookieHeader('foo=bar; path=/; httponly', $bag);
+ $this->assertSetCookieHeader('foo=bar; path=/path/foo; domain=foo.bar; httponly; samesite=lax', $bag);
+ $this->assertSetCookieHeader('foo=bar; path=/path/bar; domain=foo.bar; httponly; samesite=lax', $bag);
+ $this->assertSetCookieHeader('foo=bar; path=/path/bar; domain=bar.foo; httponly; samesite=lax', $bag);
+ $this->assertSetCookieHeader('foo=bar; path=/; httponly; samesite=lax', $bag);
$cookies = $bag->getCookies(ResponseHeaderBag::COOKIES_ARRAY);
@@ -186,8 +186,8 @@ class ResponseHeaderBagTest extends TestCase
$bag = new ResponseHeaderBag();
$this->assertFalse($bag->has('set-cookie'));
- $bag->setCookie(new Cookie('foo', 'bar', 0, '/path/foo', 'foo.bar'));
- $bag->setCookie(new Cookie('bar', 'foo', 0, '/path/bar', 'foo.bar'));
+ $bag->setCookie(Cookie::create('foo', 'bar', 0, '/path/foo', 'foo.bar'));
+ $bag->setCookie(Cookie::create('bar', 'foo', 0, '/path/bar', 'foo.bar'));
$this->assertTrue($bag->has('set-cookie'));
$cookies = $bag->getCookies(ResponseHeaderBag::COOKIES_ARRAY);
@@ -209,8 +209,8 @@ class ResponseHeaderBagTest extends TestCase
public function testRemoveCookieWithNullRemove()
{
$bag = new ResponseHeaderBag();
- $bag->setCookie(new Cookie('foo', 'bar', 0));
- $bag->setCookie(new Cookie('bar', 'foo', 0));
+ $bag->setCookie(Cookie::create('foo', 'bar'));
+ $bag->setCookie(Cookie::create('bar', 'foo'));
$cookies = $bag->getCookies(ResponseHeaderBag::COOKIES_ARRAY);
$this->assertArrayHasKey('/', $cookies['']);
@@ -228,12 +228,12 @@ class ResponseHeaderBagTest extends TestCase
{
$bag = new ResponseHeaderBag();
$bag->set('set-cookie', 'foo=bar');
- $this->assertEquals(array(new Cookie('foo', 'bar', 0, '/', null, false, false, true)), $bag->getCookies());
+ $this->assertEquals(array(Cookie::create('foo', 'bar', 0, '/', null, false, false, true, null)), $bag->getCookies());
$bag->set('set-cookie', 'foo2=bar2', false);
$this->assertEquals(array(
- new Cookie('foo', 'bar', 0, '/', null, false, false, true),
- new Cookie('foo2', 'bar2', 0, '/', null, false, false, true),
+ Cookie::create('foo', 'bar', 0, '/', null, false, false, true, null),
+ Cookie::create('foo2', 'bar2', 0, '/', null, false, false, true, null),
), $bag->getCookies());
$bag->remove('set-cookie');
@@ -250,26 +250,6 @@ class ResponseHeaderBagTest extends TestCase
$bag->getCookies('invalid_argument');
}
- /**
- * @expectedException \InvalidArgumentException
- */
- public function testMakeDispositionInvalidDisposition()
- {
- $headers = new ResponseHeaderBag();
-
- $headers->makeDisposition('invalid', 'foo.html');
- }
-
- /**
- * @dataProvider provideMakeDisposition
- */
- public function testMakeDisposition($disposition, $filename, $filenameFallback, $expected)
- {
- $headers = new ResponseHeaderBag();
-
- $this->assertEquals($expected, $headers->makeDisposition($disposition, $filename, $filenameFallback));
- }
-
public function testToStringDoesntMessUpHeaders()
{
$headers = new ResponseHeaderBag();
@@ -284,41 +264,6 @@ class ResponseHeaderBagTest extends TestCase
$this->assertEquals(array('text/html'), $allHeaders['Content-type']);
}
- public function provideMakeDisposition()
- {
- return array(
- array('attachment', 'foo.html', 'foo.html', 'attachment; filename=foo.html'),
- array('attachment', 'foo.html', '', 'attachment; filename=foo.html'),
- array('attachment', 'foo bar.html', '', 'attachment; filename="foo bar.html"'),
- array('attachment', 'foo "bar".html', '', 'attachment; filename="foo \\"bar\\".html"'),
- array('attachment', 'foo%20bar.html', 'foo bar.html', 'attachment; filename="foo bar.html"; filename*=utf-8\'\'foo%2520bar.html'),
- array('attachment', 'föö.html', 'foo.html', 'attachment; filename=foo.html; filename*=utf-8\'\'f%C3%B6%C3%B6.html'),
- );
- }
-
- /**
- * @dataProvider provideMakeDispositionFail
- * @expectedException \InvalidArgumentException
- */
- public function testMakeDispositionFail($disposition, $filename)
- {
- $headers = new ResponseHeaderBag();
-
- $headers->makeDisposition($disposition, $filename);
- }
-
- public function provideMakeDispositionFail()
- {
- return array(
- array('attachment', 'foo%20bar.html'),
- array('attachment', 'foo/bar.html'),
- array('attachment', '/foo.html'),
- array('attachment', 'foo\bar.html'),
- array('attachment', '\foo.html'),
- array('attachment', 'föö.html'),
- );
- }
-
public function testDateHeaderAddedOnCreation()
{
$now = time();
diff --git a/vendor/symfony/http-foundation/Tests/ResponseTest.php b/vendor/symfony/http-foundation/Tests/ResponseTest.php
index f9b5ef4f..03dcc11a 100644
--- a/vendor/symfony/http-foundation/Tests/ResponseTest.php
+++ b/vendor/symfony/http-foundation/Tests/ResponseTest.php
@@ -11,6 +11,7 @@
namespace Symfony\Component\HttpFoundation\Tests;
+use Symfony\Component\HttpFoundation\Cookie;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
@@ -573,6 +574,24 @@ class ResponseTest extends ResponseTestCase
$this->assertFalse($response->headers->has('expires'));
}
+ public function testPrepareSetsCookiesSecure()
+ {
+ $cookie = Cookie::create('foo', 'bar');
+
+ $response = new Response('foo');
+ $response->headers->setCookie($cookie);
+
+ $request = Request::create('/', 'GET');
+ $response->prepare($request);
+
+ $this->assertFalse($cookie->isSecure());
+
+ $request = Request::create('https://localhost/', 'GET');
+ $response->prepare($request);
+
+ $this->assertTrue($cookie->isSecure());
+ }
+
public function testSetCache()
{
$response = new Response();
diff --git a/vendor/symfony/http-foundation/Tests/Session/Attribute/AttributeBagTest.php b/vendor/symfony/http-foundation/Tests/Session/Attribute/AttributeBagTest.php
index 43644e23..8c41e475 100644
--- a/vendor/symfony/http-foundation/Tests/Session/Attribute/AttributeBagTest.php
+++ b/vendor/symfony/http-foundation/Tests/Session/Attribute/AttributeBagTest.php
@@ -45,7 +45,7 @@ class AttributeBagTest extends TestCase
),
),
);
- $this->bag = new AttributeBag('_sf2');
+ $this->bag = new AttributeBag('_sf');
$this->bag->initialize($this->array);
}
@@ -67,7 +67,7 @@ class AttributeBagTest extends TestCase
public function testGetStorageKey()
{
- $this->assertEquals('_sf2', $this->bag->getStorageKey());
+ $this->assertEquals('_sf', $this->bag->getStorageKey());
$attributeBag = new AttributeBag('test');
$this->assertEquals('test', $attributeBag->getStorageKey());
}
diff --git a/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/Fixtures/with_samesite.expected b/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/Fixtures/with_samesite.expected
new file mode 100644
index 00000000..d20fb88e
--- /dev/null
+++ b/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/Fixtures/with_samesite.expected
@@ -0,0 +1,16 @@
+open
+validateId
+read
+doRead:
+read
+
+write
+doWrite: foo|s:3:"bar";
+close
+Array
+(
+ [0] => Content-Type: text/plain; charset=utf-8
+ [1] => Cache-Control: max-age=0, private, must-revalidate
+ [2] => Set-Cookie: sid=random_session_id; path=/; secure; HttpOnly; SameSite=lax
+)
+shutdown
diff --git a/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/Fixtures/with_samesite.php b/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/Fixtures/with_samesite.php
new file mode 100644
index 00000000..2d32792a
--- /dev/null
+++ b/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/Fixtures/with_samesite.php
@@ -0,0 +1,13 @@
+ 'lax'));
+$storage->setSaveHandler(new TestSessionHandler());
+$storage->start();
+
+$_SESSION = array('foo' => 'bar');
+
+ob_start(function ($buffer) { return str_replace(session_id(), 'random_session_id', $buffer); });
diff --git a/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/Fixtures/with_samesite_and_migration.expected b/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/Fixtures/with_samesite_and_migration.expected
new file mode 100644
index 00000000..8b5fc08b
--- /dev/null
+++ b/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/Fixtures/with_samesite_and_migration.expected
@@ -0,0 +1,23 @@
+open
+validateId
+read
+doRead:
+read
+destroy
+close
+open
+validateId
+read
+doRead:
+read
+
+write
+doWrite: foo|s:3:"bar";
+close
+Array
+(
+ [0] => Content-Type: text/plain; charset=utf-8
+ [1] => Cache-Control: max-age=0, private, must-revalidate
+ [2] => Set-Cookie: sid=random_session_id; path=/; secure; HttpOnly; SameSite=lax
+)
+shutdown
diff --git a/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/Fixtures/with_samesite_and_migration.php b/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/Fixtures/with_samesite_and_migration.php
new file mode 100644
index 00000000..e0ff64b9
--- /dev/null
+++ b/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/Fixtures/with_samesite_and_migration.php
@@ -0,0 +1,15 @@
+ 'lax'));
+$storage->setSaveHandler(new TestSessionHandler());
+$storage->start();
+
+$_SESSION = array('foo' => 'bar');
+
+$storage->regenerate(true);
+
+ob_start(function ($buffer) { return preg_replace('~_sf2_meta.*$~m', '', str_replace(session_id(), 'random_session_id', $buffer)); });
diff --git a/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php b/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php
index 55a3864a..c585fd4f 100644
--- a/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php
+++ b/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php
@@ -45,7 +45,7 @@ class MongoDbSessionHandlerTest extends TestCase
'data_field' => 'data',
'time_field' => 'time',
'expiry_field' => 'expires_at',
- 'database' => 'sf2-test',
+ 'database' => 'sf-test',
'collection' => 'session-test',
);
diff --git a/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/PdoSessionHandlerTest.php b/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/PdoSessionHandlerTest.php
index e8478189..0a65eaa8 100644
--- a/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/PdoSessionHandlerTest.php
+++ b/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/PdoSessionHandlerTest.php
@@ -33,7 +33,7 @@ class PdoSessionHandlerTest extends TestCase
protected function getPersistentSqliteDsn()
{
- $this->dbFile = tempnam(sys_get_temp_dir(), 'sf2_sqlite_sessions');
+ $this->dbFile = tempnam(sys_get_temp_dir(), 'sf_sqlite_sessions');
return 'sqlite:'.$this->dbFile;
}
@@ -153,7 +153,7 @@ class PdoSessionHandlerTest extends TestCase
public function testReadLockedConvertsStreamToString()
{
- if (ini_get('session.use_strict_mode')) {
+ if (filter_var(ini_get('session.use_strict_mode'), FILTER_VALIDATE_BOOLEAN)) {
$this->markTestSkipped('Strict mode needs no locking for new sessions.');
}
diff --git a/vendor/symfony/http-foundation/Tests/Session/Storage/MockFileSessionStorageTest.php b/vendor/symfony/http-foundation/Tests/Session/Storage/MockFileSessionStorageTest.php
index 16957981..f8394d8c 100644
--- a/vendor/symfony/http-foundation/Tests/Session/Storage/MockFileSessionStorageTest.php
+++ b/vendor/symfony/http-foundation/Tests/Session/Storage/MockFileSessionStorageTest.php
@@ -35,7 +35,7 @@ class MockFileSessionStorageTest extends TestCase
protected function setUp()
{
- $this->sessionDir = sys_get_temp_dir().'/sf2test';
+ $this->sessionDir = sys_get_temp_dir().'/sftest';
$this->storage = $this->getStorage();
}
diff --git a/vendor/symfony/http-foundation/Tests/Session/Storage/NativeSessionStorageTest.php b/vendor/symfony/http-foundation/Tests/Session/Storage/NativeSessionStorageTest.php
index 52da2947..8ce703b3 100644
--- a/vendor/symfony/http-foundation/Tests/Session/Storage/NativeSessionStorageTest.php
+++ b/vendor/symfony/http-foundation/Tests/Session/Storage/NativeSessionStorageTest.php
@@ -36,7 +36,7 @@ class NativeSessionStorageTest extends TestCase
protected function setUp()
{
$this->iniSet('session.save_handler', 'files');
- $this->iniSet('session.save_path', $this->savePath = sys_get_temp_dir().'/sf2test');
+ $this->iniSet('session.save_path', $this->savePath = sys_get_temp_dir().'/sftest');
if (!is_dir($this->savePath)) {
mkdir($this->savePath);
}
@@ -171,6 +171,10 @@ class NativeSessionStorageTest extends TestCase
'cookie_httponly' => false,
);
+ if (\PHP_VERSION_ID >= 70300) {
+ $options['cookie_samesite'] = 'lax';
+ }
+
$this->getStorage($options);
$temp = session_get_cookie_params();
$gco = array();
diff --git a/vendor/symfony/http-foundation/Tests/Session/Storage/PhpBridgeSessionStorageTest.php b/vendor/symfony/http-foundation/Tests/Session/Storage/PhpBridgeSessionStorageTest.php
index 303f36d3..a5a85614 100644
--- a/vendor/symfony/http-foundation/Tests/Session/Storage/PhpBridgeSessionStorageTest.php
+++ b/vendor/symfony/http-foundation/Tests/Session/Storage/PhpBridgeSessionStorageTest.php
@@ -32,7 +32,7 @@ class PhpBridgeSessionStorageTest extends TestCase
protected function setUp()
{
$this->iniSet('session.save_handler', 'files');
- $this->iniSet('session.save_path', $this->savePath = sys_get_temp_dir().'/sf2test');
+ $this->iniSet('session.save_path', $this->savePath = sys_get_temp_dir().'/sftest');
if (!is_dir($this->savePath)) {
mkdir($this->savePath);
}
diff --git a/vendor/symfony/http-foundation/composer.json b/vendor/symfony/http-foundation/composer.json
index ef4bf826..76381a7c 100644
--- a/vendor/symfony/http-foundation/composer.json
+++ b/vendor/symfony/http-foundation/composer.json
@@ -32,7 +32,7 @@
"minimum-stability": "dev",
"extra": {
"branch-alias": {
- "dev-master": "4.1-dev"
+ "dev-master": "4.2-dev"
}
}
}
diff --git a/vendor/symfony/http-foundation/phpunit.xml.dist b/vendor/symfony/http-foundation/phpunit.xml.dist
index c1d61f8b..f57bc9e6 100644
--- a/vendor/symfony/http-foundation/phpunit.xml.dist
+++ b/vendor/symfony/http-foundation/phpunit.xml.dist
@@ -1,7 +1,7 @@
warmers = $warmers;
+ $this->debug = $debug;
+ $this->deprecationLogsFilepath = $deprecationLogsFilepath;
}
public function enableOptionalWarmers()
@@ -46,15 +50,62 @@ class CacheWarmerAggregate implements CacheWarmerInterface
*/
public function warmUp($cacheDir)
{
- foreach ($this->warmers as $warmer) {
- if (!$this->optionalsEnabled && $warmer->isOptional()) {
- continue;
- }
- if ($this->onlyOptionalsEnabled && !$warmer->isOptional()) {
- continue;
+ if ($this->debug) {
+ $collectedLogs = array();
+ $previousHandler = \defined('PHPUNIT_COMPOSER_INSTALL');
+ $previousHandler = $previousHandler ?: set_error_handler(function ($type, $message, $file, $line) use (&$collectedLogs, &$previousHandler) {
+ if (E_USER_DEPRECATED !== $type && E_DEPRECATED !== $type) {
+ return $previousHandler ? $previousHandler($type, $message, $file, $line) : false;
+ }
+
+ if (isset($collectedLogs[$message])) {
+ ++$collectedLogs[$message]['count'];
+
+ return;
+ }
+
+ $backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 3);
+ // Clean the trace by removing first frames added by the error handler itself.
+ for ($i = 0; isset($backtrace[$i]); ++$i) {
+ if (isset($backtrace[$i]['file'], $backtrace[$i]['line']) && $backtrace[$i]['line'] === $line && $backtrace[$i]['file'] === $file) {
+ $backtrace = \array_slice($backtrace, 1 + $i);
+ break;
+ }
+ }
+
+ $collectedLogs[$message] = array(
+ 'type' => $type,
+ 'message' => $message,
+ 'file' => $file,
+ 'line' => $line,
+ 'trace' => $backtrace,
+ 'count' => 1,
+ );
+ });
+ }
+
+ try {
+ foreach ($this->warmers as $warmer) {
+ if (!$this->optionalsEnabled && $warmer->isOptional()) {
+ continue;
+ }
+ if ($this->onlyOptionalsEnabled && !$warmer->isOptional()) {
+ continue;
+ }
+
+ $warmer->warmUp($cacheDir);
}
+ } finally {
+ if ($this->debug && true !== $previousHandler) {
+ restore_error_handler();
- $warmer->warmUp($cacheDir);
+ if (file_exists($this->deprecationLogsFilepath)) {
+ $previousLogs = unserialize(file_get_contents($this->deprecationLogsFilepath));
+ $collectedLogs = array_merge($previousLogs, $collectedLogs);
+ }
+
+ file_put_contents($this->deprecationLogsFilepath, serialize(array_values($collectedLogs)));
+ }
}
}
diff --git a/vendor/symfony/http-kernel/Controller/ArgumentResolver/TraceableValueResolver.php b/vendor/symfony/http-kernel/Controller/ArgumentResolver/TraceableValueResolver.php
index 4d60aa15..bde3c90c 100644
--- a/vendor/symfony/http-kernel/Controller/ArgumentResolver/TraceableValueResolver.php
+++ b/vendor/symfony/http-kernel/Controller/ArgumentResolver/TraceableValueResolver.php
@@ -38,7 +38,7 @@ final class TraceableValueResolver implements ArgumentValueResolverInterface
public function supports(Request $request, ArgumentMetadata $argument): bool
{
$method = \get_class($this->inner).'::'.__FUNCTION__;
- $this->stopwatch->start($method);
+ $this->stopwatch->start($method, 'controller.argument_value_resolver');
$return = $this->inner->supports($request, $argument);
@@ -53,7 +53,7 @@ final class TraceableValueResolver implements ArgumentValueResolverInterface
public function resolve(Request $request, ArgumentMetadata $argument): iterable
{
$method = \get_class($this->inner).'::'.__FUNCTION__;
- $this->stopwatch->start($method);
+ $this->stopwatch->start($method, 'controller.argument_value_resolver');
yield from $this->inner->resolve($request, $argument);
diff --git a/vendor/symfony/http-kernel/Controller/ContainerControllerResolver.php b/vendor/symfony/http-kernel/Controller/ContainerControllerResolver.php
index ed515d24..4f80921c 100644
--- a/vendor/symfony/http-kernel/Controller/ContainerControllerResolver.php
+++ b/vendor/symfony/http-kernel/Controller/ContainerControllerResolver.php
@@ -36,7 +36,7 @@ class ContainerControllerResolver extends ControllerResolver
{
if (1 === substr_count($controller, ':')) {
$controller = str_replace(':', '::', $controller);
- @trigger_error(sprintf('Referencing controllers with a single colon is deprecated since Symfony 4.1. Use %s instead.', $controller), E_USER_DEPRECATED);
+ // TODO deprecate this in 5.1
}
return parent::createController($controller);
diff --git a/vendor/symfony/http-kernel/DataCollector/ConfigDataCollector.php b/vendor/symfony/http-kernel/DataCollector/ConfigDataCollector.php
index 76ad4a8c..f07ac89c 100644
--- a/vendor/symfony/http-kernel/DataCollector/ConfigDataCollector.php
+++ b/vendor/symfony/http-kernel/DataCollector/ConfigDataCollector.php
@@ -30,12 +30,15 @@ class ConfigDataCollector extends DataCollector implements LateDataCollectorInte
private $version;
private $hasVarDumper;
- /**
- * @param string $name The name of the application using the web profiler
- * @param string $version The version of the application using the web profiler
- */
public function __construct(string $name = null, string $version = null)
{
+ if (1 <= \func_num_args()) {
+ @trigger_error(sprintf('The "$name" argument in method "%s()" is deprecated since Symfony 4.2.', __METHOD__), E_USER_DEPRECATED);
+ }
+ if (2 <= \func_num_args()) {
+ @trigger_error(sprintf('The "$version" argument in method "%s()" is deprecated since Symfony 4.2.', __METHOD__), E_USER_DEPRECATED);
+ }
+
$this->name = $name;
$this->version = $version;
$this->hasVarDumper = class_exists(LinkStub::class);
@@ -60,7 +63,6 @@ class ConfigDataCollector extends DataCollector implements LateDataCollectorInte
'token' => $response->headers->get('X-Debug-Token'),
'symfony_version' => Kernel::VERSION,
'symfony_state' => 'unknown',
- 'name' => isset($this->kernel) ? $this->kernel->getName() : 'n/a',
'env' => isset($this->kernel) ? $this->kernel->getEnvironment() : 'n/a',
'debug' => isset($this->kernel) ? $this->kernel->isDebug() : 'n/a',
'php_version' => PHP_VERSION,
@@ -68,8 +70,8 @@ class ConfigDataCollector extends DataCollector implements LateDataCollectorInte
'php_intl_locale' => class_exists('Locale', false) && \Locale::getDefault() ? \Locale::getDefault() : 'n/a',
'php_timezone' => date_default_timezone_get(),
'xdebug_enabled' => \extension_loaded('xdebug'),
- 'apcu_enabled' => \extension_loaded('apcu') && ini_get('apc.enabled'),
- 'zend_opcache_enabled' => \extension_loaded('Zend OPcache') && ini_get('opcache.enable'),
+ 'apcu_enabled' => \extension_loaded('apcu') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN),
+ 'zend_opcache_enabled' => \extension_loaded('Zend OPcache') && filter_var(ini_get('opcache.enable'), FILTER_VALIDATE_BOOLEAN),
'bundles' => array(),
'sapi_name' => \PHP_SAPI,
);
@@ -106,13 +108,23 @@ class ConfigDataCollector extends DataCollector implements LateDataCollectorInte
$this->data = $this->cloneVar($this->data);
}
+ /**
+ * @deprecated since Symfony 4.2
+ */
public function getApplicationName()
{
+ @trigger_error(sprintf('The method "%s()" is deprecated since Symfony 4.2.', __METHOD__), E_USER_DEPRECATED);
+
return $this->data['app_name'];
}
+ /**
+ * @deprecated since Symfony 4.2
+ */
public function getApplicationVersion()
{
+ @trigger_error(sprintf('The method "%s()" is deprecated since Symfony 4.2.', __METHOD__), E_USER_DEPRECATED);
+
return $this->data['app_version'];
}
@@ -227,10 +239,14 @@ class ConfigDataCollector extends DataCollector implements LateDataCollectorInte
* Gets the application name.
*
* @return string The application name
+ *
+ * @deprecated since Symfony 4.2
*/
public function getAppName()
{
- return $this->data['name'];
+ @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.2.', __METHOD__), E_USER_DEPRECATED);
+
+ return 'n/a';
}
/**
diff --git a/vendor/symfony/http-kernel/DataCollector/DataCollectorInterface.php b/vendor/symfony/http-kernel/DataCollector/DataCollectorInterface.php
index 549fd5d3..b9584110 100644
--- a/vendor/symfony/http-kernel/DataCollector/DataCollectorInterface.php
+++ b/vendor/symfony/http-kernel/DataCollector/DataCollectorInterface.php
@@ -13,13 +13,14 @@ namespace Symfony\Component\HttpKernel\DataCollector;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
+use Symfony\Contracts\Service\ResetInterface;
/**
* DataCollectorInterface.
*
* @author Fabien Potencier
*/
-interface DataCollectorInterface
+interface DataCollectorInterface extends ResetInterface
{
/**
* Collects data for the given Request and Response.
@@ -32,9 +33,4 @@ interface DataCollectorInterface
* @return string The collector name
*/
public function getName();
-
- /**
- * Resets this data collector to its initial state.
- */
- public function reset();
}
diff --git a/vendor/symfony/http-kernel/DataCollector/DumpDataCollector.php b/vendor/symfony/http-kernel/DataCollector/DumpDataCollector.php
index 1ca85255..13694f5a 100644
--- a/vendor/symfony/http-kernel/DataCollector/DumpDataCollector.php
+++ b/vendor/symfony/http-kernel/DataCollector/DumpDataCollector.php
@@ -204,7 +204,13 @@ class DumpDataCollector extends DataCollector implements DataDumperInterface
--$i;
}
- if (!\in_array(\PHP_SAPI, array('cli', 'phpdbg'), true) && stripos($h[$i], 'html')) {
+ if (isset($_SERVER['VAR_DUMPER_FORMAT'])) {
+ $html = 'html' === $_SERVER['VAR_DUMPER_FORMAT'];
+ } else {
+ $html = !\in_array(\PHP_SAPI, array('cli', 'phpdbg'), true) && stripos($h[$i], 'html');
+ }
+
+ if ($html) {
$dumper = new HtmlDumper('php://output', $this->charset);
$dumper->setDisplayOptions(array('fileLinkFormat' => $this->fileLinkFormat));
} else {
diff --git a/vendor/symfony/http-kernel/DataCollector/EventDataCollector.php b/vendor/symfony/http-kernel/DataCollector/EventDataCollector.php
index f9d5bed1..3a7e51bf 100644
--- a/vendor/symfony/http-kernel/DataCollector/EventDataCollector.php
+++ b/vendor/symfony/http-kernel/DataCollector/EventDataCollector.php
@@ -16,6 +16,7 @@ use Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcherInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
+use Symfony\Contracts\Service\ResetInterface;
/**
* EventDataCollector.
@@ -47,7 +48,7 @@ class EventDataCollector extends DataCollector implements LateDataCollectorInter
{
$this->data = array();
- if ($this->dispatcher instanceof TraceableEventDispatcherInterface) {
+ if ($this->dispatcher instanceof ResetInterface) {
$this->dispatcher->reset();
}
}
diff --git a/vendor/symfony/http-kernel/DataCollector/LoggerDataCollector.php b/vendor/symfony/http-kernel/DataCollector/LoggerDataCollector.php
index 533d3217..3081ac7f 100644
--- a/vendor/symfony/http-kernel/DataCollector/LoggerDataCollector.php
+++ b/vendor/symfony/http-kernel/DataCollector/LoggerDataCollector.php
@@ -134,7 +134,7 @@ class LoggerDataCollector extends DataCollector implements LateDataCollectorInte
$log['timestamp'] = $bootTime;
$log['priority'] = 100;
$log['priorityName'] = 'DEBUG';
- $log['channel'] = '-';
+ $log['channel'] = null;
$log['scream'] = false;
unset($log['type'], $log['file'], $log['line'], $log['trace'], $log['trace'], $log['count']);
$logs[] = $log;
diff --git a/vendor/symfony/http-kernel/DataCollector/RequestDataCollector.php b/vendor/symfony/http-kernel/DataCollector/RequestDataCollector.php
index 4c34cf90..ed753826 100644
--- a/vendor/symfony/http-kernel/DataCollector/RequestDataCollector.php
+++ b/vendor/symfony/http-kernel/DataCollector/RequestDataCollector.php
@@ -95,6 +95,7 @@ class RequestDataCollector extends DataCollector implements EventSubscriberInter
'status_code' => $statusCode,
'request_query' => $request->query->all(),
'request_request' => $request->request->all(),
+ 'request_files' => $request->files->all(),
'request_headers' => $request->headers->all(),
'request_server' => $request->server->all(),
'request_cookies' => $request->cookies->all(),
@@ -153,7 +154,8 @@ class RequestDataCollector extends DataCollector implements EventSubscriberInter
'controller' => $this->parseController($request->attributes->get('_controller')),
'status_code' => $statusCode,
'status_text' => Response::$statusTexts[(int) $statusCode],
- ))
+ )),
+ 0, '/', null, $request->isSecure(), true, false, 'lax'
));
}
@@ -195,6 +197,11 @@ class RequestDataCollector extends DataCollector implements EventSubscriberInter
return new ParameterBag($this->data['request_query']->getValue());
}
+ public function getRequestFiles()
+ {
+ return new ParameterBag($this->data['request_files']->getValue());
+ }
+
public function getRequestHeaders()
{
return new ParameterBag($this->data['request_headers']->getValue());
@@ -402,12 +409,25 @@ class RequestDataCollector extends DataCollector implements EventSubscriberInter
if ($controller instanceof \Closure) {
$r = new \ReflectionFunction($controller);
- return array(
+ $controller = array(
'class' => $r->getName(),
'method' => null,
'file' => $r->getFileName(),
'line' => $r->getStartLine(),
);
+
+ if (false !== strpos($r->name, '{closure}')) {
+ return $controller;
+ }
+ $controller['method'] = $r->name;
+
+ if ($class = $r->getClosureScopeClass()) {
+ $controller['class'] = $class->name;
+ } else {
+ return $r->name;
+ }
+
+ return $controller;
}
if (\is_object($controller)) {
diff --git a/vendor/symfony/http-kernel/DependencyInjection/RegisterControllerArgumentLocatorsPass.php b/vendor/symfony/http-kernel/DependencyInjection/RegisterControllerArgumentLocatorsPass.php
index 06adfe4a..125464b1 100644
--- a/vendor/symfony/http-kernel/DependencyInjection/RegisterControllerArgumentLocatorsPass.php
+++ b/vendor/symfony/http-kernel/DependencyInjection/RegisterControllerArgumentLocatorsPass.php
@@ -122,7 +122,7 @@ class RegisterControllerArgumentLocatorsPass implements CompilerPassInterface
$args = array();
foreach ($parameters as $p) {
/** @var \ReflectionParameter $p */
- $type = $target = ProxyHelper::getTypeHint($r, $p, true);
+ $type = ltrim($target = ProxyHelper::getTypeHint($r, $p), '\\');
$invalidBehavior = ContainerInterface::IGNORE_ON_INVALID_REFERENCE;
if (isset($arguments[$r->name][$p->name])) {
@@ -134,7 +134,7 @@ class RegisterControllerArgumentLocatorsPass implements CompilerPassInterface
} elseif ($p->allowsNull() && !$p->isOptional()) {
$invalidBehavior = ContainerInterface::NULL_ON_INVALID_REFERENCE;
}
- } elseif (isset($bindings[$bindingName = '$'.$p->name]) || isset($bindings[$bindingName = $type])) {
+ } elseif (isset($bindings[$bindingName = $type.' $'.$p->name]) || isset($bindings[$bindingName = '$'.$p->name]) || isset($bindings[$bindingName = $type])) {
$binding = $bindings[$bindingName];
list($bindingValue, $bindingId) = $binding->getValues();
@@ -150,7 +150,7 @@ class RegisterControllerArgumentLocatorsPass implements CompilerPassInterface
}
continue;
- } elseif (!$type || !$autowire) {
+ } elseif (!$type || !$autowire || '\\' !== $target[0]) {
continue;
} elseif (!$p->allowsNull()) {
$invalidBehavior = ContainerInterface::RUNTIME_EXCEPTION_ON_INVALID_REFERENCE;
@@ -171,7 +171,8 @@ class RegisterControllerArgumentLocatorsPass implements CompilerPassInterface
throw new InvalidArgumentException($message);
}
- $args[$p->name] = $type ? new TypedReference($target, $type, $invalidBehavior) : new Reference($target, $invalidBehavior);
+ $target = ltrim($target, '\\');
+ $args[$p->name] = $type ? new TypedReference($target, $type, $invalidBehavior, $p->name) : new Reference($target, $invalidBehavior);
}
// register the maps as a per-method service-locators
if ($args) {
diff --git a/vendor/symfony/http-kernel/DependencyInjection/ServicesResetter.php b/vendor/symfony/http-kernel/DependencyInjection/ServicesResetter.php
index b82d2fef..734fadbd 100644
--- a/vendor/symfony/http-kernel/DependencyInjection/ServicesResetter.php
+++ b/vendor/symfony/http-kernel/DependencyInjection/ServicesResetter.php
@@ -11,6 +11,8 @@
namespace Symfony\Component\HttpKernel\DependencyInjection;
+use Symfony\Contracts\Service\ResetInterface;
+
/**
* Resets provided services.
*
@@ -19,7 +21,7 @@ namespace Symfony\Component\HttpKernel\DependencyInjection;
*
* @internal
*/
-class ServicesResetter
+class ServicesResetter implements ResetInterface
{
private $resettableServices;
private $resetMethods;
diff --git a/vendor/symfony/http-kernel/EventListener/AbstractSessionListener.php b/vendor/symfony/http-kernel/EventListener/AbstractSessionListener.php
index 08a6ac63..c7c17170 100644
--- a/vendor/symfony/http-kernel/EventListener/AbstractSessionListener.php
+++ b/vendor/symfony/http-kernel/EventListener/AbstractSessionListener.php
@@ -71,14 +71,17 @@ abstract class AbstractSessionListener implements EventSubscriberInterface
return;
}
+ $response = $event->getResponse();
+ $autoCacheControl = !$response->headers->has(self::NO_AUTO_CACHE_CONTROL_HEADER);
+ // Always remove the internal header if present
+ $response->headers->remove(self::NO_AUTO_CACHE_CONTROL_HEADER);
+
if (!$session = $this->container && $this->container->has('initialized_session') ? $this->container->get('initialized_session') : $event->getRequest()->getSession()) {
return;
}
- $response = $event->getResponse();
-
if ($session instanceof Session ? $session->getUsageIndex() !== end($this->sessionUsageStack) : $session->isStarted()) {
- if (!$response->headers->has(self::NO_AUTO_CACHE_CONTROL_HEADER)) {
+ if ($autoCacheControl) {
$response
->setPrivate()
->setMaxAge(0)
@@ -86,9 +89,6 @@ abstract class AbstractSessionListener implements EventSubscriberInterface
}
}
- // Always remove the internal header if present
- $response->headers->remove(self::NO_AUTO_CACHE_CONTROL_HEADER);
-
if ($session->isStarted()) {
/*
* Saves the session, in case it is still open, before sending the response/headers.
diff --git a/vendor/symfony/http-kernel/EventListener/AbstractTestSessionListener.php b/vendor/symfony/http-kernel/EventListener/AbstractTestSessionListener.php
index 7f07e7f1..993c6ddf 100644
--- a/vendor/symfony/http-kernel/EventListener/AbstractTestSessionListener.php
+++ b/vendor/symfony/http-kernel/EventListener/AbstractTestSessionListener.php
@@ -30,6 +30,12 @@ use Symfony\Component\HttpKernel\KernelEvents;
abstract class AbstractTestSessionListener implements EventSubscriberInterface
{
private $sessionId;
+ private $sessionOptions;
+
+ public function __construct(array $sessionOptions = array())
+ {
+ $this->sessionOptions = $sessionOptions;
+ }
public function onKernelRequest(GetResponseEvent $event)
{
@@ -72,7 +78,12 @@ abstract class AbstractTestSessionListener implements EventSubscriberInterface
}
if ($session instanceof Session ? !$session->isEmpty() || (null !== $this->sessionId && $session->getId() !== $this->sessionId) : $wasStarted) {
- $params = session_get_cookie_params();
+ $params = session_get_cookie_params() + array('samesite' => null);
+ foreach ($this->sessionOptions as $k => $v) {
+ if (0 === strpos($k, 'cookie_')) {
+ $params[substr($k, 7)] = $v;
+ }
+ }
foreach ($event->getResponse()->headers->getCookies() as $cookie) {
if ($session->getName() === $cookie->getName() && $params['path'] === $cookie->getPath() && $params['domain'] == $cookie->getDomain()) {
@@ -80,7 +91,7 @@ abstract class AbstractTestSessionListener implements EventSubscriberInterface
}
}
- $event->getResponse()->headers->setCookie(new Cookie($session->getName(), $session->getId(), 0 === $params['lifetime'] ? 0 : time() + $params['lifetime'], $params['path'], $params['domain'], $params['secure'], $params['httponly']));
+ $event->getResponse()->headers->setCookie(new Cookie($session->getName(), $session->getId(), 0 === $params['lifetime'] ? 0 : time() + $params['lifetime'], $params['path'], $params['domain'], $params['secure'], $params['httponly'], false, $params['samesite'] ?: null));
$this->sessionId = $session->getId();
}
}
diff --git a/vendor/symfony/http-kernel/EventListener/ExceptionListener.php b/vendor/symfony/http-kernel/EventListener/ExceptionListener.php
index 559872a1..02b1d4dd 100644
--- a/vendor/symfony/http-kernel/EventListener/ExceptionListener.php
+++ b/vendor/symfony/http-kernel/EventListener/ExceptionListener.php
@@ -13,9 +13,11 @@ namespace Symfony\Component\HttpKernel\EventListener;
use Psr\Log\LoggerInterface;
use Symfony\Component\Debug\Exception\FlattenException;
+use Symfony\Component\Debug\ExceptionHandler;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent;
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
@@ -33,23 +35,39 @@ class ExceptionListener implements EventSubscriberInterface
protected $controller;
protected $logger;
protected $debug;
+ private $charset;
+ private $fileLinkFormat;
+ private $isTerminating = false;
- public function __construct($controller, LoggerInterface $logger = null, $debug = false)
+ public function __construct($controller, LoggerInterface $logger = null, $debug = false, string $charset = null, $fileLinkFormat = null)
{
$this->controller = $controller;
$this->logger = $logger;
$this->debug = $debug;
+ $this->charset = $charset;
+ $this->fileLinkFormat = $fileLinkFormat;
}
public function logKernelException(GetResponseForExceptionEvent $event)
{
- $exception = $event->getException();
+ $e = FlattenException::create($event->getException());
- $this->logException($exception, sprintf('Uncaught PHP Exception %s: "%s" at %s line %s', \get_class($exception), $exception->getMessage(), $exception->getFile(), $exception->getLine()));
+ $this->logException($event->getException(), sprintf('Uncaught PHP Exception %s: "%s" at %s line %s', $e->getClass(), $e->getMessage(), $e->getFile(), $e->getLine()));
}
public function onKernelException(GetResponseForExceptionEvent $event)
{
+ if (null === $this->controller) {
+ if (!$event->isMasterRequest()) {
+ return;
+ }
+ if (!$this->isTerminating) {
+ $this->isTerminating = true;
+
+ return;
+ }
+ $this->isTerminating = false;
+ }
$exception = $event->getException();
$request = $this->duplicateRequest($exception, $event->getRequest());
$eventDispatcher = \func_num_args() > 2 ? func_get_arg(2) : null;
@@ -57,7 +75,9 @@ class ExceptionListener implements EventSubscriberInterface
try {
$response = $event->getKernel()->handle($request, HttpKernelInterface::SUB_REQUEST, false);
} catch (\Exception $e) {
- $this->logException($e, sprintf('Exception thrown when handling an exception (%s: %s at %s line %s)', \get_class($e), $e->getMessage(), $e->getFile(), $e->getLine()));
+ $f = FlattenException::create($e);
+
+ $this->logException($e, sprintf('Exception thrown when handling an exception (%s: %s at %s line %s)', $f->getClass(), $f->getMessage(), $e->getFile(), $e->getLine()));
$wrapper = $e;
@@ -85,6 +105,11 @@ class ExceptionListener implements EventSubscriberInterface
}
}
+ public function reset()
+ {
+ $this->isTerminating = false;
+ }
+
public static function getSubscribedEvents()
{
return array(
@@ -118,13 +143,17 @@ class ExceptionListener implements EventSubscriberInterface
* @param \Exception $exception The thrown exception
* @param Request $request The original request
*
- * @return Request $request The cloned request
+ * @return Request The cloned request
*/
protected function duplicateRequest(\Exception $exception, Request $request)
{
$attributes = array(
- '_controller' => $this->controller,
- 'exception' => FlattenException::create($exception),
+ 'exception' => $exception = FlattenException::create($exception),
+ '_controller' => $this->controller ?: function () use ($exception) {
+ $handler = new ExceptionHandler($this->debug, $this->charset, $this->fileLinkFormat);
+
+ return new Response($handler->getHtml($exception), $exception->getStatusCode(), $exception->getHeaders());
+ },
'logger' => $this->logger instanceof DebugLoggerInterface ? $this->logger : null,
);
$request = $request->duplicate(null, null, $attributes);
diff --git a/vendor/symfony/http-kernel/EventListener/SessionListener.php b/vendor/symfony/http-kernel/EventListener/SessionListener.php
index 5ede7c3f..75624b6c 100644
--- a/vendor/symfony/http-kernel/EventListener/SessionListener.php
+++ b/vendor/symfony/http-kernel/EventListener/SessionListener.php
@@ -12,10 +12,15 @@
namespace Symfony\Component\HttpKernel\EventListener;
use Psr\Container\ContainerInterface;
+use Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage;
/**
* Sets the session in the request.
*
+ * When the passed container contains a "session_storage" entry which
+ * holds a NativeSessionStorage instance, the "cookie_secure" option
+ * will be set to true whenever the current master request is secure.
+ *
* @author Fabien Potencier
*
* @final
@@ -33,6 +38,13 @@ class SessionListener extends AbstractSessionListener
return;
}
+ if ($this->container->has('session_storage')
+ && ($storage = $this->container->get('session_storage')) instanceof NativeSessionStorage
+ && $this->container->get('request_stack')->getMasterRequest()->isSecure()
+ ) {
+ $storage->setOptions(array('cookie_secure' => true));
+ }
+
return $this->container->get('session');
}
}
diff --git a/vendor/symfony/http-kernel/EventListener/TestSessionListener.php b/vendor/symfony/http-kernel/EventListener/TestSessionListener.php
index f859d097..23589a2b 100644
--- a/vendor/symfony/http-kernel/EventListener/TestSessionListener.php
+++ b/vendor/symfony/http-kernel/EventListener/TestSessionListener.php
@@ -24,9 +24,10 @@ class TestSessionListener extends AbstractTestSessionListener
{
private $container;
- public function __construct(ContainerInterface $container)
+ public function __construct(ContainerInterface $container, array $sessionOptions = array())
{
$this->container = $container;
+ parent::__construct($sessionOptions);
}
protected function getSession()
diff --git a/vendor/symfony/http-kernel/EventListener/TranslatorListener.php b/vendor/symfony/http-kernel/EventListener/TranslatorListener.php
index 2a5fc712..e0b344e4 100644
--- a/vendor/symfony/http-kernel/EventListener/TranslatorListener.php
+++ b/vendor/symfony/http-kernel/EventListener/TranslatorListener.php
@@ -18,6 +18,7 @@ use Symfony\Component\HttpKernel\Event\FinishRequestEvent;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\Translation\TranslatorInterface;
+use Symfony\Contracts\Translation\LocaleAwareInterface;
/**
* Synchronizes the locale between the request and the translator.
@@ -29,8 +30,14 @@ class TranslatorListener implements EventSubscriberInterface
private $translator;
private $requestStack;
- public function __construct(TranslatorInterface $translator, RequestStack $requestStack)
+ /**
+ * @param LocaleAwareInterface $translator
+ */
+ public function __construct($translator, RequestStack $requestStack)
{
+ if (!$translator instanceof TranslatorInterface && !$translator instanceof LocaleAwareInterface) {
+ throw new \TypeError(sprintf('Argument 1 passed to %s() must be an instance of %s, %s given.', __METHOD__, LocaleAwareInterface::class, \is_object($translator) ? \get_class($translator) : \gettype($translator)));
+ }
$this->translator = $translator;
$this->requestStack = $requestStack;
}
diff --git a/vendor/symfony/http-kernel/Exception/ControllerDoesNotReturnResponseException.php b/vendor/symfony/http-kernel/Exception/ControllerDoesNotReturnResponseException.php
new file mode 100644
index 00000000..39149aa5
--- /dev/null
+++ b/vendor/symfony/http-kernel/Exception/ControllerDoesNotReturnResponseException.php
@@ -0,0 +1,78 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\HttpKernel\Exception;
+
+/**
+ * @author Grégoire Pineau
+ */
+class ControllerDoesNotReturnResponseException extends \LogicException
+{
+ public function __construct(string $message, callable $controller, string $file, int $line)
+ {
+ parent::__construct($message);
+
+ if (!$controllerDefinition = $this->parseControllerDefinition($controller)) {
+ return;
+ }
+
+ $this->file = $controllerDefinition['file'];
+ $this->line = $controllerDefinition['line'];
+ $r = new \ReflectionProperty(\Exception::class, 'trace');
+ $r->setAccessible(true);
+ $r->setValue($this, array_merge(array(
+ array(
+ 'line' => $line,
+ 'file' => $file,
+ ),
+ ), $this->getTrace()));
+ }
+
+ private function parseControllerDefinition(callable $controller): ?array
+ {
+ if (\is_string($controller) && false !== strpos($controller, '::')) {
+ $controller = explode('::', $controller);
+ }
+
+ if (\is_array($controller)) {
+ try {
+ $r = new \ReflectionMethod($controller[0], $controller[1]);
+
+ return array(
+ 'file' => $r->getFileName(),
+ 'line' => $r->getEndLine(),
+ );
+ } catch (\ReflectionException $e) {
+ return null;
+ }
+ }
+
+ if ($controller instanceof \Closure) {
+ $r = new \ReflectionFunction($controller);
+
+ return array(
+ 'file' => $r->getFileName(),
+ 'line' => $r->getEndLine(),
+ );
+ }
+
+ if (\is_object($controller)) {
+ $r = new \ReflectionClass($controller);
+
+ return array(
+ 'file' => $r->getFileName(),
+ 'line' => $r->getEndLine(),
+ );
+ }
+
+ return null;
+ }
+}
diff --git a/vendor/symfony/http-kernel/HttpCache/HttpCache.php b/vendor/symfony/http-kernel/HttpCache/HttpCache.php
index fa3be46c..6980745a 100644
--- a/vendor/symfony/http-kernel/HttpCache/HttpCache.php
+++ b/vendor/symfony/http-kernel/HttpCache/HttpCache.php
@@ -93,7 +93,7 @@ class HttpCache implements HttpKernelInterface, TerminableInterface
/**
* Gets the current store.
*
- * @return StoreInterface $store A StoreInterface instance
+ * @return StoreInterface A StoreInterface instance
*/
public function getStore()
{
diff --git a/vendor/symfony/http-kernel/HttpKernel.php b/vendor/symfony/http-kernel/HttpKernel.php
index 06d21005..7ed4118e 100644
--- a/vendor/symfony/http-kernel/HttpKernel.php
+++ b/vendor/symfony/http-kernel/HttpKernel.php
@@ -28,6 +28,7 @@ use Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent;
use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent;
use Symfony\Component\HttpKernel\Event\PostResponseEvent;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
+use Symfony\Component\HttpKernel\Exception\ControllerDoesNotReturnResponseException;
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
@@ -146,7 +147,7 @@ class HttpKernel implements HttpKernelInterface, TerminableInterface
$arguments = $event->getArguments();
// call controller
- $response = \call_user_func_array($controller, $arguments);
+ $response = $controller(...$arguments);
// view
if (!$response instanceof Response) {
@@ -156,13 +157,14 @@ class HttpKernel implements HttpKernelInterface, TerminableInterface
if ($event->hasResponse()) {
$response = $event->getResponse();
} else {
- $msg = sprintf('The controller must return a response (%s given).', $this->varToString($response));
+ $msg = sprintf('The controller must return a "Symfony\Component\HttpFoundation\Response" object but it returned %s.', $this->varToString($response));
// the user may have forgotten to return something
if (null === $response) {
$msg .= ' Did you forget to add a return statement somewhere in your controller?';
}
- throw new \LogicException($msg);
+
+ throw new ControllerDoesNotReturnResponseException($msg, $controller, __FILE__, __LINE__ - 17);
}
}
@@ -248,23 +250,26 @@ class HttpKernel implements HttpKernelInterface, TerminableInterface
}
}
+ /**
+ * Returns a human-readable string for the specified variable.
+ */
private function varToString($var): string
{
if (\is_object($var)) {
- return sprintf('Object(%s)', \get_class($var));
+ return sprintf('an object of type %s', \get_class($var));
}
if (\is_array($var)) {
$a = array();
foreach ($var as $k => $v) {
- $a[] = sprintf('%s => %s', $k, $this->varToString($v));
+ $a[] = sprintf('%s => ...', $k);
}
- return sprintf('Array(%s)', implode(', ', $a));
+ return sprintf('an array ([%s])', mb_substr(implode(', ', $a), 0, 255));
}
if (\is_resource($var)) {
- return sprintf('Resource(%s)', get_resource_type($var));
+ return sprintf('a resource (%s)', get_resource_type($var));
}
if (null === $var) {
@@ -272,11 +277,19 @@ class HttpKernel implements HttpKernelInterface, TerminableInterface
}
if (false === $var) {
- return 'false';
+ return 'a boolean value (false)';
}
if (true === $var) {
- return 'true';
+ return 'a boolean value (true)';
+ }
+
+ if (\is_string($var)) {
+ return sprintf('a string ("%s%s")', mb_substr($var, 0, 255), mb_strlen($var) > 255 ? '...' : '');
+ }
+
+ if (is_numeric($var)) {
+ return sprintf('a number (%s)', (string) $var);
}
return (string) $var;
diff --git a/vendor/symfony/http-kernel/Kernel.php b/vendor/symfony/http-kernel/Kernel.php
index 23e82059..d34beba4 100644
--- a/vendor/symfony/http-kernel/Kernel.php
+++ b/vendor/symfony/http-kernel/Kernel.php
@@ -16,6 +16,7 @@ use Symfony\Bridge\ProxyManager\LazyProxy\PhpDumper\ProxyDumper;
use Symfony\Component\Config\ConfigCache;
use Symfony\Component\Config\Loader\DelegatingLoader;
use Symfony\Component\Config\Loader\LoaderResolver;
+use Symfony\Component\Debug\DebugClassLoader;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\Compiler\PassConfig;
use Symfony\Component\DependencyInjection\ContainerBuilder;
@@ -41,6 +42,9 @@ use Symfony\Component\HttpKernel\DependencyInjection\MergeExtensionConfiguration
*
* It manages an environment made of bundles.
*
+ * Environment names must always start with a letter and
+ * they must only contain letters and numbers.
+ *
* @author Fabien Potencier
*/
abstract class Kernel implements KernelInterface, RebootableInterface, TerminableInterface
@@ -51,10 +55,16 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
protected $bundles = array();
protected $container;
+ /**
+ * @deprecated since Symfony 4.2
+ */
protected $rootDir;
protected $environment;
protected $debug;
protected $booted = false;
+ /**
+ * @deprecated since Symfony 4.2
+ */
protected $name;
protected $startTime;
@@ -63,22 +73,22 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
private $requestStackSize = 0;
private $resetServices = false;
- const VERSION = '4.1.6';
- const VERSION_ID = 40106;
+ const VERSION = '4.2.1';
+ const VERSION_ID = 40201;
const MAJOR_VERSION = 4;
- const MINOR_VERSION = 1;
- const RELEASE_VERSION = 6;
+ const MINOR_VERSION = 2;
+ const RELEASE_VERSION = 1;
const EXTRA_VERSION = '';
- const END_OF_MAINTENANCE = '01/2019';
- const END_OF_LIFE = '07/2019';
+ const END_OF_MAINTENANCE = '07/2019';
+ const END_OF_LIFE = '01/2020';
public function __construct(string $environment, bool $debug)
{
$this->environment = $environment;
$this->debug = $debug;
- $this->rootDir = $this->getRootDir();
- $this->name = $this->getName();
+ $this->rootDir = $this->getRootDir(false);
+ $this->name = $this->getName(false);
}
public function __clone()
@@ -215,7 +225,10 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
public function getBundle($name)
{
if (!isset($this->bundles[$name])) {
- throw new \InvalidArgumentException(sprintf('Bundle "%s" does not exist or it is not enabled. Maybe you forgot to add it in the registerBundles() method of your %s.php file?', $name, \get_class($this)));
+ $class = \get_class($this);
+ $class = 'c' === $class[0] && 0 === strpos($class, "class@anonymous\0") ? get_parent_class($class).'@anonymous' : $class;
+
+ throw new \InvalidArgumentException(sprintf('Bundle "%s" does not exist or it is not enabled. Maybe you forgot to add it in the registerBundles() method of your %s.php file?', $name, $class));
}
return $this->bundles[$name];
@@ -244,15 +257,10 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
$isResource = 0 === strpos($path, 'Resources') && null !== $dir;
$overridePath = substr($path, 9);
- $resourceBundle = null;
$bundle = $this->getBundle($bundleName);
$files = array();
if ($isResource && file_exists($file = $dir.'/'.$bundle->getName().$overridePath)) {
- if (null !== $resourceBundle) {
- throw new \RuntimeException(sprintf('"%s" resource is hidden by a resource from the "%s" derived bundle. Create a "%s" file to override the bundle resource.', $file, $resourceBundle, $dir.'/'.$bundle->getName().$overridePath));
- }
-
$files[] = $file;
}
@@ -261,7 +269,6 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
return $file;
}
$files[] = $file;
- $resourceBundle = $bundle->getName();
}
if (\count($files) > 0) {
@@ -273,9 +280,15 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
/**
* {@inheritdoc}
+ *
+ * @deprecated since Symfony 4.2
*/
- public function getName()
+ public function getName(/* $triggerDeprecation = true */)
{
+ if (0 === \func_num_args() || func_get_arg(0)) {
+ @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.2.', __METHOD__), E_USER_DEPRECATED);
+ }
+
if (null === $this->name) {
$this->name = preg_replace('/[^a-zA-Z0-9_]+/', '', basename($this->rootDir));
if (ctype_digit($this->name[0])) {
@@ -304,9 +317,15 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
/**
* {@inheritdoc}
+ *
+ * @deprecated since Symfony 4.2, use getProjectDir() instead
*/
- public function getRootDir()
+ public function getRootDir(/* $triggerDeprecation = true */)
{
+ if (0 === \func_num_args() || func_get_arg(0)) {
+ @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.2, use getProjectDir() instead.', __METHOD__), E_USER_DEPRECATED);
+ }
+
if (null === $this->rootDir) {
$r = new \ReflectionObject($this);
$this->rootDir = \dirname($r->getFileName());
@@ -366,7 +385,7 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
*/
public function getCacheDir()
{
- return $this->rootDir.'/cache/'.$this->environment;
+ return $this->getProjectDir().'/var/cache/'.$this->environment;
}
/**
@@ -374,7 +393,7 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
*/
public function getLogDir()
{
- return $this->rootDir.'/logs';
+ return $this->getProjectDir().'/var/log';
}
/**
@@ -427,7 +446,10 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
*/
protected function getContainerClass()
{
- return $this->name.ucfirst($this->environment).($this->debug ? 'Debug' : '').'ProjectContainer';
+ $class = \get_class($this);
+ $class = 'c' === $class[0] && 0 === strpos($class, "class@anonymous\0") ? get_parent_class($class).ContainerBuilder::hash($class) : $class;
+
+ return $this->name.str_replace('\\', '_', $class).ucfirst($this->environment).($this->debug ? 'Debug' : '').'Container';
}
/**
@@ -489,7 +511,7 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
return;
}
- $backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 3);
+ $backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 5);
// Clean the trace by removing first frames added by the error handler itself.
for ($i = 0; isset($backtrace[$i]); ++$i) {
if (isset($backtrace[$i]['file'], $backtrace[$i]['line']) && $backtrace[$i]['line'] === $line && $backtrace[$i]['file'] === $file) {
@@ -497,13 +519,20 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
break;
}
}
+ // Remove frames added by DebugClassLoader.
+ for ($i = \count($backtrace) - 2; 0 < $i; --$i) {
+ if (DebugClassLoader::class === ($backtrace[$i]['class'] ?? null)) {
+ $backtrace = array($backtrace[$i + 1]);
+ break;
+ }
+ }
$collectedLogs[$message] = array(
'type' => $type,
'message' => $message,
'file' => $file,
'line' => $line,
- 'trace' => $backtrace,
+ 'trace' => array($backtrace[0]),
'count' => 1,
);
});
@@ -578,10 +607,16 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
}
return array(
+ /*
+ * @deprecated since Symfony 4.2, use kernel.project_dir instead
+ */
'kernel.root_dir' => realpath($this->rootDir) ?: $this->rootDir,
'kernel.project_dir' => realpath($this->getProjectDir()) ?: $this->getProjectDir(),
'kernel.environment' => $this->environment,
'kernel.debug' => $this->debug,
+ /*
+ * @deprecated since Symfony 4.2
+ */
'kernel.name' => $this->name,
'kernel.cache_dir' => realpath($cacheDir = $this->warmupDir ?: $this->getCacheDir()) ?: $cacheDir,
'kernel.logs_dir' => realpath($this->getLogDir()) ?: $this->getLogDir(),
diff --git a/vendor/symfony/http-kernel/KernelInterface.php b/vendor/symfony/http-kernel/KernelInterface.php
index 485f3bf8..93c4190b 100644
--- a/vendor/symfony/http-kernel/KernelInterface.php
+++ b/vendor/symfony/http-kernel/KernelInterface.php
@@ -21,6 +21,8 @@ use Symfony\Component\HttpKernel\Bundle\BundleInterface;
* It manages an environment made of application kernel and bundles.
*
* @author Fabien Potencier
+ *
+ * @method string getProjectDir() Gets the project dir (path of the project's composer file) - not defining it is deprecated since Symfony 4.2
*/
interface KernelInterface extends HttpKernelInterface, \Serializable
{
@@ -100,6 +102,8 @@ interface KernelInterface extends HttpKernelInterface, \Serializable
* Gets the name of the kernel.
*
* @return string The kernel name
+ *
+ * @deprecated since Symfony 4.2
*/
public function getName();
@@ -121,6 +125,8 @@ interface KernelInterface extends HttpKernelInterface, \Serializable
* Gets the application root dir (path of the project's Kernel class).
*
* @return string The Kernel root dir
+ *
+ * @deprecated since Symfony 4.2
*/
public function getRootDir();
diff --git a/vendor/symfony/http-kernel/Profiler/Profiler.php b/vendor/symfony/http-kernel/Profiler/Profiler.php
index b4b0681b..809a3396 100644
--- a/vendor/symfony/http-kernel/Profiler/Profiler.php
+++ b/vendor/symfony/http-kernel/Profiler/Profiler.php
@@ -17,13 +17,14 @@ use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\DataCollector\DataCollectorInterface;
use Symfony\Component\HttpKernel\DataCollector\LateDataCollectorInterface;
+use Symfony\Contracts\Service\ResetInterface;
/**
* Profiler.
*
* @author Fabien Potencier
*/
-class Profiler
+class Profiler implements ResetInterface
{
private $storage;
diff --git a/vendor/symfony/http-kernel/Profiler/ProfilerStorageInterface.php b/vendor/symfony/http-kernel/Profiler/ProfilerStorageInterface.php
index 544fb1fe..b78bae84 100644
--- a/vendor/symfony/http-kernel/Profiler/ProfilerStorageInterface.php
+++ b/vendor/symfony/http-kernel/Profiler/ProfilerStorageInterface.php
@@ -14,6 +14,14 @@ namespace Symfony\Component\HttpKernel\Profiler;
/**
* ProfilerStorageInterface.
*
+ * This interface exists for historical reasons. The only supported
+ * implementation is FileProfilerStorage.
+ *
+ * As the profiler must only be used on non-production servers, the file storage
+ * is more than enough and no other implementations will ever be supported.
+ *
+ * @internal since 4.2
+ *
* @author Fabien Potencier
*/
interface ProfilerStorageInterface
diff --git a/vendor/symfony/http-kernel/Tests/CacheClearer/ChainCacheClearerTest.php b/vendor/symfony/http-kernel/Tests/CacheClearer/ChainCacheClearerTest.php
index 06400b44..5f09e4b2 100644
--- a/vendor/symfony/http-kernel/Tests/CacheClearer/ChainCacheClearerTest.php
+++ b/vendor/symfony/http-kernel/Tests/CacheClearer/ChainCacheClearerTest.php
@@ -20,7 +20,7 @@ class ChainCacheClearerTest extends TestCase
public static function setUpBeforeClass()
{
- self::$cacheDir = tempnam(sys_get_temp_dir(), 'sf2_cache_clearer_dir');
+ self::$cacheDir = tempnam(sys_get_temp_dir(), 'sf_cache_clearer_dir');
}
public static function tearDownAfterClass()
diff --git a/vendor/symfony/http-kernel/Tests/CacheWarmer/CacheWarmerAggregateTest.php b/vendor/symfony/http-kernel/Tests/CacheWarmer/CacheWarmerAggregateTest.php
index cfa998c1..09ba7020 100644
--- a/vendor/symfony/http-kernel/Tests/CacheWarmer/CacheWarmerAggregateTest.php
+++ b/vendor/symfony/http-kernel/Tests/CacheWarmer/CacheWarmerAggregateTest.php
@@ -20,7 +20,7 @@ class CacheWarmerAggregateTest extends TestCase
public static function setUpBeforeClass()
{
- self::$cacheDir = tempnam(sys_get_temp_dir(), 'sf2_cache_warmer_dir');
+ self::$cacheDir = tempnam(sys_get_temp_dir(), 'sf_cache_warmer_dir');
}
public static function tearDownAfterClass()
diff --git a/vendor/symfony/http-kernel/Tests/CacheWarmer/CacheWarmerTest.php b/vendor/symfony/http-kernel/Tests/CacheWarmer/CacheWarmerTest.php
index 4d34e7bf..cee8b550 100644
--- a/vendor/symfony/http-kernel/Tests/CacheWarmer/CacheWarmerTest.php
+++ b/vendor/symfony/http-kernel/Tests/CacheWarmer/CacheWarmerTest.php
@@ -20,7 +20,7 @@ class CacheWarmerTest extends TestCase
public static function setUpBeforeClass()
{
- self::$cacheFile = tempnam(sys_get_temp_dir(), 'sf2_cache_warmer_dir');
+ self::$cacheFile = tempnam(sys_get_temp_dir(), 'sf_cache_warmer_dir');
}
public static function tearDownAfterClass()
diff --git a/vendor/symfony/http-kernel/Tests/ClientTest.php b/vendor/symfony/http-kernel/Tests/ClientTest.php
index 17cbe368..4ce3670a 100644
--- a/vendor/symfony/http-kernel/Tests/ClientTest.php
+++ b/vendor/symfony/http-kernel/Tests/ClientTest.php
@@ -61,13 +61,13 @@ class ClientTest extends TestCase
$m->setAccessible(true);
$response = new Response();
- $response->headers->setCookie($cookie1 = new Cookie('foo', 'bar', \DateTime::createFromFormat('j-M-Y H:i:s T', '15-Feb-2009 20:00:00 GMT')->format('U'), '/foo', 'http://example.com', true, true));
+ $response->headers->setCookie($cookie1 = new Cookie('foo', 'bar', \DateTime::createFromFormat('j-M-Y H:i:s T', '15-Feb-2009 20:00:00 GMT')->format('U'), '/foo', 'http://example.com', true, true, false, null));
$domResponse = $m->invoke($client, $response);
$this->assertSame((string) $cookie1, $domResponse->getHeader('Set-Cookie'));
$response = new Response();
- $response->headers->setCookie($cookie1 = new Cookie('foo', 'bar', \DateTime::createFromFormat('j-M-Y H:i:s T', '15-Feb-2009 20:00:00 GMT')->format('U'), '/foo', 'http://example.com', true, true));
- $response->headers->setCookie($cookie2 = new Cookie('foo1', 'bar1', \DateTime::createFromFormat('j-M-Y H:i:s T', '15-Feb-2009 20:00:00 GMT')->format('U'), '/foo', 'http://example.com', true, true));
+ $response->headers->setCookie($cookie1 = new Cookie('foo', 'bar', \DateTime::createFromFormat('j-M-Y H:i:s T', '15-Feb-2009 20:00:00 GMT')->format('U'), '/foo', 'http://example.com', true, true, false, null));
+ $response->headers->setCookie($cookie2 = new Cookie('foo1', 'bar1', \DateTime::createFromFormat('j-M-Y H:i:s T', '15-Feb-2009 20:00:00 GMT')->format('U'), '/foo', 'http://example.com', true, true, false, null));
$domResponse = $m->invoke($client, $response);
$this->assertSame((string) $cookie1, $domResponse->getHeader('Set-Cookie'));
$this->assertSame(array((string) $cookie1, (string) $cookie2), $domResponse->getHeader('Set-Cookie', false));
diff --git a/vendor/symfony/http-kernel/Tests/Controller/ContainerControllerResolverTest.php b/vendor/symfony/http-kernel/Tests/Controller/ContainerControllerResolverTest.php
index 57414d00..1a144eee 100644
--- a/vendor/symfony/http-kernel/Tests/Controller/ContainerControllerResolverTest.php
+++ b/vendor/symfony/http-kernel/Tests/Controller/ContainerControllerResolverTest.php
@@ -19,10 +19,6 @@ use Symfony\Component\HttpKernel\Controller\ContainerControllerResolver;
class ContainerControllerResolverTest extends ControllerResolverTest
{
- /**
- * @group legacy
- * @expectedDeprecation Referencing controllers with a single colon is deprecated since Symfony 4.1. Use foo::action instead.
- */
public function testGetControllerServiceWithSingleColon()
{
$service = new ControllerTestService('foo');
diff --git a/vendor/symfony/http-kernel/Tests/DataCollector/ConfigDataCollectorTest.php b/vendor/symfony/http-kernel/Tests/DataCollector/ConfigDataCollectorTest.php
index a99e34ad..10b05858 100644
--- a/vendor/symfony/http-kernel/Tests/DataCollector/ConfigDataCollectorTest.php
+++ b/vendor/symfony/http-kernel/Tests/DataCollector/ConfigDataCollectorTest.php
@@ -30,7 +30,6 @@ class ConfigDataCollectorTest extends TestCase
$this->assertSame('test', $c->getEnv());
$this->assertTrue($c->isDebug());
$this->assertSame('config', $c->getName());
- $this->assertSame('testkernel', $c->getAppName());
$this->assertRegExp('~^'.preg_quote($c->getPhpVersion(), '~').'~', PHP_VERSION);
$this->assertRegExp('~'.preg_quote((string) $c->getPhpVersionExtra(), '~').'$~', PHP_VERSION);
$this->assertSame(PHP_INT_SIZE * 8, $c->getPhpArchitecture());
@@ -39,18 +38,29 @@ class ConfigDataCollectorTest extends TestCase
$this->assertSame(Kernel::VERSION, $c->getSymfonyVersion());
$this->assertNull($c->getToken());
$this->assertSame(\extension_loaded('xdebug'), $c->hasXDebug());
- $this->assertSame(\extension_loaded('Zend OPcache') && ini_get('opcache.enable'), $c->hasZendOpcache());
- $this->assertSame(\extension_loaded('apcu') && ini_get('apc.enabled'), $c->hasApcu());
+ $this->assertSame(\extension_loaded('Zend OPcache') && filter_var(ini_get('opcache.enable'), FILTER_VALIDATE_BOOLEAN), $c->hasZendOpcache());
+ $this->assertSame(\extension_loaded('apcu') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN), $c->hasApcu());
}
-}
-class KernelForTest extends Kernel
-{
- public function getName()
+ /**
+ * @group legacy
+ * @expectedDeprecation The "$name" argument in method "Symfony\Component\HttpKernel\DataCollector\ConfigDataCollector::__construct()" is deprecated since Symfony 4.2.
+ * @expectedDeprecation The "$version" argument in method "Symfony\Component\HttpKernel\DataCollector\ConfigDataCollector::__construct()" is deprecated since Symfony 4.2.
+ * @expectedDeprecation The method "Symfony\Component\HttpKernel\DataCollector\ConfigDataCollector::getApplicationName()" is deprecated since Symfony 4.2.
+ * @expectedDeprecation The method "Symfony\Component\HttpKernel\DataCollector\ConfigDataCollector::getApplicationVersion()" is deprecated since Symfony 4.2.
+ */
+ public function testLegacy()
{
- return 'testkernel';
+ $c = new ConfigDataCollector('name', null);
+ $c->collect(new Request(), new Response());
+
+ $this->assertSame('name', $c->getApplicationName());
+ $this->assertNull($c->getApplicationVersion());
}
+}
+class KernelForTest extends Kernel
+{
public function registerBundles()
{
}
diff --git a/vendor/symfony/http-kernel/Tests/DataCollector/RequestDataCollectorTest.php b/vendor/symfony/http-kernel/Tests/DataCollector/RequestDataCollectorTest.php
index cce08e27..24904f7c 100644
--- a/vendor/symfony/http-kernel/Tests/DataCollector/RequestDataCollectorTest.php
+++ b/vendor/symfony/http-kernel/Tests/DataCollector/RequestDataCollectorTest.php
@@ -225,6 +225,8 @@ class RequestDataCollectorTest extends TestCase
$cookie = $this->getCookieByName($response, 'sf_redirect');
$this->assertNotEmpty($cookie->getValue());
+ $this->assertSame('lax', $cookie->getSameSite());
+ $this->assertFalse($cookie->isSecure());
}
public function testItCollectsTheRedirectionAndClearTheCookie()
@@ -274,9 +276,9 @@ class RequestDataCollectorTest extends TestCase
$response->setStatusCode(200);
$response->headers->set('Content-Type', 'application/json');
$response->headers->set('X-Foo-Bar', null);
- $response->headers->setCookie(new Cookie('foo', 'bar', 1, '/foo', 'localhost', true, true));
- $response->headers->setCookie(new Cookie('bar', 'foo', new \DateTime('@946684800')));
- $response->headers->setCookie(new Cookie('bazz', 'foo', '2000-12-12'));
+ $response->headers->setCookie(new Cookie('foo', 'bar', 1, '/foo', 'localhost', true, true, false, null));
+ $response->headers->setCookie(new Cookie('bar', 'foo', new \DateTime('@946684800'), '/', null, false, true, false, null));
+ $response->headers->setCookie(new Cookie('bazz', 'foo', '2000-12-12', '/', null, false, true, false, null));
return $response;
}
diff --git a/vendor/symfony/http-kernel/Tests/DependencyInjection/RegisterControllerArgumentLocatorsPassTest.php b/vendor/symfony/http-kernel/Tests/DependencyInjection/RegisterControllerArgumentLocatorsPassTest.php
index 6c036e88..d03ea53a 100644
--- a/vendor/symfony/http-kernel/Tests/DependencyInjection/RegisterControllerArgumentLocatorsPassTest.php
+++ b/vendor/symfony/http-kernel/Tests/DependencyInjection/RegisterControllerArgumentLocatorsPassTest.php
@@ -149,7 +149,7 @@ class RegisterControllerArgumentLocatorsPassTest extends TestCase
$this->assertSame(ServiceLocator::class, $locator->getClass());
$this->assertFalse($locator->isPublic());
- $expected = array('bar' => new ServiceClosureArgument(new TypedReference(ControllerDummy::class, ControllerDummy::class, ContainerInterface::RUNTIME_EXCEPTION_ON_INVALID_REFERENCE)));
+ $expected = array('bar' => new ServiceClosureArgument(new TypedReference(ControllerDummy::class, ControllerDummy::class, ContainerInterface::RUNTIME_EXCEPTION_ON_INVALID_REFERENCE, 'bar')));
$this->assertEquals($expected, $locator->getArgument(0));
}
@@ -309,16 +309,23 @@ class RegisterControllerArgumentLocatorsPassTest extends TestCase
public function provideBindings()
{
- return array(array(ControllerDummy::class), array('$bar'));
+ return array(
+ array(ControllerDummy::class.'$bar'),
+ array(ControllerDummy::class),
+ array('$bar'),
+ );
}
- public function testBindScalarValueToControllerArgument()
+ /**
+ * @dataProvider provideBindScalarValueToControllerArgument
+ */
+ public function testBindScalarValueToControllerArgument($bindingKey)
{
$container = new ContainerBuilder();
$resolver = $container->register('argument_resolver.service')->addArgument(array());
$container->register('foo', ArgumentWithoutTypeController::class)
- ->setBindings(array('$someArg' => '%foo%'))
+ ->setBindings(array($bindingKey => '%foo%'))
->addTag('controller.service_arguments');
$container->setParameter('foo', 'foo_val');
@@ -341,6 +348,12 @@ class RegisterControllerArgumentLocatorsPassTest extends TestCase
$this->assertSame('foo_val', $container->get((string) $reference));
}
+ public function provideBindScalarValueToControllerArgument()
+ {
+ yield array('$someArg');
+ yield array('string $someArg');
+ }
+
public function testBindingsOnChildDefinitions()
{
$container = new ContainerBuilder();
@@ -420,7 +433,7 @@ class NonExistentClassOptionalController
class ArgumentWithoutTypeController
{
- public function fooAction($someArg)
+ public function fooAction(string $someArg)
{
}
}
diff --git a/vendor/symfony/http-kernel/Tests/EventListener/ExceptionListenerTest.php b/vendor/symfony/http-kernel/Tests/EventListener/ExceptionListenerTest.php
index 5743696c..5251976e 100644
--- a/vendor/symfony/http-kernel/Tests/EventListener/ExceptionListenerTest.php
+++ b/vendor/symfony/http-kernel/Tests/EventListener/ExceptionListenerTest.php
@@ -155,6 +155,25 @@ class ExceptionListenerTest extends TestCase
$this->assertFalse($response->headers->has('content-security-policy'), 'CSP header has been removed');
$this->assertFalse($dispatcher->hasListeners(KernelEvents::RESPONSE), 'CSP removal listener has been removed');
}
+
+ public function testNullController()
+ {
+ $listener = new ExceptionListener(null);
+ $kernel = $this->getMockBuilder(HttpKernelInterface::class)->getMock();
+ $kernel->expects($this->once())->method('handle')->will($this->returnCallback(function (Request $request) {
+ $controller = $request->attributes->get('_controller');
+
+ return $controller();
+ }));
+ $request = Request::create('/');
+ $event = new GetResponseForExceptionEvent($kernel, $request, HttpKernelInterface::MASTER_REQUEST, new \Exception('foo'));
+
+ $listener->onKernelException($event);
+ $this->assertNull($event->getResponse());
+
+ $listener->onKernelException($event);
+ $this->assertContains('Whoops, looks like something went wrong.', $event->getResponse()->getContent());
+ }
}
class TestLogger extends Logger implements DebugLoggerInterface
diff --git a/vendor/symfony/http-kernel/Tests/EventListener/SessionListenerTest.php b/vendor/symfony/http-kernel/Tests/EventListener/SessionListenerTest.php
index 03fb3763..e6255a56 100644
--- a/vendor/symfony/http-kernel/Tests/EventListener/SessionListenerTest.php
+++ b/vendor/symfony/http-kernel/Tests/EventListener/SessionListenerTest.php
@@ -106,17 +106,24 @@ class SessionListenerTest extends TestCase
$this->assertFalse($response->headers->has(AbstractSessionListener::NO_AUTO_CACHE_CONTROL_HEADER));
}
- public function testUninitilizedSession()
+ public function testUninitializedSession()
{
- $event = $this->getMockBuilder(FilterResponseEvent::class)->disableOriginalConstructor()->getMock();
- $event->expects($this->once())->method('isMasterRequest')->willReturn(true);
+ $kernel = $this->getMockBuilder(HttpKernelInterface::class)->disableOriginalConstructor()->getMock();
+ $response = new Response();
+ $response->setSharedMaxAge(60);
+ $response->headers->set(AbstractSessionListener::NO_AUTO_CACHE_CONTROL_HEADER, 'true');
$container = new ServiceLocator(array(
'initialized_session' => function () {},
));
$listener = new SessionListener($container);
- $listener->onKernelResponse($event);
+ $listener->onKernelResponse(new FilterResponseEvent($kernel, new Request(), HttpKernelInterface::MASTER_REQUEST, $response));
+ $this->assertTrue($response->headers->hasCacheControlDirective('public'));
+ $this->assertFalse($response->headers->hasCacheControlDirective('private'));
+ $this->assertFalse($response->headers->hasCacheControlDirective('must-revalidate'));
+ $this->assertSame('60', $response->headers->getCacheControlDirective('s-maxage'));
+ $this->assertFalse($response->headers->has(AbstractSessionListener::NO_AUTO_CACHE_CONTROL_HEADER));
}
public function testSurrogateMasterRequestIsPublic()
diff --git a/vendor/symfony/http-kernel/Tests/EventListener/TestSessionListenerTest.php b/vendor/symfony/http-kernel/Tests/EventListener/TestSessionListenerTest.php
index b06dca3c..cd52bd56 100644
--- a/vendor/symfony/http-kernel/Tests/EventListener/TestSessionListenerTest.php
+++ b/vendor/symfony/http-kernel/Tests/EventListener/TestSessionListenerTest.php
@@ -12,7 +12,6 @@
namespace Symfony\Component\HttpKernel\Tests\EventListener;
use PHPUnit\Framework\TestCase;
-use Symfony\Component\DependencyInjection\ServiceSubscriberInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Session\SessionInterface;
@@ -144,15 +143,6 @@ class TestSessionListenerTest extends TestCase
$this->filterResponse(new Request());
}
- public function testDoesNotImplementServiceSubscriberInterface()
- {
- $this->assertTrue(interface_exists(ServiceSubscriberInterface::class));
- $this->assertTrue(class_exists(SessionListener::class));
- $this->assertTrue(class_exists(TestSessionListener::class));
- $this->assertFalse(is_subclass_of(SessionListener::class, ServiceSubscriberInterface::class), 'Implementing ServiceSubscriberInterface would create a dep on the DI component, which eg Silex cannot afford');
- $this->assertFalse(is_subclass_of(TestSessionListener::class, ServiceSubscriberInterface::class, 'Implementing ServiceSubscriberInterface would create a dep on the DI component, which eg Silex cannot afford'));
- }
-
public function testDoesNotThrowIfRequestDoesNotHaveASession()
{
$kernel = $this->getMockBuilder('Symfony\Component\HttpKernel\HttpKernelInterface')->getMock();
diff --git a/vendor/symfony/http-kernel/Tests/EventListener/TranslatorListenerTest.php b/vendor/symfony/http-kernel/Tests/EventListener/TranslatorListenerTest.php
index 23b83317..b448f3bf 100644
--- a/vendor/symfony/http-kernel/Tests/EventListener/TranslatorListenerTest.php
+++ b/vendor/symfony/http-kernel/Tests/EventListener/TranslatorListenerTest.php
@@ -17,6 +17,7 @@ use Symfony\Component\HttpKernel\Event\FinishRequestEvent;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\HttpKernel\EventListener\TranslatorListener;
use Symfony\Component\HttpKernel\HttpKernelInterface;
+use Symfony\Contracts\Translation\LocaleAwareInterface;
class TranslatorListenerTest extends TestCase
{
@@ -26,7 +27,7 @@ class TranslatorListenerTest extends TestCase
protected function setUp()
{
- $this->translator = $this->getMockBuilder('Symfony\Component\Translation\TranslatorInterface')->getMock();
+ $this->translator = $this->getMockBuilder(LocaleAwareInterface::class)->getMock();
$this->requestStack = $this->getMockBuilder('Symfony\Component\HttpFoundation\RequestStack')->getMock();
$this->listener = new TranslatorListener($this->translator, $this->requestStack);
}
diff --git a/vendor/symfony/http-kernel/Tests/Fixtures/123/Kernel123.php b/vendor/symfony/http-kernel/Tests/Fixtures/123/Kernel123.php
deleted file mode 100644
index d3a76684..00000000
--- a/vendor/symfony/http-kernel/Tests/Fixtures/123/Kernel123.php
+++ /dev/null
@@ -1,37 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\HttpKernel\Tests\Fixtures\_123;
-
-use Symfony\Component\Config\Loader\LoaderInterface;
-use Symfony\Component\HttpKernel\Kernel;
-
-class Kernel123 extends Kernel
-{
- public function registerBundles()
- {
- return array();
- }
-
- public function registerContainerConfiguration(LoaderInterface $loader)
- {
- }
-
- public function getCacheDir()
- {
- return sys_get_temp_dir().'/'.Kernel::VERSION.'/kernel123/cache/'.$this->environment;
- }
-
- public function getLogDir()
- {
- return sys_get_temp_dir().'/'.Kernel::VERSION.'/kernel123/logs';
- }
-}
diff --git a/vendor/symfony/http-kernel/Tests/Fixtures/KernelForTest.php b/vendor/symfony/http-kernel/Tests/Fixtures/KernelForTest.php
index 9acee4ca..9734594b 100644
--- a/vendor/symfony/http-kernel/Tests/Fixtures/KernelForTest.php
+++ b/vendor/symfony/http-kernel/Tests/Fixtures/KernelForTest.php
@@ -34,4 +34,14 @@ class KernelForTest extends Kernel
{
return $this->booted;
}
+
+ public function getCacheDir()
+ {
+ return $this->getProjectDir().'/Tests/Fixtures/cache.'.$this->environment;
+ }
+
+ public function getLogDir()
+ {
+ return $this->getProjectDir().'/Tests/Fixtures/logs';
+ }
}
diff --git a/vendor/symfony/http-kernel/Tests/Fixtures/KernelWithoutBundles.php b/vendor/symfony/http-kernel/Tests/Fixtures/KernelWithoutBundles.php
index cee1b09f..0d0881d6 100644
--- a/vendor/symfony/http-kernel/Tests/Fixtures/KernelWithoutBundles.php
+++ b/vendor/symfony/http-kernel/Tests/Fixtures/KernelWithoutBundles.php
@@ -26,6 +26,11 @@ class KernelWithoutBundles extends Kernel
{
}
+ public function getProjectDir()
+ {
+ return __DIR__;
+ }
+
protected function build(ContainerBuilder $container)
{
$container->setParameter('test_executed', true);
diff --git a/vendor/symfony/http-kernel/Tests/Fragment/FragmentHandlerTest.php b/vendor/symfony/http-kernel/Tests/Fragment/FragmentHandlerTest.php
index a296aa0e..0dfaa796 100644
--- a/vendor/symfony/http-kernel/Tests/Fragment/FragmentHandlerTest.php
+++ b/vendor/symfony/http-kernel/Tests/Fragment/FragmentHandlerTest.php
@@ -88,7 +88,7 @@ class FragmentHandlerTest extends TestCase
;
if ($arguments) {
- \call_user_func_array(array($e, 'with'), $arguments);
+ $e->with(...$arguments);
}
$handler = new FragmentHandler($this->requestStack);
diff --git a/vendor/symfony/http-kernel/Tests/HttpCache/EsiTest.php b/vendor/symfony/http-kernel/Tests/HttpCache/EsiTest.php
index 863ad761..846caee4 100644
--- a/vendor/symfony/http-kernel/Tests/HttpCache/EsiTest.php
+++ b/vendor/symfony/http-kernel/Tests/HttpCache/EsiTest.php
@@ -234,7 +234,7 @@ class EsiTest extends TestCase
if (\is_array($response)) {
$cache->expects($this->any())
->method('handle')
- ->will(\call_user_func_array(array($this, 'onConsecutiveCalls'), $response))
+ ->will($this->onConsecutiveCalls(...$response))
;
} else {
$cache->expects($this->any())
diff --git a/vendor/symfony/http-kernel/Tests/HttpCache/SsiTest.php b/vendor/symfony/http-kernel/Tests/HttpCache/SsiTest.php
index 26ef6cb2..1f1fbf84 100644
--- a/vendor/symfony/http-kernel/Tests/HttpCache/SsiTest.php
+++ b/vendor/symfony/http-kernel/Tests/HttpCache/SsiTest.php
@@ -201,7 +201,7 @@ class SsiTest extends TestCase
if (\is_array($response)) {
$cache->expects($this->any())
->method('handle')
- ->will(\call_user_func_array(array($this, 'onConsecutiveCalls'), $response))
+ ->will($this->onConsecutiveCalls(...$response))
;
} else {
$cache->expects($this->any())
diff --git a/vendor/symfony/http-kernel/Tests/HttpKernelTest.php b/vendor/symfony/http-kernel/Tests/HttpKernelTest.php
index c5326a33..129fa704 100644
--- a/vendor/symfony/http-kernel/Tests/HttpKernelTest.php
+++ b/vendor/symfony/http-kernel/Tests/HttpKernelTest.php
@@ -23,6 +23,7 @@ use Symfony\Component\HttpKernel\Controller\ControllerResolverInterface;
use Symfony\Component\HttpKernel\Event\FilterControllerArgumentsEvent;
use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent;
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
+use Symfony\Component\HttpKernel\Exception\ControllerDoesNotReturnResponseException;
use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException;
use Symfony\Component\HttpKernel\HttpKernel;
use Symfony\Component\HttpKernel\HttpKernelInterface;
@@ -211,15 +212,23 @@ class HttpKernelTest extends TestCase
$this->assertResponseEquals(new Response('foo'), $kernel->handle(new Request()));
}
- /**
- * @expectedException \LogicException
- */
public function testHandleWhenTheControllerDoesNotReturnAResponse()
{
$dispatcher = new EventDispatcher();
$kernel = $this->getHttpKernel($dispatcher, function () { return 'foo'; });
- $kernel->handle(new Request());
+ try {
+ $kernel->handle(new Request());
+
+ $this->fail('The kernel should throw an exception.');
+ } catch (ControllerDoesNotReturnResponseException $e) {
+ }
+
+ $first = $e->getTrace()[0];
+
+ // `file` index the array starting at 0, and __FILE__ starts at 1
+ $line = file($first['file'])[$first['line'] - 2];
+ $this->assertContains('// call controller', $line);
}
public function testHandleWhenTheControllerDoesNotReturnAResponseButAViewIsRegistered()
@@ -265,7 +274,7 @@ class HttpKernelTest extends TestCase
$oldArguments = $event->getArguments();
$newController = function ($id) use ($oldController, $oldArguments) {
- $response = \call_user_func_array($oldController, $oldArguments);
+ $response = $oldController(...$oldArguments);
$response->headers->set('X-Id', $id);
diff --git a/vendor/symfony/http-kernel/Tests/KernelTest.php b/vendor/symfony/http-kernel/Tests/KernelTest.php
index 8926f208..2b581398 100644
--- a/vendor/symfony/http-kernel/Tests/KernelTest.php
+++ b/vendor/symfony/http-kernel/Tests/KernelTest.php
@@ -33,7 +33,7 @@ class KernelTest extends TestCase
public static function tearDownAfterClass()
{
$fs = new Filesystem();
- $fs->remove(__DIR__.'/Fixtures/cache');
+ $fs->remove(__DIR__.'/Fixtures/var');
}
public function testConstructor()
@@ -67,15 +67,15 @@ class KernelTest extends TestCase
public function testInitializeContainerClearsOldContainers()
{
$fs = new Filesystem();
- $legacyContainerDir = __DIR__.'/Fixtures/cache/custom/ContainerA123456';
+ $legacyContainerDir = __DIR__.'/Fixtures/var/cache/custom/ContainerA123456';
$fs->mkdir($legacyContainerDir);
touch($legacyContainerDir.'.legacy');
$kernel = new CustomProjectDirKernel();
$kernel->boot();
- $containerDir = __DIR__.'/Fixtures/cache/custom/'.substr(\get_class($kernel->getContainer()), 0, 16);
- $this->assertTrue(unlink(__DIR__.'/Fixtures/cache/custom/FixturesCustomDebugProjectContainer.php.meta'));
+ $containerDir = __DIR__.'/Fixtures/var/cache/custom/'.substr(\get_class($kernel->getContainer()), 0, 16);
+ $this->assertTrue(unlink(__DIR__.'/Fixtures/var/cache/custom/TestsSymfony_Component_HttpKernel_Tests_CustomProjectDirKernelCustomDebugContainer.php.meta'));
$this->assertFileExists($containerDir);
$this->assertFileNotExists($containerDir.'.legacy');
@@ -295,6 +295,9 @@ EOF;
$this->assertEquals($expected, $output);
}
+ /**
+ * @group legacy
+ */
public function testGetRootDir()
{
$kernel = new KernelForTest('test', true);
@@ -302,6 +305,9 @@ EOF;
$this->assertEquals(__DIR__.\DIRECTORY_SEPARATOR.'Fixtures', realpath($kernel->getRootDir()));
}
+ /**
+ * @group legacy
+ */
public function testGetName()
{
$kernel = new KernelForTest('test', true);
@@ -309,6 +315,9 @@ EOF;
$this->assertEquals('Fixtures', $kernel->getName());
}
+ /**
+ * @group legacy
+ */
public function testOverrideGetName()
{
$kernel = new KernelForOverrideName('test', true);
@@ -506,40 +515,32 @@ EOF;
$this->assertTrue($kernel->getContainer()->getParameter('test_executed'));
}
- public function testKernelRootDirNameStartingWithANumber()
- {
- $dir = __DIR__.'/Fixtures/123';
- require_once $dir.'/Kernel123.php';
- $kernel = new \Symfony\Component\HttpKernel\Tests\Fixtures\_123\Kernel123('dev', true);
- $this->assertEquals('_123', $kernel->getName());
- }
-
public function testProjectDirExtension()
{
$kernel = new CustomProjectDirKernel();
$kernel->boot();
- $this->assertSame('foo', $kernel->getProjectDir());
- $this->assertSame('foo', $kernel->getContainer()->getParameter('kernel.project_dir'));
+ $this->assertSame(__DIR__.'/Fixtures', $kernel->getProjectDir());
+ $this->assertSame(__DIR__.\DIRECTORY_SEPARATOR.'Fixtures', $kernel->getContainer()->getParameter('kernel.project_dir'));
}
public function testKernelReset()
{
- (new Filesystem())->remove(__DIR__.'/Fixtures/cache');
+ (new Filesystem())->remove(__DIR__.'/Fixtures/var/cache');
$kernel = new CustomProjectDirKernel();
$kernel->boot();
$containerClass = \get_class($kernel->getContainer());
$containerFile = (new \ReflectionClass($kernel->getContainer()))->getFileName();
- unlink(__DIR__.'/Fixtures/cache/custom/FixturesCustomDebugProjectContainer.php.meta');
+ unlink(__DIR__.'/Fixtures/var/cache/custom/TestsSymfony_Component_HttpKernel_Tests_CustomProjectDirKernelCustomDebugContainer.php.meta');
$kernel = new CustomProjectDirKernel();
$kernel->boot();
$this->assertInstanceOf($containerClass, $kernel->getContainer());
$this->assertFileExists($containerFile);
- unlink(__DIR__.'/Fixtures/cache/custom/FixturesCustomDebugProjectContainer.php.meta');
+ unlink(__DIR__.'/Fixtures/var/cache/custom/TestsSymfony_Component_HttpKernel_Tests_CustomProjectDirKernelCustomDebugContainer.php.meta');
$kernel = new CustomProjectDirKernel(function ($container) { $container->register('foo', 'stdClass')->setPublic(true); });
$kernel->boot();
@@ -707,11 +708,10 @@ class CustomProjectDirKernel extends Kernel
private $buildContainer;
private $httpKernel;
- public function __construct(\Closure $buildContainer = null, HttpKernelInterface $httpKernel = null, $name = 'custom')
+ public function __construct(\Closure $buildContainer = null, HttpKernelInterface $httpKernel = null, $env = 'custom')
{
- parent::__construct($name, true);
+ parent::__construct($env, true);
- $this->baseDir = 'foo';
$this->buildContainer = $buildContainer;
$this->httpKernel = $httpKernel;
}
@@ -726,11 +726,6 @@ class CustomProjectDirKernel extends Kernel
}
public function getProjectDir()
- {
- return $this->baseDir;
- }
-
- public function getRootDir()
{
return __DIR__.'/Fixtures';
}
diff --git a/vendor/symfony/http-kernel/Tests/Profiler/FileProfilerStorageTest.php b/vendor/symfony/http-kernel/Tests/Profiler/FileProfilerStorageTest.php
index a1db1d9c..e64c622c 100644
--- a/vendor/symfony/http-kernel/Tests/Profiler/FileProfilerStorageTest.php
+++ b/vendor/symfony/http-kernel/Tests/Profiler/FileProfilerStorageTest.php
@@ -22,7 +22,7 @@ class FileProfilerStorageTest extends TestCase
protected function setUp()
{
- $this->tmpDir = sys_get_temp_dir().'/sf2_profiler_file_storage';
+ $this->tmpDir = sys_get_temp_dir().'/sf_profiler_file_storage';
if (is_dir($this->tmpDir)) {
self::cleanDir();
}
diff --git a/vendor/symfony/http-kernel/Tests/Profiler/ProfilerTest.php b/vendor/symfony/http-kernel/Tests/Profiler/ProfilerTest.php
index cff133c1..2f7e8dd2 100644
--- a/vendor/symfony/http-kernel/Tests/Profiler/ProfilerTest.php
+++ b/vendor/symfony/http-kernel/Tests/Profiler/ProfilerTest.php
@@ -84,7 +84,7 @@ class ProfilerTest extends TestCase
protected function setUp()
{
- $this->tmp = tempnam(sys_get_temp_dir(), 'sf2_profiler');
+ $this->tmp = tempnam(sys_get_temp_dir(), 'sf_profiler');
if (file_exists($this->tmp)) {
@unlink($this->tmp);
}
diff --git a/vendor/symfony/http-kernel/composer.json b/vendor/symfony/http-kernel/composer.json
index 4d7ab116..1e5684d5 100644
--- a/vendor/symfony/http-kernel/composer.json
+++ b/vendor/symfony/http-kernel/composer.json
@@ -17,6 +17,7 @@
],
"require": {
"php": "^7.1.3",
+ "symfony/contracts": "^1.0.2",
"symfony/event-dispatcher": "~4.1",
"symfony/http-foundation": "^4.1.1",
"symfony/debug": "~3.4|~4.0",
@@ -28,7 +29,7 @@
"symfony/config": "~3.4|~4.0",
"symfony/console": "~3.4|~4.0",
"symfony/css-selector": "~3.4|~4.0",
- "symfony/dependency-injection": "^4.1",
+ "symfony/dependency-injection": "^4.2",
"symfony/dom-crawler": "~3.4|~4.0",
"symfony/expression-language": "~3.4|~4.0",
"symfony/finder": "~3.4|~4.0",
@@ -36,7 +37,7 @@
"symfony/routing": "~3.4|~4.0",
"symfony/stopwatch": "~3.4|~4.0",
"symfony/templating": "~3.4|~4.0",
- "symfony/translation": "~3.4|~4.0",
+ "symfony/translation": "~4.2",
"symfony/var-dumper": "^4.1.1",
"psr/cache": "~1.0"
},
@@ -45,7 +46,8 @@
},
"conflict": {
"symfony/config": "<3.4",
- "symfony/dependency-injection": "<4.1",
+ "symfony/dependency-injection": "<4.2",
+ "symfony/translation": "<4.2",
"symfony/var-dumper": "<4.1.1",
"twig/twig": "<1.34|<2.4,>=2"
},
@@ -65,7 +67,7 @@
"minimum-stability": "dev",
"extra": {
"branch-alias": {
- "dev-master": "4.1-dev"
+ "dev-master": "4.2-dev"
}
}
}
diff --git a/vendor/symfony/http-kernel/phpunit.xml.dist b/vendor/symfony/http-kernel/phpunit.xml.dist
index e0de769d..3fc07707 100644
--- a/vendor/symfony/http-kernel/phpunit.xml.dist
+++ b/vendor/symfony/http-kernel/phpunit.xml.dist
@@ -1,7 +1,7 @@
get, 'normalizers', $option, sprintf('No normalizer was set for the "%s" option.', $option));
}
+
+ /**
+ * @return string|\Closure
+ *
+ * @throws NoConfigurationException on no configured deprecation
+ */
+ public function getDeprecationMessage(string $option)
+ {
+ return \call_user_func($this->get, 'deprecated', $option, sprintf('No deprecation was set for the "%s" option.', $option));
+ }
}
diff --git a/vendor/symfony/options-resolver/Exception/ExceptionInterface.php b/vendor/symfony/options-resolver/Exception/ExceptionInterface.php
index b62bb51d..ea99d050 100644
--- a/vendor/symfony/options-resolver/Exception/ExceptionInterface.php
+++ b/vendor/symfony/options-resolver/Exception/ExceptionInterface.php
@@ -16,6 +16,6 @@ namespace Symfony\Component\OptionsResolver\Exception;
*
* @author Bernhard Schussek
*/
-interface ExceptionInterface
+interface ExceptionInterface extends \Throwable
{
}
diff --git a/vendor/symfony/options-resolver/Options.php b/vendor/symfony/options-resolver/Options.php
index d444ec42..d18374cb 100644
--- a/vendor/symfony/options-resolver/Options.php
+++ b/vendor/symfony/options-resolver/Options.php
@@ -16,6 +16,8 @@ namespace Symfony\Component\OptionsResolver;
*
* @author Bernhard Schussek
* @author Tobias Schultze
+ *
+ * @method mixed offsetGet(string $option, bool $triggerDeprecation = true)
*/
interface Options extends \ArrayAccess, \Countable
{
diff --git a/vendor/symfony/options-resolver/OptionsResolver.php b/vendor/symfony/options-resolver/OptionsResolver.php
index 5dd026f7..5d238f50 100644
--- a/vendor/symfony/options-resolver/OptionsResolver.php
+++ b/vendor/symfony/options-resolver/OptionsResolver.php
@@ -12,6 +12,7 @@
namespace Symfony\Component\OptionsResolver;
use Symfony\Component\OptionsResolver\Exception\AccessException;
+use Symfony\Component\OptionsResolver\Exception\InvalidArgumentException;
use Symfony\Component\OptionsResolver\Exception\InvalidOptionsException;
use Symfony\Component\OptionsResolver\Exception\MissingOptionsException;
use Symfony\Component\OptionsResolver\Exception\NoSuchOptionException;
@@ -36,6 +37,13 @@ class OptionsResolver implements Options
*/
private $defaults = array();
+ /**
+ * A list of closure for nested options.
+ *
+ * @var \Closure[][]
+ */
+ private $nested = array();
+
/**
* The names of required options.
*/
@@ -75,6 +83,16 @@ class OptionsResolver implements Options
*/
private $calling = array();
+ /**
+ * A list of deprecated options.
+ */
+ private $deprecated = array();
+
+ /**
+ * The list of options provided by the user.
+ */
+ private $given = array();
+
/**
* Whether the instance is locked for reading.
*
@@ -124,6 +142,20 @@ class OptionsResolver implements Options
* is spread across different locations of your code, such as base and
* sub-classes.
*
+ * If you want to define nested options, you can pass a closure with the
+ * following signature:
+ *
+ * $options->setDefault('database', function (OptionsResolver $resolver) {
+ * $resolver->setDefined(array('dbname', 'host', 'port', 'user', 'pass'));
+ * }
+ *
+ * To get access to the parent options, add a second argument to the closure's
+ * signature:
+ *
+ * function (OptionsResolver $resolver, Options $parent) {
+ * // 'default' === $parent['connection']
+ * }
+ *
* @param string $option The name of the option
* @param mixed $value The default value of the option
*
@@ -161,15 +193,27 @@ class OptionsResolver implements Options
$this->lazy[$option][] = $value;
$this->defined[$option] = true;
- // Make sure the option is processed
- unset($this->resolved[$option]);
+ // Make sure the option is processed and is not nested anymore
+ unset($this->resolved[$option], $this->nested[$option]);
+
+ return $this;
+ }
+
+ if (isset($params[0]) && null !== ($class = $params[0]->getClass()) && self::class === $class->name && (!isset($params[1]) || (null !== ($class = $params[1]->getClass()) && Options::class === $class->name))) {
+ // Store closure for later evaluation
+ $this->nested[$option][] = $value;
+ $this->defaults[$option] = array();
+ $this->defined[$option] = true;
+
+ // Make sure the option is processed and is not lazy anymore
+ unset($this->resolved[$option], $this->lazy[$option]);
return $this;
}
}
- // This option is not lazy anymore
- unset($this->lazy[$option]);
+ // This option is not lazy nor nested anymore
+ unset($this->lazy[$option], $this->nested[$option]);
// Yet undefined options can be marked as resolved, because we only need
// to resolve options with lazy closures, normalizers or validation
@@ -348,6 +392,62 @@ class OptionsResolver implements Options
return array_keys($this->defined);
}
+ public function isNested(string $option): bool
+ {
+ return isset($this->nested[$option]);
+ }
+
+ /**
+ * Deprecates an option, allowed types or values.
+ *
+ * Instead of passing the message, you may also pass a closure with the
+ * following signature:
+ *
+ * function (Options $options, $value): string {
+ * // ...
+ * }
+ *
+ * The closure receives the value as argument and should return a string.
+ * Return an empty string to ignore the option deprecation.
+ *
+ * The closure is invoked when {@link resolve()} is called. The parameter
+ * passed to the closure is the value of the option after validating it
+ * and before normalizing it.
+ *
+ * @param string|\Closure $deprecationMessage
+ */
+ public function setDeprecated(string $option, $deprecationMessage = 'The option "%name%" is deprecated.'): self
+ {
+ if ($this->locked) {
+ throw new AccessException('Options cannot be deprecated from a lazy option or normalizer.');
+ }
+
+ if (!isset($this->defined[$option])) {
+ throw new UndefinedOptionsException(sprintf('The option "%s" does not exist, defined options are: "%s".', $option, implode('", "', array_keys($this->defined))));
+ }
+
+ if (!\is_string($deprecationMessage) && !$deprecationMessage instanceof \Closure) {
+ throw new InvalidArgumentException(sprintf('Invalid type for deprecation message argument, expected string or \Closure, but got "%s".', \gettype($deprecationMessage)));
+ }
+
+ // ignore if empty string
+ if ('' === $deprecationMessage) {
+ return $this;
+ }
+
+ $this->deprecated[$option] = $deprecationMessage;
+
+ // Make sure the option is processed
+ unset($this->resolved[$option]);
+
+ return $this;
+ }
+
+ public function isDeprecated(string $option): bool
+ {
+ return isset($this->deprecated[$option]);
+ }
+
/**
* Sets the normalizer for an option.
*
@@ -592,12 +692,14 @@ class OptionsResolver implements Options
$this->defined = array();
$this->defaults = array();
+ $this->nested = array();
$this->required = array();
$this->resolved = array();
$this->lazy = array();
$this->normalizers = array();
$this->allowedTypes = array();
$this->allowedValues = array();
+ $this->deprecated = array();
return $this;
}
@@ -647,6 +749,7 @@ class OptionsResolver implements Options
// Override options set by the user
foreach ($options as $option => $value) {
+ $clone->given[$option] = true;
$clone->defaults[$option] = $value;
unset($clone->resolved[$option], $clone->lazy[$option]);
}
@@ -675,7 +778,8 @@ class OptionsResolver implements Options
/**
* Returns the resolved value of an option.
*
- * @param string $option The option name
+ * @param string $option The option name
+ * @param bool $triggerDeprecation Whether to trigger the deprecation or not (true by default)
*
* @return mixed The option value
*
@@ -687,19 +791,25 @@ class OptionsResolver implements Options
* @throws OptionDefinitionException If there is a cyclic dependency between
* lazy options and/or normalizers
*/
- public function offsetGet($option)
+ public function offsetGet($option/*, bool $triggerDeprecation = true*/)
{
if (!$this->locked) {
throw new AccessException('Array access is only supported within closures of lazy options and normalizers.');
}
+ $triggerDeprecation = 1 === \func_num_args() || \func_get_arg(1);
+
// Shortcut for resolved options
- if (array_key_exists($option, $this->resolved)) {
+ if (isset($this->resolved[$option]) || array_key_exists($option, $this->resolved)) {
+ if ($triggerDeprecation && isset($this->deprecated[$option]) && (isset($this->given[$option]) || $this->calling) && \is_string($this->deprecated[$option])) {
+ @trigger_error(strtr($this->deprecated[$option], array('%name%' => $option)), E_USER_DEPRECATED);
+ }
+
return $this->resolved[$option];
}
// Check whether the option is set at all
- if (!array_key_exists($option, $this->defaults)) {
+ if (!isset($this->defaults[$option]) && !array_key_exists($option, $this->defaults)) {
if (!isset($this->defined[$option])) {
throw new NoSuchOptionException(sprintf('The option "%s" does not exist. Defined options are: "%s".', $option, implode('", "', array_keys($this->defined))));
}
@@ -709,6 +819,30 @@ class OptionsResolver implements Options
$value = $this->defaults[$option];
+ // Resolve the option if it is a nested definition
+ if (isset($this->nested[$option])) {
+ // If the closure is already being called, we have a cyclic dependency
+ if (isset($this->calling[$option])) {
+ throw new OptionDefinitionException(sprintf('The options "%s" have a cyclic dependency.', implode('", "', array_keys($this->calling))));
+ }
+
+ if (!\is_array($value)) {
+ throw new InvalidOptionsException(sprintf('The nested option "%s" with value %s is expected to be of type array, but is of type "%s".', $option, $this->formatValue($value), $this->formatTypeOf($value)));
+ }
+
+ // The following section must be protected from cyclic calls.
+ $this->calling[$option] = true;
+ try {
+ $resolver = new self();
+ foreach ($this->nested[$option] as $closure) {
+ $closure($resolver, $this);
+ }
+ $value = $resolver->resolve($value);
+ } finally {
+ unset($this->calling[$option]);
+ }
+ }
+
// Resolve the option if the default value is lazily evaluated
if (isset($this->lazy[$option])) {
// If the closure is already being called, we have a cyclic
@@ -738,7 +872,7 @@ class OptionsResolver implements Options
$invalidTypes = array();
foreach ($this->allowedTypes[$option] as $type) {
- $type = isset(self::$typeAliases[$type]) ? self::$typeAliases[$type] : $type;
+ $type = self::$typeAliases[$type] ?? $type;
if ($valid = $this->verifyTypes($type, $value, $invalidTypes)) {
break;
@@ -798,6 +932,32 @@ class OptionsResolver implements Options
}
}
+ // Check whether the option is deprecated
+ // and it is provided by the user or is being called from a lazy evaluation
+ if ($triggerDeprecation && isset($this->deprecated[$option]) && (isset($this->given[$option]) || ($this->calling && \is_string($this->deprecated[$option])))) {
+ $deprecationMessage = $this->deprecated[$option];
+
+ if ($deprecationMessage instanceof \Closure) {
+ // If the closure is already being called, we have a cyclic dependency
+ if (isset($this->calling[$option])) {
+ throw new OptionDefinitionException(sprintf('The options "%s" have a cyclic dependency.', implode('", "', array_keys($this->calling))));
+ }
+
+ $this->calling[$option] = true;
+ try {
+ if (!\is_string($deprecationMessage = $deprecationMessage($this, $value))) {
+ throw new InvalidOptionsException(sprintf('Invalid type for deprecation message, expected string but got "%s", return an empty string to ignore.', \gettype($deprecationMessage)));
+ }
+ } finally {
+ unset($this->calling[$option]);
+ }
+ }
+
+ if ('' !== $deprecationMessage) {
+ @trigger_error(strtr($deprecationMessage, array('%name%' => $option)), E_USER_DEPRECATED);
+ }
+ }
+
// Normalize the validated option
if (isset($this->normalizers[$option])) {
// If the closure is already being called, we have a cyclic
@@ -827,58 +987,33 @@ class OptionsResolver implements Options
return $value;
}
- private function verifyTypes(string $type, $value, array &$invalidTypes): bool
+ private function verifyTypes(string $type, $value, array &$invalidTypes, int $level = 0): bool
{
if (\is_array($value) && '[]' === substr($type, -2)) {
- return $this->verifyArrayType($type, $value, $invalidTypes);
- }
-
- if (self::isValueValidType($type, $value)) {
- return true;
- }
-
- if (!$invalidTypes) {
- $invalidTypes[$this->formatTypeOf($value, null)] = true;
- }
-
- return false;
- }
-
- private function verifyArrayType(string $type, array $value, array &$invalidTypes, int $level = 0): bool
- {
- $type = substr($type, 0, -2);
-
- $suffix = '[]';
- while (\strlen($suffix) <= $level * 2) {
- $suffix .= '[]';
- }
-
- if ('[]' === substr($type, -2)) {
- $success = true;
- foreach ($value as $item) {
- if (!\is_array($item)) {
- $invalidTypes[$this->formatTypeOf($item, null).$suffix] = true;
+ $type = substr($type, 0, -2);
+ foreach ($value as $val) {
+ if (!$this->verifyTypes($type, $val, $invalidTypes, $level + 1)) {
return false;
}
-
- if (!$this->verifyArrayType($type, $item, $invalidTypes, $level + 1)) {
- $success = false;
- }
}
- return $success;
+ return true;
}
- foreach ($value as $item) {
- if (!self::isValueValidType($type, $item)) {
- $invalidTypes[$this->formatTypeOf($item, $type).$suffix] = $value;
+ if (('null' === $type && null === $value) || (\function_exists($func = 'is_'.$type) && $func($value)) || $value instanceof $type) {
+ return true;
+ }
- return false;
+ if (!$invalidTypes) {
+ $suffix = '';
+ while (\strlen($suffix) < $level * 2) {
+ $suffix .= '[]';
}
+ $invalidTypes[$this->formatTypeOf($value).$suffix] = true;
}
- return true;
+ return false;
}
/**
@@ -944,40 +1079,13 @@ class OptionsResolver implements Options
/**
* Returns a string representation of the type of the value.
*
- * This method should be used if you pass the type of a value as
- * message parameter to a constraint violation. Note that such
- * parameters should usually not be included in messages aimed at
- * non-technical people.
- *
* @param mixed $value The value to return the type of
+ *
+ * @return string The type of the value
*/
- private function formatTypeOf($value, ?string $type): string
+ private function formatTypeOf($value): string
{
- $suffix = '';
-
- if (null !== $type && '[]' === substr($type, -2)) {
- $suffix = '[]';
- $type = substr($type, 0, -2);
- while ('[]' === substr($type, -2)) {
- $type = substr($type, 0, -2);
- $value = array_shift($value);
- if (!\is_array($value)) {
- break;
- }
- $suffix .= '[]';
- }
-
- if (\is_array($value)) {
- $subTypes = array();
- foreach ($value as $val) {
- $subTypes[$this->formatTypeOf($val, null)] = true;
- }
-
- return implode('|', array_keys($subTypes)).$suffix;
- }
- }
-
- return (\is_object($value) ? \get_class($value) : \gettype($value)).$suffix;
+ return \is_object($value) ? \get_class($value) : \gettype($value);
}
/**
@@ -1038,9 +1146,4 @@ class OptionsResolver implements Options
return implode(', ', $values);
}
-
- private static function isValueValidType(string $type, $value): bool
- {
- return (\function_exists($isFunction = 'is_'.$type) && $isFunction($value)) || $value instanceof $type;
- }
}
diff --git a/vendor/symfony/options-resolver/Tests/Debug/OptionsResolverIntrospectorTest.php b/vendor/symfony/options-resolver/Tests/Debug/OptionsResolverIntrospectorTest.php
index 7c4753ab..4bdce6f8 100644
--- a/vendor/symfony/options-resolver/Tests/Debug/OptionsResolverIntrospectorTest.php
+++ b/vendor/symfony/options-resolver/Tests/Debug/OptionsResolverIntrospectorTest.php
@@ -200,4 +200,49 @@ class OptionsResolverIntrospectorTest extends TestCase
$debug = new OptionsResolverIntrospector($resolver);
$this->assertSame('bar', $debug->getNormalizer('foo'));
}
+
+ public function testGetDeprecationMessage()
+ {
+ $resolver = new OptionsResolver();
+ $resolver->setDefined('foo');
+ $resolver->setDeprecated('foo', 'The option "foo" is deprecated.');
+
+ $debug = new OptionsResolverIntrospector($resolver);
+ $this->assertSame('The option "foo" is deprecated.', $debug->getDeprecationMessage('foo'));
+ }
+
+ public function testGetClosureDeprecationMessage()
+ {
+ $resolver = new OptionsResolver();
+ $resolver->setDefined('foo');
+ $resolver->setDeprecated('foo', $closure = function (Options $options, $value) {});
+
+ $debug = new OptionsResolverIntrospector($resolver);
+ $this->assertSame($closure, $debug->getDeprecationMessage('foo'));
+ }
+
+ /**
+ * @expectedException \Symfony\Component\OptionsResolver\Exception\NoConfigurationException
+ * @expectedExceptionMessage No deprecation was set for the "foo" option.
+ */
+ public function testGetDeprecationMessageThrowsOnNoConfiguredValue()
+ {
+ $resolver = new OptionsResolver();
+ $resolver->setDefined('foo');
+
+ $debug = new OptionsResolverIntrospector($resolver);
+ $this->assertSame('bar', $debug->getDeprecationMessage('foo'));
+ }
+
+ /**
+ * @expectedException \Symfony\Component\OptionsResolver\Exception\UndefinedOptionsException
+ * @expectedExceptionMessage The option "foo" does not exist.
+ */
+ public function testGetDeprecationMessageThrowsOnNotDefinedOption()
+ {
+ $resolver = new OptionsResolver();
+
+ $debug = new OptionsResolverIntrospector($resolver);
+ $this->assertSame('bar', $debug->getDeprecationMessage('foo'));
+ }
}
diff --git a/vendor/symfony/options-resolver/Tests/OptionsResolverTest.php b/vendor/symfony/options-resolver/Tests/OptionsResolverTest.php
index 449a53f6..d996fdd2 100644
--- a/vendor/symfony/options-resolver/Tests/OptionsResolverTest.php
+++ b/vendor/symfony/options-resolver/Tests/OptionsResolverTest.php
@@ -450,6 +450,326 @@ class OptionsResolverTest extends TestCase
$this->assertFalse($this->resolver->isDefined('foo'));
}
+ /**
+ * @expectedException \Symfony\Component\OptionsResolver\Exception\AccessException
+ */
+ public function testFailIfSetDeprecatedFromLazyOption()
+ {
+ $this->resolver
+ ->setDefault('bar', 'baz')
+ ->setDefault('foo', function (Options $options) {
+ $options->setDeprecated('bar');
+ })
+ ->resolve()
+ ;
+ }
+
+ /**
+ * @expectedException \Symfony\Component\OptionsResolver\Exception\UndefinedOptionsException
+ */
+ public function testSetDeprecatedFailsIfUnknownOption()
+ {
+ $this->resolver->setDeprecated('foo');
+ }
+
+ /**
+ * @expectedException \Symfony\Component\OptionsResolver\Exception\InvalidArgumentException
+ * @expectedExceptionMessage Invalid type for deprecation message argument, expected string or \Closure, but got "boolean".
+ */
+ public function testSetDeprecatedFailsIfInvalidDeprecationMessageType()
+ {
+ $this->resolver
+ ->setDefined('foo')
+ ->setDeprecated('foo', true)
+ ;
+ }
+
+ /**
+ * @expectedException \Symfony\Component\OptionsResolver\Exception\InvalidArgumentException
+ * @expectedExceptionMessage Invalid type for deprecation message, expected string but got "boolean", return an empty string to ignore.
+ */
+ public function testLazyDeprecationFailsIfInvalidDeprecationMessageType()
+ {
+ $this->resolver
+ ->setDefined('foo')
+ ->setDeprecated('foo', function (Options $options, $value) {
+ return false;
+ })
+ ;
+ $this->resolver->resolve(array('foo' => null));
+ }
+
+ /**
+ * @expectedException \Symfony\Component\OptionsResolver\Exception\OptionDefinitionException
+ * @expectedExceptionMessage The options "foo", "bar" have a cyclic dependency.
+ */
+ public function testFailsIfCyclicDependencyBetweenDeprecation()
+ {
+ $this->resolver
+ ->setDefined(array('foo', 'bar'))
+ ->setDeprecated('foo', function (Options $options, $value) {
+ $options['bar'];
+ })
+ ->setDeprecated('bar', function (Options $options, $value) {
+ $options['foo'];
+ })
+ ;
+ $this->resolver->resolve(array('foo' => null, 'bar' => null));
+ }
+
+ public function testIsDeprecated()
+ {
+ $this->resolver
+ ->setDefined('foo')
+ ->setDeprecated('foo')
+ ;
+ $this->assertTrue($this->resolver->isDeprecated('foo'));
+ }
+
+ public function testIsNotDeprecatedIfEmptyString()
+ {
+ $this->resolver
+ ->setDefined('foo')
+ ->setDeprecated('foo', '')
+ ;
+ $this->assertFalse($this->resolver->isDeprecated('foo'));
+ }
+
+ /**
+ * @dataProvider provideDeprecationData
+ */
+ public function testDeprecationMessages(\Closure $configureOptions, array $options, ?array $expectedError, int $expectedCount)
+ {
+ $count = 0;
+ error_clear_last();
+ set_error_handler(function () use (&$count) {
+ ++$count;
+
+ return false;
+ });
+ $e = error_reporting(0);
+
+ $configureOptions($this->resolver);
+ $this->resolver->resolve($options);
+
+ error_reporting($e);
+ restore_error_handler();
+
+ $lastError = error_get_last();
+ unset($lastError['file'], $lastError['line']);
+
+ $this->assertSame($expectedError, $lastError);
+ $this->assertSame($expectedCount, $count);
+ }
+
+ public function provideDeprecationData()
+ {
+ yield 'It deprecates an option with default message' => array(
+ function (OptionsResolver $resolver) {
+ $resolver
+ ->setDefined(array('foo', 'bar'))
+ ->setDeprecated('foo')
+ ;
+ },
+ array('foo' => 'baz'),
+ array(
+ 'type' => E_USER_DEPRECATED,
+ 'message' => 'The option "foo" is deprecated.',
+ ),
+ 1,
+ );
+
+ yield 'It deprecates an option with custom message' => array(
+ function (OptionsResolver $resolver) {
+ $resolver
+ ->setDefined('foo')
+ ->setDefault('bar', function (Options $options) {
+ return $options['foo'];
+ })
+ ->setDeprecated('foo', 'The option "foo" is deprecated, use "bar" option instead.')
+ ;
+ },
+ array('foo' => 'baz'),
+ array(
+ 'type' => E_USER_DEPRECATED,
+ 'message' => 'The option "foo" is deprecated, use "bar" option instead.',
+ ),
+ 2,
+ );
+
+ yield 'It deprecates an option evaluated in another definition' => array(
+ function (OptionsResolver $resolver) {
+ // defined by superclass
+ $resolver
+ ->setDefault('foo', null)
+ ->setDeprecated('foo')
+ ;
+ // defined by subclass
+ $resolver->setDefault('bar', function (Options $options) {
+ return $options['foo']; // It triggers a deprecation
+ });
+ },
+ array(),
+ array(
+ 'type' => E_USER_DEPRECATED,
+ 'message' => 'The option "foo" is deprecated.',
+ ),
+ 1,
+ );
+
+ yield 'It deprecates allowed type and value' => array(
+ function (OptionsResolver $resolver) {
+ $resolver
+ ->setDefault('foo', null)
+ ->setAllowedTypes('foo', array('null', 'string', \stdClass::class))
+ ->setDeprecated('foo', function (Options $options, $value) {
+ if ($value instanceof \stdClass) {
+ return sprintf('Passing an instance of "%s" to option "foo" is deprecated, pass its FQCN instead.', \stdClass::class);
+ }
+
+ return '';
+ })
+ ;
+ },
+ array('foo' => new \stdClass()),
+ array(
+ 'type' => E_USER_DEPRECATED,
+ 'message' => 'Passing an instance of "stdClass" to option "foo" is deprecated, pass its FQCN instead.',
+ ),
+ 1,
+ );
+
+ yield 'It triggers a deprecation based on the value only if option is provided by the user' => array(
+ function (OptionsResolver $resolver) {
+ $resolver
+ ->setDefined('foo')
+ ->setAllowedTypes('foo', array('null', 'bool'))
+ ->setDeprecated('foo', function (Options $options, $value) {
+ if (!\is_bool($value)) {
+ return 'Passing a value different than true or false is deprecated.';
+ }
+
+ return '';
+ })
+ ->setDefault('baz', null)
+ ->setAllowedTypes('baz', array('null', 'int'))
+ ->setDeprecated('baz', function (Options $options, $value) {
+ if (!\is_int($value)) {
+ return 'Not passing an integer is deprecated.';
+ }
+
+ return '';
+ })
+ ->setDefault('bar', function (Options $options) {
+ $options['baz']; // It does not triggers a deprecation
+
+ return $options['foo']; // It does not triggers a deprecation
+ })
+ ;
+ },
+ array('foo' => null), // It triggers a deprecation
+ array(
+ 'type' => E_USER_DEPRECATED,
+ 'message' => 'Passing a value different than true or false is deprecated.',
+ ),
+ 1,
+ );
+
+ yield 'It ignores a deprecation if closure returns an empty string' => array(
+ function (OptionsResolver $resolver) {
+ $resolver
+ ->setDefault('foo', null)
+ ->setDeprecated('foo', function (Options $options, $value) {
+ return '';
+ })
+ ;
+ },
+ array('foo' => Bar::class),
+ null,
+ 0,
+ );
+
+ yield 'It deprecates value depending on other option value' => array(
+ function (OptionsResolver $resolver) {
+ $resolver
+ ->setDefault('widget', null)
+ ->setDefault('date_format', null)
+ ->setDeprecated('date_format', function (Options $options, $dateFormat) {
+ if (null !== $dateFormat && 'single_text' === $options['widget']) {
+ return 'Using the "date_format" option when the "widget" option is set to "single_text" is deprecated.';
+ }
+
+ return '';
+ })
+ ;
+ },
+ array('widget' => 'single_text', 'date_format' => 2),
+ array(
+ 'type' => E_USER_DEPRECATED,
+ 'message' => 'Using the "date_format" option when the "widget" option is set to "single_text" is deprecated.',
+ ),
+ 1,
+ );
+
+ yield 'It triggers a deprecation for each evaluation' => array(
+ function (OptionsResolver $resolver) {
+ $resolver
+ // defined by superclass
+ ->setDefined('foo')
+ ->setDeprecated('foo')
+ // defined by subclass
+ ->setDefault('bar', function (Options $options) {
+ return $options['foo']; // It triggers a deprecation
+ })
+ ->setNormalizer('bar', function (Options $options, $value) {
+ $options['foo']; // It triggers a deprecation
+ $options['foo']; // It triggers a deprecation
+
+ return $value;
+ })
+ ;
+ },
+ array('foo' => 'baz'), // It triggers a deprecation
+ array(
+ 'type' => E_USER_DEPRECATED,
+ 'message' => 'The option "foo" is deprecated.',
+ ),
+ 4,
+ );
+
+ yield 'It ignores a deprecation if no option is provided by the user' => array(
+ function (OptionsResolver $resolver) {
+ $resolver
+ ->setDefined('foo')
+ ->setDefault('bar', null)
+ ->setDeprecated('foo')
+ ->setDeprecated('bar')
+ ;
+ },
+ array(),
+ null,
+ 0,
+ );
+
+ yield 'It explicitly ignores a depreciation' => array(
+ function (OptionsResolver $resolver) {
+ $resolver
+ ->setDefault('baz', function (Options $options) {
+ return $options->offsetGet('foo', false);
+ })
+ ->setDefault('foo', null)
+ ->setDeprecated('foo')
+ ->setDefault('bar', function (Options $options) {
+ return $options->offsetGet('foo', false);
+ })
+ ;
+ },
+ array(),
+ null,
+ 0,
+ );
+ }
+
/**
* @expectedException \Symfony\Component\OptionsResolver\Exception\UndefinedOptionsException
*/
@@ -1733,4 +2053,414 @@ class OptionsResolverTest extends TestCase
),
));
}
+
+ public function testIsNestedOption()
+ {
+ $this->resolver->setDefaults(array(
+ 'database' => function (OptionsResolver $resolver) {
+ $resolver->setDefined(array('host', 'port'));
+ },
+ ));
+ $this->assertTrue($this->resolver->isNested('database'));
+ }
+
+ /**
+ * @expectedException \Symfony\Component\OptionsResolver\Exception\UndefinedOptionsException
+ * @expectedExceptionMessage The option "foo" does not exist. Defined options are: "host", "port".
+ */
+ public function testFailsIfUndefinedNestedOption()
+ {
+ $this->resolver->setDefaults(array(
+ 'name' => 'default',
+ 'database' => function (OptionsResolver $resolver) {
+ $resolver->setDefined(array('host', 'port'));
+ },
+ ));
+ $this->resolver->resolve(array(
+ 'database' => array('foo' => 'bar'),
+ ));
+ }
+
+ /**
+ * @expectedException \Symfony\Component\OptionsResolver\Exception\MissingOptionsException
+ * @expectedExceptionMessage The required option "host" is missing.
+ */
+ public function testFailsIfMissingRequiredNestedOption()
+ {
+ $this->resolver->setDefaults(array(
+ 'name' => 'default',
+ 'database' => function (OptionsResolver $resolver) {
+ $resolver->setRequired('host');
+ },
+ ));
+ $this->resolver->resolve(array(
+ 'database' => array(),
+ ));
+ }
+
+ /**
+ * @expectedException \Symfony\Component\OptionsResolver\Exception\InvalidOptionsException
+ * @expectedExceptionMessage The option "logging" with value null is expected to be of type "bool", but is of type "NULL".
+ */
+ public function testFailsIfInvalidTypeNestedOption()
+ {
+ $this->resolver->setDefaults(array(
+ 'name' => 'default',
+ 'database' => function (OptionsResolver $resolver) {
+ $resolver
+ ->setDefined('logging')
+ ->setAllowedTypes('logging', 'bool');
+ },
+ ));
+ $this->resolver->resolve(array(
+ 'database' => array('logging' => null),
+ ));
+ }
+
+ /**
+ * @expectedException \Symfony\Component\OptionsResolver\Exception\InvalidOptionsException
+ * @expectedExceptionMessage The nested option "database" with value null is expected to be of type array, but is of type "NULL".
+ */
+ public function testFailsIfNotArrayIsGivenForNestedOptions()
+ {
+ $this->resolver->setDefaults(array(
+ 'name' => 'default',
+ 'database' => function (OptionsResolver $resolver) {
+ $resolver->setDefined('host');
+ },
+ ));
+ $this->resolver->resolve(array(
+ 'database' => null,
+ ));
+ }
+
+ public function testResolveNestedOptionsWithoutDefault()
+ {
+ $this->resolver->setDefaults(array(
+ 'name' => 'default',
+ 'database' => function (OptionsResolver $resolver) {
+ $resolver->setDefined(array('host', 'port'));
+ },
+ ));
+ $actualOptions = $this->resolver->resolve();
+ $expectedOptions = array(
+ 'name' => 'default',
+ 'database' => array(),
+ );
+ $this->assertSame($expectedOptions, $actualOptions);
+ }
+
+ public function testResolveNestedOptionsWithDefault()
+ {
+ $this->resolver->setDefaults(array(
+ 'name' => 'default',
+ 'database' => function (OptionsResolver $resolver) {
+ $resolver->setDefaults(array(
+ 'host' => 'localhost',
+ 'port' => 3306,
+ ));
+ },
+ ));
+ $actualOptions = $this->resolver->resolve();
+ $expectedOptions = array(
+ 'name' => 'default',
+ 'database' => array(
+ 'host' => 'localhost',
+ 'port' => 3306,
+ ),
+ );
+ $this->assertSame($expectedOptions, $actualOptions);
+ }
+
+ public function testResolveMultipleNestedOptions()
+ {
+ $this->resolver->setDefaults(array(
+ 'name' => 'default',
+ 'database' => function (OptionsResolver $resolver) {
+ $resolver
+ ->setRequired(array('dbname', 'host'))
+ ->setDefaults(array(
+ 'port' => 3306,
+ 'slaves' => function (OptionsResolver $resolver) {
+ $resolver->setDefaults(array(
+ 'host' => 'slave1',
+ 'port' => 3306,
+ ));
+ },
+ ));
+ },
+ ));
+ $actualOptions = $this->resolver->resolve(array(
+ 'name' => 'custom',
+ 'database' => array(
+ 'dbname' => 'test',
+ 'host' => 'localhost',
+ 'port' => null,
+ 'slaves' => array('host' => 'slave2'),
+ ),
+ ));
+ $expectedOptions = array(
+ 'name' => 'custom',
+ 'database' => array(
+ 'port' => null,
+ 'slaves' => array('port' => 3306, 'host' => 'slave2'),
+ 'dbname' => 'test',
+ 'host' => 'localhost',
+ ),
+ );
+ $this->assertSame($expectedOptions, $actualOptions);
+ }
+
+ public function testResolveLazyOptionUsingNestedOption()
+ {
+ $this->resolver->setDefaults(array(
+ 'version' => function (Options $options) {
+ return $options['database']['server_version'];
+ },
+ 'database' => function (OptionsResolver $resolver) {
+ $resolver->setDefault('server_version', '3.15');
+ },
+ ));
+ $actualOptions = $this->resolver->resolve();
+ $expectedOptions = array(
+ 'database' => array('server_version' => '3.15'),
+ 'version' => '3.15',
+ );
+ $this->assertSame($expectedOptions, $actualOptions);
+ }
+
+ public function testNormalizeNestedOptionValue()
+ {
+ $this->resolver
+ ->setDefaults(array(
+ 'database' => function (OptionsResolver $resolver) {
+ $resolver->setDefaults(array(
+ 'port' => 3306,
+ 'host' => 'localhost',
+ 'dbname' => 'demo',
+ ));
+ },
+ ))
+ ->setNormalizer('database', function (Options $options, $value) {
+ ksort($value);
+
+ return $value;
+ });
+ $actualOptions = $this->resolver->resolve(array(
+ 'database' => array('dbname' => 'test'),
+ ));
+ $expectedOptions = array(
+ 'database' => array('dbname' => 'test', 'host' => 'localhost', 'port' => 3306),
+ );
+ $this->assertSame($expectedOptions, $actualOptions);
+ }
+
+ public function testOverwrittenNestedOptionNotEvaluatedIfLazyDefault()
+ {
+ // defined by superclass
+ $this->resolver->setDefault('foo', function (OptionsResolver $resolver) {
+ Assert::fail('Should not be called');
+ });
+ // defined by subclass
+ $this->resolver->setDefault('foo', function (Options $options) {
+ return 'lazy';
+ });
+ $this->assertSame(array('foo' => 'lazy'), $this->resolver->resolve());
+ }
+
+ public function testOverwrittenNestedOptionNotEvaluatedIfScalarDefault()
+ {
+ // defined by superclass
+ $this->resolver->setDefault('foo', function (OptionsResolver $resolver) {
+ Assert::fail('Should not be called');
+ });
+ // defined by subclass
+ $this->resolver->setDefault('foo', 'bar');
+ $this->assertSame(array('foo' => 'bar'), $this->resolver->resolve());
+ }
+
+ public function testOverwrittenLazyOptionNotEvaluatedIfNestedOption()
+ {
+ // defined by superclass
+ $this->resolver->setDefault('foo', function (Options $options) {
+ Assert::fail('Should not be called');
+ });
+ // defined by subclass
+ $this->resolver->setDefault('foo', function (OptionsResolver $resolver) {
+ $resolver->setDefault('bar', 'baz');
+ });
+ $this->assertSame(array('foo' => array('bar' => 'baz')), $this->resolver->resolve());
+ }
+
+ public function testResolveAllNestedOptionDefinitions()
+ {
+ // defined by superclass
+ $this->resolver->setDefault('foo', function (OptionsResolver $resolver) {
+ $resolver->setRequired('bar');
+ });
+ // defined by subclass
+ $this->resolver->setDefault('foo', function (OptionsResolver $resolver) {
+ $resolver->setDefault('bar', 'baz');
+ });
+ // defined by subclass
+ $this->resolver->setDefault('foo', function (OptionsResolver $resolver) {
+ $resolver->setDefault('ping', 'pong');
+ });
+ $this->assertSame(array('foo' => array('ping' => 'pong', 'bar' => 'baz')), $this->resolver->resolve());
+ }
+
+ public function testNormalizeNestedValue()
+ {
+ // defined by superclass
+ $this->resolver->setDefault('foo', function (OptionsResolver $resolver) {
+ $resolver->setDefault('bar', null);
+ });
+ // defined by subclass
+ $this->resolver->setNormalizer('foo', function (Options $options, $resolvedValue) {
+ if (null === $resolvedValue['bar']) {
+ $resolvedValue['bar'] = 'baz';
+ }
+
+ return $resolvedValue;
+ });
+ $this->assertSame(array('foo' => array('bar' => 'baz')), $this->resolver->resolve());
+ }
+
+ /**
+ * @expectedException \Symfony\Component\OptionsResolver\Exception\OptionDefinitionException
+ */
+ public function testFailsIfCyclicDependencyBetweenSameNestedOption()
+ {
+ $this->resolver->setDefault('database', function (OptionsResolver $resolver, Options $parent) {
+ $resolver->setDefault('slaves', $parent['database']);
+ });
+ $this->resolver->resolve();
+ }
+
+ /**
+ * @expectedException \Symfony\Component\OptionsResolver\Exception\OptionDefinitionException
+ */
+ public function testFailsIfCyclicDependencyBetweenNestedOptionAndParentLazyOption()
+ {
+ $this->resolver->setDefaults(array(
+ 'version' => function (Options $options) {
+ return $options['database']['server_version'];
+ },
+ 'database' => function (OptionsResolver $resolver, Options $parent) {
+ $resolver->setDefault('server_version', $parent['version']);
+ },
+ ));
+ $this->resolver->resolve();
+ }
+
+ /**
+ * @expectedException \Symfony\Component\OptionsResolver\Exception\OptionDefinitionException
+ */
+ public function testFailsIfCyclicDependencyBetweenNormalizerAndNestedOption()
+ {
+ $this->resolver
+ ->setDefault('name', 'default')
+ ->setDefault('database', function (OptionsResolver $resolver, Options $parent) {
+ $resolver->setDefault('host', $parent['name']);
+ })
+ ->setNormalizer('name', function (Options $options, $value) {
+ $options['database'];
+ });
+ $this->resolver->resolve();
+ }
+
+ /**
+ * @expectedException \Symfony\Component\OptionsResolver\Exception\OptionDefinitionException
+ */
+ public function testFailsIfCyclicDependencyBetweenNestedOptions()
+ {
+ $this->resolver->setDefault('database', function (OptionsResolver $resolver, Options $parent) {
+ $resolver->setDefault('host', $parent['slave']['host']);
+ });
+ $this->resolver->setDefault('slave', function (OptionsResolver $resolver, Options $parent) {
+ $resolver->setDefault('host', $parent['database']['host']);
+ });
+ $this->resolver->resolve();
+ }
+
+ public function testGetAccessToParentOptionFromNestedOption()
+ {
+ $this->resolver->setDefaults(array(
+ 'version' => 3.15,
+ 'database' => function (OptionsResolver $resolver, Options $parent) {
+ $resolver->setDefault('server_version', $parent['version']);
+ },
+ ));
+ $this->assertSame(array('version' => 3.15, 'database' => array('server_version' => 3.15)), $this->resolver->resolve());
+ }
+
+ public function testNestedClosureWithoutTypeHintNotInvoked()
+ {
+ $closure = function ($resolver) {
+ Assert::fail('Should not be called');
+ };
+ $this->resolver->setDefault('foo', $closure);
+ $this->assertSame(array('foo' => $closure), $this->resolver->resolve());
+ }
+
+ public function testNestedClosureWithoutTypeHint2ndArgumentNotInvoked()
+ {
+ $closure = function (OptionsResolver $resolver, $parent) {
+ Assert::fail('Should not be called');
+ };
+ $this->resolver->setDefault('foo', $closure);
+ $this->assertSame(array('foo' => $closure), $this->resolver->resolve());
+ }
+
+ public function testResolveLazyOptionWithTransitiveDefaultDependency()
+ {
+ $this->resolver->setDefaults(array(
+ 'ip' => null,
+ 'database' => function (OptionsResolver $resolver, Options $parent) {
+ $resolver->setDefault('host', $parent['ip']);
+ $resolver->setDefault('master_slave', function (OptionsResolver $resolver, Options $parent) {
+ $resolver->setDefault('host', $parent['host']);
+ });
+ },
+ 'secondary_slave' => function (Options $options) {
+ return $options['database']['master_slave']['host'];
+ },
+ ));
+ $actualOptions = $this->resolver->resolve(array('ip' => '127.0.0.1'));
+ $expectedOptions = array(
+ 'ip' => '127.0.0.1',
+ 'database' => array(
+ 'host' => '127.0.0.1',
+ 'master_slave' => array('host' => '127.0.0.1'),
+ ),
+ 'secondary_slave' => '127.0.0.1',
+ );
+ $this->assertSame($expectedOptions, $actualOptions);
+ }
+
+ public function testAccessToParentOptionFromNestedNormalizerAndLazyOption()
+ {
+ $this->resolver->setDefaults(array(
+ 'debug' => true,
+ 'database' => function (OptionsResolver $resolver, Options $parent) {
+ $resolver
+ ->setDefined('logging')
+ ->setDefault('profiling', function (Options $options) use ($parent) {
+ return $parent['debug'];
+ })
+ ->setNormalizer('logging', function (Options $options, $value) use ($parent) {
+ return false === $parent['debug'] ? true : $value;
+ });
+ },
+ ));
+ $actualOptions = $this->resolver->resolve(array(
+ 'debug' => false,
+ 'database' => array('logging' => false),
+ ));
+ $expectedOptions = array(
+ 'debug' => false,
+ 'database' => array('profiling' => false, 'logging' => true),
+ );
+ $this->assertSame($expectedOptions, $actualOptions);
+ }
}
diff --git a/vendor/symfony/options-resolver/composer.json b/vendor/symfony/options-resolver/composer.json
index e78b66f2..1c819495 100644
--- a/vendor/symfony/options-resolver/composer.json
+++ b/vendor/symfony/options-resolver/composer.json
@@ -27,7 +27,7 @@
"minimum-stability": "dev",
"extra": {
"branch-alias": {
- "dev-master": "4.1-dev"
+ "dev-master": "4.2-dev"
}
}
}
diff --git a/vendor/symfony/options-resolver/phpunit.xml.dist b/vendor/symfony/options-resolver/phpunit.xml.dist
index 7e04e604..9a2ec111 100644
--- a/vendor/symfony/options-resolver/phpunit.xml.dist
+++ b/vendor/symfony/options-resolver/phpunit.xml.dist
@@ -1,7 +1,7 @@
'a',
'B' => 'b',
'C' => 'c',
@@ -1094,8 +1094,3 @@ static $data = array (
'𑢾' => '𑣞',
'𑢿' => '𑣟',
);
-
-$result =& $data;
-unset($data);
-
-return $result;
diff --git a/vendor/symfony/polyfill-mbstring/Resources/unidata/upperCase.php b/vendor/symfony/polyfill-mbstring/Resources/unidata/upperCase.php
index ec942212..b8103b2e 100644
--- a/vendor/symfony/polyfill-mbstring/Resources/unidata/upperCase.php
+++ b/vendor/symfony/polyfill-mbstring/Resources/unidata/upperCase.php
@@ -1,6 +1,6 @@
'A',
'b' => 'B',
'c' => 'C',
@@ -1102,8 +1102,3 @@ static $data = array (
'𑣞' => '𑢾',
'𑣟' => '𑢿',
);
-
-$result =& $data;
-unset($data);
-
-return $result;
diff --git a/vendor/symfony/polyfill-php72/Php72.php b/vendor/symfony/polyfill-php72/Php72.php
index 5f122a24..d531e844 100644
--- a/vendor/symfony/polyfill-php72/Php72.php
+++ b/vendor/symfony/polyfill-php72/Php72.php
@@ -50,7 +50,10 @@ final class Php72
$s[$j] = $c < 256 ? \chr($c) : '?';
break;
- case "\xF0": ++$i;
+ case "\xF0":
+ ++$i;
+ // no break
+
case "\xE0":
$s[$j] = '?';
$i += 2;
@@ -66,7 +69,7 @@ final class Php72
public static function php_os_family()
{
- if ('\\' === DIRECTORY_SEPARATOR) {
+ if ('\\' === \DIRECTORY_SEPARATOR) {
return 'Windows';
}
@@ -98,7 +101,8 @@ final class Php72
public static function sapi_windows_vt100_support($stream, $enable = null)
{
if (!\is_resource($stream)) {
- trigger_error('sapi_windows_vt100_support() expects parameter 1 to be resource, '.gettype($stream).' given', E_USER_WARNING);
+ trigger_error('sapi_windows_vt100_support() expects parameter 1 to be resource, '.\gettype($stream).' given', E_USER_WARNING);
+
return false;
}
@@ -106,6 +110,7 @@ final class Php72
if ('STDIO' !== $meta['stream_type']) {
trigger_error('sapi_windows_vt100_support() was not able to analyze the specified stream', E_USER_WARNING);
+
return false;
}
@@ -128,17 +133,18 @@ final class Php72
public static function stream_isatty($stream)
{
if (!\is_resource($stream)) {
- trigger_error('stream_isatty() expects parameter 1 to be resource, '.gettype($stream).' given', E_USER_WARNING);
+ trigger_error('stream_isatty() expects parameter 1 to be resource, '.\gettype($stream).' given', E_USER_WARNING);
+
return false;
}
- if ('\\' === DIRECTORY_SEPARATOR) {
+ if ('\\' === \DIRECTORY_SEPARATOR) {
$stat = @fstat($stream);
// Check if formatted mode is S_IFCHR
return $stat ? 0020000 === ($stat['mode'] & 0170000) : false;
}
- return function_exists('posix_isatty') && @posix_isatty($stream);
+ return \function_exists('posix_isatty') && @posix_isatty($stream);
}
private static function initHashMask()
@@ -162,4 +168,49 @@ final class Php72
self::$hashMask ^= hexdec(substr(spl_object_hash($obj), 16 - \PHP_INT_SIZE, \PHP_INT_SIZE));
}
+
+ public static function mb_chr($code, $encoding = null)
+ {
+ if (0x80 > $code %= 0x200000) {
+ $s = \chr($code);
+ } elseif (0x800 > $code) {
+ $s = \chr(0xC0 | $code >> 6).\chr(0x80 | $code & 0x3F);
+ } elseif (0x10000 > $code) {
+ $s = \chr(0xE0 | $code >> 12).\chr(0x80 | $code >> 6 & 0x3F).\chr(0x80 | $code & 0x3F);
+ } else {
+ $s = \chr(0xF0 | $code >> 18).\chr(0x80 | $code >> 12 & 0x3F).\chr(0x80 | $code >> 6 & 0x3F).\chr(0x80 | $code & 0x3F);
+ }
+
+ if ('UTF-8' !== $encoding) {
+ $s = mb_convert_encoding($s, $encoding, 'UTF-8');
+ }
+
+ return $s;
+ }
+
+ public static function mb_ord($s, $encoding = null)
+ {
+ if (null == $encoding) {
+ $s = mb_convert_encoding($s, 'UTF-8');
+ } elseif ('UTF-8' !== $encoding) {
+ $s = mb_convert_encoding($s, 'UTF-8', $encoding);
+ }
+
+ if (1 === \strlen($s)) {
+ return \ord($s);
+ }
+
+ $code = ($s = unpack('C*', substr($s, 0, 4))) ? $s[1] : 0;
+ if (0xF0 <= $code) {
+ return (($code - 0xF0) << 18) + (($s[2] - 0x80) << 12) + (($s[3] - 0x80) << 6) + $s[4] - 0x80;
+ }
+ if (0xE0 <= $code) {
+ return (($code - 0xE0) << 12) + (($s[2] - 0x80) << 6) + $s[3] - 0x80;
+ }
+ if (0xC0 <= $code) {
+ return (($code - 0xC0) << 6) + $s[2] - 0x80;
+ }
+
+ return $code;
+ }
}
diff --git a/vendor/symfony/polyfill-php72/bootstrap.php b/vendor/symfony/polyfill-php72/bootstrap.php
index 9ccea829..519056de 100644
--- a/vendor/symfony/polyfill-php72/bootstrap.php
+++ b/vendor/symfony/polyfill-php72/bootstrap.php
@@ -28,4 +28,9 @@ if (PHP_VERSION_ID < 70200) {
if (!defined('PHP_OS_FAMILY')) {
define('PHP_OS_FAMILY', p\Php72::php_os_family());
}
+ if (!function_exists('mb_chr')) {
+ function mb_ord($s, $enc = null) { return p\Php72::mb_ord($s, $enc); }
+ function mb_chr($code, $enc = null) { return p\Php72::mb_chr($code, $enc); }
+ function mb_scrub($s, $enc = null) { $enc = null === $enc ? mb_internal_encoding() : $enc; return mb_convert_encoding($s, $enc, $enc); }
+ }
}
diff --git a/vendor/symfony/process/CHANGELOG.md b/vendor/symfony/process/CHANGELOG.md
index 354db592..13fe89ea 100644
--- a/vendor/symfony/process/CHANGELOG.md
+++ b/vendor/symfony/process/CHANGELOG.md
@@ -1,6 +1,15 @@
CHANGELOG
=========
+4.2.0
+-----
+
+ * added the `Process::fromShellCommandline()` to run commands in a shell wrapper
+ * deprecated passing a command as string when creating a `Process` instance
+ * deprecated the `Process::setCommandline()` and the `PhpProcess::setPhpBinary()` methods
+ * added the `Process::waitUntil()` method to wait for the process only for a
+ specific output, then continue the normal execution of your application
+
4.1.0
-----
diff --git a/vendor/symfony/process/Exception/ExceptionInterface.php b/vendor/symfony/process/Exception/ExceptionInterface.php
index 75c1c9e5..bd4a6040 100644
--- a/vendor/symfony/process/Exception/ExceptionInterface.php
+++ b/vendor/symfony/process/Exception/ExceptionInterface.php
@@ -16,6 +16,6 @@ namespace Symfony\Component\Process\Exception;
*
* @author Johannes M. Schmitt
*/
-interface ExceptionInterface
+interface ExceptionInterface extends \Throwable
{
}
diff --git a/vendor/symfony/process/InputStream.php b/vendor/symfony/process/InputStream.php
index 0b830c1a..c8e4f00e 100644
--- a/vendor/symfony/process/InputStream.php
+++ b/vendor/symfony/process/InputStream.php
@@ -36,8 +36,8 @@ class InputStream implements \IteratorAggregate
/**
* Appends an input to the write buffer.
*
- * @param resource|string|int|float|bool|\Traversable|null The input to append as scalar,
- * stream resource or \Traversable
+ * @param resource|string|int|float|bool|\Traversable|null $input The input to append as scalar,
+ * stream resource or \Traversable
*/
public function write($input)
{
@@ -78,9 +78,7 @@ class InputStream implements \IteratorAggregate
$current = array_shift($this->input);
if ($current instanceof \Iterator) {
- foreach ($current as $cur) {
- yield $cur;
- }
+ yield from $current;
} else {
yield $current;
}
diff --git a/vendor/symfony/process/PhpExecutableFinder.php b/vendor/symfony/process/PhpExecutableFinder.php
index ee7203c9..ae8b4da8 100644
--- a/vendor/symfony/process/PhpExecutableFinder.php
+++ b/vendor/symfony/process/PhpExecutableFinder.php
@@ -37,7 +37,14 @@ class PhpExecutableFinder
{
if ($php = getenv('PHP_BINARY')) {
if (!is_executable($php)) {
- return false;
+ $command = '\\' === \DIRECTORY_SEPARATOR ? 'where' : 'command -v';
+ if ($php = strtok(exec($command.' '.escapeshellarg($php)), PHP_EOL)) {
+ if (!is_executable($php)) {
+ return false;
+ }
+ } else {
+ return false;
+ }
}
return $php;
diff --git a/vendor/symfony/process/PhpProcess.php b/vendor/symfony/process/PhpProcess.php
index 6cf02a2f..efa25e2d 100644
--- a/vendor/symfony/process/PhpProcess.php
+++ b/vendor/symfony/process/PhpProcess.php
@@ -29,11 +29,12 @@ class PhpProcess extends Process
* @param string|null $cwd The working directory or null to use the working dir of the current PHP process
* @param array|null $env The environment variables or null to use the same environment as the current PHP process
* @param int $timeout The timeout in seconds
+ * @param array|null $php Path to the PHP binary to use with any additional arguments
*/
- public function __construct(string $script, string $cwd = null, array $env = null, int $timeout = 60)
+ public function __construct(string $script, string $cwd = null, array $env = null, int $timeout = 60, array $php = null)
{
$executableFinder = new PhpExecutableFinder();
- if (false === $php = $executableFinder->find(false)) {
+ if (false === $php = $php ?? $executableFinder->find(false)) {
$php = null;
} else {
$php = array_merge(array($php), $executableFinder->findArguments());
@@ -51,9 +52,13 @@ class PhpProcess extends Process
/**
* Sets the path to the PHP binary to use.
+ *
+ * @deprecated since Symfony 4.2, use the $php argument of the constructor instead.
*/
public function setPhpBinary($php)
{
+ @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.2, use the $php argument of the constructor instead.', __METHOD__), E_USER_DEPRECATED);
+
$this->setCommandLine($php);
}
diff --git a/vendor/symfony/process/Pipes/WindowsPipes.php b/vendor/symfony/process/Pipes/WindowsPipes.php
index 9240102a..7130589c 100644
--- a/vendor/symfony/process/Pipes/WindowsPipes.php
+++ b/vendor/symfony/process/Pipes/WindowsPipes.php
@@ -28,6 +28,7 @@ class WindowsPipes extends AbstractPipes
{
private $files = array();
private $fileHandles = array();
+ private $lockHandles = array();
private $readBytes = array(
Process::STDOUT => 0,
Process::STDERR => 0,
@@ -47,31 +48,33 @@ class WindowsPipes extends AbstractPipes
Process::STDOUT => Process::OUT,
Process::STDERR => Process::ERR,
);
- $tmpCheck = false;
$tmpDir = sys_get_temp_dir();
$lastError = 'unknown reason';
set_error_handler(function ($type, $msg) use (&$lastError) { $lastError = $msg; });
for ($i = 0;; ++$i) {
foreach ($pipes as $pipe => $name) {
$file = sprintf('%s\\sf_proc_%02X.%s', $tmpDir, $i, $name);
- if (file_exists($file) && !unlink($file)) {
- continue 2;
- }
- $h = fopen($file, 'xb');
- if (!$h) {
- $error = $lastError;
- if ($tmpCheck || $tmpCheck = unlink(tempnam(false, 'sf_check_'))) {
- continue;
- }
+
+ if (!$h = fopen($file.'.lock', 'w')) {
restore_error_handler();
- throw new RuntimeException(sprintf('A temporary file could not be opened to write the process output: %s', $error));
+ throw new RuntimeException(sprintf('A temporary file could not be opened to write the process output: %s', $lastError));
}
- if (!$h || !$this->fileHandles[$pipe] = fopen($file, 'rb')) {
+ if (!flock($h, LOCK_EX | LOCK_NB)) {
continue 2;
}
- if (isset($this->files[$pipe])) {
- unlink($this->files[$pipe]);
+ if (isset($this->lockHandles[$pipe])) {
+ flock($this->lockHandles[$pipe], LOCK_UN);
+ fclose($this->lockHandles[$pipe]);
}
+ $this->lockHandles[$pipe] = $h;
+
+ if (!fclose(fopen($file, 'w')) || !$h = fopen($file, 'r')) {
+ flock($this->lockHandles[$pipe], LOCK_UN);
+ fclose($this->lockHandles[$pipe]);
+ unset($this->lockHandles[$pipe]);
+ continue 2;
+ }
+ $this->fileHandles[$pipe] = $h;
$this->files[$pipe] = $file;
}
break;
@@ -85,7 +88,6 @@ class WindowsPipes extends AbstractPipes
public function __destruct()
{
$this->close();
- $this->removeFiles();
}
/**
@@ -145,8 +147,11 @@ class WindowsPipes extends AbstractPipes
$read[$type] = $data;
}
if ($close) {
+ ftruncate($fileHandle, 0);
fclose($fileHandle);
- unset($this->fileHandles[$type]);
+ flock($this->lockHandles[$type], LOCK_UN);
+ fclose($this->lockHandles[$type]);
+ unset($this->fileHandles[$type], $this->lockHandles[$type]);
}
}
@@ -175,22 +180,12 @@ class WindowsPipes extends AbstractPipes
public function close()
{
parent::close();
- foreach ($this->fileHandles as $handle) {
+ foreach ($this->fileHandles as $type => $handle) {
+ ftruncate($handle, 0);
fclose($handle);
+ flock($this->lockHandles[$type], LOCK_UN);
+ fclose($this->lockHandles[$type]);
}
- $this->fileHandles = array();
- }
-
- /**
- * Removes temporary files.
- */
- private function removeFiles()
- {
- foreach ($this->files as $filename) {
- if (file_exists($filename)) {
- @unlink($filename);
- }
- }
- $this->files = array();
+ $this->fileHandles = $this->lockHandles = array();
}
}
diff --git a/vendor/symfony/process/Process.php b/vendor/symfony/process/Process.php
index cf551ef5..7ffbacb2 100644
--- a/vendor/symfony/process/Process.php
+++ b/vendor/symfony/process/Process.php
@@ -129,21 +129,25 @@ class Process implements \IteratorAggregate
);
/**
- * @param string|array $commandline The command line to run
- * @param string|null $cwd The working directory or null to use the working dir of the current PHP process
- * @param array|null $env The environment variables or null to use the same environment as the current PHP process
- * @param mixed|null $input The input as stream resource, scalar or \Traversable, or null for no input
- * @param int|float|null $timeout The timeout in seconds or null to disable
+ * @param array $command The command to run and its arguments listed as separate entries
+ * @param string|null $cwd The working directory or null to use the working dir of the current PHP process
+ * @param array|null $env The environment variables or null to use the same environment as the current PHP process
+ * @param mixed|null $input The input as stream resource, scalar or \Traversable, or null for no input
+ * @param int|float|null $timeout The timeout in seconds or null to disable
*
* @throws RuntimeException When proc_open is not installed
*/
- public function __construct($commandline, string $cwd = null, array $env = null, $input = null, ?float $timeout = 60)
+ public function __construct($command, string $cwd = null, array $env = null, $input = null, ?float $timeout = 60)
{
if (!\function_exists('proc_open')) {
- throw new RuntimeException('The Process class relies on proc_open, which is not available on your PHP installation.');
+ throw new LogicException('The Process class relies on proc_open, which is not available on your PHP installation.');
}
- $this->commandline = $commandline;
+ if (!\is_array($command)) {
+ @trigger_error(sprintf('Passing a command as string when creating a "%s" instance is deprecated since Symfony 4.2, pass it as an array of its arguments instead, or use the "Process::fromShellCommandline()" constructor if you need features provided by the shell.', __CLASS__), E_USER_DEPRECATED);
+ }
+
+ $this->commandline = $command;
$this->cwd = $cwd;
// on Windows, if the cwd changed via chdir(), proc_open defaults to the dir where PHP was started
@@ -163,6 +167,35 @@ class Process implements \IteratorAggregate
$this->pty = false;
}
+ /**
+ * Creates a Process instance as a command-line to be run in a shell wrapper.
+ *
+ * Command-lines are parsed by the shell of your OS (/bin/sh on Unix-like, cmd.exe on Windows.)
+ * This allows using e.g. pipes or conditional execution. In this mode, signals are sent to the
+ * shell wrapper and not to your commands.
+ *
+ * In order to inject dynamic values into command-lines, we strongly recommend using placeholders.
+ * This will save escaping values, which is not portable nor secure anyway:
+ *
+ * $process = Process::fromShellCommandline('my_command "$MY_VAR"');
+ * $process->run(null, ['MY_VAR' => $theValue]);
+ *
+ * @param string $command The command line to pass to the shell of the OS
+ * @param string|null $cwd The working directory or null to use the working dir of the current PHP process
+ * @param array|null $env The environment variables or null to use the same environment as the current PHP process
+ * @param mixed|null $input The input as stream resource, scalar or \Traversable, or null for no input
+ * @param int|float|null $timeout The timeout in seconds or null to disable
+ *
+ * @throws RuntimeException When proc_open is not installed
+ */
+ public static function fromShellCommandline(string $command, string $cwd = null, array $env = null, $input = null, ?float $timeout = 60)
+ {
+ $process = new static(array(), $cwd, $env, $input, $timeout);
+ $process->commandline = $command;
+
+ return $process;
+ }
+
public function __destruct()
{
$this->stop(0);
@@ -374,7 +407,7 @@ class Process implements \IteratorAggregate
if (null !== $callback) {
if (!$this->processPipes->haveReadSupport()) {
$this->stop(0);
- throw new \LogicException('Pass the callback to the Process::start method or enableOutput to use a callback with Process::wait');
+ throw new \LogicException('Pass the callback to the "Process::start" method or call enableOutput to use a callback with "Process::wait"');
}
$this->callback = $this->buildCallback($callback);
}
@@ -396,6 +429,51 @@ class Process implements \IteratorAggregate
return $this->exitcode;
}
+ /**
+ * Waits until the callback returns true.
+ *
+ * The callback receives the type of output (out or err) and some bytes
+ * from the output in real-time while writing the standard input to the process.
+ * It allows to have feedback from the independent process during execution.
+ *
+ * @throws RuntimeException When process timed out
+ * @throws LogicException When process is not yet started
+ */
+ public function waitUntil(callable $callback): bool
+ {
+ $this->requireProcessIsStarted(__FUNCTION__);
+ $this->updateStatus(false);
+
+ if (!$this->processPipes->haveReadSupport()) {
+ $this->stop(0);
+ throw new \LogicException('Pass the callback to the "Process::start" method or call enableOutput to use a callback with "Process::waitUntil".');
+ }
+ $callback = $this->buildCallback($callback);
+
+ $ready = false;
+ while (true) {
+ $this->checkTimeout();
+ $running = '\\' === \DIRECTORY_SEPARATOR ? $this->isRunning() : $this->processPipes->areOpen();
+ $output = $this->processPipes->readAndWrite($running, '\\' !== \DIRECTORY_SEPARATOR || !$running);
+
+ foreach ($output as $type => $data) {
+ if (3 !== $type) {
+ $ready = $callback(self::STDOUT === $type ? self::OUT : self::ERR, $data) || $ready;
+ } elseif (!isset($this->fallbackStatus['signaled'])) {
+ $this->fallbackStatus['exitcode'] = (int) $data;
+ }
+ }
+ if ($ready) {
+ return true;
+ }
+ if (!$running) {
+ return false;
+ }
+
+ usleep(1000);
+ }
+ }
+
/**
* Returns the Pid (process identifier), if applicable.
*
@@ -823,7 +901,7 @@ class Process implements \IteratorAggregate
{
$timeoutMicro = microtime(true) + $timeout;
if ($this->isRunning()) {
- // given `SIGTERM` may not be defined and that `proc_terminate` uses the constant value and not the constant itself, we use the same here
+ // given SIGTERM may not be defined and that "proc_terminate" uses the constant value and not the constant itself, we use the same here
$this->doSignal(15, false);
do {
usleep(1000);
@@ -892,9 +970,13 @@ class Process implements \IteratorAggregate
* @param string|array $commandline The command to execute
*
* @return self The current Process instance
+ *
+ * @deprecated since Symfony 4.2.
*/
public function setCommandLine($commandline)
{
+ @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.2.', __METHOD__), E_USER_DEPRECATED);
+
$this->commandline = $commandline;
return $this;
@@ -1227,7 +1309,7 @@ class Process implements \IteratorAggregate
if ($this->outputDisabled) {
return function ($type, $data) use ($callback) {
if (null !== $callback) {
- \call_user_func($callback, $type, $data);
+ return \call_user_func($callback, $type, $data);
}
};
}
@@ -1242,7 +1324,7 @@ class Process implements \IteratorAggregate
}
if (null !== $callback) {
- \call_user_func($callback, $type, $data);
+ return \call_user_func($callback, $type, $data);
}
};
}
@@ -1442,7 +1524,7 @@ class Process implements \IteratorAggregate
}
if (!$ok) {
if ($throwException) {
- throw new RuntimeException(sprintf('Error while sending signal `%s`.', $signal));
+ throw new RuntimeException(sprintf('Error while sending signal "%s".', $signal));
}
return false;
@@ -1516,7 +1598,7 @@ class Process implements \IteratorAggregate
}
/**
- * Ensures the process is terminated, throws a LogicException if the process has a status different than `terminated`.
+ * Ensures the process is terminated, throws a LogicException if the process has a status different than "terminated".
*
* @throws LogicException if the process is not yet terminated
*/
@@ -1530,14 +1612,14 @@ class Process implements \IteratorAggregate
/**
* Escapes a string to be used as a shell argument.
*/
- private function escapeArgument(string $argument): string
+ private function escapeArgument(?string $argument): string
{
+ if ('' === $argument || null === $argument) {
+ return '""';
+ }
if ('\\' !== \DIRECTORY_SEPARATOR) {
return "'".str_replace("'", "'\\''", $argument)."'";
}
- if ('' === $argument = (string) $argument) {
- return '""';
- }
if (false !== strpos($argument, "\0")) {
$argument = str_replace("\0", '?', $argument);
}
diff --git a/vendor/symfony/process/Tests/KillableProcessWithOutput.php b/vendor/symfony/process/Tests/KillableProcessWithOutput.php
new file mode 100644
index 00000000..6c31ee30
--- /dev/null
+++ b/vendor/symfony/process/Tests/KillableProcessWithOutput.php
@@ -0,0 +1,26 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+$outputs = array(
+ 'First iteration output',
+ 'Second iteration output',
+ 'One more iteration output',
+ 'This took more time',
+ 'This one was sooooo slow',
+);
+
+$iterationTime = 10000;
+
+foreach ($outputs as $output) {
+ usleep($iterationTime);
+ $iterationTime *= 10;
+ echo $output."\n";
+}
diff --git a/vendor/symfony/process/Tests/ProcessFailedExceptionTest.php b/vendor/symfony/process/Tests/ProcessFailedExceptionTest.php
index 25712af7..d8fdb5c1 100644
--- a/vendor/symfony/process/Tests/ProcessFailedExceptionTest.php
+++ b/vendor/symfony/process/Tests/ProcessFailedExceptionTest.php
@@ -24,7 +24,7 @@ class ProcessFailedExceptionTest extends TestCase
*/
public function testProcessFailedExceptionThrowsException()
{
- $process = $this->getMockBuilder('Symfony\Component\Process\Process')->setMethods(array('isSuccessful'))->setConstructorArgs(array('php'))->getMock();
+ $process = $this->getMockBuilder('Symfony\Component\Process\Process')->setMethods(array('isSuccessful'))->setConstructorArgs(array(array('php')))->getMock();
$process->expects($this->once())
->method('isSuccessful')
->will($this->returnValue(true));
@@ -52,7 +52,7 @@ class ProcessFailedExceptionTest extends TestCase
$errorOutput = 'FATAL: Unexpected error';
$workingDirectory = getcwd();
- $process = $this->getMockBuilder('Symfony\Component\Process\Process')->setMethods(array('isSuccessful', 'getOutput', 'getErrorOutput', 'getExitCode', 'getExitCodeText', 'isOutputDisabled', 'getWorkingDirectory'))->setConstructorArgs(array($cmd))->getMock();
+ $process = $this->getMockBuilder('Symfony\Component\Process\Process')->setMethods(array('isSuccessful', 'getOutput', 'getErrorOutput', 'getExitCode', 'getExitCodeText', 'isOutputDisabled', 'getWorkingDirectory'))->setConstructorArgs(array(array($cmd)))->getMock();
$process->expects($this->once())
->method('isSuccessful')
->will($this->returnValue(false));
@@ -85,7 +85,7 @@ class ProcessFailedExceptionTest extends TestCase
$this->assertEquals(
"The command \"$cmd\" failed.\n\nExit Code: $exitCode($exitText)\n\nWorking directory: {$workingDirectory}\n\nOutput:\n================\n{$output}\n\nError Output:\n================\n{$errorOutput}",
- $exception->getMessage()
+ str_replace("'php'", 'php', $exception->getMessage())
);
}
@@ -100,7 +100,7 @@ class ProcessFailedExceptionTest extends TestCase
$exitText = 'General error';
$workingDirectory = getcwd();
- $process = $this->getMockBuilder('Symfony\Component\Process\Process')->setMethods(array('isSuccessful', 'isOutputDisabled', 'getExitCode', 'getExitCodeText', 'getOutput', 'getErrorOutput', 'getWorkingDirectory'))->setConstructorArgs(array($cmd))->getMock();
+ $process = $this->getMockBuilder('Symfony\Component\Process\Process')->setMethods(array('isSuccessful', 'isOutputDisabled', 'getExitCode', 'getExitCodeText', 'getOutput', 'getErrorOutput', 'getWorkingDirectory'))->setConstructorArgs(array(array($cmd)))->getMock();
$process->expects($this->once())
->method('isSuccessful')
->will($this->returnValue(false));
@@ -131,7 +131,7 @@ class ProcessFailedExceptionTest extends TestCase
$this->assertEquals(
"The command \"$cmd\" failed.\n\nExit Code: $exitCode($exitText)\n\nWorking directory: {$workingDirectory}",
- $exception->getMessage()
+ str_replace("'php'", 'php', $exception->getMessage())
);
}
}
diff --git a/vendor/symfony/process/Tests/ProcessTest.php b/vendor/symfony/process/Tests/ProcessTest.php
index f7d4fc82..60162975 100644
--- a/vendor/symfony/process/Tests/ProcessTest.php
+++ b/vendor/symfony/process/Tests/ProcessTest.php
@@ -55,13 +55,13 @@ class ProcessTest extends TestCase
{
try {
// Check that it works fine if the CWD exists
- $cmd = new Process('echo test', __DIR__);
+ $cmd = new Process(array('echo', 'test'), __DIR__);
$cmd->run();
} catch (\Exception $e) {
$this->fail($e);
}
- $cmd = new Process('echo test', __DIR__.'/notfound/');
+ $cmd = new Process(array('echo', 'test'), __DIR__.'/notfound/');
$cmd->run();
}
@@ -133,6 +133,30 @@ class ProcessTest extends TestCase
$this->assertLessThan(15, microtime(true) - $start);
}
+ public function testWaitUntilSpecificOutput()
+ {
+ $p = $this->getProcess(array(self::$phpBin, __DIR__.'/KillableProcessWithOutput.php'));
+ $p->start();
+
+ $start = microtime(true);
+
+ $completeOutput = '';
+ $result = $p->waitUntil(function ($type, $output) use (&$completeOutput) {
+ return false !== strpos($completeOutput .= $output, 'One more');
+ });
+ $this->assertTrue($result);
+ $this->assertLessThan(20, microtime(true) - $start);
+ $this->assertStringStartsWith("First iteration output\nSecond iteration output\nOne more", $completeOutput);
+ $p->stop();
+ }
+
+ public function testWaitUntilCanReturnFalse()
+ {
+ $p = $this->getProcess('echo foo');
+ $p->start();
+ $this->assertFalse($p->waitUntil(function () { return false; }));
+ }
+
public function testAllOutputIsActuallyReadOnTermination()
{
// this code will result in a maximum of 2 reads of 8192 bytes by calling
@@ -1436,12 +1460,12 @@ class ProcessTest extends TestCase
$p = new Process(array(self::$phpBin, '-r', 'echo $argv[1];', $arg));
$p->run();
- $this->assertSame($arg, $p->getOutput());
+ $this->assertSame((string) $arg, $p->getOutput());
}
public function testRawCommandLine()
{
- $p = new Process(sprintf('"%s" -r %s "a" "" "b"', self::$phpBin, escapeshellarg('print_r($argv);')));
+ $p = Process::fromShellCommandline(sprintf('"%s" -r %s "a" "" "b"', self::$phpBin, escapeshellarg('print_r($argv);')));
$p->run();
$expected = << 'Foo', 'BAR' => 'Bar');
$cmd = '\\' === \DIRECTORY_SEPARATOR ? 'echo !FOO! !BAR! !BAZ!' : 'echo $FOO $BAR $BAZ';
- $p = new Process($cmd, null, $env);
+ $p = Process::fromShellCommandline($cmd, null, $env);
$p->run(null, array('BAR' => 'baR', 'BAZ' => 'baZ'));
$this->assertSame('Foo baR baZ', rtrim($p->getOutput()));
$this->assertSame($env, $p->getEnv());
}
- /**
- * @param string $commandline
- * @param string|null $cwd
- * @param array|null $env
- * @param string|null $input
- * @param int $timeout
- * @param array $options
- *
- * @return Process
- */
- private function getProcess($commandline, $cwd = null, array $env = null, $input = null, $timeout = 60)
+ private function getProcess($commandline, string $cwd = null, array $env = null, $input = null, ?int $timeout = 60): Process
{
- $process = new Process($commandline, $cwd, $env, $input, $timeout);
+ if (\is_string($commandline)) {
+ $process = Process::fromShellCommandline($commandline, $cwd, $env, $input, $timeout);
+ } else {
+ $process = new Process($commandline, $cwd, $env, $input, $timeout);
+ }
$process->inheritEnvironmentVariables();
if (self::$process) {
@@ -1501,10 +1522,7 @@ EOTXT;
return self::$process = $process;
}
- /**
- * @return Process
- */
- private function getProcessForCode($code, $cwd = null, array $env = null, $input = null, $timeout = 60)
+ private function getProcessForCode(string $code, string $cwd = null, array $env = null, $input = null, ?int $timeout = 60): Process
{
return $this->getProcess(array(self::$phpBin, '-r', $code), $cwd, $env, $input, $timeout);
}
diff --git a/vendor/symfony/process/composer.json b/vendor/symfony/process/composer.json
index 58f4005b..44bad06b 100644
--- a/vendor/symfony/process/composer.json
+++ b/vendor/symfony/process/composer.json
@@ -27,7 +27,7 @@
"minimum-stability": "dev",
"extra": {
"branch-alias": {
- "dev-master": "4.1-dev"
+ "dev-master": "4.2-dev"
}
}
}
diff --git a/vendor/symfony/process/phpunit.xml.dist b/vendor/symfony/process/phpunit.xml.dist
index d3884673..c32f2510 100644
--- a/vendor/symfony/process/phpunit.xml.dist
+++ b/vendor/symfony/process/phpunit.xml.dist
@@ -1,7 +1,7 @@
*/
-interface ExceptionInterface
+interface ExceptionInterface extends \Throwable
{
}
diff --git a/vendor/symfony/routing/Generator/Dumper/PhpGeneratorDumper.php b/vendor/symfony/routing/Generator/Dumper/PhpGeneratorDumper.php
index 97e03350..6f08a0f3 100644
--- a/vendor/symfony/routing/Generator/Dumper/PhpGeneratorDumper.php
+++ b/vendor/symfony/routing/Generator/Dumper/PhpGeneratorDumper.php
@@ -113,10 +113,17 @@ EOF;
?? $this->context->getParameter('_locale')
?: $this->defaultLocale;
- if (null !== $locale && (self::$declaredRoutes[$name.'.'.$locale][1]['_canonical_route'] ?? null) === $name) {
- unset($parameters['_locale']);
- $name .= '.'.$locale;
- } elseif (!isset(self::$declaredRoutes[$name])) {
+ if (null !== $locale && null !== $name) {
+ do {
+ if ((self::$declaredRoutes[$name.'.'.$locale][1]['_canonical_route'] ?? null) === $name) {
+ unset($parameters['_locale']);
+ $name .= '.'.$locale;
+ break;
+ }
+ } while (false !== $locale = strstr($locale, '_', true));
+ }
+
+ if (!isset(self::$declaredRoutes[$name])) {
throw new RouteNotFoundException(sprintf('Unable to generate a URL for the named route "%s" as such route does not exist.', $name));
}
diff --git a/vendor/symfony/routing/Generator/UrlGenerator.php b/vendor/symfony/routing/Generator/UrlGenerator.php
index 38dd1384..91794423 100644
--- a/vendor/symfony/routing/Generator/UrlGenerator.php
+++ b/vendor/symfony/routing/Generator/UrlGenerator.php
@@ -112,13 +112,21 @@ class UrlGenerator implements UrlGeneratorInterface, ConfigurableRequirementsInt
*/
public function generate($name, $parameters = array(), $referenceType = self::ABSOLUTE_PATH)
{
+ $route = null;
$locale = $parameters['_locale']
?? $this->context->getParameter('_locale')
?: $this->defaultLocale;
- if (null !== $locale && null !== ($route = $this->routes->get($name.'.'.$locale)) && $route->getDefault('_canonical_route') === $name) {
- unset($parameters['_locale']);
- } elseif (null === $route = $this->routes->get($name)) {
+ if (null !== $locale) {
+ do {
+ if (null !== ($route = $this->routes->get($name.'.'.$locale)) && $route->getDefault('_canonical_route') === $name) {
+ unset($parameters['_locale']);
+ break;
+ }
+ } while (false !== $locale = strstr($locale, '_', true));
+ }
+
+ if (null === $route = $route ?? $this->routes->get($name)) {
throw new RouteNotFoundException(sprintf('Unable to generate a URL for the named route "%s" as such route does not exist.', $name));
}
@@ -254,10 +262,7 @@ class UrlGenerator implements UrlGeneratorInterface, ConfigurableRequirementsInt
});
// extract fragment
- $fragment = '';
- if (isset($defaults['_fragment'])) {
- $fragment = $defaults['_fragment'];
- }
+ $fragment = $defaults['_fragment'] ?? '';
if (isset($extra['_fragment'])) {
$fragment = $extra['_fragment'];
diff --git a/vendor/symfony/routing/Loader/AnnotationClassLoader.php b/vendor/symfony/routing/Loader/AnnotationClassLoader.php
index 958217fc..1e5449ab 100644
--- a/vendor/symfony/routing/Loader/AnnotationClassLoader.php
+++ b/vendor/symfony/routing/Loader/AnnotationClassLoader.php
@@ -120,12 +120,9 @@ abstract class AnnotationClassLoader implements LoaderInterface
}
if (0 === $collection->count() && $class->hasMethod('__invoke')) {
+ $globals = $this->resetGlobals();
foreach ($this->reader->getClassAnnotations($class) as $annot) {
if ($annot instanceof $this->routeAnnotationClass) {
- $globals['path'] = '';
- $globals['name'] = '';
- $globals['localized_paths'] = array();
-
$this->addRoute($collection, $annot, $globals, $class, $class->getMethod('__invoke'));
}
}
@@ -142,8 +139,16 @@ abstract class AnnotationClassLoader implements LoaderInterface
}
$name = $globals['name'].$name;
+ $requirements = $annot->getRequirements();
+
+ foreach ($requirements as $placeholder => $requirement) {
+ if (\is_int($placeholder)) {
+ @trigger_error(sprintf('A placeholder name must be a string (%d given). Did you forget to specify the placeholder key for the requirement "%s" of route "%s" in "%s::%s()"?', $placeholder, $requirement, $name, $class->getName(), $method->getName()), E_USER_DEPRECATED);
+ }
+ }
+
$defaults = array_replace($globals['defaults'], $annot->getDefaults());
- $requirements = array_replace($globals['requirements'], $annot->getRequirements());
+ $requirements = array_replace($globals['requirements'], $requirements);
$options = array_replace($globals['options'], $annot->getOptions());
$schemes = array_merge($globals['schemes'], $annot->getSchemes());
$methods = array_merge($globals['methods'], $annot->getMethods());
@@ -254,18 +259,7 @@ abstract class AnnotationClassLoader implements LoaderInterface
protected function getGlobals(\ReflectionClass $class)
{
- $globals = array(
- 'path' => null,
- 'localized_paths' => array(),
- 'requirements' => array(),
- 'options' => array(),
- 'defaults' => array(),
- 'schemes' => array(),
- 'methods' => array(),
- 'host' => '',
- 'condition' => '',
- 'name' => '',
- );
+ $globals = $this->resetGlobals();
if ($annot = $this->reader->getClassAnnotation($class, $this->routeAnnotationClass)) {
if (null !== $annot->getName()) {
@@ -305,11 +299,33 @@ abstract class AnnotationClassLoader implements LoaderInterface
if (null !== $annot->getCondition()) {
$globals['condition'] = $annot->getCondition();
}
+
+ foreach ($globals['requirements'] as $placeholder => $requirement) {
+ if (\is_int($placeholder)) {
+ @trigger_error(sprintf('A placeholder name must be a string (%d given). Did you forget to specify the placeholder key for the requirement "%s" in "%s"?', $placeholder, $requirement, $class->getName()), E_USER_DEPRECATED);
+ }
+ }
}
return $globals;
}
+ private function resetGlobals()
+ {
+ return array(
+ 'path' => null,
+ 'localized_paths' => array(),
+ 'requirements' => array(),
+ 'options' => array(),
+ 'defaults' => array(),
+ 'schemes' => array(),
+ 'methods' => array(),
+ 'host' => '',
+ 'condition' => '',
+ 'name' => '',
+ );
+ }
+
protected function createRoute($path, $defaults, $requirements, $options, $host, $schemes, $methods, $condition)
{
return new Route($path, $defaults, $requirements, $options, $host, $schemes, $methods, $condition);
diff --git a/vendor/symfony/routing/Loader/AnnotationFileLoader.php b/vendor/symfony/routing/Loader/AnnotationFileLoader.php
index ecd68e04..b69fa99c 100644
--- a/vendor/symfony/routing/Loader/AnnotationFileLoader.php
+++ b/vendor/symfony/routing/Loader/AnnotationFileLoader.php
@@ -32,7 +32,7 @@ class AnnotationFileLoader extends FileLoader
public function __construct(FileLocatorInterface $locator, AnnotationClassLoader $loader)
{
if (!\function_exists('token_get_all')) {
- throw new \RuntimeException('The Tokenizer extension is required for the routing annotation loaders.');
+ throw new \LogicException('The Tokenizer extension is required for the routing annotation loaders.');
}
parent::__construct($locator);
diff --git a/vendor/symfony/routing/Loader/YamlFileLoader.php b/vendor/symfony/routing/Loader/YamlFileLoader.php
index bd35c75a..ca2e313a 100644
--- a/vendor/symfony/routing/Loader/YamlFileLoader.php
+++ b/vendor/symfony/routing/Loader/YamlFileLoader.php
@@ -116,6 +116,12 @@ class YamlFileLoader extends FileLoader
$methods = isset($config['methods']) ? $config['methods'] : array();
$condition = isset($config['condition']) ? $config['condition'] : null;
+ foreach ($requirements as $placeholder => $requirement) {
+ if (\is_int($placeholder)) {
+ @trigger_error(sprintf('A placeholder name must be a string (%d given). Did you forget to specify the placeholder key for the requirement "%s" of route "%s" in "%s"?', $placeholder, $requirement, $name, $path), E_USER_DEPRECATED);
+ }
+ }
+
if (isset($config['controller'])) {
$defaults['_controller'] = $config['controller'];
}
diff --git a/vendor/symfony/routing/Matcher/Dumper/PhpMatcherDumper.php b/vendor/symfony/routing/Matcher/Dumper/PhpMatcherDumper.php
index 14e5cc34..c11fc694 100644
--- a/vendor/symfony/routing/Matcher/Dumper/PhpMatcherDumper.php
+++ b/vendor/symfony/routing/Matcher/Dumper/PhpMatcherDumper.php
@@ -13,7 +13,6 @@ namespace Symfony\Component\Routing\Matcher\Dumper;
use Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface;
use Symfony\Component\ExpressionLanguage\ExpressionLanguage;
-use Symfony\Component\Routing\Matcher\RedirectableUrlMatcherInterface;
use Symfony\Component\Routing\Route;
use Symfony\Component\Routing\RouteCollection;
@@ -56,13 +55,11 @@ class PhpMatcherDumper extends MatcherDumper
// trailing slash support is only enabled if we know how to redirect the user
$interfaces = class_implements($options['base_class']);
- $supportsRedirections = isset($interfaces[RedirectableUrlMatcherInterface::class]);
return <<context = \$context;
- }
-
-{$this->generateMatchMethod($supportsRedirections)}
+{$this->generateProperties()} }
}
EOF;
@@ -90,7 +87,7 @@ EOF;
/**
* Generates the code for the match method implementing UrlMatcherInterface.
*/
- private function generateMatchMethod(bool $supportsRedirections): string
+ private function generateProperties(): string
{
// Group hosts by same-suffix, re-order when possible
$matchHost = false;
@@ -103,86 +100,25 @@ EOF;
$routes->addRoute($host ?: '/(.*)', array($name, $route));
}
- $routes = $matchHost ? $routes->populateCollection(new RouteCollection()) : $this->getRoutes();
-
- $code = rtrim($this->compileRoutes($routes, $matchHost), "\n");
- $fetchHost = $matchHost ? " \$host = strtolower(\$context->getHost());\n" : '';
-
- $code = <<context;
- \$requestMethod = \$canonicalMethod = \$context->getMethod();
-{$fetchHost}
- if ('HEAD' === \$requestMethod) {
- \$canonicalMethod = 'GET';
- }
-
-$code
-
-EOF;
-
- if ($supportsRedirections) {
- return <<<'EOF'
- public function match($pathinfo)
- {
- $allow = $allowSchemes = array();
- if ($ret = $this->doMatch($pathinfo, $allow, $allowSchemes)) {
- return $ret;
- }
- if ($allow) {
- throw new MethodNotAllowedException(array_keys($allow));
- }
- if (!in_array($this->context->getMethod(), array('HEAD', 'GET'), true)) {
- // no-op
- } elseif ($allowSchemes) {
- redirect_scheme:
- $scheme = $this->context->getScheme();
- $this->context->setScheme(key($allowSchemes));
- try {
- if ($ret = $this->doMatch($pathinfo)) {
- return $this->redirect($pathinfo, $ret['_route'], $this->context->getScheme()) + $ret;
- }
- } finally {
- $this->context->setScheme($scheme);
- }
- } elseif ('/' !== $pathinfo) {
- $pathinfo = '/' !== $pathinfo[-1] ? $pathinfo.'/' : substr($pathinfo, 0, -1);
- if ($ret = $this->doMatch($pathinfo, $allow, $allowSchemes)) {
- return $this->redirect($pathinfo, $ret['_route']) + $ret;
- }
- if ($allowSchemes) {
- goto redirect_scheme;
- }
- }
- throw new ResourceNotFoundException();
- }
-
- private function doMatch(string $rawPathinfo, array &$allow = array(), array &$allowSchemes = array()): ?array
-
-EOF
- .$code."\n return null;\n }";
+ if ($matchHost) {
+ $code = '$this->matchHost = true;'."\n";
+ $routes = $routes->populateCollection(new RouteCollection());
+ } else {
+ $code = '';
+ $routes = $this->getRoutes();
}
- return " public function match(\$rawPathinfo)\n".$code."\n throw \$allow ? new MethodNotAllowedException(array_keys(\$allow)) : new ResourceNotFoundException();\n }";
- }
-
- /**
- * Generates PHP code to match a RouteCollection with all its routes.
- */
- private function compileRoutes(RouteCollection $routes, bool $matchHost): string
- {
list($staticRoutes, $dynamicRoutes) = $this->groupStaticRoutes($routes);
- $code = $this->compileStaticRoutes($staticRoutes, $matchHost);
+ $conditions = array(null);
+ $code .= $this->compileStaticRoutes($staticRoutes, $conditions);
$chunkLimit = \count($dynamicRoutes);
while (true) {
try {
$this->signalingException = new \RuntimeException('preg_match(): Compilation failed: regular expression is too large');
- $code .= $this->compileDynamicRoutes($dynamicRoutes, $matchHost, $chunkLimit);
+ $code .= $this->compileDynamicRoutes($dynamicRoutes, $matchHost, $chunkLimit, $conditions);
break;
} catch (\Exception $e) {
if (1 < $chunkLimit && $this->signalingException === $e) {
@@ -193,12 +129,24 @@ EOF
}
}
- // used to display the Welcome Page in apps that don't define a homepage
- $code .= " if ('/' === \$pathinfo && !\$allow && !\$allowSchemes) {\n";
- $code .= " throw new Symfony\Component\Routing\Exception\NoConfigurationException();\n";
- $code .= " }\n";
+ unset($conditions[0]);
- return $code;
+ if (!$conditions) {
+ return $this->indent($code, 2);
+ }
+
+ foreach ($conditions as $expression => $condition) {
+ $conditions[$expression] = "case {$condition}: return {$expression};";
+ }
+
+ return $this->indent($code, 2).<<checkCondition = static function (\$condition, \$context, \$request) {
+ switch (\$condition) {
+{$this->indent(implode("\n", $conditions), 4)}
+ }
+ };
+
+EOF;
}
/**
@@ -213,9 +161,18 @@ EOF
$compiledRoute = $route->compile();
$hostRegex = $compiledRoute->getHostRegex();
$regex = $compiledRoute->getRegex();
+ if ($hasTrailingSlash = '/' !== $route->getPath()) {
+ $pos = strrpos($regex, '$');
+ $hasTrailingSlash = '/' === $regex[$pos - 1];
+ $regex = substr_replace($regex, '/?$', $pos - $hasTrailingSlash, 1 + $hasTrailingSlash);
+ }
+
if (!$compiledRoute->getPathVariables()) {
$host = !$compiledRoute->getHostVariables() ? $route->getHost() : '';
$url = $route->getPath();
+ if ($hasTrailingSlash) {
+ $url = substr($url, 0, -1);
+ }
foreach ($dynamicRegex as list($hostRx, $rx)) {
if (preg_match($rx, $url) && (!$host || !$hostRx || preg_match($hostRx, $host))) {
$dynamicRegex[] = array($hostRegex, $regex);
@@ -224,7 +181,7 @@ EOF
}
}
- $staticRoutes[$url][$name] = $route;
+ $staticRoutes[$url][$name] = array($route, $hasTrailingSlash);
} else {
$dynamicRegex[] = array($hostRegex, $regex);
$dynamicRoutes->add($name, $route);
@@ -242,58 +199,26 @@ EOF
*
* @throws \LogicException
*/
- private function compileStaticRoutes(array $staticRoutes, bool $matchHost): string
+ private function compileStaticRoutes(array $staticRoutes, array &$conditions): string
{
if (!$staticRoutes) {
return '';
}
- $code = $default = '';
+ $code = '';
foreach ($staticRoutes as $url => $routes) {
- if (1 === \count($routes)) {
- foreach ($routes as $name => $route) {
- }
-
- if (!$route->getCondition()) {
- $defaults = $route->getDefaults();
- if (isset($defaults['_canonical_route'])) {
- $name = $defaults['_canonical_route'];
- unset($defaults['_canonical_route']);
- }
- $default .= sprintf(
- "%s => array(%s, %s, %s, %s),\n",
- self::export($url),
- self::export(array('_route' => $name) + $defaults),
- self::export(!$route->compile()->getHostVariables() ? $route->getHost() : $route->compile()->getHostRegex() ?: null),
- self::export(array_flip($route->getMethods()) ?: null),
- self::export(array_flip($route->getSchemes()) ?: null)
- );
- continue;
- }
- }
-
- $code .= sprintf(" case %s:\n", self::export($url));
- foreach ($routes as $name => $route) {
- $code .= $this->compileRoute($route, $name, true);
+ $code .= self::export($url)." => array(\n";
+ foreach ($routes as $name => list($route, $hasTrailingSlash)) {
+ $code .= $this->compileRoute($route, $name, !$route->compile()->getHostVariables() ? $route->getHost() : $route->compile()->getHostRegex() ?: null, $hasTrailingSlash, $conditions);
}
- $code .= " break;\n";
+ $code .= "),\n";
}
- if ($default) {
- $code .= <<indent($default, 4)} );
-
- if (!isset(\$routes[\$pathinfo])) {
- break;
- }
- list(\$ret, \$requiredHost, \$requiredMethods, \$requiredSchemes) = \$routes[\$pathinfo];
-{$this->compileSwitchDefault(false, $matchHost)}
-EOF;
+ if ($code) {
+ return "\$this->staticRoutes = array(\n{$this->indent($code, 1)});\n";
}
- return sprintf(" switch (\$pathinfo) {\n%s }\n\n", $this->indent($code));
+ return $code;
}
/**
@@ -314,7 +239,7 @@ EOF;
* matching-but-failing subpattern is blacklisted by replacing its name by "(*F)", which forces a failure-to-match.
* To ease this backlisting operation, the name of subpatterns is also the string offset where the replacement should occur.
*/
- private function compileDynamicRoutes(RouteCollection $collection, bool $matchHost, int $chunkLimit): string
+ private function compileDynamicRoutes(RouteCollection $collection, bool $matchHost, int $chunkLimit, array &$conditions): string
{
if (!$collection->all()) {
return '';
@@ -322,8 +247,7 @@ EOF;
$code = '';
$state = (object) array(
'regex' => '',
- 'switch' => '',
- 'default' => '',
+ 'routes' => '',
'mark' => 0,
'markTail' => 0,
'hostVars' => array(),
@@ -367,7 +291,7 @@ EOF;
}
$prev = false;
$rx = '{^(?';
- $code .= "\n {$state->mark} => ".self::export($rx);
+ $code .= "\n {$state->mark} => ".self::export($rx);
$state->mark += \strlen($rx);
$state->regex = $rx;
@@ -383,7 +307,7 @@ EOF;
$state->hostVars = array();
}
$state->mark += \strlen($rx = ($prev ? ')' : '')."|{$hostRegex}(?");
- $code .= "\n .".self::export($rx);
+ $code .= "\n .".self::export($rx);
$state->regex .= $rx;
$prev = true;
}
@@ -394,17 +318,21 @@ EOF;
$state->vars = array();
$regex = preg_replace_callback('#\?P<([^>]++)>#', $state->getVars, $rx[1]);
- $tree->addRoute($regex, array($name, $regex, $state->vars, $route));
+ if ($hasTrailingSlash = '/' !== $regex && '/' === $regex[-1]) {
+ $regex = substr($regex, 0, -1);
+ }
+
+ $tree->addRoute($regex, array($name, $regex, $state->vars, $route, $hasTrailingSlash));
}
- $code .= $this->compileStaticPrefixCollection($tree, $state);
+ $code .= $this->compileStaticPrefixCollection($tree, $state, 0, $conditions);
}
if ($matchHost) {
- $code .= "\n .')'";
+ $code .= "\n .')'";
$state->regex .= ')';
}
- $rx = ")$}{$modifiers}";
- $code .= "\n .'{$rx}',";
+ $rx = ")(?:/?)$}{$modifiers}";
+ $code .= "\n .'{$rx}',";
$state->regex .= $rx;
$state->markTail = 0;
@@ -417,39 +345,10 @@ EOF;
}
}
- if ($state->default) {
- $state->switch .= <<indent($state->default, 4)} );
-
- list(\$ret, \$vars, \$requiredMethods, \$requiredSchemes) = \$routes[\$m];
-{$this->compileSwitchDefault(true, $matchHost)}
-EOF;
- }
-
- $matchedPathinfo = $matchHost ? '$host.\'.\'.$pathinfo' : '$pathinfo';
unset($state->getVars);
- return << \$regex) {
- while (preg_match(\$regex, \$matchedPathinfo, \$matches)) {
- switch (\$m = (int) \$matches['MARK']) {
-{$this->indent($state->switch, 3)} }
-
- if ({$state->mark} === \$m) {
- break;
- }
- \$regex = substr_replace(\$regex, 'F', \$m - \$offset, 1 + strlen(\$m));
- \$offset += strlen(\$m);
- }
- }
-
-EOF;
+ return "\$this->regexpList = array({$code}\n);\n"
+ ."\$this->dynamicRoutes = array(\n{$this->indent($state->routes, 1)});\n";
}
/**
@@ -458,7 +357,7 @@ EOF;
* @param \stdClass $state A simple state object that keeps track of the progress of the compilation,
* and gathers the generated switch's "case" and "default" statements
*/
- private function compileStaticPrefixCollection(StaticPrefixCollection $tree, \stdClass $state, int $prefixLen = 0): string
+ private function compileStaticPrefixCollection(StaticPrefixCollection $tree, \stdClass $state, int $prefixLen, array &$conditions): string
{
$code = '';
$prevRegex = null;
@@ -469,262 +368,72 @@ EOF;
$prevRegex = null;
$prefix = substr($route->getPrefix(), $prefixLen);
$state->mark += \strlen($rx = "|{$prefix}(?");
- $code .= "\n .".self::export($rx);
+ $code .= "\n .".self::export($rx);
$state->regex .= $rx;
- $code .= $this->indent($this->compileStaticPrefixCollection($route, $state, $prefixLen + \strlen($prefix)));
- $code .= "\n .')'";
+ $code .= $this->indent($this->compileStaticPrefixCollection($route, $state, $prefixLen + \strlen($prefix), $conditions));
+ $code .= "\n .')'";
$state->regex .= ')';
++$state->markTail;
continue;
}
- list($name, $regex, $vars, $route) = $route;
+ list($name, $regex, $vars, $route, $hasTrailingSlash) = $route;
$compiledRoute = $route->compile();
+ $vars = array_merge($state->hostVars, $vars);
if ($compiledRoute->getRegex() === $prevRegex) {
- $state->switch = substr_replace($state->switch, $this->compileRoute($route, $name, false)."\n", -19, 0);
+ $state->routes = substr_replace($state->routes, $this->compileRoute($route, $name, $vars, $hasTrailingSlash, $conditions), -3, 0);
continue;
}
$state->mark += 3 + $state->markTail + \strlen($regex) - $prefixLen;
$state->markTail = 2 + \strlen($state->mark);
$rx = sprintf('|%s(*:%s)', substr($regex, $prefixLen), $state->mark);
- $code .= "\n .".self::export($rx);
+ $code .= "\n .".self::export($rx);
$state->regex .= $rx;
- $vars = array_merge($state->hostVars, $vars);
-
- if (!$route->getCondition() && (!\is_array($next = $routes[1 + $i] ?? null) || $regex !== $next[1])) {
- $prevRegex = null;
- $defaults = $route->getDefaults();
- if (isset($defaults['_canonical_route'])) {
- $name = $defaults['_canonical_route'];
- unset($defaults['_canonical_route']);
- }
- $state->default .= sprintf(
- "%s => array(%s, %s, %s, %s),\n",
- $state->mark,
- self::export(array('_route' => $name) + $defaults),
- self::export($vars),
- self::export(array_flip($route->getMethods()) ?: null),
- self::export(array_flip($route->getSchemes()) ?: null)
- );
- } else {
- $prevRegex = $compiledRoute->getRegex();
- $combine = ' $matches = array(';
- foreach ($vars as $j => $m) {
- $combine .= sprintf('%s => $matches[%d] ?? null, ', self::export($m), 1 + $j);
- }
- $combine = $vars ? substr_replace($combine, ");\n\n", -2) : '';
-
- $state->switch .= <<mark}:
-{$combine}{$this->compileRoute($route, $name, false)}
- break;
-
-EOF;
- }
- }
-
- return $code;
- }
- /**
- * A simple helper to compiles the switch's "default" for both static and dynamic routes.
- */
- private function compileSwitchDefault(bool $hasVars, bool $matchHost): string
- {
- if ($hasVars) {
- $code = << \$v) {
- if (isset(\$matches[1 + \$i])) {
- \$ret[\$v] = \$matches[1 + \$i];
- }
- }
-
-EOF;
- } elseif ($matchHost) {
- $code = <<mergeDefaults(\$hostMatches, \$ret);
- }
- }
-
-EOF;
- } else {
- $code = '';
+ $prevRegex = $compiledRoute->getRegex();
+ $state->routes .= sprintf("%s => array(\n%s),\n", $state->mark, $this->compileRoute($route, $name, $vars, $hasTrailingSlash, $conditions));
}
- $code .= <<getScheme()]);
- if (\$requiredMethods && !isset(\$requiredMethods[\$canonicalMethod]) && !isset(\$requiredMethods[\$requestMethod])) {
- if (\$hasRequiredScheme) {
- \$allow += \$requiredMethods;
- }
- break;
- }
- if (!\$hasRequiredScheme) {
- \$allowSchemes += \$requiredSchemes;
- break;
- }
-
- return \$ret;
-
-EOF;
-
return $code;
}
/**
* Compiles a single Route to PHP code used to match it against the path info.
- *
- * @throws \LogicException
*/
- private function compileRoute(Route $route, string $name, bool $checkHost): string
+ private function compileRoute(Route $route, string $name, $vars, bool $hasTrailingSlash, array &$conditions): string
{
- $code = '';
- $compiledRoute = $route->compile();
- $conditions = array();
- $matches = (bool) $compiledRoute->getPathVariables();
- $hostMatches = (bool) $compiledRoute->getHostVariables();
- $methods = array_flip($route->getMethods());
-
- if ($route->getCondition()) {
- $expression = $this->getExpressionLanguage()->compile($route->getCondition(), array('context', 'request'));
-
- if (false !== strpos($expression, '$request')) {
- $conditions[] = '($request = $request ?? $this->request ?: $this->createRequest($pathinfo))';
- }
- $conditions[] = $expression;
- }
-
- if (!$checkHost || !$compiledRoute->getHostRegex()) {
- // no-op
- } elseif ($hostMatches) {
- $conditions[] = sprintf('preg_match(%s, $host, $hostMatches)', self::export($compiledRoute->getHostRegex()));
- } else {
- $conditions[] = sprintf('%s === $host', self::export($route->getHost()));
- }
-
- $conditions = implode(' && ', $conditions);
-
- if ($conditions) {
- $code .= <<getDefaults();
+
if (isset($defaults['_canonical_route'])) {
$name = $defaults['_canonical_route'];
unset($defaults['_canonical_route']);
}
- // optimize parameters array
- if ($matches || $hostMatches) {
- $vars = array("array('_route' => '$name')");
- if ($matches || ($hostMatches && !$checkHost)) {
- $vars[] = '$matches';
- }
- if ($hostMatches && $checkHost) {
- $vars[] = '$hostMatches';
- }
-
- $code .= sprintf(
- " \$ret = \$this->mergeDefaults(%s, %s);\n",
- implode(' + ', $vars),
- self::export($defaults)
- );
- } elseif ($defaults) {
- $code .= sprintf(" \$ret = %s;\n", self::export(array('_route' => $name) + $defaults));
- } else {
- $code .= sprintf(" \$ret = array('_route' => '%s');\n", $name);
- }
-
- if ($methods) {
- $methodVariable = isset($methods['GET']) ? '$canonicalMethod' : '$requestMethod';
- $methods = self::export($methods);
- }
-
- if ($schemes = $route->getSchemes()) {
- $schemes = self::export(array_flip($schemes));
- if ($methods) {
- $code .= <<getScheme()]);
- if (!isset((\$a = {$methods})[{$methodVariable}])) {
- if (\$hasRequiredScheme) {
- \$allow += \$a;
- }
- goto $gotoname;
- }
- if (!\$hasRequiredScheme) {
- \$allowSchemes += \$requiredSchemes;
- goto $gotoname;
- }
-
-
-EOF;
- } else {
- $code .= <<getScheme()])) {
- \$allowSchemes += \$requiredSchemes;
- goto $gotoname;
- }
-
-
-EOF;
- }
- } elseif ($methods) {
- $code .= <<getCondition()) {
+ $condition = $this->getExpressionLanguage()->compile($condition, array('context', 'request'));
+ $condition = $conditions[$condition] ?? $conditions[$condition] = (false !== strpos($condition, '$request') ? 1 : -1) * \count($conditions);
} else {
- $code = substr_replace($code, 'return', $retOffset, 6);
- }
- if ($conditions) {
- $code .= " }\n";
- } elseif ($schemes || $methods) {
- $code .= ' ';
- }
-
- if ($schemes || $methods) {
- $code .= " $gotoname:\n";
+ $condition = 'null';
}
- return $conditions ? $this->indent($code) : $code;
+ return sprintf(
+ " array(%s, %s, %s, %s, %s, %s),\n",
+ self::export(array('_route' => $name) + $defaults),
+ self::export($vars),
+ self::export(array_flip($route->getMethods()) ?: null),
+ self::export(array_flip($route->getSchemes()) ?: null),
+ self::export($hasTrailingSlash),
+ $condition
+ );
}
private function getExpressionLanguage()
{
if (null === $this->expressionLanguage) {
if (!class_exists('Symfony\Component\ExpressionLanguage\ExpressionLanguage')) {
- throw new \RuntimeException('Unable to use expressions as the Symfony ExpressionLanguage component is not installed.');
+ throw new \LogicException('Unable to use expressions as the Symfony ExpressionLanguage component is not installed.');
}
$this->expressionLanguage = new ExpressionLanguage(null, $this->expressionLanguageProviders);
}
@@ -734,6 +443,8 @@ EOF;
private function indent($code, $level = 1)
{
+ $code = preg_replace('/ => array\(\n (array\(.+),\n\),/', ' => array($1),', $code);
+
return preg_replace('/^./m', str_repeat(' ', $level).'$0', $code);
}
diff --git a/vendor/symfony/routing/Matcher/Dumper/PhpMatcherTrait.php b/vendor/symfony/routing/Matcher/Dumper/PhpMatcherTrait.php
new file mode 100644
index 00000000..85c8cba8
--- /dev/null
+++ b/vendor/symfony/routing/Matcher/Dumper/PhpMatcherTrait.php
@@ -0,0 +1,181 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Routing\Matcher\Dumper;
+
+use Symfony\Component\Routing\Exception\MethodNotAllowedException;
+use Symfony\Component\Routing\Exception\NoConfigurationException;
+use Symfony\Component\Routing\Exception\ResourceNotFoundException;
+use Symfony\Component\Routing\Matcher\RedirectableUrlMatcherInterface;
+
+/**
+ * @author Nicolas Grekas
+ *
+ * @internal
+ */
+trait PhpMatcherTrait
+{
+ private $matchHost = false;
+ private $staticRoutes = array();
+ private $regexpList = array();
+ private $dynamicRoutes = array();
+ private $checkCondition;
+
+ public function match($pathinfo)
+ {
+ $allow = $allowSchemes = array();
+ if ($ret = $this->doMatch($pathinfo, $allow, $allowSchemes)) {
+ return $ret;
+ }
+ if ($allow) {
+ throw new MethodNotAllowedException(array_keys($allow));
+ }
+ if (!$this instanceof RedirectableUrlMatcherInterface) {
+ throw new ResourceNotFoundException();
+ }
+ if (!\in_array($this->context->getMethod(), array('HEAD', 'GET'), true)) {
+ // no-op
+ } elseif ($allowSchemes) {
+ redirect_scheme:
+ $scheme = $this->context->getScheme();
+ $this->context->setScheme(key($allowSchemes));
+ try {
+ if ($ret = $this->doMatch($pathinfo)) {
+ return $this->redirect($pathinfo, $ret['_route'], $this->context->getScheme()) + $ret;
+ }
+ } finally {
+ $this->context->setScheme($scheme);
+ }
+ } elseif ('/' !== $pathinfo) {
+ $pathinfo = '/' !== $pathinfo[-1] ? $pathinfo.'/' : substr($pathinfo, 0, -1);
+ if ($ret = $this->doMatch($pathinfo, $allow, $allowSchemes)) {
+ return $this->redirect($pathinfo, $ret['_route']) + $ret;
+ }
+ if ($allowSchemes) {
+ goto redirect_scheme;
+ }
+ }
+
+ throw new ResourceNotFoundException();
+ }
+
+ private function doMatch(string $rawPathinfo, array &$allow = array(), array &$allowSchemes = array()): array
+ {
+ $allow = $allowSchemes = array();
+ $pathinfo = rawurldecode($rawPathinfo) ?: '/';
+ $context = $this->context;
+ $requestMethod = $canonicalMethod = $context->getMethod();
+ $trimmedPathinfo = '/' !== $pathinfo && '/' === $pathinfo[-1] ? substr($pathinfo, 0, -1) : $pathinfo;
+
+ if ($this->matchHost) {
+ $host = strtolower($context->getHost());
+ }
+
+ if ('HEAD' === $requestMethod) {
+ $canonicalMethod = 'GET';
+ }
+
+ foreach ($this->staticRoutes[$trimmedPathinfo] ?? array() as list($ret, $requiredHost, $requiredMethods, $requiredSchemes, $hasTrailingSlash, $condition)) {
+ if ($condition && !($this->checkCondition)($condition, $context, 0 < $condition ? $request ?? $request = $this->request ?: $this->createRequest($pathinfo) : null)) {
+ continue;
+ }
+
+ if ('/' === $pathinfo || $hasTrailingSlash === ('/' === $pathinfo[-1])) {
+ // no-op
+ } elseif ($this instanceof RedirectableUrlMatcherInterface && (!$requiredMethods || isset($requiredMethods['GET'])) && 'GET' === $canonicalMethod) {
+ return $allow = $allowSchemes = array();
+ } else {
+ continue;
+ }
+
+ if ($requiredHost) {
+ if ('#' !== $requiredHost[0] ? $requiredHost !== $host : !preg_match($requiredHost, $host, $hostMatches)) {
+ continue;
+ }
+ if ('#' === $requiredHost[0] && $hostMatches) {
+ $hostMatches['_route'] = $ret['_route'];
+ $ret = $this->mergeDefaults($hostMatches, $ret);
+ }
+ }
+
+ $hasRequiredScheme = !$requiredSchemes || isset($requiredSchemes[$context->getScheme()]);
+ if ($requiredMethods && !isset($requiredMethods[$canonicalMethod]) && !isset($requiredMethods[$requestMethod])) {
+ if ($hasRequiredScheme) {
+ $allow += $requiredMethods;
+ }
+ continue;
+ }
+ if (!$hasRequiredScheme) {
+ $allowSchemes += $requiredSchemes;
+ continue;
+ }
+
+ return $ret;
+ }
+
+ $matchedPathinfo = $this->matchHost ? $host.'.'.$pathinfo : $pathinfo;
+
+ foreach ($this->regexpList as $offset => $regex) {
+ while (preg_match($regex, $matchedPathinfo, $matches)) {
+ foreach ($this->dynamicRoutes[$m = (int) $matches['MARK']] as list($ret, $vars, $requiredMethods, $requiredSchemes, $hasTrailingSlash, $condition)) {
+ if ($condition && !($this->checkCondition)($condition, $context, 0 < $condition ? $request ?? $request = $this->request ?: $this->createRequest($pathinfo) : null)) {
+ continue;
+ }
+
+ if ('/' !== $pathinfo) {
+ if ('/' === $pathinfo[-1]) {
+ if (preg_match($regex, substr($pathinfo, 0, -1), $n) && $m === (int) $n['MARK']) {
+ $matches = $n;
+ } else {
+ $hasTrailingSlash = true;
+ }
+ }
+ if ($hasTrailingSlash !== ('/' === $pathinfo[-1])) {
+ if ($this instanceof RedirectableUrlMatcherInterface && (!$requiredMethods || isset($requiredMethods['GET'])) && 'GET' === $canonicalMethod) {
+ return $allow = $allowSchemes = array();
+ }
+ continue;
+ }
+ }
+
+ foreach ($vars as $i => $v) {
+ if (isset($matches[1 + $i])) {
+ $ret[$v] = $matches[1 + $i];
+ }
+ }
+
+ $hasRequiredScheme = !$requiredSchemes || isset($requiredSchemes[$context->getScheme()]);
+ if ($requiredMethods && !isset($requiredMethods[$canonicalMethod]) && !isset($requiredMethods[$requestMethod])) {
+ if ($hasRequiredScheme) {
+ $allow += $requiredMethods;
+ }
+ continue;
+ }
+ if (!$hasRequiredScheme) {
+ $allowSchemes += $requiredSchemes;
+ continue;
+ }
+
+ return $ret;
+ }
+
+ $regex = substr_replace($regex, 'F', $m - $offset, 1 + \strlen($m));
+ $offset += \strlen($m);
+ }
+ }
+
+ if ('/' === $pathinfo && !$allow && !$allowSchemes) {
+ throw new NoConfigurationException();
+ }
+
+ return array();
+ }
+}
diff --git a/vendor/symfony/routing/Matcher/UrlMatcher.php b/vendor/symfony/routing/Matcher/UrlMatcher.php
index 095e6dc2..0d5d14da 100644
--- a/vendor/symfony/routing/Matcher/UrlMatcher.php
+++ b/vendor/symfony/routing/Matcher/UrlMatcher.php
@@ -130,18 +130,57 @@ class UrlMatcher implements UrlMatcherInterface, RequestMatcherInterface
*/
protected function matchCollection($pathinfo, RouteCollection $routes)
{
+ // HEAD and GET are equivalent as per RFC
+ if ('HEAD' === $method = $this->context->getMethod()) {
+ $method = 'GET';
+ }
+ $supportsTrailingSlash = '/' !== $pathinfo && '' !== $pathinfo && $this instanceof RedirectableUrlMatcherInterface;
+
foreach ($routes as $name => $route) {
$compiledRoute = $route->compile();
+ $staticPrefix = $compiledRoute->getStaticPrefix();
+ $requiredMethods = $route->getMethods();
// check the static prefix of the URL first. Only use the more expensive preg_match when it matches
- if ('' !== $compiledRoute->getStaticPrefix() && 0 !== strpos($pathinfo, $compiledRoute->getStaticPrefix())) {
+ if ('' === $staticPrefix || 0 === strpos($pathinfo, $staticPrefix)) {
+ // no-op
+ } elseif (!$supportsTrailingSlash || ($requiredMethods && !\in_array('GET', $requiredMethods)) || 'GET' !== $method) {
continue;
+ } elseif ('/' === $staticPrefix[-1] && substr($staticPrefix, 0, -1) === $pathinfo) {
+ return $this->allow = $this->allowSchemes = array();
+ } elseif ('/' === $pathinfo[-1] && substr($pathinfo, 0, -1) === $staticPrefix) {
+ return $this->allow = $this->allowSchemes = array();
+ } else {
+ continue;
+ }
+ $regex = $compiledRoute->getRegex();
+
+ if ($supportsTrailingSlash) {
+ $pos = strrpos($regex, '$');
+ $hasTrailingSlash = '/' === $regex[$pos - 1];
+ $regex = substr_replace($regex, '/?$', $pos - $hasTrailingSlash, 1 + $hasTrailingSlash);
}
- if (!preg_match($compiledRoute->getRegex(), $pathinfo, $matches)) {
+ if (!preg_match($regex, $pathinfo, $matches)) {
continue;
}
+ if ($supportsTrailingSlash) {
+ if ('/' === $pathinfo[-1]) {
+ if (preg_match($regex, substr($pathinfo, 0, -1), $m)) {
+ $matches = $m;
+ } else {
+ $hasTrailingSlash = true;
+ }
+ }
+ if ($hasTrailingSlash !== ('/' === $pathinfo[-1])) {
+ if ((!$requiredMethods || \in_array('GET', $requiredMethods)) && 'GET' === $method) {
+ return $this->allow = $this->allowSchemes = array();
+ }
+ continue;
+ }
+ }
+
$hostMatches = array();
if ($compiledRoute->getHostRegex() && !preg_match($compiledRoute->getHostRegex(), $this->context->getHost(), $hostMatches)) {
continue;
@@ -154,12 +193,7 @@ class UrlMatcher implements UrlMatcherInterface, RequestMatcherInterface
}
$hasRequiredScheme = !$route->getSchemes() || $route->hasScheme($this->context->getScheme());
- if ($requiredMethods = $route->getMethods()) {
- // HEAD and GET are equivalent as per RFC
- if ('HEAD' === $method = $this->context->getMethod()) {
- $method = 'GET';
- }
-
+ if ($requiredMethods) {
if (!\in_array($method, $requiredMethods)) {
if ($hasRequiredScheme) {
$this->allow = array_merge($this->allow, $requiredMethods);
@@ -177,6 +211,8 @@ class UrlMatcher implements UrlMatcherInterface, RequestMatcherInterface
return $this->getAttributes($route, $name, array_replace($matches, $hostMatches, isset($status[1]) ? $status[1] : array()));
}
+
+ return array();
}
/**
@@ -246,7 +282,7 @@ class UrlMatcher implements UrlMatcherInterface, RequestMatcherInterface
{
if (null === $this->expressionLanguage) {
if (!class_exists('Symfony\Component\ExpressionLanguage\ExpressionLanguage')) {
- throw new \RuntimeException('Unable to use expressions as the Symfony ExpressionLanguage component is not installed.');
+ throw new \LogicException('Unable to use expressions as the Symfony ExpressionLanguage component is not installed.');
}
$this->expressionLanguage = new ExpressionLanguage(null, $this->expressionLanguageProviders);
}
diff --git a/vendor/symfony/routing/RouteCollectionBuilder.php b/vendor/symfony/routing/RouteCollectionBuilder.php
index eb42887f..e0f30769 100644
--- a/vendor/symfony/routing/RouteCollectionBuilder.php
+++ b/vendor/symfony/routing/RouteCollectionBuilder.php
@@ -11,7 +11,7 @@
namespace Symfony\Component\Routing;
-use Symfony\Component\Config\Exception\FileLoaderLoadException;
+use Symfony\Component\Config\Exception\LoaderLoadException;
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\Config\Resource\ResourceInterface;
@@ -54,7 +54,7 @@ class RouteCollectionBuilder
*
* @return self
*
- * @throws FileLoaderLoadException
+ * @throws LoaderLoadException
*/
public function import($resource, $prefix = '/', $type = null)
{
@@ -347,7 +347,7 @@ class RouteCollectionBuilder
*
* @return RouteCollection[]
*
- * @throws FileLoaderLoadException If no loader is found
+ * @throws LoaderLoadException If no loader is found
*/
private function load($resource, string $type = null): array
{
@@ -362,11 +362,11 @@ class RouteCollectionBuilder
}
if (null === $resolver = $this->loader->getResolver()) {
- throw new FileLoaderLoadException($resource, null, null, null, $type);
+ throw new LoaderLoadException($resource, null, null, null, $type);
}
if (false === $loader = $resolver->resolve($resource, $type)) {
- throw new FileLoaderLoadException($resource, null, null, null, $type);
+ throw new LoaderLoadException($resource, null, null, null, $type);
}
$collections = $loader->load($resource, $type);
diff --git a/vendor/symfony/routing/Router.php b/vendor/symfony/routing/Router.php
index 56842a4d..3f4838ea 100644
--- a/vendor/symfony/routing/Router.php
+++ b/vendor/symfony/routing/Router.php
@@ -375,7 +375,7 @@ class Router implements RouterInterface, RequestMatcherInterface
* Provides the ConfigCache factory implementation, falling back to a
* default implementation if necessary.
*
- * @return ConfigCacheFactoryInterface $configCacheFactory
+ * @return ConfigCacheFactoryInterface
*/
private function getConfigCacheFactory()
{
diff --git a/vendor/symfony/routing/Tests/Fixtures/AnnotationFixtures/InvokableController.php b/vendor/symfony/routing/Tests/Fixtures/AnnotationFixtures/InvokableController.php
index b25a0ad9..c70793a8 100644
--- a/vendor/symfony/routing/Tests/Fixtures/AnnotationFixtures/InvokableController.php
+++ b/vendor/symfony/routing/Tests/Fixtures/AnnotationFixtures/InvokableController.php
@@ -5,7 +5,7 @@ namespace Symfony\Component\Routing\Tests\Fixtures\AnnotationFixtures;
use Symfony\Component\Routing\Annotation\Route;
/**
- * @Route("/here", name="lol")
+ * @Route("/here", name="lol", methods={"GET", "POST"}, schemes={"https"})
*/
class InvokableController
{
diff --git a/vendor/symfony/routing/Tests/Fixtures/AnnotationFixtures/RequirementsWithoutPlaceholderNameController.php b/vendor/symfony/routing/Tests/Fixtures/AnnotationFixtures/RequirementsWithoutPlaceholderNameController.php
new file mode 100644
index 00000000..301f9691
--- /dev/null
+++ b/vendor/symfony/routing/Tests/Fixtures/AnnotationFixtures/RequirementsWithoutPlaceholderNameController.php
@@ -0,0 +1,27 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Routing\Tests\Fixtures\AnnotationFixtures;
+
+use Symfony\Component\Routing\Annotation\Route;
+
+/**
+ * @Route("/", requirements={"foo", "\d+"})
+ */
+class RequirementsWithoutPlaceholderNameController
+{
+ /**
+ * @Route("/{foo}", name="foo", requirements={"foo", "\d+"})
+ */
+ public function foo()
+ {
+ }
+}
diff --git a/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher0.php b/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher0.php
index e7c07650..e1466356 100644
--- a/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher0.php
+++ b/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher0.php
@@ -1,7 +1,6 @@
context = $context;
}
-
- public function match($rawPathinfo)
- {
- $allow = $allowSchemes = array();
- $pathinfo = rawurldecode($rawPathinfo);
- $context = $this->context;
- $requestMethod = $canonicalMethod = $context->getMethod();
-
- if ('HEAD' === $requestMethod) {
- $canonicalMethod = 'GET';
- }
-
- if ('/' === $pathinfo && !$allow && !$allowSchemes) {
- throw new Symfony\Component\Routing\Exception\NoConfigurationException();
- }
-
- throw $allow ? new MethodNotAllowedException(array_keys($allow)) : new ResourceNotFoundException();
- }
}
diff --git a/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher1.php b/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher1.php
index 68e7741b..ce1201a5 100644
--- a/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher1.php
+++ b/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher1.php
@@ -1,7 +1,6 @@
context = $context;
- }
-
- public function match($rawPathinfo)
- {
- $allow = $allowSchemes = array();
- $pathinfo = rawurldecode($rawPathinfo);
- $context = $this->context;
- $requestMethod = $canonicalMethod = $context->getMethod();
- $host = strtolower($context->getHost());
-
- if ('HEAD' === $requestMethod) {
- $canonicalMethod = 'GET';
- }
-
- switch ($pathinfo) {
- default:
- $routes = array(
- '/test/baz' => array(array('_route' => 'baz'), null, null, null),
- '/test/baz.html' => array(array('_route' => 'baz2'), null, null, null),
- '/test/baz3/' => array(array('_route' => 'baz3'), null, null, null),
- '/foofoo' => array(array('_route' => 'foofoo', 'def' => 'test'), null, null, null),
- '/spa ce' => array(array('_route' => 'space'), null, null, null),
- '/multi/new' => array(array('_route' => 'overridden2'), null, null, null),
- '/multi/hey/' => array(array('_route' => 'hey'), null, null, null),
- '/ababa' => array(array('_route' => 'ababa'), null, null, null),
- '/route1' => array(array('_route' => 'route1'), 'a.example.com', null, null),
- '/c2/route2' => array(array('_route' => 'route2'), 'a.example.com', null, null),
- '/route4' => array(array('_route' => 'route4'), 'a.example.com', null, null),
- '/c2/route3' => array(array('_route' => 'route3'), 'b.example.com', null, null),
- '/route5' => array(array('_route' => 'route5'), 'c.example.com', null, null),
- '/route6' => array(array('_route' => 'route6'), null, null, null),
- '/route11' => array(array('_route' => 'route11'), '#^(?P[^\\.]++)\\.example\\.com$#sDi', null, null),
- '/route12' => array(array('_route' => 'route12', 'var1' => 'val'), '#^(?P[^\\.]++)\\.example\\.com$#sDi', null, null),
- '/route17' => array(array('_route' => 'route17'), null, null, null),
- );
-
- if (!isset($routes[$pathinfo])) {
- break;
- }
- list($ret, $requiredHost, $requiredMethods, $requiredSchemes) = $routes[$pathinfo];
-
- if ($requiredHost) {
- if ('#' !== $requiredHost[0] ? $requiredHost !== $host : !preg_match($requiredHost, $host, $hostMatches)) {
- break;
- }
- if ('#' === $requiredHost[0] && $hostMatches) {
- $hostMatches['_route'] = $ret['_route'];
- $ret = $this->mergeDefaults($hostMatches, $ret);
- }
- }
-
- $hasRequiredScheme = !$requiredSchemes || isset($requiredSchemes[$context->getScheme()]);
- if ($requiredMethods && !isset($requiredMethods[$canonicalMethod]) && !isset($requiredMethods[$requestMethod])) {
- if ($hasRequiredScheme) {
- $allow += $requiredMethods;
- }
- break;
- }
- if (!$hasRequiredScheme) {
- $allowSchemes += $requiredSchemes;
- break;
- }
-
- return $ret;
- }
-
- $matchedPathinfo = $host.'.'.$pathinfo;
- $regexList = array(
+ $this->matchHost = true;
+ $this->staticRoutes = array(
+ '/test/baz' => array(array(array('_route' => 'baz'), null, null, null, false, null)),
+ '/test/baz.html' => array(array(array('_route' => 'baz2'), null, null, null, false, null)),
+ '/test/baz3' => array(array(array('_route' => 'baz3'), null, null, null, true, null)),
+ '/foofoo' => array(array(array('_route' => 'foofoo', 'def' => 'test'), null, null, null, false, null)),
+ '/spa ce' => array(array(array('_route' => 'space'), null, null, null, false, null)),
+ '/multi/new' => array(array(array('_route' => 'overridden2'), null, null, null, false, null)),
+ '/multi/hey' => array(array(array('_route' => 'hey'), null, null, null, true, null)),
+ '/ababa' => array(array(array('_route' => 'ababa'), null, null, null, false, null)),
+ '/route1' => array(array(array('_route' => 'route1'), 'a.example.com', null, null, false, null)),
+ '/c2/route2' => array(array(array('_route' => 'route2'), 'a.example.com', null, null, false, null)),
+ '/route4' => array(array(array('_route' => 'route4'), 'a.example.com', null, null, false, null)),
+ '/c2/route3' => array(array(array('_route' => 'route3'), 'b.example.com', null, null, false, null)),
+ '/route5' => array(array(array('_route' => 'route5'), 'c.example.com', null, null, false, null)),
+ '/route6' => array(array(array('_route' => 'route6'), null, null, null, false, null)),
+ '/route11' => array(array(array('_route' => 'route11'), '#^(?P[^\\.]++)\\.example\\.com$#sDi', null, null, false, null)),
+ '/route12' => array(array(array('_route' => 'route12', 'var1' => 'val'), '#^(?P[^\\.]++)\\.example\\.com$#sDi', null, null, false, null)),
+ '/route17' => array(array(array('_route' => 'route17'), null, null, null, false, null)),
+ );
+ $this->regexpList = array(
0 => '{^(?'
.'|(?:(?:[^./]*+\\.)++)(?'
.'|/foo/(baz|symfony)(*:47)'
@@ -88,160 +42,72 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
.'|/([^/]++)(*:70)'
.'|head/([^/]++)(*:90)'
.')'
- .'|/test/([^/]++)/(?'
- .'|(*:116)'
+ .'|/test/([^/]++)(?'
+ .'|(*:115)'
.')'
- .'|/([\']+)(*:132)'
+ .'|/([\']+)(*:131)'
.'|/a/(?'
.'|b\'b/([^/]++)(?'
- .'|(*:161)'
- .'|(*:169)'
+ .'|(*:160)'
+ .'|(*:168)'
.')'
- .'|(.*)(*:182)'
+ .'|(.*)(*:181)'
.'|b\'b/([^/]++)(?'
- .'|(*:205)'
- .'|(*:213)'
+ .'|(*:204)'
+ .'|(*:212)'
.')'
.')'
- .'|/multi/hello(?:/([^/]++))?(*:249)'
+ .'|/multi/hello(?:/([^/]++))?(*:248)'
.'|/([^/]++)/b/([^/]++)(?'
- .'|(*:280)'
- .'|(*:288)'
+ .'|(*:279)'
+ .'|(*:287)'
.')'
- .'|/aba/([^/]++)(*:310)'
+ .'|/aba/([^/]++)(*:309)'
.')|(?i:([^\\.]++)\\.example\\.com)\\.(?'
.'|/route1(?'
- .'|3/([^/]++)(*:372)'
- .'|4/([^/]++)(*:390)'
+ .'|3/([^/]++)(*:371)'
+ .'|4/([^/]++)(*:389)'
.')'
.')|(?i:c\\.example\\.com)\\.(?'
- .'|/route15/([^/]++)(*:442)'
+ .'|/route15/([^/]++)(*:441)'
.')|(?:(?:[^./]*+\\.)++)(?'
- .'|/route16/([^/]++)(*:490)'
+ .'|/route16/([^/]++)(*:489)'
.'|/a/(?'
- .'|a\\.\\.\\.(*:511)'
+ .'|a\\.\\.\\.(*:510)'
.'|b/(?'
- .'|([^/]++)(*:532)'
- .'|c/([^/]++)(*:550)'
+ .'|([^/]++)(*:531)'
+ .'|c/([^/]++)(*:549)'
.')'
.')'
.')'
- .')$}sD',
+ .')(?:/?)$}sD',
+ );
+ $this->dynamicRoutes = array(
+ 47 => array(array(array('_route' => 'foo', 'def' => 'test'), array('bar'), null, null, false, null)),
+ 70 => array(array(array('_route' => 'bar'), array('foo'), array('GET' => 0, 'HEAD' => 1), null, false, null)),
+ 90 => array(array(array('_route' => 'barhead'), array('foo'), array('GET' => 0), null, false, null)),
+ 115 => array(
+ array(array('_route' => 'baz4'), array('foo'), null, null, true, null),
+ array(array('_route' => 'baz5'), array('foo'), array('POST' => 0), null, true, null),
+ array(array('_route' => 'baz.baz6'), array('foo'), array('PUT' => 0), null, true, null),
+ ),
+ 131 => array(array(array('_route' => 'quoter'), array('quoter'), null, null, false, null)),
+ 160 => array(array(array('_route' => 'foo1'), array('foo'), array('PUT' => 0), null, false, null)),
+ 168 => array(array(array('_route' => 'bar1'), array('bar'), null, null, false, null)),
+ 181 => array(array(array('_route' => 'overridden'), array('var'), null, null, false, null)),
+ 204 => array(array(array('_route' => 'foo2'), array('foo1'), null, null, false, null)),
+ 212 => array(array(array('_route' => 'bar2'), array('bar1'), null, null, false, null)),
+ 248 => array(array(array('_route' => 'helloWorld', 'who' => 'World!'), array('who'), null, null, false, null)),
+ 279 => array(array(array('_route' => 'foo3'), array('_locale', 'foo'), null, null, false, null)),
+ 287 => array(array(array('_route' => 'bar3'), array('_locale', 'bar'), null, null, false, null)),
+ 309 => array(array(array('_route' => 'foo4'), array('foo'), null, null, false, null)),
+ 371 => array(array(array('_route' => 'route13'), array('var1', 'name'), null, null, false, null)),
+ 389 => array(array(array('_route' => 'route14', 'var1' => 'val'), array('var1', 'name'), null, null, false, null)),
+ 441 => array(array(array('_route' => 'route15'), array('name'), null, null, false, null)),
+ 489 => array(array(array('_route' => 'route16', 'var1' => 'val'), array('name'), null, null, false, null)),
+ 510 => array(array(array('_route' => 'a'), array(), null, null, false, null)),
+ 531 => array(array(array('_route' => 'b'), array('var'), null, null, false, null)),
+ 549 => array(array(array('_route' => 'c'), array('var'), null, null, false, null)),
);
-
- foreach ($regexList as $offset => $regex) {
- while (preg_match($regex, $matchedPathinfo, $matches)) {
- switch ($m = (int) $matches['MARK']) {
- case 116:
- $matches = array('foo' => $matches[1] ?? null);
-
- // baz4
- return $this->mergeDefaults(array('_route' => 'baz4') + $matches, array());
-
- // baz5
- $ret = $this->mergeDefaults(array('_route' => 'baz5') + $matches, array());
- if (!isset(($a = array('POST' => 0))[$requestMethod])) {
- $allow += $a;
- goto not_baz5;
- }
-
- return $ret;
- not_baz5:
-
- // baz.baz6
- $ret = $this->mergeDefaults(array('_route' => 'baz.baz6') + $matches, array());
- if (!isset(($a = array('PUT' => 0))[$requestMethod])) {
- $allow += $a;
- goto not_bazbaz6;
- }
-
- return $ret;
- not_bazbaz6:
-
- break;
- case 161:
- $matches = array('foo' => $matches[1] ?? null);
-
- // foo1
- $ret = $this->mergeDefaults(array('_route' => 'foo1') + $matches, array());
- if (!isset(($a = array('PUT' => 0))[$requestMethod])) {
- $allow += $a;
- goto not_foo1;
- }
-
- return $ret;
- not_foo1:
-
- break;
- case 205:
- $matches = array('foo1' => $matches[1] ?? null);
-
- // foo2
- return $this->mergeDefaults(array('_route' => 'foo2') + $matches, array());
-
- break;
- case 280:
- $matches = array('_locale' => $matches[1] ?? null, 'foo' => $matches[2] ?? null);
-
- // foo3
- return $this->mergeDefaults(array('_route' => 'foo3') + $matches, array());
-
- break;
- default:
- $routes = array(
- 47 => array(array('_route' => 'foo', 'def' => 'test'), array('bar'), null, null),
- 70 => array(array('_route' => 'bar'), array('foo'), array('GET' => 0, 'HEAD' => 1), null),
- 90 => array(array('_route' => 'barhead'), array('foo'), array('GET' => 0), null),
- 132 => array(array('_route' => 'quoter'), array('quoter'), null, null),
- 169 => array(array('_route' => 'bar1'), array('bar'), null, null),
- 182 => array(array('_route' => 'overridden'), array('var'), null, null),
- 213 => array(array('_route' => 'bar2'), array('bar1'), null, null),
- 249 => array(array('_route' => 'helloWorld', 'who' => 'World!'), array('who'), null, null),
- 288 => array(array('_route' => 'bar3'), array('_locale', 'bar'), null, null),
- 310 => array(array('_route' => 'foo4'), array('foo'), null, null),
- 372 => array(array('_route' => 'route13'), array('var1', 'name'), null, null),
- 390 => array(array('_route' => 'route14', 'var1' => 'val'), array('var1', 'name'), null, null),
- 442 => array(array('_route' => 'route15'), array('name'), null, null),
- 490 => array(array('_route' => 'route16', 'var1' => 'val'), array('name'), null, null),
- 511 => array(array('_route' => 'a'), array(), null, null),
- 532 => array(array('_route' => 'b'), array('var'), null, null),
- 550 => array(array('_route' => 'c'), array('var'), null, null),
- );
-
- list($ret, $vars, $requiredMethods, $requiredSchemes) = $routes[$m];
-
- foreach ($vars as $i => $v) {
- if (isset($matches[1 + $i])) {
- $ret[$v] = $matches[1 + $i];
- }
- }
-
- $hasRequiredScheme = !$requiredSchemes || isset($requiredSchemes[$context->getScheme()]);
- if ($requiredMethods && !isset($requiredMethods[$canonicalMethod]) && !isset($requiredMethods[$requestMethod])) {
- if ($hasRequiredScheme) {
- $allow += $requiredMethods;
- }
- break;
- }
- if (!$hasRequiredScheme) {
- $allowSchemes += $requiredSchemes;
- break;
- }
-
- return $ret;
- }
-
- if (550 === $m) {
- break;
- }
- $regex = substr_replace($regex, 'F', $m - $offset, 1 + strlen($m));
- $offset += strlen($m);
- }
- }
- if ('/' === $pathinfo && !$allow && !$allowSchemes) {
- throw new Symfony\Component\Routing\Exception\NoConfigurationException();
- }
-
- throw $allow ? new MethodNotAllowedException(array_keys($allow)) : new ResourceNotFoundException();
}
}
diff --git a/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher10.php b/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher10.php
index 2f5cc3fc..d1a6caed 100644
--- a/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher10.php
+++ b/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher10.php
@@ -1,7 +1,6 @@
context = $context;
- }
-
- public function match($rawPathinfo)
- {
- $allow = $allowSchemes = array();
- $pathinfo = rawurldecode($rawPathinfo);
- $context = $this->context;
- $requestMethod = $canonicalMethod = $context->getMethod();
-
- if ('HEAD' === $requestMethod) {
- $canonicalMethod = 'GET';
- }
-
- $matchedPathinfo = $pathinfo;
- $regexList = array(
+ $this->regexpList = array(
0 => '{^(?'
.'|/c(?'
.'|f(?'
@@ -906,7 +893,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
.'|1d92b/([^/]++)/([^/]++)/([^/]++)/51d92b(*:24737)'
.'|98b3e/([^/]++)/([^/]++)/([^/]++)/598b3e(*:24786)'
.')'
- .')$}sD',
+ .')(?:/?)$}sD',
24786 => '{^(?'
.'|/5(?'
.'|b69b9/([^/]++)/([^/]++)/([^/]++)/5b69b9(*:24837)'
@@ -1781,1050 +1768,1009 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
.')'
.'|9c9ad/([^/]++)/([^/]++)/([^/]++)/49c9ad(*:49718)'
.')'
- .')$}sD',
+ .')(?:/?)$}sD',
+ );
+ $this->dynamicRoutes = array(
+ 54 => array(array(array('_route' => '_0'), array('a', 'b', 'c'), null, null, false, null)),
+ 102 => array(array(array('_route' => '_190'), array('a', 'b', 'c'), null, null, false, null)),
+ 147 => array(array(array('_route' => '_478'), array('a', 'b', 'c'), null, null, false, null)),
+ 194 => array(array(array('_route' => '_259'), array('a', 'b', 'c'), null, null, false, null)),
+ 240 => array(array(array('_route' => '_368'), array('a', 'b', 'c'), null, null, false, null)),
+ 291 => array(array(array('_route' => '_1'), array('a', 'b', 'c'), null, null, false, null)),
+ 337 => array(array(array('_route' => '_116'), array('a', 'b', 'c'), null, null, false, null)),
+ 383 => array(array(array('_route' => '_490'), array('a', 'b', 'c'), null, null, false, null)),
+ 434 => array(array(array('_route' => '_2'), array('a', 'b', 'c'), null, null, false, null)),
+ 480 => array(array(array('_route' => '_124'), array('a', 'b', 'c'), null, null, false, null)),
+ 526 => array(array(array('_route' => '_389'), array('a', 'b', 'c'), null, null, false, null)),
+ 577 => array(array(array('_route' => '_8'), array('a', 'b', 'c'), null, null, false, null)),
+ 623 => array(array(array('_route' => '_104'), array('a', 'b', 'c'), null, null, false, null)),
+ 677 => array(array(array('_route' => '_12'), array('a', 'b', 'c'), null, null, false, null)),
+ 722 => array(array(array('_route' => '_442'), array('a', 'b', 'c'), null, null, false, null)),
+ 769 => array(array(array('_route' => '_253'), array('a', 'b', 'c'), null, null, false, null)),
+ 820 => array(array(array('_route' => '_13'), array('a', 'b', 'c'), null, null, false, null)),
+ 866 => array(array(array('_route' => '_254'), array('a', 'b', 'c'), null, null, false, null)),
+ 912 => array(array(array('_route' => '_347'), array('a', 'b', 'c'), null, null, false, null)),
+ 963 => array(array(array('_route' => '_16'), array('a', 'b', 'c'), null, null, false, null)),
+ 1009 => array(array(array('_route' => '_87'), array('a', 'b', 'c'), null, null, false, null)),
+ 1058 => array(array(array('_route' => '_31'), array('a', 'b', 'c'), null, null, false, null)),
+ 1109 => array(array(array('_route' => '_50'), array('a', 'b', 'c'), null, null, false, null)),
+ 1156 => array(array(array('_route' => '_219'), array('a', 'b', 'c'), null, null, false, null)),
+ 1203 => array(array(array('_route' => '_332'), array('a', 'b', 'c'), null, null, false, null)),
+ 1250 => array(array(array('_route' => '_359'), array('a', 'b', 'c'), null, null, false, null)),
+ 1302 => array(array(array('_route' => '_183'), array('a', 'b', 'c'), null, null, false, null)),
+ 1349 => array(array(array('_route' => '_500'), array('a', 'b', 'c'), null, null, false, null)),
+ 1401 => array(array(array('_route' => '_214'), array('a', 'b', 'c'), null, null, false, null)),
+ 1448 => array(array(array('_route' => '_321'), array('a', 'b', 'c'), null, null, false, null)),
+ 1497 => array(array(array('_route' => '_243'), array('a', 'b', 'c'), null, null, false, null)),
+ 1545 => array(array(array('_route' => '_328'), array('a', 'b', 'c'), null, null, false, null)),
+ 1596 => array(array(array('_route' => '_362'), array('a', 'b', 'c'), null, null, false, null)),
+ 1643 => array(array(array('_route' => '_488'), array('a', 'b', 'c'), null, null, false, null)),
+ 1701 => array(array(array('_route' => '_3'), array('a', 'b', 'c'), null, null, false, null)),
+ 1751 => array(array(array('_route' => '_102'), array('a', 'b', 'c'), null, null, false, null)),
+ 1797 => array(array(array('_route' => '_220'), array('a', 'b', 'c'), null, null, false, null)),
+ 1845 => array(array(array('_route' => '_127'), array('a', 'b', 'c'), null, null, false, null)),
+ 1897 => array(array(array('_route' => '_5'), array('a', 'b', 'c'), null, null, false, null)),
+ 1944 => array(array(array('_route' => '_242'), array('a', 'b', 'c'), null, null, false, null)),
+ 1991 => array(array(array('_route' => '_397'), array('a', 'b', 'c'), null, null, false, null)),
+ 2038 => array(array(array('_route' => '_454'), array('a', 'b', 'c'), null, null, false, null)),
+ 2090 => array(array(array('_route' => '_34'), array('a', 'b', 'c'), null, null, false, null)),
+ 2137 => array(array(array('_route' => '_281'), array('a', 'b', 'c'), null, null, false, null)),
+ 2189 => array(array(array('_route' => '_64'), array('a', 'b', 'c'), null, null, false, null)),
+ 2236 => array(array(array('_route' => '_205'), array('a', 'b', 'c'), null, null, false, null)),
+ 2291 => array(array(array('_route' => '_71'), array('a', 'b', 'c'), null, null, false, null)),
+ 2337 => array(array(array('_route' => '_203'), array('a', 'b', 'c'), null, null, false, null)),
+ 2385 => array(array(array('_route' => '_97'), array('a', 'b', 'c'), null, null, false, null)),
+ 2437 => array(array(array('_route' => '_98'), array('a', 'b', 'c'), null, null, false, null)),
+ 2484 => array(array(array('_route' => '_267'), array('a', 'b', 'c'), null, null, false, null)),
+ 2531 => array(array(array('_route' => '_309'), array('a', 'b', 'c'), null, null, false, null)),
+ 2586 => array(array(array('_route' => '_117'), array('a', 'b', 'c'), null, null, false, null)),
+ 2631 => array(array(array('_route' => '_211'), array('a', 'b', 'c'), null, null, false, null)),
+ 2679 => array(array(array('_route' => '_484'), array('a', 'b', 'c'), null, null, false, null)),
+ 2731 => array(array(array('_route' => '_139'), array('a', 'b', 'c'), null, null, false, null)),
+ 2778 => array(array(array('_route' => '_421'), array('a', 'b', 'c'), null, null, false, null)),
+ 2830 => array(array(array('_route' => '_185'), array('a', 'b', 'c'), null, null, false, null)),
+ 2877 => array(array(array('_route' => '_439'), array('a', 'b', 'c'), null, null, false, null)),
+ 2926 => array(array(array('_route' => '_218'), array('a', 'b', 'c'), null, null, false, null)),
+ 2977 => array(array(array('_route' => '_233'), array('a', 'b', 'c'), null, null, false, null)),
+ 3024 => array(array(array('_route' => '_483'), array('a', 'b', 'c'), null, null, false, null)),
+ 3073 => array(array(array('_route' => '_265'), array('a', 'b', 'c'), null, null, false, null)),
+ 3124 => array(array(array('_route' => '_299'), array('a', 'b', 'c'), null, null, false, null)),
+ 3171 => array(array(array('_route' => '_351'), array('a', 'b', 'c'), null, null, false, null)),
+ 3218 => array(array(array('_route' => '_472'), array('a', 'b', 'c'), null, null, false, null)),
+ 3267 => array(array(array('_route' => '_360'), array('a', 'b', 'c'), null, null, false, null)),
+ 3315 => array(array(array('_route' => '_466'), array('a', 'b', 'c'), null, null, false, null)),
+ 3372 => array(array(array('_route' => '_4'), array('a', 'b', 'c'), null, null, false, null)),
+ 3419 => array(array(array('_route' => '_142'), array('a', 'b', 'c'), null, null, false, null)),
+ 3466 => array(array(array('_route' => '_151'), array('a', 'b', 'c'), null, null, false, null)),
+ 3513 => array(array(array('_route' => '_308'), array('a', 'b', 'c'), null, null, false, null)),
+ 3560 => array(array(array('_route' => '_440'), array('a', 'b', 'c'), null, null, false, null)),
+ 3612 => array(array(array('_route' => '_14'), array('a', 'b', 'c'), null, null, false, null)),
+ 3659 => array(array(array('_route' => '_358'), array('a', 'b', 'c'), null, null, false, null)),
+ 3711 => array(array(array('_route' => '_37'), array('a', 'b', 'c'), null, null, false, null)),
+ 3758 => array(array(array('_route' => '_38'), array('a', 'b', 'c'), null, null, false, null)),
+ 3805 => array(array(array('_route' => '_146'), array('a', 'b', 'c'), null, null, false, null)),
+ 3852 => array(array(array('_route' => '_194'), array('a', 'b', 'c'), null, null, false, null)),
+ 3899 => array(array(array('_route' => '_487'), array('a', 'b', 'c'), null, null, false, null)),
+ 3948 => array(array(array('_route' => '_42'), array('a', 'b', 'c'), null, null, false, null)),
+ 3999 => array(array(array('_route' => '_54'), array('a', 'b', 'c'), null, null, false, null)),
+ 4046 => array(array(array('_route' => '_326'), array('a', 'b', 'c'), null, null, false, null)),
+ 4098 => array(array(array('_route' => '_68'), array('a', 'b', 'c'), null, null, false, null)),
+ 4145 => array(array(array('_route' => '_108'), array('a', 'b', 'c'), null, null, false, null)),
+ 4197 => array(array(array('_route' => '_74'), array('a', 'b', 'c'), null, null, false, null)),
+ 4244 => array(array(array('_route' => '_315'), array('a', 'b', 'c'), null, null, false, null)),
+ 4291 => array(array(array('_route' => '_374'), array('a', 'b', 'c'), null, null, false, null)),
+ 4343 => array(array(array('_route' => '_99'), array('a', 'b', 'c'), null, null, false, null)),
+ 4390 => array(array(array('_route' => '_238'), array('a', 'b', 'c'), null, null, false, null)),
+ 4442 => array(array(array('_route' => '_107'), array('a', 'b', 'c'), null, null, false, null)),
+ 4489 => array(array(array('_route' => '_409'), array('a', 'b', 'c'), null, null, false, null)),
+ 4541 => array(array(array('_route' => '_122'), array('a', 'b', 'c'), null, null, false, null)),
+ 4588 => array(array(array('_route' => '_379'), array('a', 'b', 'c'), null, null, false, null)),
+ 4635 => array(array(array('_route' => '_390'), array('a', 'b', 'c'), null, null, false, null)),
+ 4687 => array(array(array('_route' => '_171'), array('a', 'b', 'c'), null, null, false, null)),
+ 4734 => array(array(array('_route' => '_260'), array('a', 'b', 'c'), null, null, false, null)),
+ 4781 => array(array(array('_route' => '_434'), array('a', 'b', 'c'), null, null, false, null)),
+ 4830 => array(array(array('_route' => '_189'), array('a', 'b', 'c'), null, null, false, null)),
+ 4878 => array(array(array('_route' => '_467'), array('a', 'b', 'c'), null, null, false, null)),
+ 4935 => array(array(array('_route' => '_6'), array('a', 'b', 'c'), null, null, false, null)),
+ 4982 => array(array(array('_route' => '_286'), array('a', 'b', 'c'), null, null, false, null)),
+ 5029 => array(array(array('_route' => '_438'), array('a', 'b', 'c'), null, null, false, null)),
+ 5081 => array(array(array('_route' => '_19'), array('a', 'b', 'c'), null, null, false, null)),
+ 5131 => array(array(array('_route' => '_24'), array('a', 'b', 'c'), null, null, false, null)),
+ 5177 => array(array(array('_route' => '_172'), array('a', 'b', 'c'), null, null, false, null)),
+ 5230 => array(array(array('_route' => '_33'), array('a', 'b', 'c'), null, null, false, null)),
+ 5277 => array(array(array('_route' => '_400'), array('a', 'b', 'c'), null, null, false, null)),
+ 5324 => array(array(array('_route' => '_427'), array('a', 'b', 'c'), null, null, false, null)),
+ 5376 => array(array(array('_route' => '_35'), array('a', 'b', 'c'), null, null, false, null)),
+ 5423 => array(array(array('_route' => '_156'), array('a', 'b', 'c'), null, null, false, null)),
+ 5475 => array(array(array('_route' => '_36'), array('a', 'b', 'c'), null, null, false, null)),
+ 5522 => array(array(array('_route' => '_251'), array('a', 'b', 'c'), null, null, false, null)),
+ 5574 => array(array(array('_route' => '_43'), array('a', 'b', 'c'), null, null, false, null)),
+ 5621 => array(array(array('_route' => '_292'), array('a', 'b', 'c'), null, null, false, null)),
+ 5668 => array(array(array('_route' => '_411'), array('a', 'b', 'c'), null, null, false, null)),
+ 5720 => array(array(array('_route' => '_69'), array('a', 'b', 'c'), null, null, false, null)),
+ 5767 => array(array(array('_route' => '_159'), array('a', 'b', 'c'), null, null, false, null)),
+ 5814 => array(array(array('_route' => '_170'), array('a', 'b', 'c'), null, null, false, null)),
+ 5861 => array(array(array('_route' => '_376'), array('a', 'b', 'c'), null, null, false, null)),
+ 5913 => array(array(array('_route' => '_131'), array('a', 'b', 'c'), null, null, false, null)),
+ 5960 => array(array(array('_route' => '_446'), array('a', 'b', 'c'), null, null, false, null)),
+ 6015 => array(array(array('_route' => '_140'), array('a', 'b', 'c'), null, null, false, null)),
+ 6061 => array(array(array('_route' => '_353'), array('a', 'b', 'c'), null, null, false, null)),
+ 6112 => array(array(array('_route' => '_224'), array('a', 'b', 'c'), null, null, false, null)),
+ 6158 => array(array(array('_route' => '_346'), array('a', 'b', 'c'), null, null, false, null)),
+ 6204 => array(array(array('_route' => '_443'), array('a', 'b', 'c'), null, null, false, null)),
+ 6254 => array(array(array('_route' => '_154'), array('a', 'b', 'c'), null, null, false, null)),
+ 6305 => array(array(array('_route' => '_212'), array('a', 'b', 'c'), null, null, false, null)),
+ 6352 => array(array(array('_route' => '_313'), array('a', 'b', 'c'), null, null, false, null)),
+ 6399 => array(array(array('_route' => '_395'), array('a', 'b', 'c'), null, null, false, null)),
+ 6446 => array(array(array('_route' => '_441'), array('a', 'b', 'c'), null, null, false, null)),
+ 6498 => array(array(array('_route' => '_223'), array('a', 'b', 'c'), null, null, false, null)),
+ 6545 => array(array(array('_route' => '_303'), array('a', 'b', 'c'), null, null, false, null)),
+ 6594 => array(array(array('_route' => '_410'), array('a', 'b', 'c'), null, null, false, null)),
+ 6642 => array(array(array('_route' => '_494'), array('a', 'b', 'c'), null, null, false, null)),
+ 6702 => array(array(array('_route' => '_7'), array('a', 'b', 'c'), null, null, false, null)),
+ 6748 => array(array(array('_route' => '_268'), array('a', 'b', 'c'), null, null, false, null)),
+ 6796 => array(array(array('_route' => '_178'), array('a', 'b', 'c'), null, null, false, null)),
+ 6843 => array(array(array('_route' => '_179'), array('a', 'b', 'c'), null, null, false, null)),
+ 6890 => array(array(array('_route' => '_416'), array('a', 'b', 'c'), null, null, false, null)),
+ 6942 => array(array(array('_route' => '_25'), array('a', 'b', 'c'), null, null, false, null)),
+ 6989 => array(array(array('_route' => '_307'), array('a', 'b', 'c'), null, null, false, null)),
+ 7036 => array(array(array('_route' => '_387'), array('a', 'b', 'c'), null, null, false, null)),
+ 7083 => array(array(array('_route' => '_471'), array('a', 'b', 'c'), null, null, false, null)),
+ 7132 => array(array(array('_route' => '_90'), array('a', 'b', 'c'), null, null, false, null)),
+ 7183 => array(array(array('_route' => '_95'), array('a', 'b', 'c'), null, null, false, null)),
+ 7230 => array(array(array('_route' => '_338'), array('a', 'b', 'c'), null, null, false, null)),
+ 7277 => array(array(array('_route' => '_401'), array('a', 'b', 'c'), null, null, false, null)),
+ 7329 => array(array(array('_route' => '_147'), array('a', 'b', 'c'), null, null, false, null)),
+ 7376 => array(array(array('_route' => '_319'), array('a', 'b', 'c'), null, null, false, null)),
+ 7423 => array(array(array('_route' => '_354'), array('a', 'b', 'c'), null, null, false, null)),
+ 7470 => array(array(array('_route' => '_428'), array('a', 'b', 'c'), null, null, false, null)),
+ 7522 => array(array(array('_route' => '_162'), array('a', 'b', 'c'), null, null, false, null)),
+ 7572 => array(array(array('_route' => '_175'), array('a', 'b', 'c'), null, null, false, null)),
+ 7618 => array(array(array('_route' => '_455'), array('a', 'b', 'c'), null, null, false, null)),
+ 7666 => array(array(array('_route' => '_355'), array('a', 'b', 'c'), null, null, false, null)),
+ 7718 => array(array(array('_route' => '_197'), array('a', 'b', 'c'), null, null, false, null)),
+ 7768 => array(array(array('_route' => '_202'), array('a', 'b', 'c'), null, null, false, null)),
+ 7813 => array(array(array('_route' => '_489'), array('a', 'b', 'c'), null, null, false, null)),
+ 7863 => array(array(array('_route' => '_199'), array('a', 'b', 'c'), null, null, false, null)),
+ 7914 => array(array(array('_route' => '_263'), array('a', 'b', 'c'), null, null, false, null)),
+ 7961 => array(array(array('_route' => '_406'), array('a', 'b', 'c'), null, null, false, null)),
+ 8010 => array(array(array('_route' => '_289'), array('a', 'b', 'c'), null, null, false, null)),
+ 8058 => array(array(array('_route' => '_325'), array('a', 'b', 'c'), null, null, false, null)),
+ 8106 => array(array(array('_route' => '_378'), array('a', 'b', 'c'), null, null, false, null)),
+ 8154 => array(array(array('_route' => '_468'), array('a', 'b', 'c'), null, null, false, null)),
+ 8211 => array(array(array('_route' => '_9'), array('a', 'b', 'c'), null, null, false, null)),
+ 8258 => array(array(array('_route' => '_216'), array('a', 'b', 'c'), null, null, false, null)),
+ 8307 => array(array(array('_route' => '_26'), array('a', 'b', 'c'), null, null, false, null)),
+ 8355 => array(array(array('_route' => '_62'), array('a', 'b', 'c'), null, null, false, null)),
+ 8406 => array(array(array('_route' => '_81'), array('a', 'b', 'c'), null, null, false, null)),
+ 8453 => array(array(array('_route' => '_318'), array('a', 'b', 'c'), null, null, false, null)),
+ 8505 => array(array(array('_route' => '_121'), array('a', 'b', 'c'), null, null, false, null)),
+ 8551 => array(array(array('_route' => '_182'), array('a', 'b', 'c'), null, null, false, null)),
+ 8603 => array(array(array('_route' => '_136'), array('a', 'b', 'c'), null, null, false, null)),
+ 8650 => array(array(array('_route' => '_415'), array('a', 'b', 'c'), null, null, false, null)),
+ 8697 => array(array(array('_route' => '_457'), array('a', 'b', 'c'), null, null, false, null)),
+ 8744 => array(array(array('_route' => '_463'), array('a', 'b', 'c'), null, null, false, null)),
+ 8796 => array(array(array('_route' => '_148'), array('a', 'b', 'c'), null, null, false, null)),
+ 8843 => array(array(array('_route' => '_273'), array('a', 'b', 'c'), null, null, false, null)),
+ 8892 => array(array(array('_route' => '_284'), array('a', 'b', 'c'), null, null, false, null)),
+ 8940 => array(array(array('_route' => '_288'), array('a', 'b', 'c'), null, null, false, null)),
+ 8991 => array(array(array('_route' => '_295'), array('a', 'b', 'c'), null, null, false, null)),
+ 9038 => array(array(array('_route' => '_305'), array('a', 'b', 'c'), null, null, false, null)),
+ 9085 => array(array(array('_route' => '_453'), array('a', 'b', 'c'), null, null, false, null)),
+ 9134 => array(array(array('_route' => '_340'), array('a', 'b', 'c'), null, null, false, null)),
+ 9185 => array(array(array('_route' => '_371'), array('a', 'b', 'c'), null, null, false, null)),
+ 9232 => array(array(array('_route' => '_417'), array('a', 'b', 'c'), null, null, false, null)),
+ 9284 => array(array(array('_route' => '_382'), array('a', 'b', 'c'), null, null, false, null)),
+ 9331 => array(array(array('_route' => '_404'), array('a', 'b', 'c'), null, null, false, null)),
+ 9389 => array(array(array('_route' => '_10'), array('a', 'b', 'c'), null, null, false, null)),
+ 9436 => array(array(array('_route' => '_279'), array('a', 'b', 'c'), null, null, false, null)),
+ 9483 => array(array(array('_route' => '_377'), array('a', 'b', 'c'), null, null, false, null)),
+ 9535 => array(array(array('_route' => '_39'), array('a', 'b', 'c'), null, null, false, null)),
+ 9582 => array(array(array('_route' => '_40'), array('a', 'b', 'c'), null, null, false, null)),
+ 9629 => array(array(array('_route' => '_264'), array('a', 'b', 'c'), null, null, false, null)),
+ 9676 => array(array(array('_route' => '_449'), array('a', 'b', 'c'), null, null, false, null)),
+ 9728 => array(array(array('_route' => '_46'), array('a', 'b', 'c'), null, null, false, null)),
+ 9775 => array(array(array('_route' => '_257'), array('a', 'b', 'c'), null, null, false, null)),
+ 9822 => array(array(array('_route' => '_274'), array('a', 'b', 'c'), null, null, false, null)),
+ 9869 => array(array(array('_route' => '_388'), array('a', 'b', 'c'), null, null, false, null)),
+ 9921 => array(array(array('_route' => '_53'), array('a', 'b', 'c'), null, null, false, null)),
+ 9968 => array(array(array('_route' => '_345'), array('a', 'b', 'c'), null, null, false, null)),
+ 10020 => array(array(array('_route' => '_73'), array('a', 'b', 'c'), null, null, false, null)),
+ 10068 => array(array(array('_route' => '_296'), array('a', 'b', 'c'), null, null, false, null)),
+ 10121 => array(array(array('_route' => '_75'), array('a', 'b', 'c'), null, null, false, null)),
+ 10169 => array(array(array('_route' => '_458'), array('a', 'b', 'c'), null, null, false, null)),
+ 10225 => array(array(array('_route' => '_79'), array('a', 'b', 'c'), null, null, false, null)),
+ 10272 => array(array(array('_route' => '_129'), array('a', 'b', 'c'), null, null, false, null)),
+ 10319 => array(array(array('_route' => '_418'), array('a', 'b', 'c'), null, null, false, null)),
+ 10368 => array(array(array('_route' => '_225'), array('a', 'b', 'c'), null, null, false, null)),
+ 10416 => array(array(array('_route' => '_479'), array('a', 'b', 'c'), null, null, false, null)),
+ 10466 => array(array(array('_route' => '_120'), array('a', 'b', 'c'), null, null, false, null)),
+ 10515 => array(array(array('_route' => '_276'), array('a', 'b', 'c'), null, null, false, null)),
+ 10564 => array(array(array('_route' => '_370'), array('a', 'b', 'c'), null, null, false, null)),
+ 10616 => array(array(array('_route' => '_385'), array('a', 'b', 'c'), null, null, false, null)),
+ 10664 => array(array(array('_route' => '_469'), array('a', 'b', 'c'), null, null, false, null)),
+ 10714 => array(array(array('_route' => '_435'), array('a', 'b', 'c'), null, null, false, null)),
+ 10772 => array(array(array('_route' => '_11'), array('a', 'b', 'c'), null, null, false, null)),
+ 10820 => array(array(array('_route' => '_105'), array('a', 'b', 'c'), null, null, false, null)),
+ 10868 => array(array(array('_route' => '_132'), array('a', 'b', 'c'), null, null, false, null)),
+ 10921 => array(array(array('_route' => '_18'), array('a', 'b', 'c'), null, null, false, null)),
+ 10969 => array(array(array('_route' => '_210'), array('a', 'b', 'c'), null, null, false, null)),
+ 11017 => array(array(array('_route' => '_329'), array('a', 'b', 'c'), null, null, false, null)),
+ 11073 => array(array(array('_route' => '_29'), array('a', 'b', 'c'), null, null, false, null)),
+ 11120 => array(array(array('_route' => '_480'), array('a', 'b', 'c'), null, null, false, null)),
+ 11169 => array(array(array('_route' => '_426'), array('a', 'b', 'c'), null, null, false, null)),
+ 11222 => array(array(array('_route' => '_32'), array('a', 'b', 'c'), null, null, false, null)),
+ 11270 => array(array(array('_route' => '_217'), array('a', 'b', 'c'), null, null, false, null)),
+ 11318 => array(array(array('_route' => '_275'), array('a', 'b', 'c'), null, null, false, null)),
+ 11371 => array(array(array('_route' => '_45'), array('a', 'b', 'c'), null, null, false, null)),
+ 11419 => array(array(array('_route' => '_157'), array('a', 'b', 'c'), null, null, false, null)),
+ 11467 => array(array(array('_route' => '_184'), array('a', 'b', 'c'), null, null, false, null)),
+ 11515 => array(array(array('_route' => '_250'), array('a', 'b', 'c'), null, null, false, null)),
+ 11563 => array(array(array('_route' => '_356'), array('a', 'b', 'c'), null, null, false, null)),
+ 11616 => array(array(array('_route' => '_47'), array('a', 'b', 'c'), null, null, false, null)),
+ 11664 => array(array(array('_route' => '_445'), array('a', 'b', 'c'), null, null, false, null)),
+ 11714 => array(array(array('_route' => '_48'), array('a', 'b', 'c'), null, null, false, null)),
+ 11766 => array(array(array('_route' => '_58'), array('a', 'b', 'c'), null, null, false, null)),
+ 11814 => array(array(array('_route' => '_414'), array('a', 'b', 'c'), null, null, false, null)),
+ 11862 => array(array(array('_route' => '_431'), array('a', 'b', 'c'), null, null, false, null)),
+ 11915 => array(array(array('_route' => '_84'), array('a', 'b', 'c'), null, null, false, null)),
+ 11963 => array(array(array('_route' => '_294'), array('a', 'b', 'c'), null, null, false, null)),
+ 12011 => array(array(array('_route' => '_336'), array('a', 'b', 'c'), null, null, false, null)),
+ 12059 => array(array(array('_route' => '_465'), array('a', 'b', 'c'), null, null, false, null)),
+ 12112 => array(array(array('_route' => '_103'), array('a', 'b', 'c'), null, null, false, null)),
+ 12160 => array(array(array('_route' => '_111'), array('a', 'b', 'c'), null, null, false, null)),
+ 12208 => array(array(array('_route' => '_207'), array('a', 'b', 'c'), null, null, false, null)),
+ 12256 => array(array(array('_route' => '_402'), array('a', 'b', 'c'), null, null, false, null)),
+ 12309 => array(array(array('_route' => '_230'), array('a', 'b', 'c'), null, null, false, null)),
+ 12356 => array(array(array('_route' => '_331'), array('a', 'b', 'c'), null, null, false, null)),
+ 12406 => array(array(array('_route' => '_248'), array('a', 'b', 'c'), null, null, false, null)),
+ 12455 => array(array(array('_route' => '_282'), array('a', 'b', 'c'), null, null, false, null)),
+ 12513 => array(array(array('_route' => '_15'), array('a', 'b', 'c'), null, null, false, null)),
+ 12561 => array(array(array('_route' => '_130'), array('a', 'b', 'c'), null, null, false, null)),
+ 12609 => array(array(array('_route' => '_231'), array('a', 'b', 'c'), null, null, false, null)),
+ 12657 => array(array(array('_route' => '_365'), array('a', 'b', 'c'), null, null, false, null)),
+ 12705 => array(array(array('_route' => '_448'), array('a', 'b', 'c'), null, null, false, null)),
+ 12758 => array(array(array('_route' => '_20'), array('a', 'b', 'c'), null, null, false, null)),
+ 12806 => array(array(array('_route' => '_93'), array('a', 'b', 'c'), null, null, false, null)),
+ 12854 => array(array(array('_route' => '_186'), array('a', 'b', 'c'), null, null, false, null)),
+ 12902 => array(array(array('_route' => '_460'), array('a', 'b', 'c'), null, null, false, null)),
+ 12955 => array(array(array('_route' => '_52'), array('a', 'b', 'c'), null, null, false, null)),
+ 13003 => array(array(array('_route' => '_447'), array('a', 'b', 'c'), null, null, false, null)),
+ 13056 => array(array(array('_route' => '_56'), array('a', 'b', 'c'), null, null, false, null)),
+ 13104 => array(array(array('_route' => '_133'), array('a', 'b', 'c'), null, null, false, null)),
+ 13152 => array(array(array('_route' => '_297'), array('a', 'b', 'c'), null, null, false, null)),
+ 13205 => array(array(array('_route' => '_82'), array('a', 'b', 'c'), null, null, false, null)),
+ 13253 => array(array(array('_route' => '_165'), array('a', 'b', 'c'), null, null, false, null)),
+ 13301 => array(array(array('_route' => '_213'), array('a', 'b', 'c'), null, null, false, null)),
+ 13351 => array(array(array('_route' => '_86'), array('a', 'b', 'c'), null, null, false, null)),
+ 13403 => array(array(array('_route' => '_92'), array('a', 'b', 'c'), null, null, false, null)),
+ 13450 => array(array(array('_route' => '_280'), array('a', 'b', 'c'), null, null, false, null)),
+ 13500 => array(array(array('_route' => '_143'), array('a', 'b', 'c'), null, null, false, null)),
+ 13549 => array(array(array('_route' => '_177'), array('a', 'b', 'c'), null, null, false, null)),
+ 13601 => array(array(array('_route' => '_188'), array('a', 'b', 'c'), null, null, false, null)),
+ 13649 => array(array(array('_route' => '_311'), array('a', 'b', 'c'), null, null, false, null)),
+ 13697 => array(array(array('_route' => '_350'), array('a', 'b', 'c'), null, null, false, null)),
+ 13750 => array(array(array('_route' => '_226'), array('a', 'b', 'c'), null, null, false, null)),
+ 13798 => array(array(array('_route' => '_291'), array('a', 'b', 'c'), null, null, false, null)),
+ 13851 => array(array(array('_route' => '_244'), array('a', 'b', 'c'), null, null, false, null)),
+ 13898 => array(array(array('_route' => '_287'), array('a', 'b', 'c'), null, null, false, null)),
+ 13951 => array(array(array('_route' => '_300'), array('a', 'b', 'c'), null, null, false, null)),
+ 13999 => array(array(array('_route' => '_451'), array('a', 'b', 'c'), null, null, false, null)),
+ 14047 => array(array(array('_route' => '_452'), array('a', 'b', 'c'), null, null, false, null)),
+ 14095 => array(array(array('_route' => '_481'), array('a', 'b', 'c'), null, null, false, null)),
+ 14145 => array(array(array('_route' => '_312'), array('a', 'b', 'c'), null, null, false, null)),
+ 14203 => array(array(array('_route' => '_17'), array('a', 'b', 'c'), null, null, false, null)),
+ 14251 => array(array(array('_route' => '_227'), array('a', 'b', 'c'), null, null, false, null)),
+ 14299 => array(array(array('_route' => '_393'), array('a', 'b', 'c'), null, null, false, null)),
+ 14349 => array(array(array('_route' => '_57'), array('a', 'b', 'c'), null, null, false, null)),
+ 14401 => array(array(array('_route' => '_61'), array('a', 'b', 'c'), null, null, false, null)),
+ 14449 => array(array(array('_route' => '_112'), array('a', 'b', 'c'), null, null, false, null)),
+ 14500 => array(array(array('_route' => '_135'), array('a', 'b', 'c'), null, null, false, null)),
+ 14547 => array(array(array('_route' => '_271'), array('a', 'b', 'c'), null, null, false, null)),
+ 14596 => array(array(array('_route' => '_459'), array('a', 'b', 'c'), null, null, false, null)),
+ 14649 => array(array(array('_route' => '_67'), array('a', 'b', 'c'), null, null, false, null)),
+ 14697 => array(array(array('_route' => '_113'), array('a', 'b', 'c'), null, null, false, null)),
+ 14745 => array(array(array('_route' => '_497'), array('a', 'b', 'c'), null, null, false, null)),
+ 14795 => array(array(array('_route' => '_70'), array('a', 'b', 'c'), null, null, false, null)),
+ 14847 => array(array(array('_route' => '_89'), array('a', 'b', 'c'), null, null, false, null)),
+ 14895 => array(array(array('_route' => '_128'), array('a', 'b', 'c'), null, null, false, null)),
+ 14948 => array(array(array('_route' => '_150'), array('a', 'b', 'c'), null, null, false, null)),
+ 14996 => array(array(array('_route' => '_166'), array('a', 'b', 'c'), null, null, false, null)),
+ 15047 => array(array(array('_route' => '_206'), array('a', 'b', 'c'), null, null, false, null)),
+ 15094 => array(array(array('_route' => '_419'), array('a', 'b', 'c'), null, null, false, null)),
+ 15148 => array(array(array('_route' => '_201'), array('a', 'b', 'c'), null, null, false, null)),
+ 15196 => array(array(array('_route' => '_314'), array('a', 'b', 'c'), null, null, false, null)),
+ 15244 => array(array(array('_route' => '_429'), array('a', 'b', 'c'), null, null, false, null)),
+ 15297 => array(array(array('_route' => '_228'), array('a', 'b', 'c'), null, null, false, null)),
+ 15345 => array(array(array('_route' => '_477'), array('a', 'b', 'c'), null, null, false, null)),
+ 15395 => array(array(array('_route' => '_272'), array('a', 'b', 'c'), null, null, false, null)),
+ 15444 => array(array(array('_route' => '_486'), array('a', 'b', 'c'), null, null, false, null)),
+ 15502 => array(array(array('_route' => '_21'), array('a', 'b', 'c'), null, null, false, null)),
+ 15550 => array(array(array('_route' => '_247'), array('a', 'b', 'c'), null, null, false, null)),
+ 15598 => array(array(array('_route' => '_424'), array('a', 'b', 'c'), null, null, false, null)),
+ 15646 => array(array(array('_route' => '_499'), array('a', 'b', 'c'), null, null, false, null)),
+ 15699 => array(array(array('_route' => '_23'), array('a', 'b', 'c'), null, null, false, null)),
+ 15747 => array(array(array('_route' => '_152'), array('a', 'b', 'c'), null, null, false, null)),
+ 15795 => array(array(array('_route' => '_304'), array('a', 'b', 'c'), null, null, false, null)),
+ 15843 => array(array(array('_route' => '_352'), array('a', 'b', 'c'), null, null, false, null)),
+ 15896 => array(array(array('_route' => '_28'), array('a', 'b', 'c'), null, null, false, null)),
+ 15944 => array(array(array('_route' => '_240'), array('a', 'b', 'c'), null, null, false, null)),
+ 16000 => array(array(array('_route' => '_30'), array('a', 'b', 'c'), null, null, false, null)),
+ 16047 => array(array(array('_route' => '_41'), array('a', 'b', 'c'), null, null, false, null)),
+ 16096 => array(array(array('_route' => '_301'), array('a', 'b', 'c'), null, null, false, null)),
+ 16149 => array(array(array('_route' => '_66'), array('a', 'b', 'c'), null, null, false, null)),
+ 16197 => array(array(array('_route' => '_72'), array('a', 'b', 'c'), null, null, false, null)),
+ 16245 => array(array(array('_route' => '_320'), array('a', 'b', 'c'), null, null, false, null)),
+ 16298 => array(array(array('_route' => '_78'), array('a', 'b', 'c'), null, null, false, null)),
+ 16346 => array(array(array('_route' => '_337'), array('a', 'b', 'c'), null, null, false, null)),
+ 16394 => array(array(array('_route' => '_399'), array('a', 'b', 'c'), null, null, false, null)),
+ 16442 => array(array(array('_route' => '_495'), array('a', 'b', 'c'), null, null, false, null)),
+ 16492 => array(array(array('_route' => '_85'), array('a', 'b', 'c'), null, null, false, null)),
+ 16544 => array(array(array('_route' => '_101'), array('a', 'b', 'c'), null, null, false, null)),
+ 16592 => array(array(array('_route' => '_176'), array('a', 'b', 'c'), null, null, false, null)),
+ 16640 => array(array(array('_route' => '_246'), array('a', 'b', 'c'), null, null, false, null)),
+ 16693 => array(array(array('_route' => '_125'), array('a', 'b', 'c'), null, null, false, null)),
+ 16741 => array(array(array('_route' => '_341'), array('a', 'b', 'c'), null, null, false, null)),
+ 16794 => array(array(array('_route' => '_137'), array('a', 'b', 'c'), null, null, false, null)),
+ 16842 => array(array(array('_route' => '_270'), array('a', 'b', 'c'), null, null, false, null)),
+ 16890 => array(array(array('_route' => '_386'), array('a', 'b', 'c'), null, null, false, null)),
+ 16943 => array(array(array('_route' => '_169'), array('a', 'b', 'c'), null, null, false, null)),
+ 16991 => array(array(array('_route' => '_200'), array('a', 'b', 'c'), null, null, false, null)),
+ 17039 => array(array(array('_route' => '_262'), array('a', 'b', 'c'), null, null, false, null)),
+ 17092 => array(array(array('_route' => '_187'), array('a', 'b', 'c'), null, null, false, null)),
+ 17140 => array(array(array('_route' => '_333'), array('a', 'b', 'c'), null, null, false, null)),
+ 17190 => array(array(array('_route' => '_215'), array('a', 'b', 'c'), null, null, false, null)),
+ 17239 => array(array(array('_route' => '_316'), array('a', 'b', 'c'), null, null, false, null)),
+ 17288 => array(array(array('_route' => '_343'), array('a', 'b', 'c'), null, null, false, null)),
+ 17346 => array(array(array('_route' => '_22'), array('a', 'b', 'c'), null, null, false, null)),
+ 17394 => array(array(array('_route' => '_420'), array('a', 'b', 'c'), null, null, false, null)),
+ 17447 => array(array(array('_route' => '_55'), array('a', 'b', 'c'), null, null, false, null)),
+ 17494 => array(array(array('_route' => '_496'), array('a', 'b', 'c'), null, null, false, null)),
+ 17547 => array(array(array('_route' => '_153'), array('a', 'b', 'c'), null, null, false, null)),
+ 17595 => array(array(array('_route' => '_344'), array('a', 'b', 'c'), null, null, false, null)),
+ 17648 => array(array(array('_route' => '_160'), array('a', 'b', 'c'), null, null, false, null)),
+ 17696 => array(array(array('_route' => '_398'), array('a', 'b', 'c'), null, null, false, null)),
+ 17749 => array(array(array('_route' => '_161'), array('a', 'b', 'c'), null, null, false, null)),
+ 17797 => array(array(array('_route' => '_193'), array('a', 'b', 'c'), null, null, false, null)),
+ 17847 => array(array(array('_route' => '_174'), array('a', 'b', 'c'), null, null, false, null)),
+ 17899 => array(array(array('_route' => '_209'), array('a', 'b', 'c'), null, null, false, null)),
+ 17947 => array(array(array('_route' => '_261'), array('a', 'b', 'c'), null, null, false, null)),
+ 18000 => array(array(array('_route' => '_222'), array('a', 'b', 'c'), null, null, false, null)),
+ 18048 => array(array(array('_route' => '_323'), array('a', 'b', 'c'), null, null, false, null)),
+ 18096 => array(array(array('_route' => '_380'), array('a', 'b', 'c'), null, null, false, null)),
+ 18149 => array(array(array('_route' => '_232'), array('a', 'b', 'c'), null, null, false, null)),
+ 18197 => array(array(array('_route' => '_383'), array('a', 'b', 'c'), null, null, false, null)),
+ 18247 => array(array(array('_route' => '_306'), array('a', 'b', 'c'), null, null, false, null)),
+ 18296 => array(array(array('_route' => '_327'), array('a', 'b', 'c'), null, null, false, null)),
+ 18345 => array(array(array('_route' => '_364'), array('a', 'b', 'c'), null, null, false, null)),
+ 18397 => array(array(array('_route' => '_403'), array('a', 'b', 'c'), null, null, false, null)),
+ 18445 => array(array(array('_route' => '_405'), array('a', 'b', 'c'), null, null, false, null)),
+ 18495 => array(array(array('_route' => '_412'), array('a', 'b', 'c'), null, null, false, null)),
+ 18553 => array(array(array('_route' => '_27'), array('a', 'b', 'c'), null, null, false, null)),
+ 18601 => array(array(array('_route' => '_134'), array('a', 'b', 'c'), null, null, false, null)),
+ 18649 => array(array(array('_route' => '_245'), array('a', 'b', 'c'), null, null, false, null)),
+ 18702 => array(array(array('_route' => '_59'), array('a', 'b', 'c'), null, null, false, null)),
+ 18750 => array(array(array('_route' => '_208'), array('a', 'b', 'c'), null, null, false, null)),
+ 18803 => array(array(array('_route' => '_60'), array('a', 'b', 'c'), null, null, false, null)),
+ 18851 => array(array(array('_route' => '_119'), array('a', 'b', 'c'), null, null, false, null)),
+ 18902 => array(array(array('_route' => '_163'), array('a', 'b', 'c'), null, null, false, null)),
+ 18949 => array(array(array('_route' => '_249'), array('a', 'b', 'c'), null, null, false, null)),
+ 18998 => array(array(array('_route' => '_278'), array('a', 'b', 'c'), null, null, false, null)),
+ 19051 => array(array(array('_route' => '_63'), array('a', 'b', 'c'), null, null, false, null)),
+ 19099 => array(array(array('_route' => '_195'), array('a', 'b', 'c'), null, null, false, null)),
+ 19147 => array(array(array('_route' => '_252'), array('a', 'b', 'c'), null, null, false, null)),
+ 19195 => array(array(array('_route' => '_461'), array('a', 'b', 'c'), null, null, false, null)),
+ 19248 => array(array(array('_route' => '_126'), array('a', 'b', 'c'), null, null, false, null)),
+ 19296 => array(array(array('_route' => '_158'), array('a', 'b', 'c'), null, null, false, null)),
+ 19344 => array(array(array('_route' => '_221'), array('a', 'b', 'c'), null, null, false, null)),
+ 19392 => array(array(array('_route' => '_269'), array('a', 'b', 'c'), null, null, false, null)),
+ 19440 => array(array(array('_route' => '_310'), array('a', 'b', 'c'), null, null, false, null)),
+ 19496 => array(array(array('_route' => '_138'), array('a', 'b', 'c'), null, null, false, null)),
+ 19543 => array(array(array('_route' => '_348'), array('a', 'b', 'c'), null, null, false, null)),
+ 19592 => array(array(array('_route' => '_236'), array('a', 'b', 'c'), null, null, false, null)),
+ 19640 => array(array(array('_route' => '_433'), array('a', 'b', 'c'), null, null, false, null)),
+ 19693 => array(array(array('_route' => '_141'), array('a', 'b', 'c'), null, null, false, null)),
+ 19741 => array(array(array('_route' => '_283'), array('a', 'b', 'c'), null, null, false, null)),
+ 19794 => array(array(array('_route' => '_144'), array('a', 'b', 'c'), null, null, false, null)),
+ 19842 => array(array(array('_route' => '_191'), array('a', 'b', 'c'), null, null, false, null)),
+ 19895 => array(array(array('_route' => '_168'), array('a', 'b', 'c'), null, null, false, null)),
+ 19943 => array(array(array('_route' => '_363'), array('a', 'b', 'c'), null, null, false, null)),
+ 19991 => array(array(array('_route' => '_381'), array('a', 'b', 'c'), null, null, false, null)),
+ 20044 => array(array(array('_route' => '_180'), array('a', 'b', 'c'), null, null, false, null)),
+ 20092 => array(array(array('_route' => '_339'), array('a', 'b', 'c'), null, null, false, null)),
+ 20142 => array(array(array('_route' => '_196'), array('a', 'b', 'c'), null, null, false, null)),
+ 20194 => array(array(array('_route' => '_198'), array('a', 'b', 'c'), null, null, false, null)),
+ 20242 => array(array(array('_route' => '_285'), array('a', 'b', 'c'), null, null, false, null)),
+ 20292 => array(array(array('_route' => '_349'), array('a', 'b', 'c'), null, null, false, null)),
+ 20344 => array(array(array('_route' => '_367'), array('a', 'b', 'c'), null, null, false, null)),
+ 20392 => array(array(array('_route' => '_384'), array('a', 'b', 'c'), null, null, false, null)),
+ 20440 => array(array(array('_route' => '_498'), array('a', 'b', 'c'), null, null, false, null)),
+ 20490 => array(array(array('_route' => '_369'), array('a', 'b', 'c'), null, null, false, null)),
+ 20542 => array(array(array('_route' => '_408'), array('a', 'b', 'c'), null, null, false, null)),
+ 20590 => array(array(array('_route' => '_413'), array('a', 'b', 'c'), null, null, false, null)),
+ 20652 => array(array(array('_route' => '_44'), array('a', 'b', 'c'), null, null, false, null)),
+ 20699 => array(array(array('_route' => '_256'), array('a', 'b', 'c'), null, null, false, null)),
+ 20748 => array(array(array('_route' => '_173'), array('a', 'b', 'c'), null, null, false, null)),
+ 20796 => array(array(array('_route' => '_266'), array('a', 'b', 'c'), null, null, false, null)),
+ 20844 => array(array(array('_route' => '_392'), array('a', 'b', 'c'), null, null, false, null)),
+ 20892 => array(array(array('_route' => '_430'), array('a', 'b', 'c'), null, null, false, null)),
+ 20940 => array(array(array('_route' => '_482'), array('a', 'b', 'c'), null, null, false, null)),
+ 20993 => array(array(array('_route' => '_49'), array('a', 'b', 'c'), null, null, false, null)),
+ 21041 => array(array(array('_route' => '_94'), array('a', 'b', 'c'), null, null, false, null)),
+ 21089 => array(array(array('_route' => '_407'), array('a', 'b', 'c'), null, null, false, null)),
+ 21142 => array(array(array('_route' => '_65'), array('a', 'b', 'c'), null, null, false, null)),
+ 21190 => array(array(array('_route' => '_181'), array('a', 'b', 'c'), null, null, false, null)),
+ 21238 => array(array(array('_route' => '_437'), array('a', 'b', 'c'), null, null, false, null)),
+ 21291 => array(array(array('_route' => '_76'), array('a', 'b', 'c'), null, null, false, null)),
+ 21339 => array(array(array('_route' => '_357'), array('a', 'b', 'c'), null, null, false, null)),
+ 21392 => array(array(array('_route' => '_80'), array('a', 'b', 'c'), null, null, false, null)),
+ 21440 => array(array(array('_route' => '_106'), array('a', 'b', 'c'), null, null, false, null)),
+ 21493 => array(array(array('_route' => '_83'), array('a', 'b', 'c'), null, null, false, null)),
+ 21541 => array(array(array('_route' => '_255'), array('a', 'b', 'c'), null, null, false, null)),
+ 21589 => array(array(array('_route' => '_330'), array('a', 'b', 'c'), null, null, false, null)),
+ 21642 => array(array(array('_route' => '_100'), array('a', 'b', 'c'), null, null, false, null)),
+ 21690 => array(array(array('_route' => '_396'), array('a', 'b', 'c'), null, null, false, null)),
+ 21738 => array(array(array('_route' => '_422'), array('a', 'b', 'c'), null, null, false, null)),
+ 21791 => array(array(array('_route' => '_149'), array('a', 'b', 'c'), null, null, false, null)),
+ 21839 => array(array(array('_route' => '_324'), array('a', 'b', 'c'), null, null, false, null)),
+ 21892 => array(array(array('_route' => '_164'), array('a', 'b', 'c'), null, null, false, null)),
+ 21940 => array(array(array('_route' => '_423'), array('a', 'b', 'c'), null, null, false, null)),
+ 21990 => array(array(array('_route' => '_241'), array('a', 'b', 'c'), null, null, false, null)),
+ 22042 => array(array(array('_route' => '_290'), array('a', 'b', 'c'), null, null, false, null)),
+ 22090 => array(array(array('_route' => '_335'), array('a', 'b', 'c'), null, null, false, null)),
+ 22140 => array(array(array('_route' => '_373'), array('a', 'b', 'c'), null, null, false, null)),
+ 22189 => array(array(array('_route' => '_375'), array('a', 'b', 'c'), null, null, false, null)),
+ 22238 => array(array(array('_route' => '_450'), array('a', 'b', 'c'), null, null, false, null)),
+ 22287 => array(array(array('_route' => '_464'), array('a', 'b', 'c'), null, null, false, null)),
+ 22345 => array(array(array('_route' => '_51'), array('a', 'b', 'c'), null, null, false, null)),
+ 22393 => array(array(array('_route' => '_77'), array('a', 'b', 'c'), null, null, false, null)),
+ 22441 => array(array(array('_route' => '_234'), array('a', 'b', 'c'), null, null, false, null)),
+ 22489 => array(array(array('_route' => '_394'), array('a', 'b', 'c'), null, null, false, null)),
+ 22542 => array(array(array('_route' => '_88'), array('a', 'b', 'c'), null, null, false, null)),
+ 22590 => array(array(array('_route' => '_155'), array('a', 'b', 'c'), null, null, false, null)),
+ 22643 => array(array(array('_route' => '_96'), array('a', 'b', 'c'), null, null, false, null)),
+ 22691 => array(array(array('_route' => '_298'), array('a', 'b', 'c'), null, null, false, null)),
+ 22739 => array(array(array('_route' => '_470'), array('a', 'b', 'c'), null, null, false, null)),
+ 22792 => array(array(array('_route' => '_109'), array('a', 'b', 'c'), null, null, false, null)),
+ 22840 => array(array(array('_route' => '_204'), array('a', 'b', 'c'), null, null, false, null)),
+ 22893 => array(array(array('_route' => '_115'), array('a', 'b', 'c'), null, null, false, null)),
+ 22941 => array(array(array('_route' => '_145'), array('a', 'b', 'c'), null, null, false, null)),
+ 22994 => array(array(array('_route' => '_123'), array('a', 'b', 'c'), null, null, false, null)),
+ 23042 => array(array(array('_route' => '_277'), array('a', 'b', 'c'), null, null, false, null)),
+ 23090 => array(array(array('_route' => '_473'), array('a', 'b', 'c'), null, null, false, null)),
+ 23143 => array(array(array('_route' => '_334'), array('a', 'b', 'c'), null, null, false, null)),
+ 23191 => array(array(array('_route' => '_493'), array('a', 'b', 'c'), null, null, false, null)),
+ 23244 => array(array(array('_route' => '_372'), array('a', 'b', 'c'), null, null, false, null)),
+ 23292 => array(array(array('_route' => '_432'), array('a', 'b', 'c'), null, null, false, null)),
+ 23340 => array(array(array('_route' => '_436'), array('a', 'b', 'c'), null, null, false, null)),
+ 23393 => array(array(array('_route' => '_425'), array('a', 'b', 'c'), null, null, false, null)),
+ 23441 => array(array(array('_route' => '_456'), array('a', 'b', 'c'), null, null, false, null)),
+ 23489 => array(array(array('_route' => '_474'), array('a', 'b', 'c'), null, null, false, null)),
+ 23539 => array(array(array('_route' => '_485'), array('a', 'b', 'c'), null, null, false, null)),
+ 23594 => array(array(array('_route' => '_91'), array('a', 'b', 'c'), null, null, false, null)),
+ 23646 => array(array(array('_route' => '_110'), array('a', 'b', 'c'), null, null, false, null)),
+ 23694 => array(array(array('_route' => '_114'), array('a', 'b', 'c'), null, null, false, null)),
+ 23750 => array(array(array('_route' => '_118'), array('a', 'b', 'c'), null, null, false, null)),
+ 23796 => array(array(array('_route' => '_475'), array('a', 'b', 'c'), null, null, false, null)),
+ 23844 => array(array(array('_route' => '_366'), array('a', 'b', 'c'), null, null, false, null)),
+ 23897 => array(array(array('_route' => '_167'), array('a', 'b', 'c'), null, null, false, null)),
+ 23945 => array(array(array('_route' => '_192'), array('a', 'b', 'c'), null, null, false, null)),
+ 23993 => array(array(array('_route' => '_342'), array('a', 'b', 'c'), null, null, false, null)),
+ 24046 => array(array(array('_route' => '_229'), array('a', 'b', 'c'), null, null, false, null)),
+ 24097 => array(array(array('_route' => '_235'), array('a', 'b', 'c'), null, null, false, null)),
+ 24144 => array(array(array('_route' => '_302'), array('a', 'b', 'c'), null, null, false, null)),
+ 24193 => array(array(array('_route' => '_322'), array('a', 'b', 'c'), null, null, false, null)),
+ 24246 => array(array(array('_route' => '_237'), array('a', 'b', 'c'), null, null, false, null)),
+ 24294 => array(array(array('_route' => '_293'), array('a', 'b', 'c'), null, null, false, null)),
+ 24347 => array(array(array('_route' => '_239'), array('a', 'b', 'c'), null, null, false, null)),
+ 24395 => array(array(array('_route' => '_444'), array('a', 'b', 'c'), null, null, false, null)),
+ 24443 => array(array(array('_route' => '_491'), array('a', 'b', 'c'), null, null, false, null)),
+ 24491 => array(array(array('_route' => '_492'), array('a', 'b', 'c'), null, null, false, null)),
+ 24541 => array(array(array('_route' => '_258'), array('a', 'b', 'c'), null, null, false, null)),
+ 24590 => array(array(array('_route' => '_317'), array('a', 'b', 'c'), null, null, false, null)),
+ 24639 => array(array(array('_route' => '_361'), array('a', 'b', 'c'), null, null, false, null)),
+ 24688 => array(array(array('_route' => '_391'), array('a', 'b', 'c'), null, null, false, null)),
+ 24737 => array(array(array('_route' => '_462'), array('a', 'b', 'c'), null, null, false, null)),
+ 24786 => array(array(array('_route' => '_476'), array('a', 'b', 'c'), null, null, false, null)),
+ 24837 => array(array(array('_route' => '_501'), array('a', 'b', 'c'), null, null, false, null)),
+ 24889 => array(array(array('_route' => '_514'), array('a', 'b', 'c'), null, null, false, null)),
+ 24937 => array(array(array('_route' => '_731'), array('a', 'b', 'c'), null, null, false, null)),
+ 24990 => array(array(array('_route' => '_522'), array('a', 'b', 'c'), null, null, false, null)),
+ 25038 => array(array(array('_route' => '_693'), array('a', 'b', 'c'), null, null, false, null)),
+ 25091 => array(array(array('_route' => '_537'), array('a', 'b', 'c'), null, null, false, null)),
+ 25139 => array(array(array('_route' => '_554'), array('a', 'b', 'c'), null, null, false, null)),
+ 25187 => array(array(array('_route' => '_645'), array('a', 'b', 'c'), null, null, false, null)),
+ 25235 => array(array(array('_route' => '_862'), array('a', 'b', 'c'), null, null, false, null)),
+ 25288 => array(array(array('_route' => '_539'), array('a', 'b', 'c'), null, null, false, null)),
+ 25336 => array(array(array('_route' => '_729'), array('a', 'b', 'c'), null, null, false, null)),
+ 25384 => array(array(array('_route' => '_897'), array('a', 'b', 'c'), null, null, false, null)),
+ 25437 => array(array(array('_route' => '_561'), array('a', 'b', 'c'), null, null, false, null)),
+ 25485 => array(array(array('_route' => '_615'), array('a', 'b', 'c'), null, null, false, null)),
+ 25533 => array(array(array('_route' => '_764'), array('a', 'b', 'c'), null, null, false, null)),
+ 25581 => array(array(array('_route' => '_948'), array('a', 'b', 'c'), null, null, false, null)),
+ 25634 => array(array(array('_route' => '_617'), array('a', 'b', 'c'), null, null, false, null)),
+ 25682 => array(array(array('_route' => '_671'), array('a', 'b', 'c'), null, null, false, null)),
+ 25735 => array(array(array('_route' => '_649'), array('a', 'b', 'c'), null, null, false, null)),
+ 25783 => array(array(array('_route' => '_651'), array('a', 'b', 'c'), null, null, false, null)),
+ 25831 => array(array(array('_route' => '_684'), array('a', 'b', 'c'), null, null, false, null)),
+ 25884 => array(array(array('_route' => '_669'), array('a', 'b', 'c'), null, null, false, null)),
+ 25932 => array(array(array('_route' => '_743'), array('a', 'b', 'c'), null, null, false, null)),
+ 25980 => array(array(array('_route' => '_962'), array('a', 'b', 'c'), null, null, false, null)),
+ 26033 => array(array(array('_route' => '_694'), array('a', 'b', 'c'), null, null, false, null)),
+ 26081 => array(array(array('_route' => '_985'), array('a', 'b', 'c'), null, null, false, null)),
+ 26134 => array(array(array('_route' => '_707'), array('a', 'b', 'c'), null, null, false, null)),
+ 26182 => array(array(array('_route' => '_718'), array('a', 'b', 'c'), null, null, false, null)),
+ 26235 => array(array(array('_route' => '_720'), array('a', 'b', 'c'), null, null, false, null)),
+ 26283 => array(array(array('_route' => '_745'), array('a', 'b', 'c'), null, null, false, null)),
+ 26333 => array(array(array('_route' => '_874'), array('a', 'b', 'c'), null, null, false, null)),
+ 26391 => array(array(array('_route' => '_502'), array('a', 'b', 'c'), null, null, false, null)),
+ 26439 => array(array(array('_route' => '_667'), array('a', 'b', 'c'), null, null, false, null)),
+ 26487 => array(array(array('_route' => '_911'), array('a', 'b', 'c'), null, null, false, null)),
+ 26535 => array(array(array('_route' => '_942'), array('a', 'b', 'c'), null, null, false, null)),
+ 26585 => array(array(array('_route' => '_504'), array('a', 'b', 'c'), null, null, false, null)),
+ 26637 => array(array(array('_route' => '_524'), array('a', 'b', 'c'), null, null, false, null)),
+ 26685 => array(array(array('_route' => '_732'), array('a', 'b', 'c'), null, null, false, null)),
+ 26738 => array(array(array('_route' => '_596'), array('a', 'b', 'c'), null, null, false, null)),
+ 26786 => array(array(array('_route' => '_601'), array('a', 'b', 'c'), null, null, false, null)),
+ 26839 => array(array(array('_route' => '_620'), array('a', 'b', 'c'), null, null, false, null)),
+ 26887 => array(array(array('_route' => '_631'), array('a', 'b', 'c'), null, null, false, null)),
+ 26935 => array(array(array('_route' => '_771'), array('a', 'b', 'c'), null, null, false, null)),
+ 26983 => array(array(array('_route' => '_937'), array('a', 'b', 'c'), null, null, false, null)),
+ 27031 => array(array(array('_route' => '_999'), array('a', 'b', 'c'), null, null, false, null)),
+ 27084 => array(array(array('_route' => '_657'), array('a', 'b', 'c'), null, null, false, null)),
+ 27132 => array(array(array('_route' => '_701'), array('a', 'b', 'c'), null, null, false, null)),
+ 27185 => array(array(array('_route' => '_662'), array('a', 'b', 'c'), null, null, false, null)),
+ 27233 => array(array(array('_route' => '_797'), array('a', 'b', 'c'), null, null, false, null)),
+ 27281 => array(array(array('_route' => '_924'), array('a', 'b', 'c'), null, null, false, null)),
+ 27334 => array(array(array('_route' => '_702'), array('a', 'b', 'c'), null, null, false, null)),
+ 27382 => array(array(array('_route' => '_750'), array('a', 'b', 'c'), null, null, false, null)),
+ 27435 => array(array(array('_route' => '_749'), array('a', 'b', 'c'), null, null, false, null)),
+ 27483 => array(array(array('_route' => '_837'), array('a', 'b', 'c'), null, null, false, null)),
+ 27533 => array(array(array('_route' => '_758'), array('a', 'b', 'c'), null, null, false, null)),
+ 27585 => array(array(array('_route' => '_810'), array('a', 'b', 'c'), null, null, false, null)),
+ 27633 => array(array(array('_route' => '_902'), array('a', 'b', 'c'), null, null, false, null)),
+ 27683 => array(array(array('_route' => '_845'), array('a', 'b', 'c'), null, null, false, null)),
+ 27741 => array(array(array('_route' => '_503'), array('a', 'b', 'c'), null, null, false, null)),
+ 27792 => array(array(array('_route' => '_756'), array('a', 'b', 'c'), null, null, false, null)),
+ 27839 => array(array(array('_route' => '_799'), array('a', 'b', 'c'), null, null, false, null)),
+ 27888 => array(array(array('_route' => '_769'), array('a', 'b', 'c'), null, null, false, null)),
+ 27936 => array(array(array('_route' => '_981'), array('a', 'b', 'c'), null, null, false, null)),
+ 27989 => array(array(array('_route' => '_507'), array('a', 'b', 'c'), null, null, false, null)),
+ 28037 => array(array(array('_route' => '_672'), array('a', 'b', 'c'), null, null, false, null)),
+ 28085 => array(array(array('_route' => '_790'), array('a', 'b', 'c'), null, null, false, null)),
+ 28138 => array(array(array('_route' => '_515'), array('a', 'b', 'c'), null, null, false, null)),
+ 28186 => array(array(array('_route' => '_523'), array('a', 'b', 'c'), null, null, false, null)),
+ 28234 => array(array(array('_route' => '_957'), array('a', 'b', 'c'), null, null, false, null)),
+ 28282 => array(array(array('_route' => '_995'), array('a', 'b', 'c'), null, null, false, null)),
+ 28335 => array(array(array('_route' => '_532'), array('a', 'b', 'c'), null, null, false, null)),
+ 28383 => array(array(array('_route' => '_642'), array('a', 'b', 'c'), null, null, false, null)),
+ 28433 => array(array(array('_route' => '_579'), array('a', 'b', 'c'), null, null, false, null)),
+ 28485 => array(array(array('_route' => '_625'), array('a', 'b', 'c'), null, null, false, null)),
+ 28533 => array(array(array('_route' => '_916'), array('a', 'b', 'c'), null, null, false, null)),
+ 28586 => array(array(array('_route' => '_633'), array('a', 'b', 'c'), null, null, false, null)),
+ 28634 => array(array(array('_route' => '_656'), array('a', 'b', 'c'), null, null, false, null)),
+ 28687 => array(array(array('_route' => '_658'), array('a', 'b', 'c'), null, null, false, null)),
+ 28735 => array(array(array('_route' => '_943'), array('a', 'b', 'c'), null, null, false, null)),
+ 28788 => array(array(array('_route' => '_664'), array('a', 'b', 'c'), null, null, false, null)),
+ 28836 => array(array(array('_route' => '_852'), array('a', 'b', 'c'), null, null, false, null)),
+ 28884 => array(array(array('_route' => '_870'), array('a', 'b', 'c'), null, null, false, null)),
+ 28937 => array(array(array('_route' => '_683'), array('a', 'b', 'c'), null, null, false, null)),
+ 28985 => array(array(array('_route' => '_915'), array('a', 'b', 'c'), null, null, false, null)),
+ 29038 => array(array(array('_route' => '_719'), array('a', 'b', 'c'), null, null, false, null)),
+ 29086 => array(array(array('_route' => '_859'), array('a', 'b', 'c'), null, null, false, null)),
+ 29134 => array(array(array('_route' => '_912'), array('a', 'b', 'c'), null, null, false, null)),
+ 29182 => array(array(array('_route' => '_978'), array('a', 'b', 'c'), null, null, false, null)),
+ 29235 => array(array(array('_route' => '_738'), array('a', 'b', 'c'), null, null, false, null)),
+ 29283 => array(array(array('_route' => '_883'), array('a', 'b', 'c'), null, null, false, null)),
+ 29333 => array(array(array('_route' => '_741'), array('a', 'b', 'c'), null, null, false, null)),
+ 29382 => array(array(array('_route' => '_760'), array('a', 'b', 'c'), null, null, false, null)),
+ 29431 => array(array(array('_route' => '_895'), array('a', 'b', 'c'), null, null, false, null)),
+ 29489 => array(array(array('_route' => '_505'), array('a', 'b', 'c'), null, null, false, null)),
+ 29537 => array(array(array('_route' => '_935'), array('a', 'b', 'c'), null, null, false, null)),
+ 29590 => array(array(array('_route' => '_509'), array('a', 'b', 'c'), null, null, false, null)),
+ 29638 => array(array(array('_route' => '_820'), array('a', 'b', 'c'), null, null, false, null)),
+ 29686 => array(array(array('_route' => '_910'), array('a', 'b', 'c'), null, null, false, null)),
+ 29739 => array(array(array('_route' => '_518'), array('a', 'b', 'c'), null, null, false, null)),
+ 29787 => array(array(array('_route' => '_618'), array('a', 'b', 'c'), null, null, false, null)),
+ 29840 => array(array(array('_route' => '_546'), array('a', 'b', 'c'), null, null, false, null)),
+ 29888 => array(array(array('_route' => '_740'), array('a', 'b', 'c'), null, null, false, null)),
+ 29936 => array(array(array('_route' => '_867'), array('a', 'b', 'c'), null, null, false, null)),
+ 29989 => array(array(array('_route' => '_572'), array('a', 'b', 'c'), null, null, false, null)),
+ 30037 => array(array(array('_route' => '_952'), array('a', 'b', 'c'), null, null, false, null)),
+ 30090 => array(array(array('_route' => '_573'), array('a', 'b', 'c'), null, null, false, null)),
+ 30138 => array(array(array('_route' => '_692'), array('a', 'b', 'c'), null, null, false, null)),
+ 30186 => array(array(array('_route' => '_700'), array('a', 'b', 'c'), null, null, false, null)),
+ 30234 => array(array(array('_route' => '_772'), array('a', 'b', 'c'), null, null, false, null)),
+ 30284 => array(array(array('_route' => '_653'), array('a', 'b', 'c'), null, null, false, null)),
+ 30336 => array(array(array('_route' => '_695'), array('a', 'b', 'c'), null, null, false, null)),
+ 30384 => array(array(array('_route' => '_748'), array('a', 'b', 'c'), null, null, false, null)),
+ 30437 => array(array(array('_route' => '_710'), array('a', 'b', 'c'), null, null, false, null)),
+ 30485 => array(array(array('_route' => '_716'), array('a', 'b', 'c'), null, null, false, null)),
+ 30533 => array(array(array('_route' => '_969'), array('a', 'b', 'c'), null, null, false, null)),
+ 30586 => array(array(array('_route' => '_734'), array('a', 'b', 'c'), null, null, false, null)),
+ 30634 => array(array(array('_route' => '_742'), array('a', 'b', 'c'), null, null, false, null)),
+ 30682 => array(array(array('_route' => '_844'), array('a', 'b', 'c'), null, null, false, null)),
+ 30735 => array(array(array('_route' => '_763'), array('a', 'b', 'c'), null, null, false, null)),
+ 30783 => array(array(array('_route' => '_965'), array('a', 'b', 'c'), null, null, false, null)),
+ 30836 => array(array(array('_route' => '_778'), array('a', 'b', 'c'), null, null, false, null)),
+ 30884 => array(array(array('_route' => '_813'), array('a', 'b', 'c'), null, null, false, null)),
+ 30932 => array(array(array('_route' => '_831'), array('a', 'b', 'c'), null, null, false, null)),
+ 30982 => array(array(array('_route' => '_955'), array('a', 'b', 'c'), null, null, false, null)),
+ 31031 => array(array(array('_route' => '_997'), array('a', 'b', 'c'), null, null, false, null)),
+ 31089 => array(array(array('_route' => '_506'), array('a', 'b', 'c'), null, null, false, null)),
+ 31137 => array(array(array('_route' => '_575'), array('a', 'b', 'c'), null, null, false, null)),
+ 31190 => array(array(array('_route' => '_516'), array('a', 'b', 'c'), null, null, false, null)),
+ 31238 => array(array(array('_route' => '_553'), array('a', 'b', 'c'), null, null, false, null)),
+ 31291 => array(array(array('_route' => '_528'), array('a', 'b', 'c'), null, null, false, null)),
+ 31339 => array(array(array('_route' => '_847'), array('a', 'b', 'c'), null, null, false, null)),
+ 31387 => array(array(array('_route' => '_904'), array('a', 'b', 'c'), null, null, false, null)),
+ 31440 => array(array(array('_route' => '_574'), array('a', 'b', 'c'), null, null, false, null)),
+ 31488 => array(array(array('_route' => '_818'), array('a', 'b', 'c'), null, null, false, null)),
+ 31538 => array(array(array('_route' => '_577'), array('a', 'b', 'c'), null, null, false, null)),
+ 31590 => array(array(array('_route' => '_584'), array('a', 'b', 'c'), null, null, false, null)),
+ 31638 => array(array(array('_route' => '_905'), array('a', 'b', 'c'), null, null, false, null)),
+ 31691 => array(array(array('_route' => '_612'), array('a', 'b', 'c'), null, null, false, null)),
+ 31739 => array(array(array('_route' => '_688'), array('a', 'b', 'c'), null, null, false, null)),
+ 31787 => array(array(array('_route' => '_854'), array('a', 'b', 'c'), null, null, false, null)),
+ 31840 => array(array(array('_route' => '_613'), array('a', 'b', 'c'), null, null, false, null)),
+ 31888 => array(array(array('_route' => '_767'), array('a', 'b', 'c'), null, null, false, null)),
+ 31941 => array(array(array('_route' => '_666'), array('a', 'b', 'c'), null, null, false, null)),
+ 31989 => array(array(array('_route' => '_759'), array('a', 'b', 'c'), null, null, false, null)),
+ 32037 => array(array(array('_route' => '_827'), array('a', 'b', 'c'), null, null, false, null)),
+ 32085 => array(array(array('_route' => '_840'), array('a', 'b', 'c'), null, null, false, null)),
+ 32138 => array(array(array('_route' => '_680'), array('a', 'b', 'c'), null, null, false, null)),
+ 32186 => array(array(array('_route' => '_784'), array('a', 'b', 'c'), null, null, false, null)),
+ 32234 => array(array(array('_route' => '_842'), array('a', 'b', 'c'), null, null, false, null)),
+ 32282 => array(array(array('_route' => '_860'), array('a', 'b', 'c'), null, null, false, null)),
+ 32332 => array(array(array('_route' => '_704'), array('a', 'b', 'c'), null, null, false, null)),
+ 32381 => array(array(array('_route' => '_727'), array('a', 'b', 'c'), null, null, false, null)),
+ 32430 => array(array(array('_route' => '_777'), array('a', 'b', 'c'), null, null, false, null)),
+ 32482 => array(array(array('_route' => '_838'), array('a', 'b', 'c'), null, null, false, null)),
+ 32530 => array(array(array('_route' => '_861'), array('a', 'b', 'c'), null, null, false, null)),
+ 32583 => array(array(array('_route' => '_849'), array('a', 'b', 'c'), null, null, false, null)),
+ 32631 => array(array(array('_route' => '_982'), array('a', 'b', 'c'), null, null, false, null)),
+ 32679 => array(array(array('_route' => '_986'), array('a', 'b', 'c'), null, null, false, null)),
+ 32741 => array(array(array('_route' => '_508'), array('a', 'b', 'c'), null, null, false, null)),
+ 32788 => array(array(array('_route' => '_517'), array('a', 'b', 'c'), null, null, false, null)),
+ 32837 => array(array(array('_route' => '_622'), array('a', 'b', 'c'), null, null, false, null)),
+ 32890 => array(array(array('_route' => '_513'), array('a', 'b', 'c'), null, null, false, null)),
+ 32938 => array(array(array('_route' => '_655'), array('a', 'b', 'c'), null, null, false, null)),
+ 32986 => array(array(array('_route' => '_843'), array('a', 'b', 'c'), null, null, false, null)),
+ 33034 => array(array(array('_route' => '_939'), array('a', 'b', 'c'), null, null, false, null)),
+ 33084 => array(array(array('_route' => '_529'), array('a', 'b', 'c'), null, null, false, null)),
+ 33136 => array(array(array('_route' => '_535'), array('a', 'b', 'c'), null, null, false, null)),
+ 33184 => array(array(array('_route' => '_685'), array('a', 'b', 'c'), null, null, false, null)),
+ 33240 => array(array(array('_route' => '_559'), array('a', 'b', 'c'), null, null, false, null)),
+ 33287 => array(array(array('_route' => '_661'), array('a', 'b', 'c'), null, null, false, null)),
+ 33336 => array(array(array('_route' => '_768'), array('a', 'b', 'c'), null, null, false, null)),
+ 33389 => array(array(array('_route' => '_589'), array('a', 'b', 'c'), null, null, false, null)),
+ 33437 => array(array(array('_route' => '_647'), array('a', 'b', 'c'), null, null, false, null)),
+ 33485 => array(array(array('_route' => '_652'), array('a', 'b', 'c'), null, null, false, null)),
+ 33533 => array(array(array('_route' => '_834'), array('a', 'b', 'c'), null, null, false, null)),
+ 33586 => array(array(array('_route' => '_591'), array('a', 'b', 'c'), null, null, false, null)),
+ 33634 => array(array(array('_route' => '_599'), array('a', 'b', 'c'), null, null, false, null)),
+ 33687 => array(array(array('_route' => '_787'), array('a', 'b', 'c'), null, null, false, null)),
+ 33734 => array(array(array('_route' => '_848'), array('a', 'b', 'c'), null, null, false, null)),
+ 33787 => array(array(array('_route' => '_796'), array('a', 'b', 'c'), null, null, false, null)),
+ 33835 => array(array(array('_route' => '_877'), array('a', 'b', 'c'), null, null, false, null)),
+ 33885 => array(array(array('_route' => '_809'), array('a', 'b', 'c'), null, null, false, null)),
+ 33934 => array(array(array('_route' => '_817'), array('a', 'b', 'c'), null, null, false, null)),
+ 33986 => array(array(array('_route' => '_819'), array('a', 'b', 'c'), null, null, false, null)),
+ 34034 => array(array(array('_route' => '_865'), array('a', 'b', 'c'), null, null, false, null)),
+ 34084 => array(array(array('_route' => '_919'), array('a', 'b', 'c'), null, null, false, null)),
+ 34133 => array(array(array('_route' => '_949'), array('a', 'b', 'c'), null, null, false, null)),
+ 34191 => array(array(array('_route' => '_510'), array('a', 'b', 'c'), null, null, false, null)),
+ 34239 => array(array(array('_route' => '_590'), array('a', 'b', 'c'), null, null, false, null)),
+ 34287 => array(array(array('_route' => '_597'), array('a', 'b', 'c'), null, null, false, null)),
+ 34335 => array(array(array('_route' => '_682'), array('a', 'b', 'c'), null, null, false, null)),
+ 34383 => array(array(array('_route' => '_723'), array('a', 'b', 'c'), null, null, false, null)),
+ 34436 => array(array(array('_route' => '_521'), array('a', 'b', 'c'), null, null, false, null)),
+ 34484 => array(array(array('_route' => '_594'), array('a', 'b', 'c'), null, null, false, null)),
+ 34532 => array(array(array('_route' => '_689'), array('a', 'b', 'c'), null, null, false, null)),
+ 34580 => array(array(array('_route' => '_713'), array('a', 'b', 'c'), null, null, false, null)),
+ 34628 => array(array(array('_route' => '_889'), array('a', 'b', 'c'), null, null, false, null)),
+ 34681 => array(array(array('_route' => '_531'), array('a', 'b', 'c'), null, null, false, null)),
+ 34729 => array(array(array('_route' => '_639'), array('a', 'b', 'c'), null, null, false, null)),
+ 34780 => array(array(array('_route' => '_646'), array('a', 'b', 'c'), null, null, false, null)),
+ 34827 => array(array(array('_route' => '_659'), array('a', 'b', 'c'), null, null, false, null)),
+ 34876 => array(array(array('_route' => '_959'), array('a', 'b', 'c'), null, null, false, null)),
+ 34929 => array(array(array('_route' => '_550'), array('a', 'b', 'c'), null, null, false, null)),
+ 34977 => array(array(array('_route' => '_833'), array('a', 'b', 'c'), null, null, false, null)),
+ 35025 => array(array(array('_route' => '_899'), array('a', 'b', 'c'), null, null, false, null)),
+ 35081 => array(array(array('_route' => '_580'), array('a', 'b', 'c'), null, null, false, null)),
+ 35128 => array(array(array('_route' => '_762'), array('a', 'b', 'c'), null, null, false, null)),
+ 35177 => array(array(array('_route' => '_896'), array('a', 'b', 'c'), null, null, false, null)),
+ 35230 => array(array(array('_route' => '_595'), array('a', 'b', 'c'), null, null, false, null)),
+ 35278 => array(array(array('_route' => '_933'), array('a', 'b', 'c'), null, null, false, null)),
+ 35328 => array(array(array('_route' => '_610'), array('a', 'b', 'c'), null, null, false, null)),
+ 35380 => array(array(array('_route' => '_629'), array('a', 'b', 'c'), null, null, false, null)),
+ 35428 => array(array(array('_route' => '_744'), array('a', 'b', 'c'), null, null, false, null)),
+ 35481 => array(array(array('_route' => '_674'), array('a', 'b', 'c'), null, null, false, null)),
+ 35529 => array(array(array('_route' => '_726'), array('a', 'b', 'c'), null, null, false, null)),
+ 35577 => array(array(array('_route' => '_929'), array('a', 'b', 'c'), null, null, false, null)),
+ 35627 => array(array(array('_route' => '_696'), array('a', 'b', 'c'), null, null, false, null)),
+ 35679 => array(array(array('_route' => '_841'), array('a', 'b', 'c'), null, null, false, null)),
+ 35727 => array(array(array('_route' => '_890'), array('a', 'b', 'c'), null, null, false, null)),
+ 35777 => array(array(array('_route' => '_885'), array('a', 'b', 'c'), null, null, false, null)),
+ 35826 => array(array(array('_route' => '_888'), array('a', 'b', 'c'), null, null, false, null)),
+ 35875 => array(array(array('_route' => '_996'), array('a', 'b', 'c'), null, null, false, null)),
+ 35933 => array(array(array('_route' => '_511'), array('a', 'b', 'c'), null, null, false, null)),
+ 35981 => array(array(array('_route' => '_576'), array('a', 'b', 'c'), null, null, false, null)),
+ 36029 => array(array(array('_route' => '_623'), array('a', 'b', 'c'), null, null, false, null)),
+ 36082 => array(array(array('_route' => '_560'), array('a', 'b', 'c'), null, null, false, null)),
+ 36129 => array(array(array('_route' => '_585'), array('a', 'b', 'c'), null, null, false, null)),
+ 36182 => array(array(array('_route' => '_570'), array('a', 'b', 'c'), null, null, false, null)),
+ 36230 => array(array(array('_route' => '_578'), array('a', 'b', 'c'), null, null, false, null)),
+ 36281 => array(array(array('_route' => '_780'), array('a', 'b', 'c'), null, null, false, null)),
+ 36328 => array(array(array('_route' => '_808'), array('a', 'b', 'c'), null, null, false, null)),
+ 36382 => array(array(array('_route' => '_593'), array('a', 'b', 'c'), null, null, false, null)),
+ 36430 => array(array(array('_route' => '_900'), array('a', 'b', 'c'), null, null, false, null)),
+ 36483 => array(array(array('_route' => '_632'), array('a', 'b', 'c'), null, null, false, null)),
+ 36531 => array(array(array('_route' => '_654'), array('a', 'b', 'c'), null, null, false, null)),
+ 36579 => array(array(array('_route' => '_721'), array('a', 'b', 'c'), null, null, false, null)),
+ 36627 => array(array(array('_route' => '_836'), array('a', 'b', 'c'), null, null, false, null)),
+ 36680 => array(array(array('_route' => '_637'), array('a', 'b', 'c'), null, null, false, null)),
+ 36728 => array(array(array('_route' => '_737'), array('a', 'b', 'c'), null, null, false, null)),
+ 36784 => array(array(array('_route' => '_699'), array('a', 'b', 'c'), null, null, false, null)),
+ 36831 => array(array(array('_route' => '_822'), array('a', 'b', 'c'), null, null, false, null)),
+ 36880 => array(array(array('_route' => '_853'), array('a', 'b', 'c'), null, null, false, null)),
+ 36933 => array(array(array('_route' => '_708'), array('a', 'b', 'c'), null, null, false, null)),
+ 36981 => array(array(array('_route' => '_871'), array('a', 'b', 'c'), null, null, false, null)),
+ 37034 => array(array(array('_route' => '_752'), array('a', 'b', 'c'), null, null, false, null)),
+ 37082 => array(array(array('_route' => '_989'), array('a', 'b', 'c'), null, null, false, null)),
+ 37132 => array(array(array('_route' => '_855'), array('a', 'b', 'c'), null, null, false, null)),
+ 37184 => array(array(array('_route' => '_858'), array('a', 'b', 'c'), null, null, false, null)),
+ 37232 => array(array(array('_route' => '_898'), array('a', 'b', 'c'), null, null, false, null)),
+ 37282 => array(array(array('_route' => '_903'), array('a', 'b', 'c'), null, null, false, null)),
+ 37331 => array(array(array('_route' => '_909'), array('a', 'b', 'c'), null, null, false, null)),
+ 37380 => array(array(array('_route' => '_950'), array('a', 'b', 'c'), null, null, false, null)),
+ 37441 => array(array(array('_route' => '_512'), array('a', 'b', 'c'), null, null, false, null)),
+ 37488 => array(array(array('_route' => '_691'), array('a', 'b', 'c'), null, null, false, null)),
+ 37537 => array(array(array('_route' => '_686'), array('a', 'b', 'c'), null, null, false, null)),
+ 37587 => array(array(array('_route' => '_527'), array('a', 'b', 'c'), null, null, false, null)),
+ 37639 => array(array(array('_route' => '_541'), array('a', 'b', 'c'), null, null, false, null)),
+ 37687 => array(array(array('_route' => '_956'), array('a', 'b', 'c'), null, null, false, null)),
+ 37740 => array(array(array('_route' => '_555'), array('a', 'b', 'c'), null, null, false, null)),
+ 37788 => array(array(array('_route' => '_681'), array('a', 'b', 'c'), null, null, false, null)),
+ 37841 => array(array(array('_route' => '_556'), array('a', 'b', 'c'), null, null, false, null)),
+ 37889 => array(array(array('_route' => '_802'), array('a', 'b', 'c'), null, null, false, null)),
+ 37939 => array(array(array('_route' => '_558'), array('a', 'b', 'c'), null, null, false, null)),
+ 37991 => array(array(array('_route' => '_564'), array('a', 'b', 'c'), null, null, false, null)),
+ 38039 => array(array(array('_route' => '_670'), array('a', 'b', 'c'), null, null, false, null)),
+ 38087 => array(array(array('_route' => '_884'), array('a', 'b', 'c'), null, null, false, null)),
+ 38140 => array(array(array('_route' => '_627'), array('a', 'b', 'c'), null, null, false, null)),
+ 38187 => array(array(array('_route' => '_746'), array('a', 'b', 'c'), null, null, false, null)),
+ 38240 => array(array(array('_route' => '_668'), array('a', 'b', 'c'), null, null, false, null)),
+ 38291 => array(array(array('_route' => '_712'), array('a', 'b', 'c'), null, null, false, null)),
+ 38338 => array(array(array('_route' => '_863'), array('a', 'b', 'c'), null, null, false, null)),
+ 38387 => array(array(array('_route' => '_801'), array('a', 'b', 'c'), null, null, false, null)),
+ 38440 => array(array(array('_route' => '_709'), array('a', 'b', 'c'), null, null, false, null)),
+ 38488 => array(array(array('_route' => '_850'), array('a', 'b', 'c'), null, null, false, null)),
+ 38536 => array(array(array('_route' => '_918'), array('a', 'b', 'c'), null, null, false, null)),
+ 38586 => array(array(array('_route' => '_803'), array('a', 'b', 'c'), null, null, false, null)),
+ 38638 => array(array(array('_route' => '_864'), array('a', 'b', 'c'), null, null, false, null)),
+ 38686 => array(array(array('_route' => '_880'), array('a', 'b', 'c'), null, null, false, null)),
+ 38734 => array(array(array('_route' => '_927'), array('a', 'b', 'c'), null, null, false, null)),
+ 38787 => array(array(array('_route' => '_930'), array('a', 'b', 'c'), null, null, false, null)),
+ 38835 => array(array(array('_route' => '_951'), array('a', 'b', 'c'), null, null, false, null)),
+ 38883 => array(array(array('_route' => '_963'), array('a', 'b', 'c'), null, null, false, null)),
+ 38942 => array(array(array('_route' => '_519'), array('a', 'b', 'c'), null, null, false, null)),
+ 38990 => array(array(array('_route' => '_823'), array('a', 'b', 'c'), null, null, false, null)),
+ 39038 => array(array(array('_route' => '_954'), array('a', 'b', 'c'), null, null, false, null)),
+ 39091 => array(array(array('_route' => '_525'), array('a', 'b', 'c'), null, null, false, null)),
+ 39139 => array(array(array('_route' => '_991'), array('a', 'b', 'c'), null, null, false, null)),
+ 39189 => array(array(array('_route' => '_536'), array('a', 'b', 'c'), null, null, false, null)),
+ 39241 => array(array(array('_route' => '_545'), array('a', 'b', 'c'), null, null, false, null)),
+ 39289 => array(array(array('_route' => '_944'), array('a', 'b', 'c'), null, null, false, null)),
+ 39342 => array(array(array('_route' => '_557'), array('a', 'b', 'c'), null, null, false, null)),
+ 39390 => array(array(array('_route' => '_783'), array('a', 'b', 'c'), null, null, false, null)),
+ 39438 => array(array(array('_route' => '_807'), array('a', 'b', 'c'), null, null, false, null)),
+ 39491 => array(array(array('_route' => '_586'), array('a', 'b', 'c'), null, null, false, null)),
+ 39539 => array(array(array('_route' => '_711'), array('a', 'b', 'c'), null, null, false, null)),
+ 39592 => array(array(array('_route' => '_598'), array('a', 'b', 'c'), null, null, false, null)),
+ 39640 => array(array(array('_route' => '_635'), array('a', 'b', 'c'), null, null, false, null)),
+ 39688 => array(array(array('_route' => '_983'), array('a', 'b', 'c'), null, null, false, null)),
+ 39741 => array(array(array('_route' => '_634'), array('a', 'b', 'c'), null, null, false, null)),
+ 39789 => array(array(array('_route' => '_641'), array('a', 'b', 'c'), null, null, false, null)),
+ 39840 => array(array(array('_route' => '_779'), array('a', 'b', 'c'), null, null, false, null)),
+ 39887 => array(array(array('_route' => '_876'), array('a', 'b', 'c'), null, null, false, null)),
+ 39936 => array(array(array('_route' => '_811'), array('a', 'b', 'c'), null, null, false, null)),
+ 39984 => array(array(array('_route' => '_824'), array('a', 'b', 'c'), null, null, false, null)),
+ 40037 => array(array(array('_route' => '_660'), array('a', 'b', 'c'), null, null, false, null)),
+ 40085 => array(array(array('_route' => '_789'), array('a', 'b', 'c'), null, null, false, null)),
+ 40138 => array(array(array('_route' => '_733'), array('a', 'b', 'c'), null, null, false, null)),
+ 40186 => array(array(array('_route' => '_735'), array('a', 'b', 'c'), null, null, false, null)),
+ 40234 => array(array(array('_route' => '_882'), array('a', 'b', 'c'), null, null, false, null)),
+ 40282 => array(array(array('_route' => '_967'), array('a', 'b', 'c'), null, null, false, null)),
+ 40332 => array(array(array('_route' => '_736'), array('a', 'b', 'c'), null, null, false, null)),
+ 40381 => array(array(array('_route' => '_753'), array('a', 'b', 'c'), null, null, false, null)),
+ 40430 => array(array(array('_route' => '_786'), array('a', 'b', 'c'), null, null, false, null)),
+ 40479 => array(array(array('_route' => '_907'), array('a', 'b', 'c'), null, null, false, null)),
+ 40528 => array(array(array('_route' => '_920'), array('a', 'b', 'c'), null, null, false, null)),
+ 40577 => array(array(array('_route' => '_971'), array('a', 'b', 'c'), null, null, false, null)),
+ 40635 => array(array(array('_route' => '_520'), array('a', 'b', 'c'), null, null, false, null)),
+ 40683 => array(array(array('_route' => '_891'), array('a', 'b', 'c'), null, null, false, null)),
+ 40739 => array(array(array('_route' => '_534'), array('a', 'b', 'c'), null, null, false, null)),
+ 40785 => array(array(array('_route' => '_602'), array('a', 'b', 'c'), null, null, false, null)),
+ 40834 => array(array(array('_route' => '_605'), array('a', 'b', 'c'), null, null, false, null)),
+ 40882 => array(array(array('_route' => '_979'), array('a', 'b', 'c'), null, null, false, null)),
+ 40932 => array(array(array('_route' => '_547'), array('a', 'b', 'c'), null, null, false, null)),
+ 40987 => array(array(array('_route' => '_549'), array('a', 'b', 'c'), null, null, false, null)),
+ 41034 => array(array(array('_route' => '_755'), array('a', 'b', 'c'), null, null, false, null)),
+ 41083 => array(array(array('_route' => '_922'), array('a', 'b', 'c'), null, null, false, null)),
+ 41131 => array(array(array('_route' => '_977'), array('a', 'b', 'c'), null, null, false, null)),
+ 41184 => array(array(array('_route' => '_565'), array('a', 'b', 'c'), null, null, false, null)),
+ 41232 => array(array(array('_route' => '_926'), array('a', 'b', 'c'), null, null, false, null)),
+ 41282 => array(array(array('_route' => '_571'), array('a', 'b', 'c'), null, null, false, null)),
+ 41331 => array(array(array('_route' => '_581'), array('a', 'b', 'c'), null, null, false, null)),
+ 41380 => array(array(array('_route' => '_619'), array('a', 'b', 'c'), null, null, false, null)),
+ 41429 => array(array(array('_route' => '_636'), array('a', 'b', 'c'), null, null, false, null)),
+ 41481 => array(array(array('_route' => '_679'), array('a', 'b', 'c'), null, null, false, null)),
+ 41529 => array(array(array('_route' => '_866'), array('a', 'b', 'c'), null, null, false, null)),
+ 41577 => array(array(array('_route' => '_973'), array('a', 'b', 'c'), null, null, false, null)),
+ 41630 => array(array(array('_route' => '_690'), array('a', 'b', 'c'), null, null, false, null)),
+ 41678 => array(array(array('_route' => '_775'), array('a', 'b', 'c'), null, null, false, null)),
+ 41731 => array(array(array('_route' => '_722'), array('a', 'b', 'c'), null, null, false, null)),
+ 41779 => array(array(array('_route' => '_906'), array('a', 'b', 'c'), null, null, false, null)),
+ 41827 => array(array(array('_route' => '_946'), array('a', 'b', 'c'), null, null, false, null)),
+ 41877 => array(array(array('_route' => '_788'), array('a', 'b', 'c'), null, null, false, null)),
+ 41929 => array(array(array('_route' => '_828'), array('a', 'b', 'c'), null, null, false, null)),
+ 41977 => array(array(array('_route' => '_892'), array('a', 'b', 'c'), null, null, false, null)),
+ 42025 => array(array(array('_route' => '_972'), array('a', 'b', 'c'), null, null, false, null)),
+ 42075 => array(array(array('_route' => '_829'), array('a', 'b', 'c'), null, null, false, null)),
+ 42127 => array(array(array('_route' => '_923'), array('a', 'b', 'c'), null, null, false, null)),
+ 42175 => array(array(array('_route' => '_947'), array('a', 'b', 'c'), null, null, false, null)),
+ 42234 => array(array(array('_route' => '_526'), array('a', 'b', 'c'), null, null, false, null)),
+ 42282 => array(array(array('_route' => '_614'), array('a', 'b', 'c'), null, null, false, null)),
+ 42330 => array(array(array('_route' => '_621'), array('a', 'b', 'c'), null, null, false, null)),
+ 42383 => array(array(array('_route' => '_543'), array('a', 'b', 'c'), null, null, false, null)),
+ 42431 => array(array(array('_route' => '_812'), array('a', 'b', 'c'), null, null, false, null)),
+ 42487 => array(array(array('_route' => '_548'), array('a', 'b', 'c'), null, null, false, null)),
+ 42534 => array(array(array('_route' => '_747'), array('a', 'b', 'c'), null, null, false, null)),
+ 42583 => array(array(array('_route' => '_715'), array('a', 'b', 'c'), null, null, false, null)),
+ 42631 => array(array(array('_route' => '_940'), array('a', 'b', 'c'), null, null, false, null)),
+ 42684 => array(array(array('_route' => '_563'), array('a', 'b', 'c'), null, null, false, null)),
+ 42732 => array(array(array('_route' => '_611'), array('a', 'b', 'c'), null, null, false, null)),
+ 42780 => array(array(array('_route' => '_830'), array('a', 'b', 'c'), null, null, false, null)),
+ 42833 => array(array(array('_route' => '_569'), array('a', 'b', 'c'), null, null, false, null)),
+ 42881 => array(array(array('_route' => '_908'), array('a', 'b', 'c'), null, null, false, null)),
+ 42929 => array(array(array('_route' => '_913'), array('a', 'b', 'c'), null, null, false, null)),
+ 42982 => array(array(array('_route' => '_644'), array('a', 'b', 'c'), null, null, false, null)),
+ 43030 => array(array(array('_route' => '_776'), array('a', 'b', 'c'), null, null, false, null)),
+ 43078 => array(array(array('_route' => '_856'), array('a', 'b', 'c'), null, null, false, null)),
+ 43131 => array(array(array('_route' => '_650'), array('a', 'b', 'c'), null, null, false, null)),
+ 43179 => array(array(array('_route' => '_761'), array('a', 'b', 'c'), null, null, false, null)),
+ 43232 => array(array(array('_route' => '_663'), array('a', 'b', 'c'), null, null, false, null)),
+ 43280 => array(array(array('_route' => '_754'), array('a', 'b', 'c'), null, null, false, null)),
+ 43333 => array(array(array('_route' => '_665'), array('a', 'b', 'c'), null, null, false, null)),
+ 43381 => array(array(array('_route' => '_805'), array('a', 'b', 'c'), null, null, false, null)),
+ 43429 => array(array(array('_route' => '_846'), array('a', 'b', 'c'), null, null, false, null)),
+ 43477 => array(array(array('_route' => '_857'), array('a', 'b', 'c'), null, null, false, null)),
+ 43530 => array(array(array('_route' => '_675'), array('a', 'b', 'c'), null, null, false, null)),
+ 43578 => array(array(array('_route' => '_839'), array('a', 'b', 'c'), null, null, false, null)),
+ 43626 => array(array(array('_route' => '_968'), array('a', 'b', 'c'), null, null, false, null)),
+ 43676 => array(array(array('_route' => '_697'), array('a', 'b', 'c'), null, null, false, null)),
+ 43728 => array(array(array('_route' => '_725'), array('a', 'b', 'c'), null, null, false, null)),
+ 43776 => array(array(array('_route' => '_794'), array('a', 'b', 'c'), null, null, false, null)),
+ 43829 => array(array(array('_route' => '_773'), array('a', 'b', 'c'), null, null, false, null)),
+ 43877 => array(array(array('_route' => '_992'), array('a', 'b', 'c'), null, null, false, null)),
+ 43930 => array(array(array('_route' => '_901'), array('a', 'b', 'c'), null, null, false, null)),
+ 43978 => array(array(array('_route' => '_970'), array('a', 'b', 'c'), null, null, false, null)),
+ 44028 => array(array(array('_route' => '_964'), array('a', 'b', 'c'), null, null, false, null)),
+ 44086 => array(array(array('_route' => '_530'), array('a', 'b', 'c'), null, null, false, null)),
+ 44134 => array(array(array('_route' => '_703'), array('a', 'b', 'c'), null, null, false, null)),
+ 44187 => array(array(array('_route' => '_533'), array('a', 'b', 'c'), null, null, false, null)),
+ 44235 => array(array(array('_route' => '_739'), array('a', 'b', 'c'), null, null, false, null)),
+ 44283 => array(array(array('_route' => '_791'), array('a', 'b', 'c'), null, null, false, null)),
+ 44331 => array(array(array('_route' => '_987'), array('a', 'b', 'c'), null, null, false, null)),
+ 44384 => array(array(array('_route' => '_566'), array('a', 'b', 'c'), null, null, false, null)),
+ 44432 => array(array(array('_route' => '_592'), array('a', 'b', 'c'), null, null, false, null)),
+ 44488 => array(array(array('_route' => '_568'), array('a', 'b', 'c'), null, null, false, null)),
+ 44534 => array(array(array('_route' => '_868'), array('a', 'b', 'c'), null, null, false, null)),
+ 44583 => array(array(array('_route' => '_878'), array('a', 'b', 'c'), null, null, false, null)),
+ 44636 => array(array(array('_route' => '_588'), array('a', 'b', 'c'), null, null, false, null)),
+ 44684 => array(array(array('_route' => '_793'), array('a', 'b', 'c'), null, null, false, null)),
+ 44732 => array(array(array('_route' => '_917'), array('a', 'b', 'c'), null, null, false, null)),
+ 44785 => array(array(array('_route' => '_600'), array('a', 'b', 'c'), null, null, false, null)),
+ 44833 => array(array(array('_route' => '_728'), array('a', 'b', 'c'), null, null, false, null)),
+ 44886 => array(array(array('_route' => '_603'), array('a', 'b', 'c'), null, null, false, null)),
+ 44934 => array(array(array('_route' => '_765'), array('a', 'b', 'c'), null, null, false, null)),
+ 44987 => array(array(array('_route' => '_607'), array('a', 'b', 'c'), null, null, false, null)),
+ 45035 => array(array(array('_route' => '_676'), array('a', 'b', 'c'), null, null, false, null)),
+ 45083 => array(array(array('_route' => '_804'), array('a', 'b', 'c'), null, null, false, null)),
+ 45136 => array(array(array('_route' => '_609'), array('a', 'b', 'c'), null, null, false, null)),
+ 45184 => array(array(array('_route' => '_961'), array('a', 'b', 'c'), null, null, false, null)),
+ 45232 => array(array(array('_route' => '_980'), array('a', 'b', 'c'), null, null, false, null)),
+ 45282 => array(array(array('_route' => '_714'), array('a', 'b', 'c'), null, null, false, null)),
+ 45334 => array(array(array('_route' => '_730'), array('a', 'b', 'c'), null, null, false, null)),
+ 45382 => array(array(array('_route' => '_806'), array('a', 'b', 'c'), null, null, false, null)),
+ 45430 => array(array(array('_route' => '_825'), array('a', 'b', 'c'), null, null, false, null)),
+ 45478 => array(array(array('_route' => '_879'), array('a', 'b', 'c'), null, null, false, null)),
+ 45526 => array(array(array('_route' => '_893'), array('a', 'b', 'c'), null, null, false, null)),
+ 45576 => array(array(array('_route' => '_928'), array('a', 'b', 'c'), null, null, false, null)),
+ 45628 => array(array(array('_route' => '_932'), array('a', 'b', 'c'), null, null, false, null)),
+ 45676 => array(array(array('_route' => '_958'), array('a', 'b', 'c'), null, null, false, null)),
+ 45726 => array(array(array('_route' => '_984'), array('a', 'b', 'c'), null, null, false, null)),
+ 45784 => array(array(array('_route' => '_538'), array('a', 'b', 'c'), null, null, false, null)),
+ 45832 => array(array(array('_route' => '_993'), array('a', 'b', 'c'), null, null, false, null)),
+ 45882 => array(array(array('_route' => '_542'), array('a', 'b', 'c'), null, null, false, null)),
+ 45934 => array(array(array('_route' => '_551'), array('a', 'b', 'c'), null, null, false, null)),
+ 45982 => array(array(array('_route' => '_687'), array('a', 'b', 'c'), null, null, false, null)),
+ 46030 => array(array(array('_route' => '_724'), array('a', 'b', 'c'), null, null, false, null)),
+ 46078 => array(array(array('_route' => '_925'), array('a', 'b', 'c'), null, null, false, null)),
+ 46131 => array(array(array('_route' => '_587'), array('a', 'b', 'c'), null, null, false, null)),
+ 46179 => array(array(array('_route' => '_914'), array('a', 'b', 'c'), null, null, false, null)),
+ 46229 => array(array(array('_route' => '_616'), array('a', 'b', 'c'), null, null, false, null)),
+ 46284 => array(array(array('_route' => '_677'), array('a', 'b', 'c'), null, null, false, null)),
+ 46331 => array(array(array('_route' => '_815'), array('a', 'b', 'c'), null, null, false, null)),
+ 46380 => array(array(array('_route' => '_781'), array('a', 'b', 'c'), null, null, false, null)),
+ 46430 => array(array(array('_route' => '_717'), array('a', 'b', 'c'), null, null, false, null)),
+ 46482 => array(array(array('_route' => '_782'), array('a', 'b', 'c'), null, null, false, null)),
+ 46530 => array(array(array('_route' => '_832'), array('a', 'b', 'c'), null, null, false, null)),
+ 46583 => array(array(array('_route' => '_795'), array('a', 'b', 'c'), null, null, false, null)),
+ 46631 => array(array(array('_route' => '_887'), array('a', 'b', 'c'), null, null, false, null)),
+ 46681 => array(array(array('_route' => '_800'), array('a', 'b', 'c'), null, null, false, null)),
+ 46730 => array(array(array('_route' => '_826'), array('a', 'b', 'c'), null, null, false, null)),
+ 46779 => array(array(array('_route' => '_881'), array('a', 'b', 'c'), null, null, false, null)),
+ 46828 => array(array(array('_route' => '_886'), array('a', 'b', 'c'), null, null, false, null)),
+ 46877 => array(array(array('_route' => '_938'), array('a', 'b', 'c'), null, null, false, null)),
+ 46935 => array(array(array('_route' => '_540'), array('a', 'b', 'c'), null, null, false, null)),
+ 46983 => array(array(array('_route' => '_643'), array('a', 'b', 'c'), null, null, false, null)),
+ 47033 => array(array(array('_route' => '_544'), array('a', 'b', 'c'), null, null, false, null)),
+ 47082 => array(array(array('_route' => '_552'), array('a', 'b', 'c'), null, null, false, null)),
+ 47134 => array(array(array('_route' => '_567'), array('a', 'b', 'c'), null, null, false, null)),
+ 47182 => array(array(array('_route' => '_608'), array('a', 'b', 'c'), null, null, false, null)),
+ 47230 => array(array(array('_route' => '_698'), array('a', 'b', 'c'), null, null, false, null)),
+ 47278 => array(array(array('_route' => '_988'), array('a', 'b', 'c'), null, null, false, null)),
+ 47331 => array(array(array('_route' => '_583'), array('a', 'b', 'c'), null, null, false, null)),
+ 47379 => array(array(array('_route' => '_998'), array('a', 'b', 'c'), null, null, false, null)),
+ 47432 => array(array(array('_route' => '_604'), array('a', 'b', 'c'), null, null, false, null)),
+ 47480 => array(array(array('_route' => '_630'), array('a', 'b', 'c'), null, null, false, null)),
+ 47528 => array(array(array('_route' => '_706'), array('a', 'b', 'c'), null, null, false, null)),
+ 47576 => array(array(array('_route' => '_976'), array('a', 'b', 'c'), null, null, false, null)),
+ 47629 => array(array(array('_route' => '_673'), array('a', 'b', 'c'), null, null, false, null)),
+ 47677 => array(array(array('_route' => '_678'), array('a', 'b', 'c'), null, null, false, null)),
+ 47725 => array(array(array('_route' => '_931'), array('a', 'b', 'c'), null, null, false, null)),
+ 47775 => array(array(array('_route' => '_751'), array('a', 'b', 'c'), null, null, false, null)),
+ 47824 => array(array(array('_route' => '_766'), array('a', 'b', 'c'), null, null, false, null)),
+ 47876 => array(array(array('_route' => '_792'), array('a', 'b', 'c'), null, null, false, null)),
+ 47924 => array(array(array('_route' => '_814'), array('a', 'b', 'c'), null, null, false, null)),
+ 47974 => array(array(array('_route' => '_798'), array('a', 'b', 'c'), null, null, false, null)),
+ 48026 => array(array(array('_route' => '_851'), array('a', 'b', 'c'), null, null, false, null)),
+ 48074 => array(array(array('_route' => '_941'), array('a', 'b', 'c'), null, null, false, null)),
+ 48122 => array(array(array('_route' => '_953'), array('a', 'b', 'c'), null, null, false, null)),
+ 48170 => array(array(array('_route' => '_975'), array('a', 'b', 'c'), null, null, false, null)),
+ 48220 => array(array(array('_route' => '_873'), array('a', 'b', 'c'), null, null, false, null)),
+ 48269 => array(array(array('_route' => '_936'), array('a', 'b', 'c'), null, null, false, null)),
+ 48318 => array(array(array('_route' => '_994'), array('a', 'b', 'c'), null, null, false, null)),
+ 48376 => array(array(array('_route' => '_562'), array('a', 'b', 'c'), null, null, false, null)),
+ 48424 => array(array(array('_route' => '_770'), array('a', 'b', 'c'), null, null, false, null)),
+ 48475 => array(array(array('_route' => '_774'), array('a', 'b', 'c'), null, null, false, null)),
+ 48522 => array(array(array('_route' => '_966'), array('a', 'b', 'c'), null, null, false, null)),
+ 48573 => array(array(array('_route' => '_582'), array('a', 'b', 'c'), null, null, false, null)),
+ 48625 => array(array(array('_route' => '_606'), array('a', 'b', 'c'), null, null, false, null)),
+ 48673 => array(array(array('_route' => '_648'), array('a', 'b', 'c'), null, null, false, null)),
+ 48723 => array(array(array('_route' => '_624'), array('a', 'b', 'c'), null, null, false, null)),
+ 48775 => array(array(array('_route' => '_626'), array('a', 'b', 'c'), null, null, false, null)),
+ 48823 => array(array(array('_route' => '_821'), array('a', 'b', 'c'), null, null, false, null)),
+ 48873 => array(array(array('_route' => '_628'), array('a', 'b', 'c'), null, null, false, null)),
+ 48922 => array(array(array('_route' => '_638'), array('a', 'b', 'c'), null, null, false, null)),
+ 48974 => array(array(array('_route' => '_640'), array('a', 'b', 'c'), null, null, false, null)),
+ 49022 => array(array(array('_route' => '_990'), array('a', 'b', 'c'), null, null, false, null)),
+ 49072 => array(array(array('_route' => '_705'), array('a', 'b', 'c'), null, null, false, null)),
+ 49121 => array(array(array('_route' => '_757'), array('a', 'b', 'c'), null, null, false, null)),
+ 49176 => array(array(array('_route' => '_785'), array('a', 'b', 'c'), null, null, false, null)),
+ 49223 => array(array(array('_route' => '_875'), array('a', 'b', 'c'), null, null, false, null)),
+ 49270 => array(array(array('_route' => '_894'), array('a', 'b', 'c'), null, null, false, null)),
+ 49319 => array(array(array('_route' => '_945'), array('a', 'b', 'c'), null, null, false, null)),
+ 49375 => array(array(array('_route' => '_816'), array('a', 'b', 'c'), null, null, false, null)),
+ 49422 => array(array(array('_route' => '_872'), array('a', 'b', 'c'), null, null, false, null)),
+ 49471 => array(array(array('_route' => '_921'), array('a', 'b', 'c'), null, null, false, null)),
+ 49519 => array(array(array('_route' => '_960'), array('a', 'b', 'c'), null, null, false, null)),
+ 49567 => array(array(array('_route' => '_974'), array('a', 'b', 'c'), null, null, false, null)),
+ 49620 => array(array(array('_route' => '_835'), array('a', 'b', 'c'), null, null, false, null)),
+ 49668 => array(array(array('_route' => '_934'), array('a', 'b', 'c'), null, null, false, null)),
+ 49718 => array(array(array('_route' => '_869'), array('a', 'b', 'c'), null, null, false, null)),
);
-
- foreach ($regexList as $offset => $regex) {
- while (preg_match($regex, $matchedPathinfo, $matches)) {
- switch ($m = (int) $matches['MARK']) {
- default:
- $routes = array(
- 54 => array(array('_route' => '_0'), array('a', 'b', 'c'), null, null),
- 102 => array(array('_route' => '_190'), array('a', 'b', 'c'), null, null),
- 147 => array(array('_route' => '_478'), array('a', 'b', 'c'), null, null),
- 194 => array(array('_route' => '_259'), array('a', 'b', 'c'), null, null),
- 240 => array(array('_route' => '_368'), array('a', 'b', 'c'), null, null),
- 291 => array(array('_route' => '_1'), array('a', 'b', 'c'), null, null),
- 337 => array(array('_route' => '_116'), array('a', 'b', 'c'), null, null),
- 383 => array(array('_route' => '_490'), array('a', 'b', 'c'), null, null),
- 434 => array(array('_route' => '_2'), array('a', 'b', 'c'), null, null),
- 480 => array(array('_route' => '_124'), array('a', 'b', 'c'), null, null),
- 526 => array(array('_route' => '_389'), array('a', 'b', 'c'), null, null),
- 577 => array(array('_route' => '_8'), array('a', 'b', 'c'), null, null),
- 623 => array(array('_route' => '_104'), array('a', 'b', 'c'), null, null),
- 677 => array(array('_route' => '_12'), array('a', 'b', 'c'), null, null),
- 722 => array(array('_route' => '_442'), array('a', 'b', 'c'), null, null),
- 769 => array(array('_route' => '_253'), array('a', 'b', 'c'), null, null),
- 820 => array(array('_route' => '_13'), array('a', 'b', 'c'), null, null),
- 866 => array(array('_route' => '_254'), array('a', 'b', 'c'), null, null),
- 912 => array(array('_route' => '_347'), array('a', 'b', 'c'), null, null),
- 963 => array(array('_route' => '_16'), array('a', 'b', 'c'), null, null),
- 1009 => array(array('_route' => '_87'), array('a', 'b', 'c'), null, null),
- 1058 => array(array('_route' => '_31'), array('a', 'b', 'c'), null, null),
- 1109 => array(array('_route' => '_50'), array('a', 'b', 'c'), null, null),
- 1156 => array(array('_route' => '_219'), array('a', 'b', 'c'), null, null),
- 1203 => array(array('_route' => '_332'), array('a', 'b', 'c'), null, null),
- 1250 => array(array('_route' => '_359'), array('a', 'b', 'c'), null, null),
- 1302 => array(array('_route' => '_183'), array('a', 'b', 'c'), null, null),
- 1349 => array(array('_route' => '_500'), array('a', 'b', 'c'), null, null),
- 1401 => array(array('_route' => '_214'), array('a', 'b', 'c'), null, null),
- 1448 => array(array('_route' => '_321'), array('a', 'b', 'c'), null, null),
- 1497 => array(array('_route' => '_243'), array('a', 'b', 'c'), null, null),
- 1545 => array(array('_route' => '_328'), array('a', 'b', 'c'), null, null),
- 1596 => array(array('_route' => '_362'), array('a', 'b', 'c'), null, null),
- 1643 => array(array('_route' => '_488'), array('a', 'b', 'c'), null, null),
- 1701 => array(array('_route' => '_3'), array('a', 'b', 'c'), null, null),
- 1751 => array(array('_route' => '_102'), array('a', 'b', 'c'), null, null),
- 1797 => array(array('_route' => '_220'), array('a', 'b', 'c'), null, null),
- 1845 => array(array('_route' => '_127'), array('a', 'b', 'c'), null, null),
- 1897 => array(array('_route' => '_5'), array('a', 'b', 'c'), null, null),
- 1944 => array(array('_route' => '_242'), array('a', 'b', 'c'), null, null),
- 1991 => array(array('_route' => '_397'), array('a', 'b', 'c'), null, null),
- 2038 => array(array('_route' => '_454'), array('a', 'b', 'c'), null, null),
- 2090 => array(array('_route' => '_34'), array('a', 'b', 'c'), null, null),
- 2137 => array(array('_route' => '_281'), array('a', 'b', 'c'), null, null),
- 2189 => array(array('_route' => '_64'), array('a', 'b', 'c'), null, null),
- 2236 => array(array('_route' => '_205'), array('a', 'b', 'c'), null, null),
- 2291 => array(array('_route' => '_71'), array('a', 'b', 'c'), null, null),
- 2337 => array(array('_route' => '_203'), array('a', 'b', 'c'), null, null),
- 2385 => array(array('_route' => '_97'), array('a', 'b', 'c'), null, null),
- 2437 => array(array('_route' => '_98'), array('a', 'b', 'c'), null, null),
- 2484 => array(array('_route' => '_267'), array('a', 'b', 'c'), null, null),
- 2531 => array(array('_route' => '_309'), array('a', 'b', 'c'), null, null),
- 2586 => array(array('_route' => '_117'), array('a', 'b', 'c'), null, null),
- 2631 => array(array('_route' => '_211'), array('a', 'b', 'c'), null, null),
- 2679 => array(array('_route' => '_484'), array('a', 'b', 'c'), null, null),
- 2731 => array(array('_route' => '_139'), array('a', 'b', 'c'), null, null),
- 2778 => array(array('_route' => '_421'), array('a', 'b', 'c'), null, null),
- 2830 => array(array('_route' => '_185'), array('a', 'b', 'c'), null, null),
- 2877 => array(array('_route' => '_439'), array('a', 'b', 'c'), null, null),
- 2926 => array(array('_route' => '_218'), array('a', 'b', 'c'), null, null),
- 2977 => array(array('_route' => '_233'), array('a', 'b', 'c'), null, null),
- 3024 => array(array('_route' => '_483'), array('a', 'b', 'c'), null, null),
- 3073 => array(array('_route' => '_265'), array('a', 'b', 'c'), null, null),
- 3124 => array(array('_route' => '_299'), array('a', 'b', 'c'), null, null),
- 3171 => array(array('_route' => '_351'), array('a', 'b', 'c'), null, null),
- 3218 => array(array('_route' => '_472'), array('a', 'b', 'c'), null, null),
- 3267 => array(array('_route' => '_360'), array('a', 'b', 'c'), null, null),
- 3315 => array(array('_route' => '_466'), array('a', 'b', 'c'), null, null),
- 3372 => array(array('_route' => '_4'), array('a', 'b', 'c'), null, null),
- 3419 => array(array('_route' => '_142'), array('a', 'b', 'c'), null, null),
- 3466 => array(array('_route' => '_151'), array('a', 'b', 'c'), null, null),
- 3513 => array(array('_route' => '_308'), array('a', 'b', 'c'), null, null),
- 3560 => array(array('_route' => '_440'), array('a', 'b', 'c'), null, null),
- 3612 => array(array('_route' => '_14'), array('a', 'b', 'c'), null, null),
- 3659 => array(array('_route' => '_358'), array('a', 'b', 'c'), null, null),
- 3711 => array(array('_route' => '_37'), array('a', 'b', 'c'), null, null),
- 3758 => array(array('_route' => '_38'), array('a', 'b', 'c'), null, null),
- 3805 => array(array('_route' => '_146'), array('a', 'b', 'c'), null, null),
- 3852 => array(array('_route' => '_194'), array('a', 'b', 'c'), null, null),
- 3899 => array(array('_route' => '_487'), array('a', 'b', 'c'), null, null),
- 3948 => array(array('_route' => '_42'), array('a', 'b', 'c'), null, null),
- 3999 => array(array('_route' => '_54'), array('a', 'b', 'c'), null, null),
- 4046 => array(array('_route' => '_326'), array('a', 'b', 'c'), null, null),
- 4098 => array(array('_route' => '_68'), array('a', 'b', 'c'), null, null),
- 4145 => array(array('_route' => '_108'), array('a', 'b', 'c'), null, null),
- 4197 => array(array('_route' => '_74'), array('a', 'b', 'c'), null, null),
- 4244 => array(array('_route' => '_315'), array('a', 'b', 'c'), null, null),
- 4291 => array(array('_route' => '_374'), array('a', 'b', 'c'), null, null),
- 4343 => array(array('_route' => '_99'), array('a', 'b', 'c'), null, null),
- 4390 => array(array('_route' => '_238'), array('a', 'b', 'c'), null, null),
- 4442 => array(array('_route' => '_107'), array('a', 'b', 'c'), null, null),
- 4489 => array(array('_route' => '_409'), array('a', 'b', 'c'), null, null),
- 4541 => array(array('_route' => '_122'), array('a', 'b', 'c'), null, null),
- 4588 => array(array('_route' => '_379'), array('a', 'b', 'c'), null, null),
- 4635 => array(array('_route' => '_390'), array('a', 'b', 'c'), null, null),
- 4687 => array(array('_route' => '_171'), array('a', 'b', 'c'), null, null),
- 4734 => array(array('_route' => '_260'), array('a', 'b', 'c'), null, null),
- 4781 => array(array('_route' => '_434'), array('a', 'b', 'c'), null, null),
- 4830 => array(array('_route' => '_189'), array('a', 'b', 'c'), null, null),
- 4878 => array(array('_route' => '_467'), array('a', 'b', 'c'), null, null),
- 4935 => array(array('_route' => '_6'), array('a', 'b', 'c'), null, null),
- 4982 => array(array('_route' => '_286'), array('a', 'b', 'c'), null, null),
- 5029 => array(array('_route' => '_438'), array('a', 'b', 'c'), null, null),
- 5081 => array(array('_route' => '_19'), array('a', 'b', 'c'), null, null),
- 5131 => array(array('_route' => '_24'), array('a', 'b', 'c'), null, null),
- 5177 => array(array('_route' => '_172'), array('a', 'b', 'c'), null, null),
- 5230 => array(array('_route' => '_33'), array('a', 'b', 'c'), null, null),
- 5277 => array(array('_route' => '_400'), array('a', 'b', 'c'), null, null),
- 5324 => array(array('_route' => '_427'), array('a', 'b', 'c'), null, null),
- 5376 => array(array('_route' => '_35'), array('a', 'b', 'c'), null, null),
- 5423 => array(array('_route' => '_156'), array('a', 'b', 'c'), null, null),
- 5475 => array(array('_route' => '_36'), array('a', 'b', 'c'), null, null),
- 5522 => array(array('_route' => '_251'), array('a', 'b', 'c'), null, null),
- 5574 => array(array('_route' => '_43'), array('a', 'b', 'c'), null, null),
- 5621 => array(array('_route' => '_292'), array('a', 'b', 'c'), null, null),
- 5668 => array(array('_route' => '_411'), array('a', 'b', 'c'), null, null),
- 5720 => array(array('_route' => '_69'), array('a', 'b', 'c'), null, null),
- 5767 => array(array('_route' => '_159'), array('a', 'b', 'c'), null, null),
- 5814 => array(array('_route' => '_170'), array('a', 'b', 'c'), null, null),
- 5861 => array(array('_route' => '_376'), array('a', 'b', 'c'), null, null),
- 5913 => array(array('_route' => '_131'), array('a', 'b', 'c'), null, null),
- 5960 => array(array('_route' => '_446'), array('a', 'b', 'c'), null, null),
- 6015 => array(array('_route' => '_140'), array('a', 'b', 'c'), null, null),
- 6061 => array(array('_route' => '_353'), array('a', 'b', 'c'), null, null),
- 6112 => array(array('_route' => '_224'), array('a', 'b', 'c'), null, null),
- 6158 => array(array('_route' => '_346'), array('a', 'b', 'c'), null, null),
- 6204 => array(array('_route' => '_443'), array('a', 'b', 'c'), null, null),
- 6254 => array(array('_route' => '_154'), array('a', 'b', 'c'), null, null),
- 6305 => array(array('_route' => '_212'), array('a', 'b', 'c'), null, null),
- 6352 => array(array('_route' => '_313'), array('a', 'b', 'c'), null, null),
- 6399 => array(array('_route' => '_395'), array('a', 'b', 'c'), null, null),
- 6446 => array(array('_route' => '_441'), array('a', 'b', 'c'), null, null),
- 6498 => array(array('_route' => '_223'), array('a', 'b', 'c'), null, null),
- 6545 => array(array('_route' => '_303'), array('a', 'b', 'c'), null, null),
- 6594 => array(array('_route' => '_410'), array('a', 'b', 'c'), null, null),
- 6642 => array(array('_route' => '_494'), array('a', 'b', 'c'), null, null),
- 6702 => array(array('_route' => '_7'), array('a', 'b', 'c'), null, null),
- 6748 => array(array('_route' => '_268'), array('a', 'b', 'c'), null, null),
- 6796 => array(array('_route' => '_178'), array('a', 'b', 'c'), null, null),
- 6843 => array(array('_route' => '_179'), array('a', 'b', 'c'), null, null),
- 6890 => array(array('_route' => '_416'), array('a', 'b', 'c'), null, null),
- 6942 => array(array('_route' => '_25'), array('a', 'b', 'c'), null, null),
- 6989 => array(array('_route' => '_307'), array('a', 'b', 'c'), null, null),
- 7036 => array(array('_route' => '_387'), array('a', 'b', 'c'), null, null),
- 7083 => array(array('_route' => '_471'), array('a', 'b', 'c'), null, null),
- 7132 => array(array('_route' => '_90'), array('a', 'b', 'c'), null, null),
- 7183 => array(array('_route' => '_95'), array('a', 'b', 'c'), null, null),
- 7230 => array(array('_route' => '_338'), array('a', 'b', 'c'), null, null),
- 7277 => array(array('_route' => '_401'), array('a', 'b', 'c'), null, null),
- 7329 => array(array('_route' => '_147'), array('a', 'b', 'c'), null, null),
- 7376 => array(array('_route' => '_319'), array('a', 'b', 'c'), null, null),
- 7423 => array(array('_route' => '_354'), array('a', 'b', 'c'), null, null),
- 7470 => array(array('_route' => '_428'), array('a', 'b', 'c'), null, null),
- 7522 => array(array('_route' => '_162'), array('a', 'b', 'c'), null, null),
- 7572 => array(array('_route' => '_175'), array('a', 'b', 'c'), null, null),
- 7618 => array(array('_route' => '_455'), array('a', 'b', 'c'), null, null),
- 7666 => array(array('_route' => '_355'), array('a', 'b', 'c'), null, null),
- 7718 => array(array('_route' => '_197'), array('a', 'b', 'c'), null, null),
- 7768 => array(array('_route' => '_202'), array('a', 'b', 'c'), null, null),
- 7813 => array(array('_route' => '_489'), array('a', 'b', 'c'), null, null),
- 7863 => array(array('_route' => '_199'), array('a', 'b', 'c'), null, null),
- 7914 => array(array('_route' => '_263'), array('a', 'b', 'c'), null, null),
- 7961 => array(array('_route' => '_406'), array('a', 'b', 'c'), null, null),
- 8010 => array(array('_route' => '_289'), array('a', 'b', 'c'), null, null),
- 8058 => array(array('_route' => '_325'), array('a', 'b', 'c'), null, null),
- 8106 => array(array('_route' => '_378'), array('a', 'b', 'c'), null, null),
- 8154 => array(array('_route' => '_468'), array('a', 'b', 'c'), null, null),
- 8211 => array(array('_route' => '_9'), array('a', 'b', 'c'), null, null),
- 8258 => array(array('_route' => '_216'), array('a', 'b', 'c'), null, null),
- 8307 => array(array('_route' => '_26'), array('a', 'b', 'c'), null, null),
- 8355 => array(array('_route' => '_62'), array('a', 'b', 'c'), null, null),
- 8406 => array(array('_route' => '_81'), array('a', 'b', 'c'), null, null),
- 8453 => array(array('_route' => '_318'), array('a', 'b', 'c'), null, null),
- 8505 => array(array('_route' => '_121'), array('a', 'b', 'c'), null, null),
- 8551 => array(array('_route' => '_182'), array('a', 'b', 'c'), null, null),
- 8603 => array(array('_route' => '_136'), array('a', 'b', 'c'), null, null),
- 8650 => array(array('_route' => '_415'), array('a', 'b', 'c'), null, null),
- 8697 => array(array('_route' => '_457'), array('a', 'b', 'c'), null, null),
- 8744 => array(array('_route' => '_463'), array('a', 'b', 'c'), null, null),
- 8796 => array(array('_route' => '_148'), array('a', 'b', 'c'), null, null),
- 8843 => array(array('_route' => '_273'), array('a', 'b', 'c'), null, null),
- 8892 => array(array('_route' => '_284'), array('a', 'b', 'c'), null, null),
- 8940 => array(array('_route' => '_288'), array('a', 'b', 'c'), null, null),
- 8991 => array(array('_route' => '_295'), array('a', 'b', 'c'), null, null),
- 9038 => array(array('_route' => '_305'), array('a', 'b', 'c'), null, null),
- 9085 => array(array('_route' => '_453'), array('a', 'b', 'c'), null, null),
- 9134 => array(array('_route' => '_340'), array('a', 'b', 'c'), null, null),
- 9185 => array(array('_route' => '_371'), array('a', 'b', 'c'), null, null),
- 9232 => array(array('_route' => '_417'), array('a', 'b', 'c'), null, null),
- 9284 => array(array('_route' => '_382'), array('a', 'b', 'c'), null, null),
- 9331 => array(array('_route' => '_404'), array('a', 'b', 'c'), null, null),
- 9389 => array(array('_route' => '_10'), array('a', 'b', 'c'), null, null),
- 9436 => array(array('_route' => '_279'), array('a', 'b', 'c'), null, null),
- 9483 => array(array('_route' => '_377'), array('a', 'b', 'c'), null, null),
- 9535 => array(array('_route' => '_39'), array('a', 'b', 'c'), null, null),
- 9582 => array(array('_route' => '_40'), array('a', 'b', 'c'), null, null),
- 9629 => array(array('_route' => '_264'), array('a', 'b', 'c'), null, null),
- 9676 => array(array('_route' => '_449'), array('a', 'b', 'c'), null, null),
- 9728 => array(array('_route' => '_46'), array('a', 'b', 'c'), null, null),
- 9775 => array(array('_route' => '_257'), array('a', 'b', 'c'), null, null),
- 9822 => array(array('_route' => '_274'), array('a', 'b', 'c'), null, null),
- 9869 => array(array('_route' => '_388'), array('a', 'b', 'c'), null, null),
- 9921 => array(array('_route' => '_53'), array('a', 'b', 'c'), null, null),
- 9968 => array(array('_route' => '_345'), array('a', 'b', 'c'), null, null),
- 10020 => array(array('_route' => '_73'), array('a', 'b', 'c'), null, null),
- 10068 => array(array('_route' => '_296'), array('a', 'b', 'c'), null, null),
- 10121 => array(array('_route' => '_75'), array('a', 'b', 'c'), null, null),
- 10169 => array(array('_route' => '_458'), array('a', 'b', 'c'), null, null),
- 10225 => array(array('_route' => '_79'), array('a', 'b', 'c'), null, null),
- 10272 => array(array('_route' => '_129'), array('a', 'b', 'c'), null, null),
- 10319 => array(array('_route' => '_418'), array('a', 'b', 'c'), null, null),
- 10368 => array(array('_route' => '_225'), array('a', 'b', 'c'), null, null),
- 10416 => array(array('_route' => '_479'), array('a', 'b', 'c'), null, null),
- 10466 => array(array('_route' => '_120'), array('a', 'b', 'c'), null, null),
- 10515 => array(array('_route' => '_276'), array('a', 'b', 'c'), null, null),
- 10564 => array(array('_route' => '_370'), array('a', 'b', 'c'), null, null),
- 10616 => array(array('_route' => '_385'), array('a', 'b', 'c'), null, null),
- 10664 => array(array('_route' => '_469'), array('a', 'b', 'c'), null, null),
- 10714 => array(array('_route' => '_435'), array('a', 'b', 'c'), null, null),
- 10772 => array(array('_route' => '_11'), array('a', 'b', 'c'), null, null),
- 10820 => array(array('_route' => '_105'), array('a', 'b', 'c'), null, null),
- 10868 => array(array('_route' => '_132'), array('a', 'b', 'c'), null, null),
- 10921 => array(array('_route' => '_18'), array('a', 'b', 'c'), null, null),
- 10969 => array(array('_route' => '_210'), array('a', 'b', 'c'), null, null),
- 11017 => array(array('_route' => '_329'), array('a', 'b', 'c'), null, null),
- 11073 => array(array('_route' => '_29'), array('a', 'b', 'c'), null, null),
- 11120 => array(array('_route' => '_480'), array('a', 'b', 'c'), null, null),
- 11169 => array(array('_route' => '_426'), array('a', 'b', 'c'), null, null),
- 11222 => array(array('_route' => '_32'), array('a', 'b', 'c'), null, null),
- 11270 => array(array('_route' => '_217'), array('a', 'b', 'c'), null, null),
- 11318 => array(array('_route' => '_275'), array('a', 'b', 'c'), null, null),
- 11371 => array(array('_route' => '_45'), array('a', 'b', 'c'), null, null),
- 11419 => array(array('_route' => '_157'), array('a', 'b', 'c'), null, null),
- 11467 => array(array('_route' => '_184'), array('a', 'b', 'c'), null, null),
- 11515 => array(array('_route' => '_250'), array('a', 'b', 'c'), null, null),
- 11563 => array(array('_route' => '_356'), array('a', 'b', 'c'), null, null),
- 11616 => array(array('_route' => '_47'), array('a', 'b', 'c'), null, null),
- 11664 => array(array('_route' => '_445'), array('a', 'b', 'c'), null, null),
- 11714 => array(array('_route' => '_48'), array('a', 'b', 'c'), null, null),
- 11766 => array(array('_route' => '_58'), array('a', 'b', 'c'), null, null),
- 11814 => array(array('_route' => '_414'), array('a', 'b', 'c'), null, null),
- 11862 => array(array('_route' => '_431'), array('a', 'b', 'c'), null, null),
- 11915 => array(array('_route' => '_84'), array('a', 'b', 'c'), null, null),
- 11963 => array(array('_route' => '_294'), array('a', 'b', 'c'), null, null),
- 12011 => array(array('_route' => '_336'), array('a', 'b', 'c'), null, null),
- 12059 => array(array('_route' => '_465'), array('a', 'b', 'c'), null, null),
- 12112 => array(array('_route' => '_103'), array('a', 'b', 'c'), null, null),
- 12160 => array(array('_route' => '_111'), array('a', 'b', 'c'), null, null),
- 12208 => array(array('_route' => '_207'), array('a', 'b', 'c'), null, null),
- 12256 => array(array('_route' => '_402'), array('a', 'b', 'c'), null, null),
- 12309 => array(array('_route' => '_230'), array('a', 'b', 'c'), null, null),
- 12356 => array(array('_route' => '_331'), array('a', 'b', 'c'), null, null),
- 12406 => array(array('_route' => '_248'), array('a', 'b', 'c'), null, null),
- 12455 => array(array('_route' => '_282'), array('a', 'b', 'c'), null, null),
- 12513 => array(array('_route' => '_15'), array('a', 'b', 'c'), null, null),
- 12561 => array(array('_route' => '_130'), array('a', 'b', 'c'), null, null),
- 12609 => array(array('_route' => '_231'), array('a', 'b', 'c'), null, null),
- 12657 => array(array('_route' => '_365'), array('a', 'b', 'c'), null, null),
- 12705 => array(array('_route' => '_448'), array('a', 'b', 'c'), null, null),
- 12758 => array(array('_route' => '_20'), array('a', 'b', 'c'), null, null),
- 12806 => array(array('_route' => '_93'), array('a', 'b', 'c'), null, null),
- 12854 => array(array('_route' => '_186'), array('a', 'b', 'c'), null, null),
- 12902 => array(array('_route' => '_460'), array('a', 'b', 'c'), null, null),
- 12955 => array(array('_route' => '_52'), array('a', 'b', 'c'), null, null),
- 13003 => array(array('_route' => '_447'), array('a', 'b', 'c'), null, null),
- 13056 => array(array('_route' => '_56'), array('a', 'b', 'c'), null, null),
- 13104 => array(array('_route' => '_133'), array('a', 'b', 'c'), null, null),
- 13152 => array(array('_route' => '_297'), array('a', 'b', 'c'), null, null),
- 13205 => array(array('_route' => '_82'), array('a', 'b', 'c'), null, null),
- 13253 => array(array('_route' => '_165'), array('a', 'b', 'c'), null, null),
- 13301 => array(array('_route' => '_213'), array('a', 'b', 'c'), null, null),
- 13351 => array(array('_route' => '_86'), array('a', 'b', 'c'), null, null),
- 13403 => array(array('_route' => '_92'), array('a', 'b', 'c'), null, null),
- 13450 => array(array('_route' => '_280'), array('a', 'b', 'c'), null, null),
- 13500 => array(array('_route' => '_143'), array('a', 'b', 'c'), null, null),
- 13549 => array(array('_route' => '_177'), array('a', 'b', 'c'), null, null),
- 13601 => array(array('_route' => '_188'), array('a', 'b', 'c'), null, null),
- 13649 => array(array('_route' => '_311'), array('a', 'b', 'c'), null, null),
- 13697 => array(array('_route' => '_350'), array('a', 'b', 'c'), null, null),
- 13750 => array(array('_route' => '_226'), array('a', 'b', 'c'), null, null),
- 13798 => array(array('_route' => '_291'), array('a', 'b', 'c'), null, null),
- 13851 => array(array('_route' => '_244'), array('a', 'b', 'c'), null, null),
- 13898 => array(array('_route' => '_287'), array('a', 'b', 'c'), null, null),
- 13951 => array(array('_route' => '_300'), array('a', 'b', 'c'), null, null),
- 13999 => array(array('_route' => '_451'), array('a', 'b', 'c'), null, null),
- 14047 => array(array('_route' => '_452'), array('a', 'b', 'c'), null, null),
- 14095 => array(array('_route' => '_481'), array('a', 'b', 'c'), null, null),
- 14145 => array(array('_route' => '_312'), array('a', 'b', 'c'), null, null),
- 14203 => array(array('_route' => '_17'), array('a', 'b', 'c'), null, null),
- 14251 => array(array('_route' => '_227'), array('a', 'b', 'c'), null, null),
- 14299 => array(array('_route' => '_393'), array('a', 'b', 'c'), null, null),
- 14349 => array(array('_route' => '_57'), array('a', 'b', 'c'), null, null),
- 14401 => array(array('_route' => '_61'), array('a', 'b', 'c'), null, null),
- 14449 => array(array('_route' => '_112'), array('a', 'b', 'c'), null, null),
- 14500 => array(array('_route' => '_135'), array('a', 'b', 'c'), null, null),
- 14547 => array(array('_route' => '_271'), array('a', 'b', 'c'), null, null),
- 14596 => array(array('_route' => '_459'), array('a', 'b', 'c'), null, null),
- 14649 => array(array('_route' => '_67'), array('a', 'b', 'c'), null, null),
- 14697 => array(array('_route' => '_113'), array('a', 'b', 'c'), null, null),
- 14745 => array(array('_route' => '_497'), array('a', 'b', 'c'), null, null),
- 14795 => array(array('_route' => '_70'), array('a', 'b', 'c'), null, null),
- 14847 => array(array('_route' => '_89'), array('a', 'b', 'c'), null, null),
- 14895 => array(array('_route' => '_128'), array('a', 'b', 'c'), null, null),
- 14948 => array(array('_route' => '_150'), array('a', 'b', 'c'), null, null),
- 14996 => array(array('_route' => '_166'), array('a', 'b', 'c'), null, null),
- 15047 => array(array('_route' => '_206'), array('a', 'b', 'c'), null, null),
- 15094 => array(array('_route' => '_419'), array('a', 'b', 'c'), null, null),
- 15148 => array(array('_route' => '_201'), array('a', 'b', 'c'), null, null),
- 15196 => array(array('_route' => '_314'), array('a', 'b', 'c'), null, null),
- 15244 => array(array('_route' => '_429'), array('a', 'b', 'c'), null, null),
- 15297 => array(array('_route' => '_228'), array('a', 'b', 'c'), null, null),
- 15345 => array(array('_route' => '_477'), array('a', 'b', 'c'), null, null),
- 15395 => array(array('_route' => '_272'), array('a', 'b', 'c'), null, null),
- 15444 => array(array('_route' => '_486'), array('a', 'b', 'c'), null, null),
- 15502 => array(array('_route' => '_21'), array('a', 'b', 'c'), null, null),
- 15550 => array(array('_route' => '_247'), array('a', 'b', 'c'), null, null),
- 15598 => array(array('_route' => '_424'), array('a', 'b', 'c'), null, null),
- 15646 => array(array('_route' => '_499'), array('a', 'b', 'c'), null, null),
- 15699 => array(array('_route' => '_23'), array('a', 'b', 'c'), null, null),
- 15747 => array(array('_route' => '_152'), array('a', 'b', 'c'), null, null),
- 15795 => array(array('_route' => '_304'), array('a', 'b', 'c'), null, null),
- 15843 => array(array('_route' => '_352'), array('a', 'b', 'c'), null, null),
- 15896 => array(array('_route' => '_28'), array('a', 'b', 'c'), null, null),
- 15944 => array(array('_route' => '_240'), array('a', 'b', 'c'), null, null),
- 16000 => array(array('_route' => '_30'), array('a', 'b', 'c'), null, null),
- 16047 => array(array('_route' => '_41'), array('a', 'b', 'c'), null, null),
- 16096 => array(array('_route' => '_301'), array('a', 'b', 'c'), null, null),
- 16149 => array(array('_route' => '_66'), array('a', 'b', 'c'), null, null),
- 16197 => array(array('_route' => '_72'), array('a', 'b', 'c'), null, null),
- 16245 => array(array('_route' => '_320'), array('a', 'b', 'c'), null, null),
- 16298 => array(array('_route' => '_78'), array('a', 'b', 'c'), null, null),
- 16346 => array(array('_route' => '_337'), array('a', 'b', 'c'), null, null),
- 16394 => array(array('_route' => '_399'), array('a', 'b', 'c'), null, null),
- 16442 => array(array('_route' => '_495'), array('a', 'b', 'c'), null, null),
- 16492 => array(array('_route' => '_85'), array('a', 'b', 'c'), null, null),
- 16544 => array(array('_route' => '_101'), array('a', 'b', 'c'), null, null),
- 16592 => array(array('_route' => '_176'), array('a', 'b', 'c'), null, null),
- 16640 => array(array('_route' => '_246'), array('a', 'b', 'c'), null, null),
- 16693 => array(array('_route' => '_125'), array('a', 'b', 'c'), null, null),
- 16741 => array(array('_route' => '_341'), array('a', 'b', 'c'), null, null),
- 16794 => array(array('_route' => '_137'), array('a', 'b', 'c'), null, null),
- 16842 => array(array('_route' => '_270'), array('a', 'b', 'c'), null, null),
- 16890 => array(array('_route' => '_386'), array('a', 'b', 'c'), null, null),
- 16943 => array(array('_route' => '_169'), array('a', 'b', 'c'), null, null),
- 16991 => array(array('_route' => '_200'), array('a', 'b', 'c'), null, null),
- 17039 => array(array('_route' => '_262'), array('a', 'b', 'c'), null, null),
- 17092 => array(array('_route' => '_187'), array('a', 'b', 'c'), null, null),
- 17140 => array(array('_route' => '_333'), array('a', 'b', 'c'), null, null),
- 17190 => array(array('_route' => '_215'), array('a', 'b', 'c'), null, null),
- 17239 => array(array('_route' => '_316'), array('a', 'b', 'c'), null, null),
- 17288 => array(array('_route' => '_343'), array('a', 'b', 'c'), null, null),
- 17346 => array(array('_route' => '_22'), array('a', 'b', 'c'), null, null),
- 17394 => array(array('_route' => '_420'), array('a', 'b', 'c'), null, null),
- 17447 => array(array('_route' => '_55'), array('a', 'b', 'c'), null, null),
- 17494 => array(array('_route' => '_496'), array('a', 'b', 'c'), null, null),
- 17547 => array(array('_route' => '_153'), array('a', 'b', 'c'), null, null),
- 17595 => array(array('_route' => '_344'), array('a', 'b', 'c'), null, null),
- 17648 => array(array('_route' => '_160'), array('a', 'b', 'c'), null, null),
- 17696 => array(array('_route' => '_398'), array('a', 'b', 'c'), null, null),
- 17749 => array(array('_route' => '_161'), array('a', 'b', 'c'), null, null),
- 17797 => array(array('_route' => '_193'), array('a', 'b', 'c'), null, null),
- 17847 => array(array('_route' => '_174'), array('a', 'b', 'c'), null, null),
- 17899 => array(array('_route' => '_209'), array('a', 'b', 'c'), null, null),
- 17947 => array(array('_route' => '_261'), array('a', 'b', 'c'), null, null),
- 18000 => array(array('_route' => '_222'), array('a', 'b', 'c'), null, null),
- 18048 => array(array('_route' => '_323'), array('a', 'b', 'c'), null, null),
- 18096 => array(array('_route' => '_380'), array('a', 'b', 'c'), null, null),
- 18149 => array(array('_route' => '_232'), array('a', 'b', 'c'), null, null),
- 18197 => array(array('_route' => '_383'), array('a', 'b', 'c'), null, null),
- 18247 => array(array('_route' => '_306'), array('a', 'b', 'c'), null, null),
- 18296 => array(array('_route' => '_327'), array('a', 'b', 'c'), null, null),
- 18345 => array(array('_route' => '_364'), array('a', 'b', 'c'), null, null),
- 18397 => array(array('_route' => '_403'), array('a', 'b', 'c'), null, null),
- 18445 => array(array('_route' => '_405'), array('a', 'b', 'c'), null, null),
- 18495 => array(array('_route' => '_412'), array('a', 'b', 'c'), null, null),
- 18553 => array(array('_route' => '_27'), array('a', 'b', 'c'), null, null),
- 18601 => array(array('_route' => '_134'), array('a', 'b', 'c'), null, null),
- 18649 => array(array('_route' => '_245'), array('a', 'b', 'c'), null, null),
- 18702 => array(array('_route' => '_59'), array('a', 'b', 'c'), null, null),
- 18750 => array(array('_route' => '_208'), array('a', 'b', 'c'), null, null),
- 18803 => array(array('_route' => '_60'), array('a', 'b', 'c'), null, null),
- 18851 => array(array('_route' => '_119'), array('a', 'b', 'c'), null, null),
- 18902 => array(array('_route' => '_163'), array('a', 'b', 'c'), null, null),
- 18949 => array(array('_route' => '_249'), array('a', 'b', 'c'), null, null),
- 18998 => array(array('_route' => '_278'), array('a', 'b', 'c'), null, null),
- 19051 => array(array('_route' => '_63'), array('a', 'b', 'c'), null, null),
- 19099 => array(array('_route' => '_195'), array('a', 'b', 'c'), null, null),
- 19147 => array(array('_route' => '_252'), array('a', 'b', 'c'), null, null),
- 19195 => array(array('_route' => '_461'), array('a', 'b', 'c'), null, null),
- 19248 => array(array('_route' => '_126'), array('a', 'b', 'c'), null, null),
- 19296 => array(array('_route' => '_158'), array('a', 'b', 'c'), null, null),
- 19344 => array(array('_route' => '_221'), array('a', 'b', 'c'), null, null),
- 19392 => array(array('_route' => '_269'), array('a', 'b', 'c'), null, null),
- 19440 => array(array('_route' => '_310'), array('a', 'b', 'c'), null, null),
- 19496 => array(array('_route' => '_138'), array('a', 'b', 'c'), null, null),
- 19543 => array(array('_route' => '_348'), array('a', 'b', 'c'), null, null),
- 19592 => array(array('_route' => '_236'), array('a', 'b', 'c'), null, null),
- 19640 => array(array('_route' => '_433'), array('a', 'b', 'c'), null, null),
- 19693 => array(array('_route' => '_141'), array('a', 'b', 'c'), null, null),
- 19741 => array(array('_route' => '_283'), array('a', 'b', 'c'), null, null),
- 19794 => array(array('_route' => '_144'), array('a', 'b', 'c'), null, null),
- 19842 => array(array('_route' => '_191'), array('a', 'b', 'c'), null, null),
- 19895 => array(array('_route' => '_168'), array('a', 'b', 'c'), null, null),
- 19943 => array(array('_route' => '_363'), array('a', 'b', 'c'), null, null),
- 19991 => array(array('_route' => '_381'), array('a', 'b', 'c'), null, null),
- 20044 => array(array('_route' => '_180'), array('a', 'b', 'c'), null, null),
- 20092 => array(array('_route' => '_339'), array('a', 'b', 'c'), null, null),
- 20142 => array(array('_route' => '_196'), array('a', 'b', 'c'), null, null),
- 20194 => array(array('_route' => '_198'), array('a', 'b', 'c'), null, null),
- 20242 => array(array('_route' => '_285'), array('a', 'b', 'c'), null, null),
- 20292 => array(array('_route' => '_349'), array('a', 'b', 'c'), null, null),
- 20344 => array(array('_route' => '_367'), array('a', 'b', 'c'), null, null),
- 20392 => array(array('_route' => '_384'), array('a', 'b', 'c'), null, null),
- 20440 => array(array('_route' => '_498'), array('a', 'b', 'c'), null, null),
- 20490 => array(array('_route' => '_369'), array('a', 'b', 'c'), null, null),
- 20542 => array(array('_route' => '_408'), array('a', 'b', 'c'), null, null),
- 20590 => array(array('_route' => '_413'), array('a', 'b', 'c'), null, null),
- 20652 => array(array('_route' => '_44'), array('a', 'b', 'c'), null, null),
- 20699 => array(array('_route' => '_256'), array('a', 'b', 'c'), null, null),
- 20748 => array(array('_route' => '_173'), array('a', 'b', 'c'), null, null),
- 20796 => array(array('_route' => '_266'), array('a', 'b', 'c'), null, null),
- 20844 => array(array('_route' => '_392'), array('a', 'b', 'c'), null, null),
- 20892 => array(array('_route' => '_430'), array('a', 'b', 'c'), null, null),
- 20940 => array(array('_route' => '_482'), array('a', 'b', 'c'), null, null),
- 20993 => array(array('_route' => '_49'), array('a', 'b', 'c'), null, null),
- 21041 => array(array('_route' => '_94'), array('a', 'b', 'c'), null, null),
- 21089 => array(array('_route' => '_407'), array('a', 'b', 'c'), null, null),
- 21142 => array(array('_route' => '_65'), array('a', 'b', 'c'), null, null),
- 21190 => array(array('_route' => '_181'), array('a', 'b', 'c'), null, null),
- 21238 => array(array('_route' => '_437'), array('a', 'b', 'c'), null, null),
- 21291 => array(array('_route' => '_76'), array('a', 'b', 'c'), null, null),
- 21339 => array(array('_route' => '_357'), array('a', 'b', 'c'), null, null),
- 21392 => array(array('_route' => '_80'), array('a', 'b', 'c'), null, null),
- 21440 => array(array('_route' => '_106'), array('a', 'b', 'c'), null, null),
- 21493 => array(array('_route' => '_83'), array('a', 'b', 'c'), null, null),
- 21541 => array(array('_route' => '_255'), array('a', 'b', 'c'), null, null),
- 21589 => array(array('_route' => '_330'), array('a', 'b', 'c'), null, null),
- 21642 => array(array('_route' => '_100'), array('a', 'b', 'c'), null, null),
- 21690 => array(array('_route' => '_396'), array('a', 'b', 'c'), null, null),
- 21738 => array(array('_route' => '_422'), array('a', 'b', 'c'), null, null),
- 21791 => array(array('_route' => '_149'), array('a', 'b', 'c'), null, null),
- 21839 => array(array('_route' => '_324'), array('a', 'b', 'c'), null, null),
- 21892 => array(array('_route' => '_164'), array('a', 'b', 'c'), null, null),
- 21940 => array(array('_route' => '_423'), array('a', 'b', 'c'), null, null),
- 21990 => array(array('_route' => '_241'), array('a', 'b', 'c'), null, null),
- 22042 => array(array('_route' => '_290'), array('a', 'b', 'c'), null, null),
- 22090 => array(array('_route' => '_335'), array('a', 'b', 'c'), null, null),
- 22140 => array(array('_route' => '_373'), array('a', 'b', 'c'), null, null),
- 22189 => array(array('_route' => '_375'), array('a', 'b', 'c'), null, null),
- 22238 => array(array('_route' => '_450'), array('a', 'b', 'c'), null, null),
- 22287 => array(array('_route' => '_464'), array('a', 'b', 'c'), null, null),
- 22345 => array(array('_route' => '_51'), array('a', 'b', 'c'), null, null),
- 22393 => array(array('_route' => '_77'), array('a', 'b', 'c'), null, null),
- 22441 => array(array('_route' => '_234'), array('a', 'b', 'c'), null, null),
- 22489 => array(array('_route' => '_394'), array('a', 'b', 'c'), null, null),
- 22542 => array(array('_route' => '_88'), array('a', 'b', 'c'), null, null),
- 22590 => array(array('_route' => '_155'), array('a', 'b', 'c'), null, null),
- 22643 => array(array('_route' => '_96'), array('a', 'b', 'c'), null, null),
- 22691 => array(array('_route' => '_298'), array('a', 'b', 'c'), null, null),
- 22739 => array(array('_route' => '_470'), array('a', 'b', 'c'), null, null),
- 22792 => array(array('_route' => '_109'), array('a', 'b', 'c'), null, null),
- 22840 => array(array('_route' => '_204'), array('a', 'b', 'c'), null, null),
- 22893 => array(array('_route' => '_115'), array('a', 'b', 'c'), null, null),
- 22941 => array(array('_route' => '_145'), array('a', 'b', 'c'), null, null),
- 22994 => array(array('_route' => '_123'), array('a', 'b', 'c'), null, null),
- 23042 => array(array('_route' => '_277'), array('a', 'b', 'c'), null, null),
- 23090 => array(array('_route' => '_473'), array('a', 'b', 'c'), null, null),
- 23143 => array(array('_route' => '_334'), array('a', 'b', 'c'), null, null),
- 23191 => array(array('_route' => '_493'), array('a', 'b', 'c'), null, null),
- 23244 => array(array('_route' => '_372'), array('a', 'b', 'c'), null, null),
- 23292 => array(array('_route' => '_432'), array('a', 'b', 'c'), null, null),
- 23340 => array(array('_route' => '_436'), array('a', 'b', 'c'), null, null),
- 23393 => array(array('_route' => '_425'), array('a', 'b', 'c'), null, null),
- 23441 => array(array('_route' => '_456'), array('a', 'b', 'c'), null, null),
- 23489 => array(array('_route' => '_474'), array('a', 'b', 'c'), null, null),
- 23539 => array(array('_route' => '_485'), array('a', 'b', 'c'), null, null),
- 23594 => array(array('_route' => '_91'), array('a', 'b', 'c'), null, null),
- 23646 => array(array('_route' => '_110'), array('a', 'b', 'c'), null, null),
- 23694 => array(array('_route' => '_114'), array('a', 'b', 'c'), null, null),
- 23750 => array(array('_route' => '_118'), array('a', 'b', 'c'), null, null),
- 23796 => array(array('_route' => '_475'), array('a', 'b', 'c'), null, null),
- 23844 => array(array('_route' => '_366'), array('a', 'b', 'c'), null, null),
- 23897 => array(array('_route' => '_167'), array('a', 'b', 'c'), null, null),
- 23945 => array(array('_route' => '_192'), array('a', 'b', 'c'), null, null),
- 23993 => array(array('_route' => '_342'), array('a', 'b', 'c'), null, null),
- 24046 => array(array('_route' => '_229'), array('a', 'b', 'c'), null, null),
- 24097 => array(array('_route' => '_235'), array('a', 'b', 'c'), null, null),
- 24144 => array(array('_route' => '_302'), array('a', 'b', 'c'), null, null),
- 24193 => array(array('_route' => '_322'), array('a', 'b', 'c'), null, null),
- 24246 => array(array('_route' => '_237'), array('a', 'b', 'c'), null, null),
- 24294 => array(array('_route' => '_293'), array('a', 'b', 'c'), null, null),
- 24347 => array(array('_route' => '_239'), array('a', 'b', 'c'), null, null),
- 24395 => array(array('_route' => '_444'), array('a', 'b', 'c'), null, null),
- 24443 => array(array('_route' => '_491'), array('a', 'b', 'c'), null, null),
- 24491 => array(array('_route' => '_492'), array('a', 'b', 'c'), null, null),
- 24541 => array(array('_route' => '_258'), array('a', 'b', 'c'), null, null),
- 24590 => array(array('_route' => '_317'), array('a', 'b', 'c'), null, null),
- 24639 => array(array('_route' => '_361'), array('a', 'b', 'c'), null, null),
- 24688 => array(array('_route' => '_391'), array('a', 'b', 'c'), null, null),
- 24737 => array(array('_route' => '_462'), array('a', 'b', 'c'), null, null),
- 24786 => array(array('_route' => '_476'), array('a', 'b', 'c'), null, null),
- 24837 => array(array('_route' => '_501'), array('a', 'b', 'c'), null, null),
- 24889 => array(array('_route' => '_514'), array('a', 'b', 'c'), null, null),
- 24937 => array(array('_route' => '_731'), array('a', 'b', 'c'), null, null),
- 24990 => array(array('_route' => '_522'), array('a', 'b', 'c'), null, null),
- 25038 => array(array('_route' => '_693'), array('a', 'b', 'c'), null, null),
- 25091 => array(array('_route' => '_537'), array('a', 'b', 'c'), null, null),
- 25139 => array(array('_route' => '_554'), array('a', 'b', 'c'), null, null),
- 25187 => array(array('_route' => '_645'), array('a', 'b', 'c'), null, null),
- 25235 => array(array('_route' => '_862'), array('a', 'b', 'c'), null, null),
- 25288 => array(array('_route' => '_539'), array('a', 'b', 'c'), null, null),
- 25336 => array(array('_route' => '_729'), array('a', 'b', 'c'), null, null),
- 25384 => array(array('_route' => '_897'), array('a', 'b', 'c'), null, null),
- 25437 => array(array('_route' => '_561'), array('a', 'b', 'c'), null, null),
- 25485 => array(array('_route' => '_615'), array('a', 'b', 'c'), null, null),
- 25533 => array(array('_route' => '_764'), array('a', 'b', 'c'), null, null),
- 25581 => array(array('_route' => '_948'), array('a', 'b', 'c'), null, null),
- 25634 => array(array('_route' => '_617'), array('a', 'b', 'c'), null, null),
- 25682 => array(array('_route' => '_671'), array('a', 'b', 'c'), null, null),
- 25735 => array(array('_route' => '_649'), array('a', 'b', 'c'), null, null),
- 25783 => array(array('_route' => '_651'), array('a', 'b', 'c'), null, null),
- 25831 => array(array('_route' => '_684'), array('a', 'b', 'c'), null, null),
- 25884 => array(array('_route' => '_669'), array('a', 'b', 'c'), null, null),
- 25932 => array(array('_route' => '_743'), array('a', 'b', 'c'), null, null),
- 25980 => array(array('_route' => '_962'), array('a', 'b', 'c'), null, null),
- 26033 => array(array('_route' => '_694'), array('a', 'b', 'c'), null, null),
- 26081 => array(array('_route' => '_985'), array('a', 'b', 'c'), null, null),
- 26134 => array(array('_route' => '_707'), array('a', 'b', 'c'), null, null),
- 26182 => array(array('_route' => '_718'), array('a', 'b', 'c'), null, null),
- 26235 => array(array('_route' => '_720'), array('a', 'b', 'c'), null, null),
- 26283 => array(array('_route' => '_745'), array('a', 'b', 'c'), null, null),
- 26333 => array(array('_route' => '_874'), array('a', 'b', 'c'), null, null),
- 26391 => array(array('_route' => '_502'), array('a', 'b', 'c'), null, null),
- 26439 => array(array('_route' => '_667'), array('a', 'b', 'c'), null, null),
- 26487 => array(array('_route' => '_911'), array('a', 'b', 'c'), null, null),
- 26535 => array(array('_route' => '_942'), array('a', 'b', 'c'), null, null),
- 26585 => array(array('_route' => '_504'), array('a', 'b', 'c'), null, null),
- 26637 => array(array('_route' => '_524'), array('a', 'b', 'c'), null, null),
- 26685 => array(array('_route' => '_732'), array('a', 'b', 'c'), null, null),
- 26738 => array(array('_route' => '_596'), array('a', 'b', 'c'), null, null),
- 26786 => array(array('_route' => '_601'), array('a', 'b', 'c'), null, null),
- 26839 => array(array('_route' => '_620'), array('a', 'b', 'c'), null, null),
- 26887 => array(array('_route' => '_631'), array('a', 'b', 'c'), null, null),
- 26935 => array(array('_route' => '_771'), array('a', 'b', 'c'), null, null),
- 26983 => array(array('_route' => '_937'), array('a', 'b', 'c'), null, null),
- 27031 => array(array('_route' => '_999'), array('a', 'b', 'c'), null, null),
- 27084 => array(array('_route' => '_657'), array('a', 'b', 'c'), null, null),
- 27132 => array(array('_route' => '_701'), array('a', 'b', 'c'), null, null),
- 27185 => array(array('_route' => '_662'), array('a', 'b', 'c'), null, null),
- 27233 => array(array('_route' => '_797'), array('a', 'b', 'c'), null, null),
- 27281 => array(array('_route' => '_924'), array('a', 'b', 'c'), null, null),
- 27334 => array(array('_route' => '_702'), array('a', 'b', 'c'), null, null),
- 27382 => array(array('_route' => '_750'), array('a', 'b', 'c'), null, null),
- 27435 => array(array('_route' => '_749'), array('a', 'b', 'c'), null, null),
- 27483 => array(array('_route' => '_837'), array('a', 'b', 'c'), null, null),
- 27533 => array(array('_route' => '_758'), array('a', 'b', 'c'), null, null),
- 27585 => array(array('_route' => '_810'), array('a', 'b', 'c'), null, null),
- 27633 => array(array('_route' => '_902'), array('a', 'b', 'c'), null, null),
- 27683 => array(array('_route' => '_845'), array('a', 'b', 'c'), null, null),
- 27741 => array(array('_route' => '_503'), array('a', 'b', 'c'), null, null),
- 27792 => array(array('_route' => '_756'), array('a', 'b', 'c'), null, null),
- 27839 => array(array('_route' => '_799'), array('a', 'b', 'c'), null, null),
- 27888 => array(array('_route' => '_769'), array('a', 'b', 'c'), null, null),
- 27936 => array(array('_route' => '_981'), array('a', 'b', 'c'), null, null),
- 27989 => array(array('_route' => '_507'), array('a', 'b', 'c'), null, null),
- 28037 => array(array('_route' => '_672'), array('a', 'b', 'c'), null, null),
- 28085 => array(array('_route' => '_790'), array('a', 'b', 'c'), null, null),
- 28138 => array(array('_route' => '_515'), array('a', 'b', 'c'), null, null),
- 28186 => array(array('_route' => '_523'), array('a', 'b', 'c'), null, null),
- 28234 => array(array('_route' => '_957'), array('a', 'b', 'c'), null, null),
- 28282 => array(array('_route' => '_995'), array('a', 'b', 'c'), null, null),
- 28335 => array(array('_route' => '_532'), array('a', 'b', 'c'), null, null),
- 28383 => array(array('_route' => '_642'), array('a', 'b', 'c'), null, null),
- 28433 => array(array('_route' => '_579'), array('a', 'b', 'c'), null, null),
- 28485 => array(array('_route' => '_625'), array('a', 'b', 'c'), null, null),
- 28533 => array(array('_route' => '_916'), array('a', 'b', 'c'), null, null),
- 28586 => array(array('_route' => '_633'), array('a', 'b', 'c'), null, null),
- 28634 => array(array('_route' => '_656'), array('a', 'b', 'c'), null, null),
- 28687 => array(array('_route' => '_658'), array('a', 'b', 'c'), null, null),
- 28735 => array(array('_route' => '_943'), array('a', 'b', 'c'), null, null),
- 28788 => array(array('_route' => '_664'), array('a', 'b', 'c'), null, null),
- 28836 => array(array('_route' => '_852'), array('a', 'b', 'c'), null, null),
- 28884 => array(array('_route' => '_870'), array('a', 'b', 'c'), null, null),
- 28937 => array(array('_route' => '_683'), array('a', 'b', 'c'), null, null),
- 28985 => array(array('_route' => '_915'), array('a', 'b', 'c'), null, null),
- 29038 => array(array('_route' => '_719'), array('a', 'b', 'c'), null, null),
- 29086 => array(array('_route' => '_859'), array('a', 'b', 'c'), null, null),
- 29134 => array(array('_route' => '_912'), array('a', 'b', 'c'), null, null),
- 29182 => array(array('_route' => '_978'), array('a', 'b', 'c'), null, null),
- 29235 => array(array('_route' => '_738'), array('a', 'b', 'c'), null, null),
- 29283 => array(array('_route' => '_883'), array('a', 'b', 'c'), null, null),
- 29333 => array(array('_route' => '_741'), array('a', 'b', 'c'), null, null),
- 29382 => array(array('_route' => '_760'), array('a', 'b', 'c'), null, null),
- 29431 => array(array('_route' => '_895'), array('a', 'b', 'c'), null, null),
- 29489 => array(array('_route' => '_505'), array('a', 'b', 'c'), null, null),
- 29537 => array(array('_route' => '_935'), array('a', 'b', 'c'), null, null),
- 29590 => array(array('_route' => '_509'), array('a', 'b', 'c'), null, null),
- 29638 => array(array('_route' => '_820'), array('a', 'b', 'c'), null, null),
- 29686 => array(array('_route' => '_910'), array('a', 'b', 'c'), null, null),
- 29739 => array(array('_route' => '_518'), array('a', 'b', 'c'), null, null),
- 29787 => array(array('_route' => '_618'), array('a', 'b', 'c'), null, null),
- 29840 => array(array('_route' => '_546'), array('a', 'b', 'c'), null, null),
- 29888 => array(array('_route' => '_740'), array('a', 'b', 'c'), null, null),
- 29936 => array(array('_route' => '_867'), array('a', 'b', 'c'), null, null),
- 29989 => array(array('_route' => '_572'), array('a', 'b', 'c'), null, null),
- 30037 => array(array('_route' => '_952'), array('a', 'b', 'c'), null, null),
- 30090 => array(array('_route' => '_573'), array('a', 'b', 'c'), null, null),
- 30138 => array(array('_route' => '_692'), array('a', 'b', 'c'), null, null),
- 30186 => array(array('_route' => '_700'), array('a', 'b', 'c'), null, null),
- 30234 => array(array('_route' => '_772'), array('a', 'b', 'c'), null, null),
- 30284 => array(array('_route' => '_653'), array('a', 'b', 'c'), null, null),
- 30336 => array(array('_route' => '_695'), array('a', 'b', 'c'), null, null),
- 30384 => array(array('_route' => '_748'), array('a', 'b', 'c'), null, null),
- 30437 => array(array('_route' => '_710'), array('a', 'b', 'c'), null, null),
- 30485 => array(array('_route' => '_716'), array('a', 'b', 'c'), null, null),
- 30533 => array(array('_route' => '_969'), array('a', 'b', 'c'), null, null),
- 30586 => array(array('_route' => '_734'), array('a', 'b', 'c'), null, null),
- 30634 => array(array('_route' => '_742'), array('a', 'b', 'c'), null, null),
- 30682 => array(array('_route' => '_844'), array('a', 'b', 'c'), null, null),
- 30735 => array(array('_route' => '_763'), array('a', 'b', 'c'), null, null),
- 30783 => array(array('_route' => '_965'), array('a', 'b', 'c'), null, null),
- 30836 => array(array('_route' => '_778'), array('a', 'b', 'c'), null, null),
- 30884 => array(array('_route' => '_813'), array('a', 'b', 'c'), null, null),
- 30932 => array(array('_route' => '_831'), array('a', 'b', 'c'), null, null),
- 30982 => array(array('_route' => '_955'), array('a', 'b', 'c'), null, null),
- 31031 => array(array('_route' => '_997'), array('a', 'b', 'c'), null, null),
- 31089 => array(array('_route' => '_506'), array('a', 'b', 'c'), null, null),
- 31137 => array(array('_route' => '_575'), array('a', 'b', 'c'), null, null),
- 31190 => array(array('_route' => '_516'), array('a', 'b', 'c'), null, null),
- 31238 => array(array('_route' => '_553'), array('a', 'b', 'c'), null, null),
- 31291 => array(array('_route' => '_528'), array('a', 'b', 'c'), null, null),
- 31339 => array(array('_route' => '_847'), array('a', 'b', 'c'), null, null),
- 31387 => array(array('_route' => '_904'), array('a', 'b', 'c'), null, null),
- 31440 => array(array('_route' => '_574'), array('a', 'b', 'c'), null, null),
- 31488 => array(array('_route' => '_818'), array('a', 'b', 'c'), null, null),
- 31538 => array(array('_route' => '_577'), array('a', 'b', 'c'), null, null),
- 31590 => array(array('_route' => '_584'), array('a', 'b', 'c'), null, null),
- 31638 => array(array('_route' => '_905'), array('a', 'b', 'c'), null, null),
- 31691 => array(array('_route' => '_612'), array('a', 'b', 'c'), null, null),
- 31739 => array(array('_route' => '_688'), array('a', 'b', 'c'), null, null),
- 31787 => array(array('_route' => '_854'), array('a', 'b', 'c'), null, null),
- 31840 => array(array('_route' => '_613'), array('a', 'b', 'c'), null, null),
- 31888 => array(array('_route' => '_767'), array('a', 'b', 'c'), null, null),
- 31941 => array(array('_route' => '_666'), array('a', 'b', 'c'), null, null),
- 31989 => array(array('_route' => '_759'), array('a', 'b', 'c'), null, null),
- 32037 => array(array('_route' => '_827'), array('a', 'b', 'c'), null, null),
- 32085 => array(array('_route' => '_840'), array('a', 'b', 'c'), null, null),
- 32138 => array(array('_route' => '_680'), array('a', 'b', 'c'), null, null),
- 32186 => array(array('_route' => '_784'), array('a', 'b', 'c'), null, null),
- 32234 => array(array('_route' => '_842'), array('a', 'b', 'c'), null, null),
- 32282 => array(array('_route' => '_860'), array('a', 'b', 'c'), null, null),
- 32332 => array(array('_route' => '_704'), array('a', 'b', 'c'), null, null),
- 32381 => array(array('_route' => '_727'), array('a', 'b', 'c'), null, null),
- 32430 => array(array('_route' => '_777'), array('a', 'b', 'c'), null, null),
- 32482 => array(array('_route' => '_838'), array('a', 'b', 'c'), null, null),
- 32530 => array(array('_route' => '_861'), array('a', 'b', 'c'), null, null),
- 32583 => array(array('_route' => '_849'), array('a', 'b', 'c'), null, null),
- 32631 => array(array('_route' => '_982'), array('a', 'b', 'c'), null, null),
- 32679 => array(array('_route' => '_986'), array('a', 'b', 'c'), null, null),
- 32741 => array(array('_route' => '_508'), array('a', 'b', 'c'), null, null),
- 32788 => array(array('_route' => '_517'), array('a', 'b', 'c'), null, null),
- 32837 => array(array('_route' => '_622'), array('a', 'b', 'c'), null, null),
- 32890 => array(array('_route' => '_513'), array('a', 'b', 'c'), null, null),
- 32938 => array(array('_route' => '_655'), array('a', 'b', 'c'), null, null),
- 32986 => array(array('_route' => '_843'), array('a', 'b', 'c'), null, null),
- 33034 => array(array('_route' => '_939'), array('a', 'b', 'c'), null, null),
- 33084 => array(array('_route' => '_529'), array('a', 'b', 'c'), null, null),
- 33136 => array(array('_route' => '_535'), array('a', 'b', 'c'), null, null),
- 33184 => array(array('_route' => '_685'), array('a', 'b', 'c'), null, null),
- 33240 => array(array('_route' => '_559'), array('a', 'b', 'c'), null, null),
- 33287 => array(array('_route' => '_661'), array('a', 'b', 'c'), null, null),
- 33336 => array(array('_route' => '_768'), array('a', 'b', 'c'), null, null),
- 33389 => array(array('_route' => '_589'), array('a', 'b', 'c'), null, null),
- 33437 => array(array('_route' => '_647'), array('a', 'b', 'c'), null, null),
- 33485 => array(array('_route' => '_652'), array('a', 'b', 'c'), null, null),
- 33533 => array(array('_route' => '_834'), array('a', 'b', 'c'), null, null),
- 33586 => array(array('_route' => '_591'), array('a', 'b', 'c'), null, null),
- 33634 => array(array('_route' => '_599'), array('a', 'b', 'c'), null, null),
- 33687 => array(array('_route' => '_787'), array('a', 'b', 'c'), null, null),
- 33734 => array(array('_route' => '_848'), array('a', 'b', 'c'), null, null),
- 33787 => array(array('_route' => '_796'), array('a', 'b', 'c'), null, null),
- 33835 => array(array('_route' => '_877'), array('a', 'b', 'c'), null, null),
- 33885 => array(array('_route' => '_809'), array('a', 'b', 'c'), null, null),
- 33934 => array(array('_route' => '_817'), array('a', 'b', 'c'), null, null),
- 33986 => array(array('_route' => '_819'), array('a', 'b', 'c'), null, null),
- 34034 => array(array('_route' => '_865'), array('a', 'b', 'c'), null, null),
- 34084 => array(array('_route' => '_919'), array('a', 'b', 'c'), null, null),
- 34133 => array(array('_route' => '_949'), array('a', 'b', 'c'), null, null),
- 34191 => array(array('_route' => '_510'), array('a', 'b', 'c'), null, null),
- 34239 => array(array('_route' => '_590'), array('a', 'b', 'c'), null, null),
- 34287 => array(array('_route' => '_597'), array('a', 'b', 'c'), null, null),
- 34335 => array(array('_route' => '_682'), array('a', 'b', 'c'), null, null),
- 34383 => array(array('_route' => '_723'), array('a', 'b', 'c'), null, null),
- 34436 => array(array('_route' => '_521'), array('a', 'b', 'c'), null, null),
- 34484 => array(array('_route' => '_594'), array('a', 'b', 'c'), null, null),
- 34532 => array(array('_route' => '_689'), array('a', 'b', 'c'), null, null),
- 34580 => array(array('_route' => '_713'), array('a', 'b', 'c'), null, null),
- 34628 => array(array('_route' => '_889'), array('a', 'b', 'c'), null, null),
- 34681 => array(array('_route' => '_531'), array('a', 'b', 'c'), null, null),
- 34729 => array(array('_route' => '_639'), array('a', 'b', 'c'), null, null),
- 34780 => array(array('_route' => '_646'), array('a', 'b', 'c'), null, null),
- 34827 => array(array('_route' => '_659'), array('a', 'b', 'c'), null, null),
- 34876 => array(array('_route' => '_959'), array('a', 'b', 'c'), null, null),
- 34929 => array(array('_route' => '_550'), array('a', 'b', 'c'), null, null),
- 34977 => array(array('_route' => '_833'), array('a', 'b', 'c'), null, null),
- 35025 => array(array('_route' => '_899'), array('a', 'b', 'c'), null, null),
- 35081 => array(array('_route' => '_580'), array('a', 'b', 'c'), null, null),
- 35128 => array(array('_route' => '_762'), array('a', 'b', 'c'), null, null),
- 35177 => array(array('_route' => '_896'), array('a', 'b', 'c'), null, null),
- 35230 => array(array('_route' => '_595'), array('a', 'b', 'c'), null, null),
- 35278 => array(array('_route' => '_933'), array('a', 'b', 'c'), null, null),
- 35328 => array(array('_route' => '_610'), array('a', 'b', 'c'), null, null),
- 35380 => array(array('_route' => '_629'), array('a', 'b', 'c'), null, null),
- 35428 => array(array('_route' => '_744'), array('a', 'b', 'c'), null, null),
- 35481 => array(array('_route' => '_674'), array('a', 'b', 'c'), null, null),
- 35529 => array(array('_route' => '_726'), array('a', 'b', 'c'), null, null),
- 35577 => array(array('_route' => '_929'), array('a', 'b', 'c'), null, null),
- 35627 => array(array('_route' => '_696'), array('a', 'b', 'c'), null, null),
- 35679 => array(array('_route' => '_841'), array('a', 'b', 'c'), null, null),
- 35727 => array(array('_route' => '_890'), array('a', 'b', 'c'), null, null),
- 35777 => array(array('_route' => '_885'), array('a', 'b', 'c'), null, null),
- 35826 => array(array('_route' => '_888'), array('a', 'b', 'c'), null, null),
- 35875 => array(array('_route' => '_996'), array('a', 'b', 'c'), null, null),
- 35933 => array(array('_route' => '_511'), array('a', 'b', 'c'), null, null),
- 35981 => array(array('_route' => '_576'), array('a', 'b', 'c'), null, null),
- 36029 => array(array('_route' => '_623'), array('a', 'b', 'c'), null, null),
- 36082 => array(array('_route' => '_560'), array('a', 'b', 'c'), null, null),
- 36129 => array(array('_route' => '_585'), array('a', 'b', 'c'), null, null),
- 36182 => array(array('_route' => '_570'), array('a', 'b', 'c'), null, null),
- 36230 => array(array('_route' => '_578'), array('a', 'b', 'c'), null, null),
- 36281 => array(array('_route' => '_780'), array('a', 'b', 'c'), null, null),
- 36328 => array(array('_route' => '_808'), array('a', 'b', 'c'), null, null),
- 36382 => array(array('_route' => '_593'), array('a', 'b', 'c'), null, null),
- 36430 => array(array('_route' => '_900'), array('a', 'b', 'c'), null, null),
- 36483 => array(array('_route' => '_632'), array('a', 'b', 'c'), null, null),
- 36531 => array(array('_route' => '_654'), array('a', 'b', 'c'), null, null),
- 36579 => array(array('_route' => '_721'), array('a', 'b', 'c'), null, null),
- 36627 => array(array('_route' => '_836'), array('a', 'b', 'c'), null, null),
- 36680 => array(array('_route' => '_637'), array('a', 'b', 'c'), null, null),
- 36728 => array(array('_route' => '_737'), array('a', 'b', 'c'), null, null),
- 36784 => array(array('_route' => '_699'), array('a', 'b', 'c'), null, null),
- 36831 => array(array('_route' => '_822'), array('a', 'b', 'c'), null, null),
- 36880 => array(array('_route' => '_853'), array('a', 'b', 'c'), null, null),
- 36933 => array(array('_route' => '_708'), array('a', 'b', 'c'), null, null),
- 36981 => array(array('_route' => '_871'), array('a', 'b', 'c'), null, null),
- 37034 => array(array('_route' => '_752'), array('a', 'b', 'c'), null, null),
- 37082 => array(array('_route' => '_989'), array('a', 'b', 'c'), null, null),
- 37132 => array(array('_route' => '_855'), array('a', 'b', 'c'), null, null),
- 37184 => array(array('_route' => '_858'), array('a', 'b', 'c'), null, null),
- 37232 => array(array('_route' => '_898'), array('a', 'b', 'c'), null, null),
- 37282 => array(array('_route' => '_903'), array('a', 'b', 'c'), null, null),
- 37331 => array(array('_route' => '_909'), array('a', 'b', 'c'), null, null),
- 37380 => array(array('_route' => '_950'), array('a', 'b', 'c'), null, null),
- 37441 => array(array('_route' => '_512'), array('a', 'b', 'c'), null, null),
- 37488 => array(array('_route' => '_691'), array('a', 'b', 'c'), null, null),
- 37537 => array(array('_route' => '_686'), array('a', 'b', 'c'), null, null),
- 37587 => array(array('_route' => '_527'), array('a', 'b', 'c'), null, null),
- 37639 => array(array('_route' => '_541'), array('a', 'b', 'c'), null, null),
- 37687 => array(array('_route' => '_956'), array('a', 'b', 'c'), null, null),
- 37740 => array(array('_route' => '_555'), array('a', 'b', 'c'), null, null),
- 37788 => array(array('_route' => '_681'), array('a', 'b', 'c'), null, null),
- 37841 => array(array('_route' => '_556'), array('a', 'b', 'c'), null, null),
- 37889 => array(array('_route' => '_802'), array('a', 'b', 'c'), null, null),
- 37939 => array(array('_route' => '_558'), array('a', 'b', 'c'), null, null),
- 37991 => array(array('_route' => '_564'), array('a', 'b', 'c'), null, null),
- 38039 => array(array('_route' => '_670'), array('a', 'b', 'c'), null, null),
- 38087 => array(array('_route' => '_884'), array('a', 'b', 'c'), null, null),
- 38140 => array(array('_route' => '_627'), array('a', 'b', 'c'), null, null),
- 38187 => array(array('_route' => '_746'), array('a', 'b', 'c'), null, null),
- 38240 => array(array('_route' => '_668'), array('a', 'b', 'c'), null, null),
- 38291 => array(array('_route' => '_712'), array('a', 'b', 'c'), null, null),
- 38338 => array(array('_route' => '_863'), array('a', 'b', 'c'), null, null),
- 38387 => array(array('_route' => '_801'), array('a', 'b', 'c'), null, null),
- 38440 => array(array('_route' => '_709'), array('a', 'b', 'c'), null, null),
- 38488 => array(array('_route' => '_850'), array('a', 'b', 'c'), null, null),
- 38536 => array(array('_route' => '_918'), array('a', 'b', 'c'), null, null),
- 38586 => array(array('_route' => '_803'), array('a', 'b', 'c'), null, null),
- 38638 => array(array('_route' => '_864'), array('a', 'b', 'c'), null, null),
- 38686 => array(array('_route' => '_880'), array('a', 'b', 'c'), null, null),
- 38734 => array(array('_route' => '_927'), array('a', 'b', 'c'), null, null),
- 38787 => array(array('_route' => '_930'), array('a', 'b', 'c'), null, null),
- 38835 => array(array('_route' => '_951'), array('a', 'b', 'c'), null, null),
- 38883 => array(array('_route' => '_963'), array('a', 'b', 'c'), null, null),
- 38942 => array(array('_route' => '_519'), array('a', 'b', 'c'), null, null),
- 38990 => array(array('_route' => '_823'), array('a', 'b', 'c'), null, null),
- 39038 => array(array('_route' => '_954'), array('a', 'b', 'c'), null, null),
- 39091 => array(array('_route' => '_525'), array('a', 'b', 'c'), null, null),
- 39139 => array(array('_route' => '_991'), array('a', 'b', 'c'), null, null),
- 39189 => array(array('_route' => '_536'), array('a', 'b', 'c'), null, null),
- 39241 => array(array('_route' => '_545'), array('a', 'b', 'c'), null, null),
- 39289 => array(array('_route' => '_944'), array('a', 'b', 'c'), null, null),
- 39342 => array(array('_route' => '_557'), array('a', 'b', 'c'), null, null),
- 39390 => array(array('_route' => '_783'), array('a', 'b', 'c'), null, null),
- 39438 => array(array('_route' => '_807'), array('a', 'b', 'c'), null, null),
- 39491 => array(array('_route' => '_586'), array('a', 'b', 'c'), null, null),
- 39539 => array(array('_route' => '_711'), array('a', 'b', 'c'), null, null),
- 39592 => array(array('_route' => '_598'), array('a', 'b', 'c'), null, null),
- 39640 => array(array('_route' => '_635'), array('a', 'b', 'c'), null, null),
- 39688 => array(array('_route' => '_983'), array('a', 'b', 'c'), null, null),
- 39741 => array(array('_route' => '_634'), array('a', 'b', 'c'), null, null),
- 39789 => array(array('_route' => '_641'), array('a', 'b', 'c'), null, null),
- 39840 => array(array('_route' => '_779'), array('a', 'b', 'c'), null, null),
- 39887 => array(array('_route' => '_876'), array('a', 'b', 'c'), null, null),
- 39936 => array(array('_route' => '_811'), array('a', 'b', 'c'), null, null),
- 39984 => array(array('_route' => '_824'), array('a', 'b', 'c'), null, null),
- 40037 => array(array('_route' => '_660'), array('a', 'b', 'c'), null, null),
- 40085 => array(array('_route' => '_789'), array('a', 'b', 'c'), null, null),
- 40138 => array(array('_route' => '_733'), array('a', 'b', 'c'), null, null),
- 40186 => array(array('_route' => '_735'), array('a', 'b', 'c'), null, null),
- 40234 => array(array('_route' => '_882'), array('a', 'b', 'c'), null, null),
- 40282 => array(array('_route' => '_967'), array('a', 'b', 'c'), null, null),
- 40332 => array(array('_route' => '_736'), array('a', 'b', 'c'), null, null),
- 40381 => array(array('_route' => '_753'), array('a', 'b', 'c'), null, null),
- 40430 => array(array('_route' => '_786'), array('a', 'b', 'c'), null, null),
- 40479 => array(array('_route' => '_907'), array('a', 'b', 'c'), null, null),
- 40528 => array(array('_route' => '_920'), array('a', 'b', 'c'), null, null),
- 40577 => array(array('_route' => '_971'), array('a', 'b', 'c'), null, null),
- 40635 => array(array('_route' => '_520'), array('a', 'b', 'c'), null, null),
- 40683 => array(array('_route' => '_891'), array('a', 'b', 'c'), null, null),
- 40739 => array(array('_route' => '_534'), array('a', 'b', 'c'), null, null),
- 40785 => array(array('_route' => '_602'), array('a', 'b', 'c'), null, null),
- 40834 => array(array('_route' => '_605'), array('a', 'b', 'c'), null, null),
- 40882 => array(array('_route' => '_979'), array('a', 'b', 'c'), null, null),
- 40932 => array(array('_route' => '_547'), array('a', 'b', 'c'), null, null),
- 40987 => array(array('_route' => '_549'), array('a', 'b', 'c'), null, null),
- 41034 => array(array('_route' => '_755'), array('a', 'b', 'c'), null, null),
- 41083 => array(array('_route' => '_922'), array('a', 'b', 'c'), null, null),
- 41131 => array(array('_route' => '_977'), array('a', 'b', 'c'), null, null),
- 41184 => array(array('_route' => '_565'), array('a', 'b', 'c'), null, null),
- 41232 => array(array('_route' => '_926'), array('a', 'b', 'c'), null, null),
- 41282 => array(array('_route' => '_571'), array('a', 'b', 'c'), null, null),
- 41331 => array(array('_route' => '_581'), array('a', 'b', 'c'), null, null),
- 41380 => array(array('_route' => '_619'), array('a', 'b', 'c'), null, null),
- 41429 => array(array('_route' => '_636'), array('a', 'b', 'c'), null, null),
- 41481 => array(array('_route' => '_679'), array('a', 'b', 'c'), null, null),
- 41529 => array(array('_route' => '_866'), array('a', 'b', 'c'), null, null),
- 41577 => array(array('_route' => '_973'), array('a', 'b', 'c'), null, null),
- 41630 => array(array('_route' => '_690'), array('a', 'b', 'c'), null, null),
- 41678 => array(array('_route' => '_775'), array('a', 'b', 'c'), null, null),
- 41731 => array(array('_route' => '_722'), array('a', 'b', 'c'), null, null),
- 41779 => array(array('_route' => '_906'), array('a', 'b', 'c'), null, null),
- 41827 => array(array('_route' => '_946'), array('a', 'b', 'c'), null, null),
- 41877 => array(array('_route' => '_788'), array('a', 'b', 'c'), null, null),
- 41929 => array(array('_route' => '_828'), array('a', 'b', 'c'), null, null),
- 41977 => array(array('_route' => '_892'), array('a', 'b', 'c'), null, null),
- 42025 => array(array('_route' => '_972'), array('a', 'b', 'c'), null, null),
- 42075 => array(array('_route' => '_829'), array('a', 'b', 'c'), null, null),
- 42127 => array(array('_route' => '_923'), array('a', 'b', 'c'), null, null),
- 42175 => array(array('_route' => '_947'), array('a', 'b', 'c'), null, null),
- 42234 => array(array('_route' => '_526'), array('a', 'b', 'c'), null, null),
- 42282 => array(array('_route' => '_614'), array('a', 'b', 'c'), null, null),
- 42330 => array(array('_route' => '_621'), array('a', 'b', 'c'), null, null),
- 42383 => array(array('_route' => '_543'), array('a', 'b', 'c'), null, null),
- 42431 => array(array('_route' => '_812'), array('a', 'b', 'c'), null, null),
- 42487 => array(array('_route' => '_548'), array('a', 'b', 'c'), null, null),
- 42534 => array(array('_route' => '_747'), array('a', 'b', 'c'), null, null),
- 42583 => array(array('_route' => '_715'), array('a', 'b', 'c'), null, null),
- 42631 => array(array('_route' => '_940'), array('a', 'b', 'c'), null, null),
- 42684 => array(array('_route' => '_563'), array('a', 'b', 'c'), null, null),
- 42732 => array(array('_route' => '_611'), array('a', 'b', 'c'), null, null),
- 42780 => array(array('_route' => '_830'), array('a', 'b', 'c'), null, null),
- 42833 => array(array('_route' => '_569'), array('a', 'b', 'c'), null, null),
- 42881 => array(array('_route' => '_908'), array('a', 'b', 'c'), null, null),
- 42929 => array(array('_route' => '_913'), array('a', 'b', 'c'), null, null),
- 42982 => array(array('_route' => '_644'), array('a', 'b', 'c'), null, null),
- 43030 => array(array('_route' => '_776'), array('a', 'b', 'c'), null, null),
- 43078 => array(array('_route' => '_856'), array('a', 'b', 'c'), null, null),
- 43131 => array(array('_route' => '_650'), array('a', 'b', 'c'), null, null),
- 43179 => array(array('_route' => '_761'), array('a', 'b', 'c'), null, null),
- 43232 => array(array('_route' => '_663'), array('a', 'b', 'c'), null, null),
- 43280 => array(array('_route' => '_754'), array('a', 'b', 'c'), null, null),
- 43333 => array(array('_route' => '_665'), array('a', 'b', 'c'), null, null),
- 43381 => array(array('_route' => '_805'), array('a', 'b', 'c'), null, null),
- 43429 => array(array('_route' => '_846'), array('a', 'b', 'c'), null, null),
- 43477 => array(array('_route' => '_857'), array('a', 'b', 'c'), null, null),
- 43530 => array(array('_route' => '_675'), array('a', 'b', 'c'), null, null),
- 43578 => array(array('_route' => '_839'), array('a', 'b', 'c'), null, null),
- 43626 => array(array('_route' => '_968'), array('a', 'b', 'c'), null, null),
- 43676 => array(array('_route' => '_697'), array('a', 'b', 'c'), null, null),
- 43728 => array(array('_route' => '_725'), array('a', 'b', 'c'), null, null),
- 43776 => array(array('_route' => '_794'), array('a', 'b', 'c'), null, null),
- 43829 => array(array('_route' => '_773'), array('a', 'b', 'c'), null, null),
- 43877 => array(array('_route' => '_992'), array('a', 'b', 'c'), null, null),
- 43930 => array(array('_route' => '_901'), array('a', 'b', 'c'), null, null),
- 43978 => array(array('_route' => '_970'), array('a', 'b', 'c'), null, null),
- 44028 => array(array('_route' => '_964'), array('a', 'b', 'c'), null, null),
- 44086 => array(array('_route' => '_530'), array('a', 'b', 'c'), null, null),
- 44134 => array(array('_route' => '_703'), array('a', 'b', 'c'), null, null),
- 44187 => array(array('_route' => '_533'), array('a', 'b', 'c'), null, null),
- 44235 => array(array('_route' => '_739'), array('a', 'b', 'c'), null, null),
- 44283 => array(array('_route' => '_791'), array('a', 'b', 'c'), null, null),
- 44331 => array(array('_route' => '_987'), array('a', 'b', 'c'), null, null),
- 44384 => array(array('_route' => '_566'), array('a', 'b', 'c'), null, null),
- 44432 => array(array('_route' => '_592'), array('a', 'b', 'c'), null, null),
- 44488 => array(array('_route' => '_568'), array('a', 'b', 'c'), null, null),
- 44534 => array(array('_route' => '_868'), array('a', 'b', 'c'), null, null),
- 44583 => array(array('_route' => '_878'), array('a', 'b', 'c'), null, null),
- 44636 => array(array('_route' => '_588'), array('a', 'b', 'c'), null, null),
- 44684 => array(array('_route' => '_793'), array('a', 'b', 'c'), null, null),
- 44732 => array(array('_route' => '_917'), array('a', 'b', 'c'), null, null),
- 44785 => array(array('_route' => '_600'), array('a', 'b', 'c'), null, null),
- 44833 => array(array('_route' => '_728'), array('a', 'b', 'c'), null, null),
- 44886 => array(array('_route' => '_603'), array('a', 'b', 'c'), null, null),
- 44934 => array(array('_route' => '_765'), array('a', 'b', 'c'), null, null),
- 44987 => array(array('_route' => '_607'), array('a', 'b', 'c'), null, null),
- 45035 => array(array('_route' => '_676'), array('a', 'b', 'c'), null, null),
- 45083 => array(array('_route' => '_804'), array('a', 'b', 'c'), null, null),
- 45136 => array(array('_route' => '_609'), array('a', 'b', 'c'), null, null),
- 45184 => array(array('_route' => '_961'), array('a', 'b', 'c'), null, null),
- 45232 => array(array('_route' => '_980'), array('a', 'b', 'c'), null, null),
- 45282 => array(array('_route' => '_714'), array('a', 'b', 'c'), null, null),
- 45334 => array(array('_route' => '_730'), array('a', 'b', 'c'), null, null),
- 45382 => array(array('_route' => '_806'), array('a', 'b', 'c'), null, null),
- 45430 => array(array('_route' => '_825'), array('a', 'b', 'c'), null, null),
- 45478 => array(array('_route' => '_879'), array('a', 'b', 'c'), null, null),
- 45526 => array(array('_route' => '_893'), array('a', 'b', 'c'), null, null),
- 45576 => array(array('_route' => '_928'), array('a', 'b', 'c'), null, null),
- 45628 => array(array('_route' => '_932'), array('a', 'b', 'c'), null, null),
- 45676 => array(array('_route' => '_958'), array('a', 'b', 'c'), null, null),
- 45726 => array(array('_route' => '_984'), array('a', 'b', 'c'), null, null),
- 45784 => array(array('_route' => '_538'), array('a', 'b', 'c'), null, null),
- 45832 => array(array('_route' => '_993'), array('a', 'b', 'c'), null, null),
- 45882 => array(array('_route' => '_542'), array('a', 'b', 'c'), null, null),
- 45934 => array(array('_route' => '_551'), array('a', 'b', 'c'), null, null),
- 45982 => array(array('_route' => '_687'), array('a', 'b', 'c'), null, null),
- 46030 => array(array('_route' => '_724'), array('a', 'b', 'c'), null, null),
- 46078 => array(array('_route' => '_925'), array('a', 'b', 'c'), null, null),
- 46131 => array(array('_route' => '_587'), array('a', 'b', 'c'), null, null),
- 46179 => array(array('_route' => '_914'), array('a', 'b', 'c'), null, null),
- 46229 => array(array('_route' => '_616'), array('a', 'b', 'c'), null, null),
- 46284 => array(array('_route' => '_677'), array('a', 'b', 'c'), null, null),
- 46331 => array(array('_route' => '_815'), array('a', 'b', 'c'), null, null),
- 46380 => array(array('_route' => '_781'), array('a', 'b', 'c'), null, null),
- 46430 => array(array('_route' => '_717'), array('a', 'b', 'c'), null, null),
- 46482 => array(array('_route' => '_782'), array('a', 'b', 'c'), null, null),
- 46530 => array(array('_route' => '_832'), array('a', 'b', 'c'), null, null),
- 46583 => array(array('_route' => '_795'), array('a', 'b', 'c'), null, null),
- 46631 => array(array('_route' => '_887'), array('a', 'b', 'c'), null, null),
- 46681 => array(array('_route' => '_800'), array('a', 'b', 'c'), null, null),
- 46730 => array(array('_route' => '_826'), array('a', 'b', 'c'), null, null),
- 46779 => array(array('_route' => '_881'), array('a', 'b', 'c'), null, null),
- 46828 => array(array('_route' => '_886'), array('a', 'b', 'c'), null, null),
- 46877 => array(array('_route' => '_938'), array('a', 'b', 'c'), null, null),
- 46935 => array(array('_route' => '_540'), array('a', 'b', 'c'), null, null),
- 46983 => array(array('_route' => '_643'), array('a', 'b', 'c'), null, null),
- 47033 => array(array('_route' => '_544'), array('a', 'b', 'c'), null, null),
- 47082 => array(array('_route' => '_552'), array('a', 'b', 'c'), null, null),
- 47134 => array(array('_route' => '_567'), array('a', 'b', 'c'), null, null),
- 47182 => array(array('_route' => '_608'), array('a', 'b', 'c'), null, null),
- 47230 => array(array('_route' => '_698'), array('a', 'b', 'c'), null, null),
- 47278 => array(array('_route' => '_988'), array('a', 'b', 'c'), null, null),
- 47331 => array(array('_route' => '_583'), array('a', 'b', 'c'), null, null),
- 47379 => array(array('_route' => '_998'), array('a', 'b', 'c'), null, null),
- 47432 => array(array('_route' => '_604'), array('a', 'b', 'c'), null, null),
- 47480 => array(array('_route' => '_630'), array('a', 'b', 'c'), null, null),
- 47528 => array(array('_route' => '_706'), array('a', 'b', 'c'), null, null),
- 47576 => array(array('_route' => '_976'), array('a', 'b', 'c'), null, null),
- 47629 => array(array('_route' => '_673'), array('a', 'b', 'c'), null, null),
- 47677 => array(array('_route' => '_678'), array('a', 'b', 'c'), null, null),
- 47725 => array(array('_route' => '_931'), array('a', 'b', 'c'), null, null),
- 47775 => array(array('_route' => '_751'), array('a', 'b', 'c'), null, null),
- 47824 => array(array('_route' => '_766'), array('a', 'b', 'c'), null, null),
- 47876 => array(array('_route' => '_792'), array('a', 'b', 'c'), null, null),
- 47924 => array(array('_route' => '_814'), array('a', 'b', 'c'), null, null),
- 47974 => array(array('_route' => '_798'), array('a', 'b', 'c'), null, null),
- 48026 => array(array('_route' => '_851'), array('a', 'b', 'c'), null, null),
- 48074 => array(array('_route' => '_941'), array('a', 'b', 'c'), null, null),
- 48122 => array(array('_route' => '_953'), array('a', 'b', 'c'), null, null),
- 48170 => array(array('_route' => '_975'), array('a', 'b', 'c'), null, null),
- 48220 => array(array('_route' => '_873'), array('a', 'b', 'c'), null, null),
- 48269 => array(array('_route' => '_936'), array('a', 'b', 'c'), null, null),
- 48318 => array(array('_route' => '_994'), array('a', 'b', 'c'), null, null),
- 48376 => array(array('_route' => '_562'), array('a', 'b', 'c'), null, null),
- 48424 => array(array('_route' => '_770'), array('a', 'b', 'c'), null, null),
- 48475 => array(array('_route' => '_774'), array('a', 'b', 'c'), null, null),
- 48522 => array(array('_route' => '_966'), array('a', 'b', 'c'), null, null),
- 48573 => array(array('_route' => '_582'), array('a', 'b', 'c'), null, null),
- 48625 => array(array('_route' => '_606'), array('a', 'b', 'c'), null, null),
- 48673 => array(array('_route' => '_648'), array('a', 'b', 'c'), null, null),
- 48723 => array(array('_route' => '_624'), array('a', 'b', 'c'), null, null),
- 48775 => array(array('_route' => '_626'), array('a', 'b', 'c'), null, null),
- 48823 => array(array('_route' => '_821'), array('a', 'b', 'c'), null, null),
- 48873 => array(array('_route' => '_628'), array('a', 'b', 'c'), null, null),
- 48922 => array(array('_route' => '_638'), array('a', 'b', 'c'), null, null),
- 48974 => array(array('_route' => '_640'), array('a', 'b', 'c'), null, null),
- 49022 => array(array('_route' => '_990'), array('a', 'b', 'c'), null, null),
- 49072 => array(array('_route' => '_705'), array('a', 'b', 'c'), null, null),
- 49121 => array(array('_route' => '_757'), array('a', 'b', 'c'), null, null),
- 49176 => array(array('_route' => '_785'), array('a', 'b', 'c'), null, null),
- 49223 => array(array('_route' => '_875'), array('a', 'b', 'c'), null, null),
- 49270 => array(array('_route' => '_894'), array('a', 'b', 'c'), null, null),
- 49319 => array(array('_route' => '_945'), array('a', 'b', 'c'), null, null),
- 49375 => array(array('_route' => '_816'), array('a', 'b', 'c'), null, null),
- 49422 => array(array('_route' => '_872'), array('a', 'b', 'c'), null, null),
- 49471 => array(array('_route' => '_921'), array('a', 'b', 'c'), null, null),
- 49519 => array(array('_route' => '_960'), array('a', 'b', 'c'), null, null),
- 49567 => array(array('_route' => '_974'), array('a', 'b', 'c'), null, null),
- 49620 => array(array('_route' => '_835'), array('a', 'b', 'c'), null, null),
- 49668 => array(array('_route' => '_934'), array('a', 'b', 'c'), null, null),
- 49718 => array(array('_route' => '_869'), array('a', 'b', 'c'), null, null),
- );
-
- list($ret, $vars, $requiredMethods, $requiredSchemes) = $routes[$m];
-
- foreach ($vars as $i => $v) {
- if (isset($matches[1 + $i])) {
- $ret[$v] = $matches[1 + $i];
- }
- }
-
- $hasRequiredScheme = !$requiredSchemes || isset($requiredSchemes[$context->getScheme()]);
- if ($requiredMethods && !isset($requiredMethods[$canonicalMethod]) && !isset($requiredMethods[$requestMethod])) {
- if ($hasRequiredScheme) {
- $allow += $requiredMethods;
- }
- break;
- }
- if (!$hasRequiredScheme) {
- $allowSchemes += $requiredSchemes;
- break;
- }
-
- return $ret;
- }
-
- if (49718 === $m) {
- break;
- }
- $regex = substr_replace($regex, 'F', $m - $offset, 1 + strlen($m));
- $offset += strlen($m);
- }
- }
- if ('/' === $pathinfo && !$allow && !$allowSchemes) {
- throw new Symfony\Component\Routing\Exception\NoConfigurationException();
- }
-
- throw $allow ? new MethodNotAllowedException(array_keys($allow)) : new ResourceNotFoundException();
}
}
diff --git a/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher11.php b/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher11.php
index 173cc152..62638a15 100644
--- a/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher11.php
+++ b/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher11.php
@@ -1,7 +1,6 @@
context = $context;
- }
-
- public function match($pathinfo)
- {
- $allow = $allowSchemes = array();
- if ($ret = $this->doMatch($pathinfo, $allow, $allowSchemes)) {
- return $ret;
- }
- if ($allow) {
- throw new MethodNotAllowedException(array_keys($allow));
- }
- if (!in_array($this->context->getMethod(), array('HEAD', 'GET'), true)) {
- // no-op
- } elseif ($allowSchemes) {
- redirect_scheme:
- $scheme = $this->context->getScheme();
- $this->context->setScheme(key($allowSchemes));
- try {
- if ($ret = $this->doMatch($pathinfo)) {
- return $this->redirect($pathinfo, $ret['_route'], $this->context->getScheme()) + $ret;
- }
- } finally {
- $this->context->setScheme($scheme);
- }
- } elseif ('/' !== $pathinfo) {
- $pathinfo = '/' !== $pathinfo[-1] ? $pathinfo.'/' : substr($pathinfo, 0, -1);
- if ($ret = $this->doMatch($pathinfo, $allow, $allowSchemes)) {
- return $this->redirect($pathinfo, $ret['_route']) + $ret;
- }
- if ($allowSchemes) {
- goto redirect_scheme;
- }
- }
-
- throw new ResourceNotFoundException();
- }
-
- private function doMatch(string $rawPathinfo, array &$allow = array(), array &$allowSchemes = array()): ?array
- {
- $allow = $allowSchemes = array();
- $pathinfo = rawurldecode($rawPathinfo);
- $context = $this->context;
- $requestMethod = $canonicalMethod = $context->getMethod();
-
- if ('HEAD' === $requestMethod) {
- $canonicalMethod = 'GET';
- }
-
- $matchedPathinfo = $pathinfo;
- $regexList = array(
+ $this->regexpList = array(
0 => '{^(?'
.'|/(en|fr)/(?'
- .'|admin/post/(?'
- .'|(*:33)'
- .'|new(*:43)'
- .'|(\\d+)(*:55)'
- .'|(\\d+)/edit(*:72)'
- .'|(\\d+)/delete(*:91)'
+ .'|admin/post(?'
+ .'|(*:32)'
+ .'|/(?'
+ .'|new(*:46)'
+ .'|(\\d+)(*:58)'
+ .'|(\\d+)/edit(*:75)'
+ .'|(\\d+)/delete(*:94)'
+ .')'
.')'
- .'|blog/(?'
- .'|(*:107)'
- .'|rss\\.xml(*:123)'
- .'|p(?'
- .'|age/([^/]++)(*:147)'
- .'|osts/([^/]++)(*:168)'
+ .'|blog(?'
+ .'|(*:110)'
+ .'|/(?'
+ .'|rss\\.xml(*:130)'
+ .'|p(?'
+ .'|age/([^/]++)(*:154)'
+ .'|osts/([^/]++)(*:175)'
+ .')'
+ .'|comments/(\\d+)/new(*:202)'
+ .'|search(*:216)'
.')'
- .'|comments/(\\d+)/new(*:195)'
- .'|search(*:209)'
.')'
.'|log(?'
- .'|in(*:226)'
- .'|out(*:237)'
+ .'|in(*:234)'
+ .'|out(*:245)'
.')'
.')'
- .'|/(en|fr)?(*:256)'
- .')$}sD',
+ .'|/(en|fr)?(*:264)'
+ .')(?:/?)$}sD',
+ );
+ $this->dynamicRoutes = array(
+ 32 => array(array(array('_route' => 'a', '_locale' => 'en'), array('_locale'), null, null, true, null)),
+ 46 => array(array(array('_route' => 'b', '_locale' => 'en'), array('_locale'), null, null, false, null)),
+ 58 => array(array(array('_route' => 'c', '_locale' => 'en'), array('_locale', 'id'), null, null, false, null)),
+ 75 => array(array(array('_route' => 'd', '_locale' => 'en'), array('_locale', 'id'), null, null, false, null)),
+ 94 => array(array(array('_route' => 'e', '_locale' => 'en'), array('_locale', 'id'), null, null, false, null)),
+ 110 => array(array(array('_route' => 'f', '_locale' => 'en'), array('_locale'), null, null, true, null)),
+ 130 => array(array(array('_route' => 'g', '_locale' => 'en'), array('_locale'), null, null, false, null)),
+ 154 => array(array(array('_route' => 'h', '_locale' => 'en'), array('_locale', 'page'), null, null, false, null)),
+ 175 => array(array(array('_route' => 'i', '_locale' => 'en'), array('_locale', 'page'), null, null, false, null)),
+ 202 => array(array(array('_route' => 'j', '_locale' => 'en'), array('_locale', 'id'), null, null, false, null)),
+ 216 => array(array(array('_route' => 'k', '_locale' => 'en'), array('_locale'), null, null, false, null)),
+ 234 => array(array(array('_route' => 'l', '_locale' => 'en'), array('_locale'), null, null, false, null)),
+ 245 => array(array(array('_route' => 'm', '_locale' => 'en'), array('_locale'), null, null, false, null)),
+ 264 => array(array(array('_route' => 'n', '_locale' => 'en'), array('_locale'), null, null, false, null)),
);
-
- foreach ($regexList as $offset => $regex) {
- while (preg_match($regex, $matchedPathinfo, $matches)) {
- switch ($m = (int) $matches['MARK']) {
- default:
- $routes = array(
- 33 => array(array('_route' => 'a', '_locale' => 'en'), array('_locale'), null, null),
- 43 => array(array('_route' => 'b', '_locale' => 'en'), array('_locale'), null, null),
- 55 => array(array('_route' => 'c', '_locale' => 'en'), array('_locale', 'id'), null, null),
- 72 => array(array('_route' => 'd', '_locale' => 'en'), array('_locale', 'id'), null, null),
- 91 => array(array('_route' => 'e', '_locale' => 'en'), array('_locale', 'id'), null, null),
- 107 => array(array('_route' => 'f', '_locale' => 'en'), array('_locale'), null, null),
- 123 => array(array('_route' => 'g', '_locale' => 'en'), array('_locale'), null, null),
- 147 => array(array('_route' => 'h', '_locale' => 'en'), array('_locale', 'page'), null, null),
- 168 => array(array('_route' => 'i', '_locale' => 'en'), array('_locale', 'page'), null, null),
- 195 => array(array('_route' => 'j', '_locale' => 'en'), array('_locale', 'id'), null, null),
- 209 => array(array('_route' => 'k', '_locale' => 'en'), array('_locale'), null, null),
- 226 => array(array('_route' => 'l', '_locale' => 'en'), array('_locale'), null, null),
- 237 => array(array('_route' => 'm', '_locale' => 'en'), array('_locale'), null, null),
- 256 => array(array('_route' => 'n', '_locale' => 'en'), array('_locale'), null, null),
- );
-
- list($ret, $vars, $requiredMethods, $requiredSchemes) = $routes[$m];
-
- foreach ($vars as $i => $v) {
- if (isset($matches[1 + $i])) {
- $ret[$v] = $matches[1 + $i];
- }
- }
-
- $hasRequiredScheme = !$requiredSchemes || isset($requiredSchemes[$context->getScheme()]);
- if ($requiredMethods && !isset($requiredMethods[$canonicalMethod]) && !isset($requiredMethods[$requestMethod])) {
- if ($hasRequiredScheme) {
- $allow += $requiredMethods;
- }
- break;
- }
- if (!$hasRequiredScheme) {
- $allowSchemes += $requiredSchemes;
- break;
- }
-
- return $ret;
- }
-
- if (256 === $m) {
- break;
- }
- $regex = substr_replace($regex, 'F', $m - $offset, 1 + strlen($m));
- $offset += strlen($m);
- }
- }
- if ('/' === $pathinfo && !$allow && !$allowSchemes) {
- throw new Symfony\Component\Routing\Exception\NoConfigurationException();
- }
-
- return null;
}
}
diff --git a/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher12.php b/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher12.php
index eba4c8ac..df4d926a 100644
--- a/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher12.php
+++ b/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher12.php
@@ -1,7 +1,6 @@
context = $context;
- }
-
- public function match($rawPathinfo)
- {
- $allow = $allowSchemes = array();
- $pathinfo = rawurldecode($rawPathinfo);
- $context = $this->context;
- $requestMethod = $canonicalMethod = $context->getMethod();
-
- if ('HEAD' === $requestMethod) {
- $canonicalMethod = 'GET';
- }
-
- $matchedPathinfo = $pathinfo;
- $regexList = array(
+ $this->regexpList = array(
0 => '{^(?'
.'|/abc([^/]++)/(?'
.'|1(?'
@@ -45,56 +32,15 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
.')'
.')'
.')'
- .')$}sD',
+ .')(?:/?)$}sD',
+ );
+ $this->dynamicRoutes = array(
+ 27 => array(array(array('_route' => 'r1'), array('foo'), null, null, false, null)),
+ 38 => array(array(array('_route' => 'r10'), array('foo'), null, null, false, null)),
+ 46 => array(array(array('_route' => 'r100'), array('foo'), null, null, false, null)),
+ 59 => array(array(array('_route' => 'r2'), array('foo'), null, null, false, null)),
+ 70 => array(array(array('_route' => 'r20'), array('foo'), null, null, false, null)),
+ 78 => array(array(array('_route' => 'r200'), array('foo'), null, null, false, null)),
);
-
- foreach ($regexList as $offset => $regex) {
- while (preg_match($regex, $matchedPathinfo, $matches)) {
- switch ($m = (int) $matches['MARK']) {
- default:
- $routes = array(
- 27 => array(array('_route' => 'r1'), array('foo'), null, null),
- 38 => array(array('_route' => 'r10'), array('foo'), null, null),
- 46 => array(array('_route' => 'r100'), array('foo'), null, null),
- 59 => array(array('_route' => 'r2'), array('foo'), null, null),
- 70 => array(array('_route' => 'r20'), array('foo'), null, null),
- 78 => array(array('_route' => 'r200'), array('foo'), null, null),
- );
-
- list($ret, $vars, $requiredMethods, $requiredSchemes) = $routes[$m];
-
- foreach ($vars as $i => $v) {
- if (isset($matches[1 + $i])) {
- $ret[$v] = $matches[1 + $i];
- }
- }
-
- $hasRequiredScheme = !$requiredSchemes || isset($requiredSchemes[$context->getScheme()]);
- if ($requiredMethods && !isset($requiredMethods[$canonicalMethod]) && !isset($requiredMethods[$requestMethod])) {
- if ($hasRequiredScheme) {
- $allow += $requiredMethods;
- }
- break;
- }
- if (!$hasRequiredScheme) {
- $allowSchemes += $requiredSchemes;
- break;
- }
-
- return $ret;
- }
-
- if (78 === $m) {
- break;
- }
- $regex = substr_replace($regex, 'F', $m - $offset, 1 + strlen($m));
- $offset += strlen($m);
- }
- }
- if ('/' === $pathinfo && !$allow && !$allowSchemes) {
- throw new Symfony\Component\Routing\Exception\NoConfigurationException();
- }
-
- throw $allow ? new MethodNotAllowedException(array_keys($allow)) : new ResourceNotFoundException();
}
}
diff --git a/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher13.php b/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher13.php
index 5cda7753..3c13a26b 100644
--- a/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher13.php
+++ b/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher13.php
@@ -1,7 +1,6 @@
context = $context;
- }
-
- public function match($rawPathinfo)
- {
- $allow = $allowSchemes = array();
- $pathinfo = rawurldecode($rawPathinfo);
- $context = $this->context;
- $requestMethod = $canonicalMethod = $context->getMethod();
- $host = strtolower($context->getHost());
-
- if ('HEAD' === $requestMethod) {
- $canonicalMethod = 'GET';
- }
-
- $matchedPathinfo = $host.'.'.$pathinfo;
- $regexList = array(
+ $this->matchHost = true;
+ $this->regexpList = array(
0 => '{^(?'
.'|(?i:([^\\.]++)\\.exampple\\.com)\\.(?'
.'|/abc([^/]++)(?'
.'|(*:56)'
.')'
.')'
- .')$}sD',
+ .')(?:/?)$}sD',
+ );
+ $this->dynamicRoutes = array(
+ 56 => array(
+ array(array('_route' => 'r1'), array('foo', 'foo'), null, null, false, null),
+ array(array('_route' => 'r2'), array('foo', 'foo'), null, null, false, null),
+ ),
);
-
- foreach ($regexList as $offset => $regex) {
- while (preg_match($regex, $matchedPathinfo, $matches)) {
- switch ($m = (int) $matches['MARK']) {
- case 56:
- $matches = array('foo' => $matches[1] ?? null, 'foo' => $matches[2] ?? null);
-
- // r1
- return $this->mergeDefaults(array('_route' => 'r1') + $matches, array());
-
- // r2
- return $this->mergeDefaults(array('_route' => 'r2') + $matches, array());
-
- break;
- }
-
- if (56 === $m) {
- break;
- }
- $regex = substr_replace($regex, 'F', $m - $offset, 1 + strlen($m));
- $offset += strlen($m);
- }
- }
- if ('/' === $pathinfo && !$allow && !$allowSchemes) {
- throw new Symfony\Component\Routing\Exception\NoConfigurationException();
- }
-
- throw $allow ? new MethodNotAllowedException(array_keys($allow)) : new ResourceNotFoundException();
}
}
diff --git a/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher2.php b/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher2.php
index 5aec5db0..8d71ee5e 100644
--- a/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher2.php
+++ b/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher2.php
@@ -1,7 +1,6 @@
context = $context;
- }
-
- public function match($pathinfo)
- {
- $allow = $allowSchemes = array();
- if ($ret = $this->doMatch($pathinfo, $allow, $allowSchemes)) {
- return $ret;
- }
- if ($allow) {
- throw new MethodNotAllowedException(array_keys($allow));
- }
- if (!in_array($this->context->getMethod(), array('HEAD', 'GET'), true)) {
- // no-op
- } elseif ($allowSchemes) {
- redirect_scheme:
- $scheme = $this->context->getScheme();
- $this->context->setScheme(key($allowSchemes));
- try {
- if ($ret = $this->doMatch($pathinfo)) {
- return $this->redirect($pathinfo, $ret['_route'], $this->context->getScheme()) + $ret;
- }
- } finally {
- $this->context->setScheme($scheme);
- }
- } elseif ('/' !== $pathinfo) {
- $pathinfo = '/' !== $pathinfo[-1] ? $pathinfo.'/' : substr($pathinfo, 0, -1);
- if ($ret = $this->doMatch($pathinfo, $allow, $allowSchemes)) {
- return $this->redirect($pathinfo, $ret['_route']) + $ret;
- }
- if ($allowSchemes) {
- goto redirect_scheme;
- }
- }
-
- throw new ResourceNotFoundException();
- }
-
- private function doMatch(string $rawPathinfo, array &$allow = array(), array &$allowSchemes = array()): ?array
- {
- $allow = $allowSchemes = array();
- $pathinfo = rawurldecode($rawPathinfo);
- $context = $this->context;
- $requestMethod = $canonicalMethod = $context->getMethod();
- $host = strtolower($context->getHost());
-
- if ('HEAD' === $requestMethod) {
- $canonicalMethod = 'GET';
- }
-
- switch ($pathinfo) {
- default:
- $routes = array(
- '/test/baz' => array(array('_route' => 'baz'), null, null, null),
- '/test/baz.html' => array(array('_route' => 'baz2'), null, null, null),
- '/test/baz3/' => array(array('_route' => 'baz3'), null, null, null),
- '/foofoo' => array(array('_route' => 'foofoo', 'def' => 'test'), null, null, null),
- '/spa ce' => array(array('_route' => 'space'), null, null, null),
- '/multi/new' => array(array('_route' => 'overridden2'), null, null, null),
- '/multi/hey/' => array(array('_route' => 'hey'), null, null, null),
- '/ababa' => array(array('_route' => 'ababa'), null, null, null),
- '/route1' => array(array('_route' => 'route1'), 'a.example.com', null, null),
- '/c2/route2' => array(array('_route' => 'route2'), 'a.example.com', null, null),
- '/route4' => array(array('_route' => 'route4'), 'a.example.com', null, null),
- '/c2/route3' => array(array('_route' => 'route3'), 'b.example.com', null, null),
- '/route5' => array(array('_route' => 'route5'), 'c.example.com', null, null),
- '/route6' => array(array('_route' => 'route6'), null, null, null),
- '/route11' => array(array('_route' => 'route11'), '#^(?P[^\\.]++)\\.example\\.com$#sDi', null, null),
- '/route12' => array(array('_route' => 'route12', 'var1' => 'val'), '#^(?P[^\\.]++)\\.example\\.com$#sDi', null, null),
- '/route17' => array(array('_route' => 'route17'), null, null, null),
- '/secure' => array(array('_route' => 'secure'), null, null, array('https' => 0)),
- '/nonsecure' => array(array('_route' => 'nonsecure'), null, null, array('http' => 0)),
- );
-
- if (!isset($routes[$pathinfo])) {
- break;
- }
- list($ret, $requiredHost, $requiredMethods, $requiredSchemes) = $routes[$pathinfo];
-
- if ($requiredHost) {
- if ('#' !== $requiredHost[0] ? $requiredHost !== $host : !preg_match($requiredHost, $host, $hostMatches)) {
- break;
- }
- if ('#' === $requiredHost[0] && $hostMatches) {
- $hostMatches['_route'] = $ret['_route'];
- $ret = $this->mergeDefaults($hostMatches, $ret);
- }
- }
-
- $hasRequiredScheme = !$requiredSchemes || isset($requiredSchemes[$context->getScheme()]);
- if ($requiredMethods && !isset($requiredMethods[$canonicalMethod]) && !isset($requiredMethods[$requestMethod])) {
- if ($hasRequiredScheme) {
- $allow += $requiredMethods;
- }
- break;
- }
- if (!$hasRequiredScheme) {
- $allowSchemes += $requiredSchemes;
- break;
- }
-
- return $ret;
- }
-
- $matchedPathinfo = $host.'.'.$pathinfo;
- $regexList = array(
+ $this->matchHost = true;
+ $this->staticRoutes = array(
+ '/test/baz' => array(array(array('_route' => 'baz'), null, null, null, false, null)),
+ '/test/baz.html' => array(array(array('_route' => 'baz2'), null, null, null, false, null)),
+ '/test/baz3' => array(array(array('_route' => 'baz3'), null, null, null, true, null)),
+ '/foofoo' => array(array(array('_route' => 'foofoo', 'def' => 'test'), null, null, null, false, null)),
+ '/spa ce' => array(array(array('_route' => 'space'), null, null, null, false, null)),
+ '/multi/new' => array(array(array('_route' => 'overridden2'), null, null, null, false, null)),
+ '/multi/hey' => array(array(array('_route' => 'hey'), null, null, null, true, null)),
+ '/ababa' => array(array(array('_route' => 'ababa'), null, null, null, false, null)),
+ '/route1' => array(array(array('_route' => 'route1'), 'a.example.com', null, null, false, null)),
+ '/c2/route2' => array(array(array('_route' => 'route2'), 'a.example.com', null, null, false, null)),
+ '/route4' => array(array(array('_route' => 'route4'), 'a.example.com', null, null, false, null)),
+ '/c2/route3' => array(array(array('_route' => 'route3'), 'b.example.com', null, null, false, null)),
+ '/route5' => array(array(array('_route' => 'route5'), 'c.example.com', null, null, false, null)),
+ '/route6' => array(array(array('_route' => 'route6'), null, null, null, false, null)),
+ '/route11' => array(array(array('_route' => 'route11'), '#^(?P[^\\.]++)\\.example\\.com$#sDi', null, null, false, null)),
+ '/route12' => array(array(array('_route' => 'route12', 'var1' => 'val'), '#^(?P[^\\.]++)\\.example\\.com$#sDi', null, null, false, null)),
+ '/route17' => array(array(array('_route' => 'route17'), null, null, null, false, null)),
+ '/secure' => array(array(array('_route' => 'secure'), null, null, array('https' => 0), false, null)),
+ '/nonsecure' => array(array(array('_route' => 'nonsecure'), null, null, array('http' => 0), false, null)),
+ );
+ $this->regexpList = array(
0 => '{^(?'
.'|(?:(?:[^./]*+\\.)++)(?'
.'|/foo/(baz|symfony)(*:47)'
@@ -125,160 +44,72 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
.'|/([^/]++)(*:70)'
.'|head/([^/]++)(*:90)'
.')'
- .'|/test/([^/]++)/(?'
- .'|(*:116)'
+ .'|/test/([^/]++)(?'
+ .'|(*:115)'
.')'
- .'|/([\']+)(*:132)'
+ .'|/([\']+)(*:131)'
.'|/a/(?'
.'|b\'b/([^/]++)(?'
- .'|(*:161)'
- .'|(*:169)'
+ .'|(*:160)'
+ .'|(*:168)'
.')'
- .'|(.*)(*:182)'
+ .'|(.*)(*:181)'
.'|b\'b/([^/]++)(?'
- .'|(*:205)'
- .'|(*:213)'
+ .'|(*:204)'
+ .'|(*:212)'
.')'
.')'
- .'|/multi/hello(?:/([^/]++))?(*:249)'
+ .'|/multi/hello(?:/([^/]++))?(*:248)'
.'|/([^/]++)/b/([^/]++)(?'
- .'|(*:280)'
- .'|(*:288)'
+ .'|(*:279)'
+ .'|(*:287)'
.')'
- .'|/aba/([^/]++)(*:310)'
+ .'|/aba/([^/]++)(*:309)'
.')|(?i:([^\\.]++)\\.example\\.com)\\.(?'
.'|/route1(?'
- .'|3/([^/]++)(*:372)'
- .'|4/([^/]++)(*:390)'
+ .'|3/([^/]++)(*:371)'
+ .'|4/([^/]++)(*:389)'
.')'
.')|(?i:c\\.example\\.com)\\.(?'
- .'|/route15/([^/]++)(*:442)'
+ .'|/route15/([^/]++)(*:441)'
.')|(?:(?:[^./]*+\\.)++)(?'
- .'|/route16/([^/]++)(*:490)'
+ .'|/route16/([^/]++)(*:489)'
.'|/a/(?'
- .'|a\\.\\.\\.(*:511)'
+ .'|a\\.\\.\\.(*:510)'
.'|b/(?'
- .'|([^/]++)(*:532)'
- .'|c/([^/]++)(*:550)'
+ .'|([^/]++)(*:531)'
+ .'|c/([^/]++)(*:549)'
.')'
.')'
.')'
- .')$}sD',
+ .')(?:/?)$}sD',
+ );
+ $this->dynamicRoutes = array(
+ 47 => array(array(array('_route' => 'foo', 'def' => 'test'), array('bar'), null, null, false, null)),
+ 70 => array(array(array('_route' => 'bar'), array('foo'), array('GET' => 0, 'HEAD' => 1), null, false, null)),
+ 90 => array(array(array('_route' => 'barhead'), array('foo'), array('GET' => 0), null, false, null)),
+ 115 => array(
+ array(array('_route' => 'baz4'), array('foo'), null, null, true, null),
+ array(array('_route' => 'baz5'), array('foo'), array('POST' => 0), null, true, null),
+ array(array('_route' => 'baz.baz6'), array('foo'), array('PUT' => 0), null, true, null),
+ ),
+ 131 => array(array(array('_route' => 'quoter'), array('quoter'), null, null, false, null)),
+ 160 => array(array(array('_route' => 'foo1'), array('foo'), array('PUT' => 0), null, false, null)),
+ 168 => array(array(array('_route' => 'bar1'), array('bar'), null, null, false, null)),
+ 181 => array(array(array('_route' => 'overridden'), array('var'), null, null, false, null)),
+ 204 => array(array(array('_route' => 'foo2'), array('foo1'), null, null, false, null)),
+ 212 => array(array(array('_route' => 'bar2'), array('bar1'), null, null, false, null)),
+ 248 => array(array(array('_route' => 'helloWorld', 'who' => 'World!'), array('who'), null, null, false, null)),
+ 279 => array(array(array('_route' => 'foo3'), array('_locale', 'foo'), null, null, false, null)),
+ 287 => array(array(array('_route' => 'bar3'), array('_locale', 'bar'), null, null, false, null)),
+ 309 => array(array(array('_route' => 'foo4'), array('foo'), null, null, false, null)),
+ 371 => array(array(array('_route' => 'route13'), array('var1', 'name'), null, null, false, null)),
+ 389 => array(array(array('_route' => 'route14', 'var1' => 'val'), array('var1', 'name'), null, null, false, null)),
+ 441 => array(array(array('_route' => 'route15'), array('name'), null, null, false, null)),
+ 489 => array(array(array('_route' => 'route16', 'var1' => 'val'), array('name'), null, null, false, null)),
+ 510 => array(array(array('_route' => 'a'), array(), null, null, false, null)),
+ 531 => array(array(array('_route' => 'b'), array('var'), null, null, false, null)),
+ 549 => array(array(array('_route' => 'c'), array('var'), null, null, false, null)),
);
-
- foreach ($regexList as $offset => $regex) {
- while (preg_match($regex, $matchedPathinfo, $matches)) {
- switch ($m = (int) $matches['MARK']) {
- case 116:
- $matches = array('foo' => $matches[1] ?? null);
-
- // baz4
- return $this->mergeDefaults(array('_route' => 'baz4') + $matches, array());
-
- // baz5
- $ret = $this->mergeDefaults(array('_route' => 'baz5') + $matches, array());
- if (!isset(($a = array('POST' => 0))[$requestMethod])) {
- $allow += $a;
- goto not_baz5;
- }
-
- return $ret;
- not_baz5:
-
- // baz.baz6
- $ret = $this->mergeDefaults(array('_route' => 'baz.baz6') + $matches, array());
- if (!isset(($a = array('PUT' => 0))[$requestMethod])) {
- $allow += $a;
- goto not_bazbaz6;
- }
-
- return $ret;
- not_bazbaz6:
-
- break;
- case 161:
- $matches = array('foo' => $matches[1] ?? null);
-
- // foo1
- $ret = $this->mergeDefaults(array('_route' => 'foo1') + $matches, array());
- if (!isset(($a = array('PUT' => 0))[$requestMethod])) {
- $allow += $a;
- goto not_foo1;
- }
-
- return $ret;
- not_foo1:
-
- break;
- case 205:
- $matches = array('foo1' => $matches[1] ?? null);
-
- // foo2
- return $this->mergeDefaults(array('_route' => 'foo2') + $matches, array());
-
- break;
- case 280:
- $matches = array('_locale' => $matches[1] ?? null, 'foo' => $matches[2] ?? null);
-
- // foo3
- return $this->mergeDefaults(array('_route' => 'foo3') + $matches, array());
-
- break;
- default:
- $routes = array(
- 47 => array(array('_route' => 'foo', 'def' => 'test'), array('bar'), null, null),
- 70 => array(array('_route' => 'bar'), array('foo'), array('GET' => 0, 'HEAD' => 1), null),
- 90 => array(array('_route' => 'barhead'), array('foo'), array('GET' => 0), null),
- 132 => array(array('_route' => 'quoter'), array('quoter'), null, null),
- 169 => array(array('_route' => 'bar1'), array('bar'), null, null),
- 182 => array(array('_route' => 'overridden'), array('var'), null, null),
- 213 => array(array('_route' => 'bar2'), array('bar1'), null, null),
- 249 => array(array('_route' => 'helloWorld', 'who' => 'World!'), array('who'), null, null),
- 288 => array(array('_route' => 'bar3'), array('_locale', 'bar'), null, null),
- 310 => array(array('_route' => 'foo4'), array('foo'), null, null),
- 372 => array(array('_route' => 'route13'), array('var1', 'name'), null, null),
- 390 => array(array('_route' => 'route14', 'var1' => 'val'), array('var1', 'name'), null, null),
- 442 => array(array('_route' => 'route15'), array('name'), null, null),
- 490 => array(array('_route' => 'route16', 'var1' => 'val'), array('name'), null, null),
- 511 => array(array('_route' => 'a'), array(), null, null),
- 532 => array(array('_route' => 'b'), array('var'), null, null),
- 550 => array(array('_route' => 'c'), array('var'), null, null),
- );
-
- list($ret, $vars, $requiredMethods, $requiredSchemes) = $routes[$m];
-
- foreach ($vars as $i => $v) {
- if (isset($matches[1 + $i])) {
- $ret[$v] = $matches[1 + $i];
- }
- }
-
- $hasRequiredScheme = !$requiredSchemes || isset($requiredSchemes[$context->getScheme()]);
- if ($requiredMethods && !isset($requiredMethods[$canonicalMethod]) && !isset($requiredMethods[$requestMethod])) {
- if ($hasRequiredScheme) {
- $allow += $requiredMethods;
- }
- break;
- }
- if (!$hasRequiredScheme) {
- $allowSchemes += $requiredSchemes;
- break;
- }
-
- return $ret;
- }
-
- if (550 === $m) {
- break;
- }
- $regex = substr_replace($regex, 'F', $m - $offset, 1 + strlen($m));
- $offset += strlen($m);
- }
- }
- if ('/' === $pathinfo && !$allow && !$allowSchemes) {
- throw new Symfony\Component\Routing\Exception\NoConfigurationException();
- }
-
- return null;
}
}
diff --git a/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher3.php b/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher3.php
index 6f1c45aa..49b4b77c 100644
--- a/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher3.php
+++ b/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher3.php
@@ -1,7 +1,6 @@
context = $context;
- }
-
- public function match($rawPathinfo)
- {
- $allow = $allowSchemes = array();
- $pathinfo = rawurldecode($rawPathinfo);
- $context = $this->context;
- $requestMethod = $canonicalMethod = $context->getMethod();
-
- if ('HEAD' === $requestMethod) {
- $canonicalMethod = 'GET';
- }
-
- switch ($pathinfo) {
- case '/with-condition':
- // with-condition
- if (($context->getMethod() == "GET")) {
- return array('_route' => 'with-condition');
- }
- break;
- default:
- $routes = array(
- '/rootprefix/test' => array(array('_route' => 'static'), null, null, null),
- );
-
- if (!isset($routes[$pathinfo])) {
- break;
- }
- list($ret, $requiredHost, $requiredMethods, $requiredSchemes) = $routes[$pathinfo];
-
- $hasRequiredScheme = !$requiredSchemes || isset($requiredSchemes[$context->getScheme()]);
- if ($requiredMethods && !isset($requiredMethods[$canonicalMethod]) && !isset($requiredMethods[$requestMethod])) {
- if ($hasRequiredScheme) {
- $allow += $requiredMethods;
- }
- break;
- }
- if (!$hasRequiredScheme) {
- $allowSchemes += $requiredSchemes;
- break;
- }
-
- return $ret;
- }
-
- $matchedPathinfo = $pathinfo;
- $regexList = array(
+ $this->staticRoutes = array(
+ '/rootprefix/test' => array(array(array('_route' => 'static'), null, null, null, false, null)),
+ '/with-condition' => array(array(array('_route' => 'with-condition'), null, null, null, false, -1)),
+ );
+ $this->regexpList = array(
0 => '{^(?'
.'|/rootprefix/([^/]++)(*:27)'
- .')$}sD',
+ .')(?:/?)$}sD',
);
-
- foreach ($regexList as $offset => $regex) {
- while (preg_match($regex, $matchedPathinfo, $matches)) {
- switch ($m = (int) $matches['MARK']) {
- default:
- $routes = array(
- 27 => array(array('_route' => 'dynamic'), array('var'), null, null),
- );
-
- list($ret, $vars, $requiredMethods, $requiredSchemes) = $routes[$m];
-
- foreach ($vars as $i => $v) {
- if (isset($matches[1 + $i])) {
- $ret[$v] = $matches[1 + $i];
- }
- }
-
- $hasRequiredScheme = !$requiredSchemes || isset($requiredSchemes[$context->getScheme()]);
- if ($requiredMethods && !isset($requiredMethods[$canonicalMethod]) && !isset($requiredMethods[$requestMethod])) {
- if ($hasRequiredScheme) {
- $allow += $requiredMethods;
- }
- break;
- }
- if (!$hasRequiredScheme) {
- $allowSchemes += $requiredSchemes;
- break;
- }
-
- return $ret;
- }
-
- if (27 === $m) {
- break;
- }
- $regex = substr_replace($regex, 'F', $m - $offset, 1 + strlen($m));
- $offset += strlen($m);
+ $this->dynamicRoutes = array(
+ 27 => array(array(array('_route' => 'dynamic'), array('var'), null, null, false, null)),
+ );
+ $this->checkCondition = static function ($condition, $context, $request) {
+ switch ($condition) {
+ case -1: return ($context->getMethod() == "GET");
}
- }
- if ('/' === $pathinfo && !$allow && !$allowSchemes) {
- throw new Symfony\Component\Routing\Exception\NoConfigurationException();
- }
-
- throw $allow ? new MethodNotAllowedException(array_keys($allow)) : new ResourceNotFoundException();
+ };
}
}
diff --git a/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher4.php b/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher4.php
index 418f8e0b..7d99de40 100644
--- a/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher4.php
+++ b/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher4.php
@@ -1,7 +1,6 @@
context = $context;
- }
-
- public function match($rawPathinfo)
- {
- $allow = $allowSchemes = array();
- $pathinfo = rawurldecode($rawPathinfo);
- $context = $this->context;
- $requestMethod = $canonicalMethod = $context->getMethod();
-
- if ('HEAD' === $requestMethod) {
- $canonicalMethod = 'GET';
- }
-
- switch ($pathinfo) {
- case '/put_and_post':
- // put_and_post
- $ret = array('_route' => 'put_and_post');
- if (!isset(($a = array('PUT' => 0, 'POST' => 1))[$requestMethod])) {
- $allow += $a;
- goto not_put_and_post;
- }
-
- return $ret;
- not_put_and_post:
- // put_and_get_and_head
- $ret = array('_route' => 'put_and_get_and_head');
- if (!isset(($a = array('PUT' => 0, 'GET' => 1, 'HEAD' => 2))[$canonicalMethod])) {
- $allow += $a;
- goto not_put_and_get_and_head;
- }
-
- return $ret;
- not_put_and_get_and_head:
- break;
- default:
- $routes = array(
- '/just_head' => array(array('_route' => 'just_head'), null, array('HEAD' => 0), null),
- '/head_and_get' => array(array('_route' => 'head_and_get'), null, array('HEAD' => 0, 'GET' => 1), null),
- '/get_and_head' => array(array('_route' => 'get_and_head'), null, array('GET' => 0, 'HEAD' => 1), null),
- '/post_and_head' => array(array('_route' => 'post_and_head'), null, array('POST' => 0, 'HEAD' => 1), null),
- );
-
- if (!isset($routes[$pathinfo])) {
- break;
- }
- list($ret, $requiredHost, $requiredMethods, $requiredSchemes) = $routes[$pathinfo];
-
- $hasRequiredScheme = !$requiredSchemes || isset($requiredSchemes[$context->getScheme()]);
- if ($requiredMethods && !isset($requiredMethods[$canonicalMethod]) && !isset($requiredMethods[$requestMethod])) {
- if ($hasRequiredScheme) {
- $allow += $requiredMethods;
- }
- break;
- }
- if (!$hasRequiredScheme) {
- $allowSchemes += $requiredSchemes;
- break;
- }
-
- return $ret;
- }
-
- if ('/' === $pathinfo && !$allow && !$allowSchemes) {
- throw new Symfony\Component\Routing\Exception\NoConfigurationException();
- }
-
- throw $allow ? new MethodNotAllowedException(array_keys($allow)) : new ResourceNotFoundException();
+ $this->staticRoutes = array(
+ '/just_head' => array(array(array('_route' => 'just_head'), null, array('HEAD' => 0), null, false, null)),
+ '/head_and_get' => array(array(array('_route' => 'head_and_get'), null, array('HEAD' => 0, 'GET' => 1), null, false, null)),
+ '/get_and_head' => array(array(array('_route' => 'get_and_head'), null, array('GET' => 0, 'HEAD' => 1), null, false, null)),
+ '/post_and_head' => array(array(array('_route' => 'post_and_head'), null, array('POST' => 0, 'HEAD' => 1), null, false, null)),
+ '/put_and_post' => array(
+ array(array('_route' => 'put_and_post'), null, array('PUT' => 0, 'POST' => 1), null, false, null),
+ array(array('_route' => 'put_and_get_and_head'), null, array('PUT' => 0, 'GET' => 1, 'HEAD' => 2), null, false, null),
+ ),
+ );
}
}
diff --git a/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher5.php b/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher5.php
index 976a25fb..001e6cdd 100644
--- a/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher5.php
+++ b/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher5.php
@@ -1,7 +1,6 @@
context = $context;
- }
-
- public function match($pathinfo)
- {
- $allow = $allowSchemes = array();
- if ($ret = $this->doMatch($pathinfo, $allow, $allowSchemes)) {
- return $ret;
- }
- if ($allow) {
- throw new MethodNotAllowedException(array_keys($allow));
- }
- if (!in_array($this->context->getMethod(), array('HEAD', 'GET'), true)) {
- // no-op
- } elseif ($allowSchemes) {
- redirect_scheme:
- $scheme = $this->context->getScheme();
- $this->context->setScheme(key($allowSchemes));
- try {
- if ($ret = $this->doMatch($pathinfo)) {
- return $this->redirect($pathinfo, $ret['_route'], $this->context->getScheme()) + $ret;
- }
- } finally {
- $this->context->setScheme($scheme);
- }
- } elseif ('/' !== $pathinfo) {
- $pathinfo = '/' !== $pathinfo[-1] ? $pathinfo.'/' : substr($pathinfo, 0, -1);
- if ($ret = $this->doMatch($pathinfo, $allow, $allowSchemes)) {
- return $this->redirect($pathinfo, $ret['_route']) + $ret;
- }
- if ($allowSchemes) {
- goto redirect_scheme;
- }
- }
-
- throw new ResourceNotFoundException();
- }
-
- private function doMatch(string $rawPathinfo, array &$allow = array(), array &$allowSchemes = array()): ?array
- {
- $allow = $allowSchemes = array();
- $pathinfo = rawurldecode($rawPathinfo);
- $context = $this->context;
- $requestMethod = $canonicalMethod = $context->getMethod();
-
- if ('HEAD' === $requestMethod) {
- $canonicalMethod = 'GET';
- }
-
- switch ($pathinfo) {
- default:
- $routes = array(
- '/a/11' => array(array('_route' => 'a_first'), null, null, null),
- '/a/22' => array(array('_route' => 'a_second'), null, null, null),
- '/a/333' => array(array('_route' => 'a_third'), null, null, null),
- '/a/44/' => array(array('_route' => 'a_fourth'), null, null, null),
- '/a/55/' => array(array('_route' => 'a_fifth'), null, null, null),
- '/a/66/' => array(array('_route' => 'a_sixth'), null, null, null),
- '/nested/group/a/' => array(array('_route' => 'nested_a'), null, null, null),
- '/nested/group/b/' => array(array('_route' => 'nested_b'), null, null, null),
- '/nested/group/c/' => array(array('_route' => 'nested_c'), null, null, null),
- '/slashed/group/' => array(array('_route' => 'slashed_a'), null, null, null),
- '/slashed/group/b/' => array(array('_route' => 'slashed_b'), null, null, null),
- '/slashed/group/c/' => array(array('_route' => 'slashed_c'), null, null, null),
- );
-
- if (!isset($routes[$pathinfo])) {
- break;
- }
- list($ret, $requiredHost, $requiredMethods, $requiredSchemes) = $routes[$pathinfo];
-
- $hasRequiredScheme = !$requiredSchemes || isset($requiredSchemes[$context->getScheme()]);
- if ($requiredMethods && !isset($requiredMethods[$canonicalMethod]) && !isset($requiredMethods[$requestMethod])) {
- if ($hasRequiredScheme) {
- $allow += $requiredMethods;
- }
- break;
- }
- if (!$hasRequiredScheme) {
- $allowSchemes += $requiredSchemes;
- break;
- }
-
- return $ret;
- }
-
- $matchedPathinfo = $pathinfo;
- $regexList = array(
+ $this->staticRoutes = array(
+ '/a/11' => array(array(array('_route' => 'a_first'), null, null, null, false, null)),
+ '/a/22' => array(array(array('_route' => 'a_second'), null, null, null, false, null)),
+ '/a/333' => array(array(array('_route' => 'a_third'), null, null, null, false, null)),
+ '/a/44' => array(array(array('_route' => 'a_fourth'), null, null, null, true, null)),
+ '/a/55' => array(array(array('_route' => 'a_fifth'), null, null, null, true, null)),
+ '/a/66' => array(array(array('_route' => 'a_sixth'), null, null, null, true, null)),
+ '/nested/group/a' => array(array(array('_route' => 'nested_a'), null, null, null, true, null)),
+ '/nested/group/b' => array(array(array('_route' => 'nested_b'), null, null, null, true, null)),
+ '/nested/group/c' => array(array(array('_route' => 'nested_c'), null, null, null, true, null)),
+ '/slashed/group' => array(array(array('_route' => 'slashed_a'), null, null, null, true, null)),
+ '/slashed/group/b' => array(array(array('_route' => 'slashed_b'), null, null, null, true, null)),
+ '/slashed/group/c' => array(array(array('_route' => 'slashed_c'), null, null, null, true, null)),
+ );
+ $this->regexpList = array(
0 => '{^(?'
.'|/([^/]++)(*:16)'
.'|/nested/([^/]++)(*:39)'
- .')$}sD',
+ .')(?:/?)$}sD',
+ );
+ $this->dynamicRoutes = array(
+ 16 => array(array(array('_route' => 'a_wildcard'), array('param'), null, null, false, null)),
+ 39 => array(array(array('_route' => 'nested_wildcard'), array('param'), null, null, false, null)),
);
-
- foreach ($regexList as $offset => $regex) {
- while (preg_match($regex, $matchedPathinfo, $matches)) {
- switch ($m = (int) $matches['MARK']) {
- default:
- $routes = array(
- 16 => array(array('_route' => 'a_wildcard'), array('param'), null, null),
- 39 => array(array('_route' => 'nested_wildcard'), array('param'), null, null),
- );
-
- list($ret, $vars, $requiredMethods, $requiredSchemes) = $routes[$m];
-
- foreach ($vars as $i => $v) {
- if (isset($matches[1 + $i])) {
- $ret[$v] = $matches[1 + $i];
- }
- }
-
- $hasRequiredScheme = !$requiredSchemes || isset($requiredSchemes[$context->getScheme()]);
- if ($requiredMethods && !isset($requiredMethods[$canonicalMethod]) && !isset($requiredMethods[$requestMethod])) {
- if ($hasRequiredScheme) {
- $allow += $requiredMethods;
- }
- break;
- }
- if (!$hasRequiredScheme) {
- $allowSchemes += $requiredSchemes;
- break;
- }
-
- return $ret;
- }
-
- if (39 === $m) {
- break;
- }
- $regex = substr_replace($regex, 'F', $m - $offset, 1 + strlen($m));
- $offset += strlen($m);
- }
- }
- if ('/' === $pathinfo && !$allow && !$allowSchemes) {
- throw new Symfony\Component\Routing\Exception\NoConfigurationException();
- }
-
- return null;
}
}
diff --git a/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher6.php b/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher6.php
index 9cebf2d9..3f74b33f 100644
--- a/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher6.php
+++ b/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher6.php
@@ -1,7 +1,6 @@
context = $context;
- }
-
- public function match($rawPathinfo)
- {
- $allow = $allowSchemes = array();
- $pathinfo = rawurldecode($rawPathinfo);
- $context = $this->context;
- $requestMethod = $canonicalMethod = $context->getMethod();
-
- if ('HEAD' === $requestMethod) {
- $canonicalMethod = 'GET';
- }
-
- switch ($pathinfo) {
- default:
- $routes = array(
- '/trailing/simple/no-methods/' => array(array('_route' => 'simple_trailing_slash_no_methods'), null, null, null),
- '/trailing/simple/get-method/' => array(array('_route' => 'simple_trailing_slash_GET_method'), null, array('GET' => 0), null),
- '/trailing/simple/head-method/' => array(array('_route' => 'simple_trailing_slash_HEAD_method'), null, array('HEAD' => 0), null),
- '/trailing/simple/post-method/' => array(array('_route' => 'simple_trailing_slash_POST_method'), null, array('POST' => 0), null),
- '/not-trailing/simple/no-methods' => array(array('_route' => 'simple_not_trailing_slash_no_methods'), null, null, null),
- '/not-trailing/simple/get-method' => array(array('_route' => 'simple_not_trailing_slash_GET_method'), null, array('GET' => 0), null),
- '/not-trailing/simple/head-method' => array(array('_route' => 'simple_not_trailing_slash_HEAD_method'), null, array('HEAD' => 0), null),
- '/not-trailing/simple/post-method' => array(array('_route' => 'simple_not_trailing_slash_POST_method'), null, array('POST' => 0), null),
- );
-
- if (!isset($routes[$pathinfo])) {
- break;
- }
- list($ret, $requiredHost, $requiredMethods, $requiredSchemes) = $routes[$pathinfo];
-
- $hasRequiredScheme = !$requiredSchemes || isset($requiredSchemes[$context->getScheme()]);
- if ($requiredMethods && !isset($requiredMethods[$canonicalMethod]) && !isset($requiredMethods[$requestMethod])) {
- if ($hasRequiredScheme) {
- $allow += $requiredMethods;
- }
- break;
- }
- if (!$hasRequiredScheme) {
- $allowSchemes += $requiredSchemes;
- break;
- }
-
- return $ret;
- }
-
- $matchedPathinfo = $pathinfo;
- $regexList = array(
+ $this->staticRoutes = array(
+ '/trailing/simple/no-methods' => array(array(array('_route' => 'simple_trailing_slash_no_methods'), null, null, null, true, null)),
+ '/trailing/simple/get-method' => array(array(array('_route' => 'simple_trailing_slash_GET_method'), null, array('GET' => 0), null, true, null)),
+ '/trailing/simple/head-method' => array(array(array('_route' => 'simple_trailing_slash_HEAD_method'), null, array('HEAD' => 0), null, true, null)),
+ '/trailing/simple/post-method' => array(array(array('_route' => 'simple_trailing_slash_POST_method'), null, array('POST' => 0), null, true, null)),
+ '/not-trailing/simple/no-methods' => array(array(array('_route' => 'simple_not_trailing_slash_no_methods'), null, null, null, false, null)),
+ '/not-trailing/simple/get-method' => array(array(array('_route' => 'simple_not_trailing_slash_GET_method'), null, array('GET' => 0), null, false, null)),
+ '/not-trailing/simple/head-method' => array(array(array('_route' => 'simple_not_trailing_slash_HEAD_method'), null, array('HEAD' => 0), null, false, null)),
+ '/not-trailing/simple/post-method' => array(array(array('_route' => 'simple_not_trailing_slash_POST_method'), null, array('POST' => 0), null, false, null)),
+ );
+ $this->regexpList = array(
0 => '{^(?'
.'|/trailing/regex/(?'
- .'|no\\-methods/([^/]++)/(*:47)'
- .'|get\\-method/([^/]++)/(*:75)'
- .'|head\\-method/([^/]++)/(*:104)'
- .'|post\\-method/([^/]++)/(*:134)'
+ .'|no\\-methods/([^/]++)(*:46)'
+ .'|get\\-method/([^/]++)(*:73)'
+ .'|head\\-method/([^/]++)(*:101)'
+ .'|post\\-method/([^/]++)(*:130)'
.')'
.'|/not\\-trailing/regex/(?'
- .'|no\\-methods/([^/]++)(*:187)'
- .'|get\\-method/([^/]++)(*:215)'
- .'|head\\-method/([^/]++)(*:244)'
- .'|post\\-method/([^/]++)(*:273)'
+ .'|no\\-methods/([^/]++)(*:183)'
+ .'|get\\-method/([^/]++)(*:211)'
+ .'|head\\-method/([^/]++)(*:240)'
+ .'|post\\-method/([^/]++)(*:269)'
.')'
- .')$}sD',
+ .')(?:/?)$}sD',
+ );
+ $this->dynamicRoutes = array(
+ 46 => array(array(array('_route' => 'regex_trailing_slash_no_methods'), array('param'), null, null, true, null)),
+ 73 => array(array(array('_route' => 'regex_trailing_slash_GET_method'), array('param'), array('GET' => 0), null, true, null)),
+ 101 => array(array(array('_route' => 'regex_trailing_slash_HEAD_method'), array('param'), array('HEAD' => 0), null, true, null)),
+ 130 => array(array(array('_route' => 'regex_trailing_slash_POST_method'), array('param'), array('POST' => 0), null, true, null)),
+ 183 => array(array(array('_route' => 'regex_not_trailing_slash_no_methods'), array('param'), null, null, false, null)),
+ 211 => array(array(array('_route' => 'regex_not_trailing_slash_GET_method'), array('param'), array('GET' => 0), null, false, null)),
+ 240 => array(array(array('_route' => 'regex_not_trailing_slash_HEAD_method'), array('param'), array('HEAD' => 0), null, false, null)),
+ 269 => array(array(array('_route' => 'regex_not_trailing_slash_POST_method'), array('param'), array('POST' => 0), null, false, null)),
);
-
- foreach ($regexList as $offset => $regex) {
- while (preg_match($regex, $matchedPathinfo, $matches)) {
- switch ($m = (int) $matches['MARK']) {
- default:
- $routes = array(
- 47 => array(array('_route' => 'regex_trailing_slash_no_methods'), array('param'), null, null),
- 75 => array(array('_route' => 'regex_trailing_slash_GET_method'), array('param'), array('GET' => 0), null),
- 104 => array(array('_route' => 'regex_trailing_slash_HEAD_method'), array('param'), array('HEAD' => 0), null),
- 134 => array(array('_route' => 'regex_trailing_slash_POST_method'), array('param'), array('POST' => 0), null),
- 187 => array(array('_route' => 'regex_not_trailing_slash_no_methods'), array('param'), null, null),
- 215 => array(array('_route' => 'regex_not_trailing_slash_GET_method'), array('param'), array('GET' => 0), null),
- 244 => array(array('_route' => 'regex_not_trailing_slash_HEAD_method'), array('param'), array('HEAD' => 0), null),
- 273 => array(array('_route' => 'regex_not_trailing_slash_POST_method'), array('param'), array('POST' => 0), null),
- );
-
- list($ret, $vars, $requiredMethods, $requiredSchemes) = $routes[$m];
-
- foreach ($vars as $i => $v) {
- if (isset($matches[1 + $i])) {
- $ret[$v] = $matches[1 + $i];
- }
- }
-
- $hasRequiredScheme = !$requiredSchemes || isset($requiredSchemes[$context->getScheme()]);
- if ($requiredMethods && !isset($requiredMethods[$canonicalMethod]) && !isset($requiredMethods[$requestMethod])) {
- if ($hasRequiredScheme) {
- $allow += $requiredMethods;
- }
- break;
- }
- if (!$hasRequiredScheme) {
- $allowSchemes += $requiredSchemes;
- break;
- }
-
- return $ret;
- }
-
- if (273 === $m) {
- break;
- }
- $regex = substr_replace($regex, 'F', $m - $offset, 1 + strlen($m));
- $offset += strlen($m);
- }
- }
- if ('/' === $pathinfo && !$allow && !$allowSchemes) {
- throw new Symfony\Component\Routing\Exception\NoConfigurationException();
- }
-
- throw $allow ? new MethodNotAllowedException(array_keys($allow)) : new ResourceNotFoundException();
}
}
diff --git a/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher7.php b/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher7.php
index b2b70721..468db6f1 100644
--- a/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher7.php
+++ b/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher7.php
@@ -1,7 +1,6 @@
context = $context;
- }
-
- public function match($pathinfo)
- {
- $allow = $allowSchemes = array();
- if ($ret = $this->doMatch($pathinfo, $allow, $allowSchemes)) {
- return $ret;
- }
- if ($allow) {
- throw new MethodNotAllowedException(array_keys($allow));
- }
- if (!in_array($this->context->getMethod(), array('HEAD', 'GET'), true)) {
- // no-op
- } elseif ($allowSchemes) {
- redirect_scheme:
- $scheme = $this->context->getScheme();
- $this->context->setScheme(key($allowSchemes));
- try {
- if ($ret = $this->doMatch($pathinfo)) {
- return $this->redirect($pathinfo, $ret['_route'], $this->context->getScheme()) + $ret;
- }
- } finally {
- $this->context->setScheme($scheme);
- }
- } elseif ('/' !== $pathinfo) {
- $pathinfo = '/' !== $pathinfo[-1] ? $pathinfo.'/' : substr($pathinfo, 0, -1);
- if ($ret = $this->doMatch($pathinfo, $allow, $allowSchemes)) {
- return $this->redirect($pathinfo, $ret['_route']) + $ret;
- }
- if ($allowSchemes) {
- goto redirect_scheme;
- }
- }
-
- throw new ResourceNotFoundException();
- }
-
- private function doMatch(string $rawPathinfo, array &$allow = array(), array &$allowSchemes = array()): ?array
- {
- $allow = $allowSchemes = array();
- $pathinfo = rawurldecode($rawPathinfo);
- $context = $this->context;
- $requestMethod = $canonicalMethod = $context->getMethod();
-
- if ('HEAD' === $requestMethod) {
- $canonicalMethod = 'GET';
- }
-
- switch ($pathinfo) {
- default:
- $routes = array(
- '/trailing/simple/no-methods/' => array(array('_route' => 'simple_trailing_slash_no_methods'), null, null, null),
- '/trailing/simple/get-method/' => array(array('_route' => 'simple_trailing_slash_GET_method'), null, array('GET' => 0), null),
- '/trailing/simple/head-method/' => array(array('_route' => 'simple_trailing_slash_HEAD_method'), null, array('HEAD' => 0), null),
- '/trailing/simple/post-method/' => array(array('_route' => 'simple_trailing_slash_POST_method'), null, array('POST' => 0), null),
- '/not-trailing/simple/no-methods' => array(array('_route' => 'simple_not_trailing_slash_no_methods'), null, null, null),
- '/not-trailing/simple/get-method' => array(array('_route' => 'simple_not_trailing_slash_GET_method'), null, array('GET' => 0), null),
- '/not-trailing/simple/head-method' => array(array('_route' => 'simple_not_trailing_slash_HEAD_method'), null, array('HEAD' => 0), null),
- '/not-trailing/simple/post-method' => array(array('_route' => 'simple_not_trailing_slash_POST_method'), null, array('POST' => 0), null),
- );
-
- if (!isset($routes[$pathinfo])) {
- break;
- }
- list($ret, $requiredHost, $requiredMethods, $requiredSchemes) = $routes[$pathinfo];
-
- $hasRequiredScheme = !$requiredSchemes || isset($requiredSchemes[$context->getScheme()]);
- if ($requiredMethods && !isset($requiredMethods[$canonicalMethod]) && !isset($requiredMethods[$requestMethod])) {
- if ($hasRequiredScheme) {
- $allow += $requiredMethods;
- }
- break;
- }
- if (!$hasRequiredScheme) {
- $allowSchemes += $requiredSchemes;
- break;
- }
-
- return $ret;
- }
-
- $matchedPathinfo = $pathinfo;
- $regexList = array(
+ $this->staticRoutes = array(
+ '/trailing/simple/no-methods' => array(array(array('_route' => 'simple_trailing_slash_no_methods'), null, null, null, true, null)),
+ '/trailing/simple/get-method' => array(array(array('_route' => 'simple_trailing_slash_GET_method'), null, array('GET' => 0), null, true, null)),
+ '/trailing/simple/head-method' => array(array(array('_route' => 'simple_trailing_slash_HEAD_method'), null, array('HEAD' => 0), null, true, null)),
+ '/trailing/simple/post-method' => array(array(array('_route' => 'simple_trailing_slash_POST_method'), null, array('POST' => 0), null, true, null)),
+ '/not-trailing/simple/no-methods' => array(array(array('_route' => 'simple_not_trailing_slash_no_methods'), null, null, null, false, null)),
+ '/not-trailing/simple/get-method' => array(array(array('_route' => 'simple_not_trailing_slash_GET_method'), null, array('GET' => 0), null, false, null)),
+ '/not-trailing/simple/head-method' => array(array(array('_route' => 'simple_not_trailing_slash_HEAD_method'), null, array('HEAD' => 0), null, false, null)),
+ '/not-trailing/simple/post-method' => array(array(array('_route' => 'simple_not_trailing_slash_POST_method'), null, array('POST' => 0), null, false, null)),
+ );
+ $this->regexpList = array(
0 => '{^(?'
.'|/trailing/regex/(?'
- .'|no\\-methods/([^/]++)/(*:47)'
- .'|get\\-method/([^/]++)/(*:75)'
- .'|head\\-method/([^/]++)/(*:104)'
- .'|post\\-method/([^/]++)/(*:134)'
+ .'|no\\-methods/([^/]++)(*:46)'
+ .'|get\\-method/([^/]++)(*:73)'
+ .'|head\\-method/([^/]++)(*:101)'
+ .'|post\\-method/([^/]++)(*:130)'
.')'
.'|/not\\-trailing/regex/(?'
- .'|no\\-methods/([^/]++)(*:187)'
- .'|get\\-method/([^/]++)(*:215)'
- .'|head\\-method/([^/]++)(*:244)'
- .'|post\\-method/([^/]++)(*:273)'
+ .'|no\\-methods/([^/]++)(*:183)'
+ .'|get\\-method/([^/]++)(*:211)'
+ .'|head\\-method/([^/]++)(*:240)'
+ .'|post\\-method/([^/]++)(*:269)'
.')'
- .')$}sD',
+ .')(?:/?)$}sD',
+ );
+ $this->dynamicRoutes = array(
+ 46 => array(array(array('_route' => 'regex_trailing_slash_no_methods'), array('param'), null, null, true, null)),
+ 73 => array(array(array('_route' => 'regex_trailing_slash_GET_method'), array('param'), array('GET' => 0), null, true, null)),
+ 101 => array(array(array('_route' => 'regex_trailing_slash_HEAD_method'), array('param'), array('HEAD' => 0), null, true, null)),
+ 130 => array(array(array('_route' => 'regex_trailing_slash_POST_method'), array('param'), array('POST' => 0), null, true, null)),
+ 183 => array(array(array('_route' => 'regex_not_trailing_slash_no_methods'), array('param'), null, null, false, null)),
+ 211 => array(array(array('_route' => 'regex_not_trailing_slash_GET_method'), array('param'), array('GET' => 0), null, false, null)),
+ 240 => array(array(array('_route' => 'regex_not_trailing_slash_HEAD_method'), array('param'), array('HEAD' => 0), null, false, null)),
+ 269 => array(array(array('_route' => 'regex_not_trailing_slash_POST_method'), array('param'), array('POST' => 0), null, false, null)),
);
-
- foreach ($regexList as $offset => $regex) {
- while (preg_match($regex, $matchedPathinfo, $matches)) {
- switch ($m = (int) $matches['MARK']) {
- default:
- $routes = array(
- 47 => array(array('_route' => 'regex_trailing_slash_no_methods'), array('param'), null, null),
- 75 => array(array('_route' => 'regex_trailing_slash_GET_method'), array('param'), array('GET' => 0), null),
- 104 => array(array('_route' => 'regex_trailing_slash_HEAD_method'), array('param'), array('HEAD' => 0), null),
- 134 => array(array('_route' => 'regex_trailing_slash_POST_method'), array('param'), array('POST' => 0), null),
- 187 => array(array('_route' => 'regex_not_trailing_slash_no_methods'), array('param'), null, null),
- 215 => array(array('_route' => 'regex_not_trailing_slash_GET_method'), array('param'), array('GET' => 0), null),
- 244 => array(array('_route' => 'regex_not_trailing_slash_HEAD_method'), array('param'), array('HEAD' => 0), null),
- 273 => array(array('_route' => 'regex_not_trailing_slash_POST_method'), array('param'), array('POST' => 0), null),
- );
-
- list($ret, $vars, $requiredMethods, $requiredSchemes) = $routes[$m];
-
- foreach ($vars as $i => $v) {
- if (isset($matches[1 + $i])) {
- $ret[$v] = $matches[1 + $i];
- }
- }
-
- $hasRequiredScheme = !$requiredSchemes || isset($requiredSchemes[$context->getScheme()]);
- if ($requiredMethods && !isset($requiredMethods[$canonicalMethod]) && !isset($requiredMethods[$requestMethod])) {
- if ($hasRequiredScheme) {
- $allow += $requiredMethods;
- }
- break;
- }
- if (!$hasRequiredScheme) {
- $allowSchemes += $requiredSchemes;
- break;
- }
-
- return $ret;
- }
-
- if (273 === $m) {
- break;
- }
- $regex = substr_replace($regex, 'F', $m - $offset, 1 + strlen($m));
- $offset += strlen($m);
- }
- }
- if ('/' === $pathinfo && !$allow && !$allowSchemes) {
- throw new Symfony\Component\Routing\Exception\NoConfigurationException();
- }
-
- return null;
}
}
diff --git a/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher8.php b/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher8.php
index 38bbfa22..9068923a 100644
--- a/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher8.php
+++ b/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher8.php
@@ -1,7 +1,6 @@
context = $context;
- }
-
- public function match($rawPathinfo)
- {
- $allow = $allowSchemes = array();
- $pathinfo = rawurldecode($rawPathinfo);
- $context = $this->context;
- $requestMethod = $canonicalMethod = $context->getMethod();
-
- if ('HEAD' === $requestMethod) {
- $canonicalMethod = 'GET';
- }
-
- $matchedPathinfo = $pathinfo;
- $regexList = array(
+ $this->regexpList = array(
0 => '{^(?'
.'|/(a)(*:11)'
- .')$}sD',
+ .')(?:/?)$}sD',
11 => '{^(?'
.'|/(.)(*:22)'
- .')$}sDu',
+ .')(?:/?)$}sDu',
22 => '{^(?'
.'|/(.)(*:33)'
- .')$}sD',
+ .')(?:/?)$}sD',
+ );
+ $this->dynamicRoutes = array(
+ 11 => array(array(array('_route' => 'a'), array('a'), null, null, false, null)),
+ 22 => array(array(array('_route' => 'b'), array('a'), null, null, false, null)),
+ 33 => array(array(array('_route' => 'c'), array('a'), null, null, false, null)),
);
-
- foreach ($regexList as $offset => $regex) {
- while (preg_match($regex, $matchedPathinfo, $matches)) {
- switch ($m = (int) $matches['MARK']) {
- default:
- $routes = array(
- 11 => array(array('_route' => 'a'), array('a'), null, null),
- 22 => array(array('_route' => 'b'), array('a'), null, null),
- 33 => array(array('_route' => 'c'), array('a'), null, null),
- );
-
- list($ret, $vars, $requiredMethods, $requiredSchemes) = $routes[$m];
-
- foreach ($vars as $i => $v) {
- if (isset($matches[1 + $i])) {
- $ret[$v] = $matches[1 + $i];
- }
- }
-
- $hasRequiredScheme = !$requiredSchemes || isset($requiredSchemes[$context->getScheme()]);
- if ($requiredMethods && !isset($requiredMethods[$canonicalMethod]) && !isset($requiredMethods[$requestMethod])) {
- if ($hasRequiredScheme) {
- $allow += $requiredMethods;
- }
- break;
- }
- if (!$hasRequiredScheme) {
- $allowSchemes += $requiredSchemes;
- break;
- }
-
- return $ret;
- }
-
- if (33 === $m) {
- break;
- }
- $regex = substr_replace($regex, 'F', $m - $offset, 1 + strlen($m));
- $offset += strlen($m);
- }
- }
- if ('/' === $pathinfo && !$allow && !$allowSchemes) {
- throw new Symfony\Component\Routing\Exception\NoConfigurationException();
- }
-
- throw $allow ? new MethodNotAllowedException(array_keys($allow)) : new ResourceNotFoundException();
}
}
diff --git a/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher9.php b/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher9.php
index cfcd1d44..8684b595 100644
--- a/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher9.php
+++ b/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher9.php
@@ -1,7 +1,6 @@
context = $context;
- }
-
- public function match($rawPathinfo)
- {
- $allow = $allowSchemes = array();
- $pathinfo = rawurldecode($rawPathinfo);
- $context = $this->context;
- $requestMethod = $canonicalMethod = $context->getMethod();
- $host = strtolower($context->getHost());
-
- if ('HEAD' === $requestMethod) {
- $canonicalMethod = 'GET';
- }
-
- switch ($pathinfo) {
- case '/':
- // a
- if (preg_match('#^(?P[^\\.]++)\\.e\\.c\\.b\\.a$#sDi', $host, $hostMatches)) {
- return $this->mergeDefaults(array('_route' => 'a') + $hostMatches, array());
- }
- // c
- if (preg_match('#^(?P[^\\.]++)\\.e\\.c\\.b\\.a$#sDi', $host, $hostMatches)) {
- return $this->mergeDefaults(array('_route' => 'c') + $hostMatches, array());
- }
- // b
- if ('d.c.b.a' === $host) {
- return array('_route' => 'b');
- }
- break;
- }
-
- if ('/' === $pathinfo && !$allow && !$allowSchemes) {
- throw new Symfony\Component\Routing\Exception\NoConfigurationException();
- }
-
- throw $allow ? new MethodNotAllowedException(array_keys($allow)) : new ResourceNotFoundException();
+ $this->matchHost = true;
+ $this->staticRoutes = array(
+ '/' => array(
+ array(array('_route' => 'a'), '#^(?P[^\\.]++)\\.e\\.c\\.b\\.a$#sDi', null, null, false, null),
+ array(array('_route' => 'c'), '#^(?P[^\\.]++)\\.e\\.c\\.b\\.a$#sDi', null, null, false, null),
+ array(array('_route' => 'b'), 'd.c.b.a', null, null, false, null),
+ ),
+ );
}
}
diff --git a/vendor/symfony/routing/Tests/Fixtures/requirements_without_placeholder_name.yml b/vendor/symfony/routing/Tests/Fixtures/requirements_without_placeholder_name.yml
new file mode 100644
index 00000000..be8f04dd
--- /dev/null
+++ b/vendor/symfony/routing/Tests/Fixtures/requirements_without_placeholder_name.yml
@@ -0,0 +1,4 @@
+foo:
+ path: '/{foo}'
+ requirements:
+ - '\d+'
diff --git a/vendor/symfony/routing/Tests/Generator/Dumper/PhpGeneratorDumperTest.php b/vendor/symfony/routing/Tests/Generator/Dumper/PhpGeneratorDumperTest.php
index dcfb2304..45464c3a 100644
--- a/vendor/symfony/routing/Tests/Generator/Dumper/PhpGeneratorDumperTest.php
+++ b/vendor/symfony/routing/Tests/Generator/Dumper/PhpGeneratorDumperTest.php
@@ -84,19 +84,20 @@ class PhpGeneratorDumperTest extends TestCase
$this->assertEquals('/app.php/testing2', $relativeUrlWithoutParameter);
}
- public function testDumpWithLocalizedRoutes()
+ public function testDumpWithSimpleLocalizedRoutes()
{
+ $this->routeCollection->add('test', (new Route('/foo')));
$this->routeCollection->add('test.en', (new Route('/testing/is/fun'))->setDefault('_locale', 'en')->setDefault('_canonical_route', 'test'));
$this->routeCollection->add('test.nl', (new Route('/testen/is/leuk'))->setDefault('_locale', 'nl')->setDefault('_canonical_route', 'test'));
$code = $this->generatorDumper->dump(array(
- 'class' => 'LocalizedProjectUrlGenerator',
+ 'class' => 'SimpleLocalizedProjectUrlGenerator',
));
file_put_contents($this->testTmpFilepath, $code);
include $this->testTmpFilepath;
$context = new RequestContext('/app.php');
- $projectUrlGenerator = new \LocalizedProjectUrlGenerator($context, null, 'en');
+ $projectUrlGenerator = new \SimpleLocalizedProjectUrlGenerator($context, null, 'en');
$urlWithDefaultLocale = $projectUrlGenerator->generate('test');
$urlWithSpecifiedLocale = $projectUrlGenerator->generate('test', array('_locale' => 'nl'));
@@ -109,6 +110,57 @@ class PhpGeneratorDumperTest extends TestCase
$this->assertEquals('/app.php/testen/is/leuk', $urlWithSpecifiedLocale);
$this->assertEquals('/app.php/testing/is/fun', $urlWithEnglishContext);
$this->assertEquals('/app.php/testen/is/leuk', $urlWithDutchContext);
+
+ // test with full route name
+ $this->assertEquals('/app.php/testing/is/fun', $projectUrlGenerator->generate('test.en'));
+
+ $context->setParameter('_locale', 'de_DE');
+ // test that it fall backs to another route when there is no matching localized route
+ $this->assertEquals('/app.php/foo', $projectUrlGenerator->generate('test'));
+ }
+
+ /**
+ * @expectedException \Symfony\Component\Routing\Exception\RouteNotFoundException
+ * @expectedExceptionMessage Unable to generate a URL for the named route "test" as such route does not exist.
+ */
+ public function testDumpWithRouteNotFoundLocalizedRoutes()
+ {
+ $this->routeCollection->add('test.en', (new Route('/testing/is/fun'))->setDefault('_locale', 'en')->setDefault('_canonical_route', 'test'));
+
+ $code = $this->generatorDumper->dump(array(
+ 'class' => 'RouteNotFoundLocalizedProjectUrlGenerator',
+ ));
+ file_put_contents($this->testTmpFilepath, $code);
+ include $this->testTmpFilepath;
+
+ $projectUrlGenerator = new \RouteNotFoundLocalizedProjectUrlGenerator(new RequestContext('/app.php'), null, 'pl_PL');
+ $projectUrlGenerator->generate('test');
+ }
+
+ public function testDumpWithFallbackLocaleLocalizedRoutes()
+ {
+ $this->routeCollection->add('test.en', (new Route('/testing/is/fun'))->setDefault('_canonical_route', 'test'));
+ $this->routeCollection->add('test.nl', (new Route('/testen/is/leuk'))->setDefault('_canonical_route', 'test'));
+ $this->routeCollection->add('test.fr', (new Route('/tester/est/amusant'))->setDefault('_canonical_route', 'test'));
+
+ $code = $this->generatorDumper->dump(array(
+ 'class' => 'FallbackLocaleLocalizedProjectUrlGenerator',
+ ));
+ file_put_contents($this->testTmpFilepath, $code);
+ include $this->testTmpFilepath;
+
+ $context = new RequestContext('/app.php');
+ $context->setParameter('_locale', 'en_GB');
+ $projectUrlGenerator = new \FallbackLocaleLocalizedProjectUrlGenerator($context, null, null);
+
+ // test with context _locale
+ $this->assertEquals('/app.php/testing/is/fun', $projectUrlGenerator->generate('test'));
+ // test with parameters _locale
+ $this->assertEquals('/app.php/testen/is/leuk', $projectUrlGenerator->generate('test', array('_locale' => 'nl_BE')));
+
+ $projectUrlGenerator = new \FallbackLocaleLocalizedProjectUrlGenerator(new RequestContext('/app.php'), null, 'fr_CA');
+ // test with default locale
+ $this->assertEquals('/app.php/tester/est/amusant', $projectUrlGenerator->generate('test'));
}
public function testDumpWithTooManyRoutes()
diff --git a/vendor/symfony/routing/Tests/Loader/AnnotationClassLoaderTest.php b/vendor/symfony/routing/Tests/Loader/AnnotationClassLoaderTest.php
index dd9af9db..cacce677 100644
--- a/vendor/symfony/routing/Tests/Loader/AnnotationClassLoaderTest.php
+++ b/vendor/symfony/routing/Tests/Loader/AnnotationClassLoaderTest.php
@@ -33,6 +33,7 @@ use Symfony\Component\Routing\Tests\Fixtures\AnnotationFixtures\MissingRouteName
use Symfony\Component\Routing\Tests\Fixtures\AnnotationFixtures\NothingButNameController;
use Symfony\Component\Routing\Tests\Fixtures\AnnotationFixtures\PrefixedActionLocalizedRouteController;
use Symfony\Component\Routing\Tests\Fixtures\AnnotationFixtures\PrefixedActionPathController;
+use Symfony\Component\Routing\Tests\Fixtures\AnnotationFixtures\RequirementsWithoutPlaceholderNameController;
use Symfony\Component\Routing\Tests\Fixtures\AnnotationFixtures\RouteWithPrefixController;
class AnnotationClassLoaderTest extends AbstractAnnotationLoaderTest
@@ -87,11 +88,25 @@ class AnnotationClassLoaderTest extends AbstractAnnotationLoaderTest
$this->assertEquals('/path', $routes->get('action')->getPath());
}
+ /**
+ * @group legacy
+ * @expectedDeprecation A placeholder name must be a string (0 given). Did you forget to specify the placeholder key for the requirement "foo" in "Symfony\Component\Routing\Tests\Fixtures\AnnotationFixtures\RequirementsWithoutPlaceholderNameController"?
+ * @expectedDeprecation A placeholder name must be a string (1 given). Did you forget to specify the placeholder key for the requirement "\d+" in "Symfony\Component\Routing\Tests\Fixtures\AnnotationFixtures\RequirementsWithoutPlaceholderNameController"?
+ * @expectedDeprecation A placeholder name must be a string (0 given). Did you forget to specify the placeholder key for the requirement "foo" of route "foo" in "Symfony\Component\Routing\Tests\Fixtures\AnnotationFixtures\RequirementsWithoutPlaceholderNameController::foo()"?
+ * @expectedDeprecation A placeholder name must be a string (1 given). Did you forget to specify the placeholder key for the requirement "\d+" of route "foo" in "Symfony\Component\Routing\Tests\Fixtures\AnnotationFixtures\RequirementsWithoutPlaceholderNameController::foo()"?
+ */
+ public function testRequirementsWithoutPlaceholderName()
+ {
+ $this->loader->load(RequirementsWithoutPlaceholderNameController::class);
+ }
+
public function testInvokableControllerLoader()
{
$routes = $this->loader->load(InvokableController::class);
$this->assertCount(1, $routes);
$this->assertEquals('/here', $routes->get('lol')->getPath());
+ $this->assertEquals(array('GET', 'POST'), $routes->get('lol')->getMethods());
+ $this->assertEquals(array('https'), $routes->get('lol')->getSchemes());
}
public function testInvokableLocalizedControllerLoading()
@@ -134,7 +149,7 @@ class AnnotationClassLoaderTest extends AbstractAnnotationLoaderTest
$this->assertEquals('/the/path', $routes->get('post')->getPath());
}
- public function testLocalizedMethodActionControllers()
+ public function testInvokableClassRouteLoadWithMethodAnnotation()
{
$routes = $this->loader->load(LocalizedMethodActionControllers::class);
$this->assertCount(4, $routes);
diff --git a/vendor/symfony/routing/Tests/Loader/YamlFileLoaderTest.php b/vendor/symfony/routing/Tests/Loader/YamlFileLoaderTest.php
index 41f87bb5..26a72e33 100644
--- a/vendor/symfony/routing/Tests/Loader/YamlFileLoaderTest.php
+++ b/vendor/symfony/routing/Tests/Loader/YamlFileLoaderTest.php
@@ -304,4 +304,14 @@ class YamlFileLoaderTest extends TestCase
$this->assertEquals('/slash/', $routeCollection->get('a_app_homepage')->getPath());
$this->assertEquals('/no-slash', $routeCollection->get('b_app_homepage')->getPath());
}
+
+ /**
+ * @group legacy
+ * @expectedDeprecation A placeholder name must be a string (0 given). Did you forget to specify the placeholder key for the requirement "\d+" of route "foo" in "%srequirements_without_placeholder_name.yml"?
+ */
+ public function testRequirementsWithoutPlaceholderName()
+ {
+ $loader = new YamlFileLoader(new FileLocator(array(__DIR__.'/../Fixtures')));
+ $loader->load('requirements_without_placeholder_name.yml');
+ }
}
diff --git a/vendor/symfony/routing/Tests/Matcher/Dumper/PhpMatcherDumperTest.php b/vendor/symfony/routing/Tests/Matcher/Dumper/PhpMatcherDumperTest.php
index 166129cc..a5cb0435 100644
--- a/vendor/symfony/routing/Tests/Matcher/Dumper/PhpMatcherDumperTest.php
+++ b/vendor/symfony/routing/Tests/Matcher/Dumper/PhpMatcherDumperTest.php
@@ -472,9 +472,6 @@ class PhpMatcherDumperTest extends TestCase
);
}
- /**
- * @param $dumper
- */
private function generateDumpedMatcher(RouteCollection $collection, $redirectableStub = false)
{
$options = array('class' => $this->matcherClass);
diff --git a/vendor/symfony/routing/Tests/Matcher/RedirectableUrlMatcherTest.php b/vendor/symfony/routing/Tests/Matcher/RedirectableUrlMatcherTest.php
index e3679622..f1d6b532 100644
--- a/vendor/symfony/routing/Tests/Matcher/RedirectableUrlMatcherTest.php
+++ b/vendor/symfony/routing/Tests/Matcher/RedirectableUrlMatcherTest.php
@@ -141,6 +141,25 @@ class RedirectableUrlMatcherTest extends UrlMatcherTest
$this->assertSame(array('_route' => 'foo'), $matcher->match('/foo'));
}
+ public function testFallbackPage()
+ {
+ $coll = new RouteCollection();
+ $coll->add('foo', new Route('/foo/'));
+ $coll->add('bar', new Route('/{name}'));
+
+ $matcher = $this->getUrlMatcher($coll);
+ $matcher->expects($this->once())->method('redirect')->with('/foo/', 'foo')->will($this->returnValue(array('_route' => 'foo')));
+ $this->assertSame(array('_route' => 'foo'), $matcher->match('/foo'));
+
+ $coll = new RouteCollection();
+ $coll->add('foo', new Route('/foo'));
+ $coll->add('bar', new Route('/{name}/'));
+
+ $matcher = $this->getUrlMatcher($coll);
+ $matcher->expects($this->once())->method('redirect')->with('/foo', 'foo')->will($this->returnValue(array('_route' => 'foo')));
+ $this->assertSame(array('_route' => 'foo'), $matcher->match('/foo/'));
+ }
+
public function testMissingTrailingSlashAndScheme()
{
$coll = new RouteCollection();
@@ -151,6 +170,23 @@ class RedirectableUrlMatcherTest extends UrlMatcherTest
$matcher->match('/foo');
}
+ public function testSlashAndVerbPrecedenceWithRedirection()
+ {
+ $coll = new RouteCollection();
+ $coll->add('a', new Route('/api/customers/{customerId}/contactpersons', array(), array(), array(), '', array(), array('post')));
+ $coll->add('b', new Route('/api/customers/{customerId}/contactpersons/', array(), array(), array(), '', array(), array('get')));
+
+ $matcher = $this->getUrlMatcher($coll);
+ $expected = array(
+ '_route' => 'b',
+ 'customerId' => '123',
+ );
+ $this->assertEquals($expected, $matcher->match('/api/customers/123/contactpersons/'));
+
+ $matcher->expects($this->once())->method('redirect')->with('/api/customers/123/contactpersons/')->willReturn(array());
+ $this->assertEquals($expected, $matcher->match('/api/customers/123/contactpersons'));
+ }
+
protected function getUrlMatcher(RouteCollection $routes, RequestContext $context = null)
{
return $this->getMockForAbstractClass('Symfony\Component\Routing\Matcher\RedirectableUrlMatcher', array($routes, $context ?: new RequestContext()));
diff --git a/vendor/symfony/routing/Tests/Matcher/UrlMatcherTest.php b/vendor/symfony/routing/Tests/Matcher/UrlMatcherTest.php
index c1add962..bcaf3dee 100644
--- a/vendor/symfony/routing/Tests/Matcher/UrlMatcherTest.php
+++ b/vendor/symfony/routing/Tests/Matcher/UrlMatcherTest.php
@@ -455,6 +455,9 @@ class UrlMatcherTest extends TestCase
{
$coll = new RouteCollection();
$route = new Route('/foo/{bar}');
+ $route->setCondition('request.getBaseUrl() == "/bar"');
+ $coll->add('bar', $route);
+ $route = new Route('/foo/{bar}');
$route->setCondition('request.getBaseUrl() == "/sub/front.php" and request.getPathInfo() == "/foo/bar"');
$coll->add('foo', $route);
$matcher = $this->getUrlMatcher($coll, new RequestContext('/sub/front.php'));
@@ -680,6 +683,59 @@ class UrlMatcherTest extends TestCase
$this->assertEquals('b', $matcher->match('/bar/abc.123')['_route']);
}
+ public function testSlashVariant()
+ {
+ $coll = new RouteCollection();
+ $coll->add('a', new Route('/foo/{bar}', array(), array('bar' => '.*')));
+
+ $matcher = $this->getUrlMatcher($coll);
+ $this->assertEquals('a', $matcher->match('/foo/')['_route']);
+ }
+
+ public function testSlashVariant2()
+ {
+ $coll = new RouteCollection();
+ $coll->add('a', new Route('/foo/{bar}/', array(), array('bar' => '.*')));
+
+ $matcher = $this->getUrlMatcher($coll);
+ $this->assertEquals(array('_route' => 'a', 'bar' => 'bar'), $matcher->match('/foo/bar/'));
+ }
+
+ public function testSlashWithVerb()
+ {
+ $coll = new RouteCollection();
+ $coll->add('a', new Route('/{foo}', array(), array(), array(), '', array(), array('put', 'delete')));
+ $coll->add('b', new Route('/bar/'));
+
+ $matcher = $this->getUrlMatcher($coll);
+ $this->assertSame(array('_route' => 'b'), $matcher->match('/bar/'));
+ }
+
+ public function testSlashAndVerbPrecedence()
+ {
+ $coll = new RouteCollection();
+ $coll->add('a', new Route('/api/customers/{customerId}/contactpersons/', array(), array(), array(), '', array(), array('post')));
+ $coll->add('b', new Route('/api/customers/{customerId}/contactpersons', array(), array(), array(), '', array(), array('get')));
+
+ $matcher = $this->getUrlMatcher($coll);
+ $expected = array(
+ '_route' => 'b',
+ 'customerId' => '123',
+ );
+ $this->assertEquals($expected, $matcher->match('/api/customers/123/contactpersons'));
+
+ $coll = new RouteCollection();
+ $coll->add('a', new Route('/api/customers/{customerId}/contactpersons/', array(), array(), array(), '', array(), array('get')));
+ $coll->add('b', new Route('/api/customers/{customerId}/contactpersons', array(), array(), array(), '', array(), array('post')));
+
+ $matcher = $this->getUrlMatcher($coll, new RequestContext('', 'POST'));
+ $expected = array(
+ '_route' => 'b',
+ 'customerId' => '123',
+ );
+ $this->assertEquals($expected, $matcher->match('/api/customers/123/contactpersons'));
+ }
+
protected function getUrlMatcher(RouteCollection $routes, RequestContext $context = null)
{
return new UrlMatcher($routes, $context ?: new RequestContext());
diff --git a/vendor/symfony/routing/composer.json b/vendor/symfony/routing/composer.json
index 052b0e11..be489ee9 100644
--- a/vendor/symfony/routing/composer.json
+++ b/vendor/symfony/routing/composer.json
@@ -19,7 +19,7 @@
"php": "^7.1.3"
},
"require-dev": {
- "symfony/config": "~3.4|~4.0",
+ "symfony/config": "~4.2",
"symfony/http-foundation": "~3.4|~4.0",
"symfony/yaml": "~3.4|~4.0",
"symfony/expression-language": "~3.4|~4.0",
@@ -28,7 +28,7 @@
"psr/log": "~1.0"
},
"conflict": {
- "symfony/config": "<3.4",
+ "symfony/config": "<4.2",
"symfony/dependency-injection": "<3.4",
"symfony/yaml": "<3.4"
},
@@ -49,7 +49,7 @@
"minimum-stability": "dev",
"extra": {
"branch-alias": {
- "dev-master": "4.1-dev"
+ "dev-master": "4.2-dev"
}
}
}
diff --git a/vendor/symfony/routing/phpunit.xml.dist b/vendor/symfony/routing/phpunit.xml.dist
index bcc09595..df742eab 100644
--- a/vendor/symfony/routing/phpunit.xml.dist
+++ b/vendor/symfony/routing/phpunit.xml.dist
@@ -1,7 +1,7 @@
array(),
'obsolete' => array(),
);
+ $intlDomain = $domain.MessageCatalogueInterface::INTL_DOMAIN_SUFFIX;
foreach ($this->source->all($domain) as $id => $message) {
$this->messages[$domain]['all'][$id] = $message;
- $this->result->add(array($id => $message), $domain);
+ $this->result->add(array($id => $message), $this->source->defines($id, $intlDomain) ? $intlDomain : $domain);
if (null !== $keyMetadata = $this->source->getMetadata($id, $domain)) {
$this->result->setMetadata($id, $keyMetadata, $domain);
}
@@ -45,7 +48,7 @@ class MergeOperation extends AbstractOperation
if (!$this->source->has($id, $domain)) {
$this->messages[$domain]['all'][$id] = $message;
$this->messages[$domain]['new'][$id] = $message;
- $this->result->add(array($id => $message), $domain);
+ $this->result->add(array($id => $message), $this->target->defines($id, $intlDomain) ? $intlDomain : $domain);
if (null !== $keyMetadata = $this->target->getMetadata($id, $domain)) {
$this->result->setMetadata($id, $keyMetadata, $domain);
}
diff --git a/vendor/symfony/translation/Catalogue/TargetOperation.php b/vendor/symfony/translation/Catalogue/TargetOperation.php
index f3b0a29d..6264525c 100644
--- a/vendor/symfony/translation/Catalogue/TargetOperation.php
+++ b/vendor/symfony/translation/Catalogue/TargetOperation.php
@@ -11,6 +11,8 @@
namespace Symfony\Component\Translation\Catalogue;
+use Symfony\Component\Translation\MessageCatalogueInterface;
+
/**
* Target operation between two catalogues:
* intersection = source ∩ target = {x: x ∈ source ∧ x ∈ target}
@@ -33,6 +35,7 @@ class TargetOperation extends AbstractOperation
'new' => array(),
'obsolete' => array(),
);
+ $intlDomain = $domain.MessageCatalogueInterface::INTL_DOMAIN_SUFFIX;
// For 'all' messages, the code can't be simplified as ``$this->messages[$domain]['all'] = $target->all($domain);``,
// because doing so will drop messages like {x: x ∈ source ∧ x ∉ target.all ∧ x ∈ target.fallback}
@@ -46,7 +49,7 @@ class TargetOperation extends AbstractOperation
foreach ($this->source->all($domain) as $id => $message) {
if ($this->target->has($id, $domain)) {
$this->messages[$domain]['all'][$id] = $message;
- $this->result->add(array($id => $message), $domain);
+ $this->result->add(array($id => $message), $this->target->defines($id, $intlDomain) ? $intlDomain : $domain);
if (null !== $keyMetadata = $this->source->getMetadata($id, $domain)) {
$this->result->setMetadata($id, $keyMetadata, $domain);
}
@@ -59,7 +62,7 @@ class TargetOperation extends AbstractOperation
if (!$this->source->has($id, $domain)) {
$this->messages[$domain]['all'][$id] = $message;
$this->messages[$domain]['new'][$id] = $message;
- $this->result->add(array($id => $message), $domain);
+ $this->result->add(array($id => $message), $this->target->defines($id, $intlDomain) ? $intlDomain : $domain);
if (null !== $keyMetadata = $this->target->getMetadata($id, $domain)) {
$this->result->setMetadata($id, $keyMetadata, $domain);
}
diff --git a/vendor/symfony/translation/Command/XliffLintCommand.php b/vendor/symfony/translation/Command/XliffLintCommand.php
index 378788f5..67bb7764 100644
--- a/vendor/symfony/translation/Command/XliffLintCommand.php
+++ b/vendor/symfony/translation/Command/XliffLintCommand.php
@@ -13,10 +13,12 @@ namespace Symfony\Component\Translation\Command;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Exception\RuntimeException;
+use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
+use Symfony\Component\Translation\Util\XliffUtils;
/**
* Validates XLIFF files syntax and outputs encountered errors.
@@ -33,13 +35,15 @@ class XliffLintCommand extends Command
private $displayCorrectFiles;
private $directoryIteratorProvider;
private $isReadableProvider;
+ private $requireStrictFileNames;
- public function __construct(string $name = null, callable $directoryIteratorProvider = null, callable $isReadableProvider = null)
+ public function __construct(string $name = null, callable $directoryIteratorProvider = null, callable $isReadableProvider = null, bool $requireStrictFileNames = true)
{
parent::__construct($name);
$this->directoryIteratorProvider = $directoryIteratorProvider;
$this->isReadableProvider = $isReadableProvider;
+ $this->requireStrictFileNames = $requireStrictFileNames;
}
/**
@@ -49,7 +53,7 @@ class XliffLintCommand extends Command
{
$this
->setDescription('Lints a XLIFF file and outputs encountered errors')
- ->addArgument('filename', null, 'A file or a directory or STDIN')
+ ->addArgument('filename', InputArgument::IS_ARRAY, 'A file or a directory or STDIN')
->addOption('format', null, InputOption::VALUE_REQUIRED, 'The output format', 'txt')
->setHelp(<<%command.name% command lints a XLIFF file and outputs to STDOUT
@@ -76,11 +80,11 @@ EOF
protected function execute(InputInterface $input, OutputInterface $output)
{
$io = new SymfonyStyle($input, $output);
- $filename = $input->getArgument('filename');
+ $filenames = (array) $input->getArgument('filename');
$this->format = $input->getOption('format');
$this->displayCorrectFiles = $output->isVerbose();
- if (!$filename) {
+ if (0 === \count($filenames)) {
if (!$stdin = $this->getStdin()) {
throw new RuntimeException('Please provide a filename or pipe file content to STDIN.');
}
@@ -88,13 +92,15 @@ EOF
return $this->display($io, array($this->validate($stdin)));
}
- if (!$this->isReadable($filename)) {
- throw new RuntimeException(sprintf('File or directory "%s" is not readable.', $filename));
- }
-
$filesInfo = array();
- foreach ($this->getFiles($filename) as $file) {
- $filesInfo[] = $this->validate(file_get_contents($file), $file);
+ foreach ($filenames as $filename) {
+ if (!$this->isReadable($filename)) {
+ throw new RuntimeException(sprintf('File or directory "%s" is not readable.', $filename));
+ }
+
+ foreach ($this->getFiles($filename) as $file) {
+ $filesInfo[] = $this->validate(file_get_contents($file), $file);
+ }
}
return $this->display($io, $filesInfo);
@@ -115,30 +121,28 @@ EOF
$document->loadXML($content);
if (null !== $targetLanguage = $this->getTargetLanguageFromFile($document)) {
- $expectedFileExtension = sprintf('%s.xlf', str_replace('-', '_', $targetLanguage));
- $realFileExtension = explode('.', basename($file), 2)[1] ?? '';
+ $normalizedLocale = preg_quote(str_replace('-', '_', $targetLanguage), '/');
+ // strict file names require translation files to be named '____.locale.xlf'
+ // otherwise, both '____.locale.xlf' and 'locale.____.xlf' are allowed
+ $expectedFilenamePattern = $this->requireStrictFileNames ? sprintf('/^.*\.%s\.xlf/', $normalizedLocale) : sprintf('/^(.*\.%s\.xlf|%s\..*\.xlf)/', $normalizedLocale, $normalizedLocale);
- if ($expectedFileExtension !== $realFileExtension) {
+ if (0 === preg_match($expectedFilenamePattern, basename($file))) {
$errors[] = array(
'line' => -1,
'column' => -1,
- 'message' => sprintf('There is a mismatch between the file extension ("%s") and the "%s" value used in the "target-language" attribute of the file.', $realFileExtension, $targetLanguage),
+ 'message' => sprintf('There is a mismatch between the language included in the file name ("%s") and the "%s" value used in the "target-language" attribute of the file.', basename($file), $targetLanguage),
);
}
}
- $document->schemaValidate(__DIR__.'/../Resources/schemas/xliff-core-1.2-strict.xsd');
- foreach (libxml_get_errors() as $xmlError) {
+ foreach (XliffUtils::validateSchema($document) as $xmlError) {
$errors[] = array(
- 'line' => $xmlError->line,
- 'column' => $xmlError->column,
- 'message' => trim($xmlError->message),
+ 'line' => $xmlError['line'],
+ 'column' => $xmlError['column'],
+ 'message' => $xmlError['message'],
);
}
- libxml_clear_errors();
- libxml_use_internal_errors(false);
-
return array('file' => $file, 'valid' => 0 === \count($errors), 'messages' => $errors);
}
diff --git a/vendor/symfony/translation/DataCollector/TranslationDataCollector.php b/vendor/symfony/translation/DataCollector/TranslationDataCollector.php
old mode 100644
new mode 100755
index edd712dd..b2815191
--- a/vendor/symfony/translation/DataCollector/TranslationDataCollector.php
+++ b/vendor/symfony/translation/DataCollector/TranslationDataCollector.php
@@ -97,6 +97,9 @@ class TranslationDataCollector extends DataCollector implements LateDataCollecto
return !empty($this->data['locale']) ? $this->data['locale'] : null;
}
+ /**
+ * @internal since Symfony 4.2
+ */
public function getFallbackLocales()
{
return (isset($this->data['fallback_locales']) && \count($this->data['fallback_locales']) > 0) ? $this->data['fallback_locales'] : array();
diff --git a/vendor/symfony/translation/DataCollectorTranslator.php b/vendor/symfony/translation/DataCollectorTranslator.php
index 5d4d819e..ca6bedc7 100644
--- a/vendor/symfony/translation/DataCollectorTranslator.php
+++ b/vendor/symfony/translation/DataCollectorTranslator.php
@@ -12,11 +12,14 @@
namespace Symfony\Component\Translation;
use Symfony\Component\Translation\Exception\InvalidArgumentException;
+use Symfony\Component\Translation\TranslatorInterface as LegacyTranslatorInterface;
+use Symfony\Contracts\Translation\LocaleAwareInterface;
+use Symfony\Contracts\Translation\TranslatorInterface;
/**
* @author Abdellatif Ait boudad
*/
-class DataCollectorTranslator implements TranslatorInterface, TranslatorBagInterface
+class DataCollectorTranslator implements LegacyTranslatorInterface, TranslatorInterface, TranslatorBagInterface
{
const MESSAGE_DEFINED = 0;
const MESSAGE_MISSING = 1;
@@ -32,10 +35,13 @@ class DataCollectorTranslator implements TranslatorInterface, TranslatorBagInter
/**
* @param TranslatorInterface $translator The translator must implement TranslatorBagInterface
*/
- public function __construct(TranslatorInterface $translator)
+ public function __construct($translator)
{
- if (!$translator instanceof TranslatorBagInterface) {
- throw new InvalidArgumentException(sprintf('The Translator "%s" must implement TranslatorInterface and TranslatorBagInterface.', \get_class($translator)));
+ if (!$translator instanceof LegacyTranslatorInterface && !$translator instanceof TranslatorInterface) {
+ throw new \TypeError(sprintf('Argument 1 passed to %s() must be an instance of %s, %s given.', __METHOD__, TranslatorInterface::class, \is_object($translator) ? \get_class($translator) : \gettype($translator)));
+ }
+ if (!$translator instanceof TranslatorBagInterface || !$translator instanceof LocaleAwareInterface) {
+ throw new InvalidArgumentException(sprintf('The Translator "%s" must implement TranslatorInterface, TranslatorBagInterface and LocaleAwareInterface.', \get_class($translator)));
}
$this->translator = $translator;
@@ -54,11 +60,18 @@ class DataCollectorTranslator implements TranslatorInterface, TranslatorBagInter
/**
* {@inheritdoc}
+ *
+ * @deprecated since Symfony 4.2, use the trans() method instead with a %count% parameter
*/
public function transChoice($id, $number, array $parameters = array(), $domain = null, $locale = null)
{
+ if ($this->translator instanceof TranslatorInterface) {
+ $trans = $this->translator->trans($id, array('%count%' => $number) + $parameters, $domain, $locale);
+ }
+
$trans = $this->translator->transChoice($id, $number, $parameters, $domain, $locale);
- $this->collectMessage($locale, $domain, $id, $trans, $parameters, $number);
+
+ $this->collectMessage($locale, $domain, $id, $trans, array('%count%' => $number) + $parameters);
return $trans;
}
@@ -90,7 +103,7 @@ class DataCollectorTranslator implements TranslatorInterface, TranslatorBagInter
/**
* Gets the fallback locales.
*
- * @return array $locales The fallback locales
+ * @return array The fallback locales
*/
public function getFallbackLocales()
{
@@ -106,7 +119,7 @@ class DataCollectorTranslator implements TranslatorInterface, TranslatorBagInter
*/
public function __call($method, $args)
{
- return \call_user_func_array(array($this->translator, $method), $args);
+ return $this->translator->{$method}(...$args);
}
/**
@@ -123,9 +136,8 @@ class DataCollectorTranslator implements TranslatorInterface, TranslatorBagInter
* @param string $id
* @param string $translation
* @param array|null $parameters
- * @param int|null $number
*/
- private function collectMessage($locale, $domain, $id, $translation, $parameters = array(), $number = null)
+ private function collectMessage($locale, $domain, $id, $translation, $parameters = array())
{
if (null === $domain) {
$domain = 'messages';
@@ -158,8 +170,8 @@ class DataCollectorTranslator implements TranslatorInterface, TranslatorBagInter
'id' => $id,
'translation' => $translation,
'parameters' => $parameters,
- 'transChoiceNumber' => $number,
'state' => $state,
+ 'transChoiceNumber' => isset($parameters['%count%']) && is_numeric($parameters['%count%']) ? $parameters['%count%'] : null,
);
}
}
diff --git a/vendor/symfony/translation/Dumper/FileDumper.php b/vendor/symfony/translation/Dumper/FileDumper.php
index 5b10e452..8afcf608 100644
--- a/vendor/symfony/translation/Dumper/FileDumper.php
+++ b/vendor/symfony/translation/Dumper/FileDumper.php
@@ -45,7 +45,7 @@ abstract class FileDumper implements DumperInterface
/**
* Sets backup flag.
*
- * @param bool
+ * @param bool $backup
*
* @deprecated since Symfony 4.1
*/
@@ -76,7 +76,26 @@ abstract class FileDumper implements DumperInterface
throw new RuntimeException(sprintf('Unable to create directory "%s".', $directory));
}
}
- // save file
+
+ $intlDomain = $domain.MessageCatalogue::INTL_DOMAIN_SUFFIX;
+ $intlMessages = $messages->all($intlDomain);
+
+ if ($intlMessages) {
+ $intlPath = $options['path'].'/'.$this->getRelativePath($intlDomain, $messages->getLocale());
+ file_put_contents($intlPath, $this->formatCatalogue($messages, $intlDomain, $options));
+
+ $messages->replace(array(), $intlDomain);
+
+ try {
+ if ($messages->all($domain)) {
+ file_put_contents($fullpath, $this->formatCatalogue($messages, $domain, $options));
+ }
+ continue;
+ } finally {
+ $messages->replace($intlMessages, $intlDomain);
+ }
+ }
+
file_put_contents($fullpath, $this->formatCatalogue($messages, $domain, $options));
}
}
diff --git a/vendor/symfony/translation/Dumper/JsonFileDumper.php b/vendor/symfony/translation/Dumper/JsonFileDumper.php
index 32bdaf51..a4db4d6a 100644
--- a/vendor/symfony/translation/Dumper/JsonFileDumper.php
+++ b/vendor/symfony/translation/Dumper/JsonFileDumper.php
@@ -25,11 +25,7 @@ class JsonFileDumper extends FileDumper
*/
public function formatCatalogue(MessageCatalogue $messages, $domain, array $options = array())
{
- if (isset($options['json_encoding'])) {
- $flags = $options['json_encoding'];
- } else {
- $flags = JSON_PRETTY_PRINT;
- }
+ $flags = $options['json_encoding'] ?? JSON_PRETTY_PRINT;
return json_encode($messages->all($domain), $flags);
}
diff --git a/vendor/symfony/translation/Exception/ExceptionInterface.php b/vendor/symfony/translation/Exception/ExceptionInterface.php
index c85fb93c..8f9c54ef 100644
--- a/vendor/symfony/translation/Exception/ExceptionInterface.php
+++ b/vendor/symfony/translation/Exception/ExceptionInterface.php
@@ -16,6 +16,6 @@ namespace Symfony\Component\Translation\Exception;
*
* @author Fabien Potencier
*/
-interface ExceptionInterface
+interface ExceptionInterface extends \Throwable
{
}
diff --git a/vendor/symfony/translation/Formatter/ChoiceMessageFormatterInterface.php b/vendor/symfony/translation/Formatter/ChoiceMessageFormatterInterface.php
index 92acbcaf..6bc68384 100644
--- a/vendor/symfony/translation/Formatter/ChoiceMessageFormatterInterface.php
+++ b/vendor/symfony/translation/Formatter/ChoiceMessageFormatterInterface.php
@@ -13,6 +13,8 @@ namespace Symfony\Component\Translation\Formatter;
/**
* @author Abdellatif Ait boudad
+ *
+ * @deprecated since Symfony 4.2, use MessageFormatterInterface::format() with a %count% parameter instead
*/
interface ChoiceMessageFormatterInterface
{
diff --git a/vendor/symfony/translation/Formatter/IntlFormatter.php b/vendor/symfony/translation/Formatter/IntlFormatter.php
new file mode 100644
index 00000000..338d5151
--- /dev/null
+++ b/vendor/symfony/translation/Formatter/IntlFormatter.php
@@ -0,0 +1,55 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Translation\Formatter;
+
+use Symfony\Component\Translation\Exception\InvalidArgumentException;
+use Symfony\Component\Translation\Exception\LogicException;
+
+/**
+ * @author Guilherme Blanco
+ * @author Abdellatif Ait boudad
+ */
+class IntlFormatter implements IntlFormatterInterface
+{
+ private $hasMessageFormatter;
+ private $cache = array();
+
+ /**
+ * {@inheritdoc}
+ */
+ public function formatIntl(string $message, string $locale, array $parameters = array()): string
+ {
+ if (!$formatter = $this->cache[$locale][$message] ?? null) {
+ if (!($this->hasMessageFormatter ?? $this->hasMessageFormatter = class_exists(\MessageFormatter::class))) {
+ throw new LogicException('Cannot parse message translation: please install the "intl" PHP extension or the "symfony/polyfill-intl-messageformatter" package.');
+ }
+ try {
+ $this->cache[$locale][$message] = $formatter = new \MessageFormatter($locale, $message);
+ } catch (\IntlException $e) {
+ throw new InvalidArgumentException(sprintf('Invalid message format (error #%d): %s.', intl_get_error_code(), intl_get_error_message()), 0, $e);
+ }
+ }
+
+ foreach ($parameters as $key => $value) {
+ if (\in_array($key[0] ?? null, array('%', '{'), true)) {
+ unset($parameters[$key]);
+ $parameters[trim($key, '%{ }')] = $value;
+ }
+ }
+
+ if (false === $message = $formatter->format($parameters)) {
+ throw new InvalidArgumentException(sprintf('Unable to format message (error #%s): %s.', $formatter->getErrorCode(), $formatter->getErrorMessage()));
+ }
+
+ return $message;
+ }
+}
diff --git a/vendor/symfony/translation/Formatter/IntlFormatterInterface.php b/vendor/symfony/translation/Formatter/IntlFormatterInterface.php
new file mode 100644
index 00000000..5fc5d97d
--- /dev/null
+++ b/vendor/symfony/translation/Formatter/IntlFormatterInterface.php
@@ -0,0 +1,27 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Translation\Formatter;
+
+/**
+ * Formats ICU message patterns.
+ *
+ * @author Nicolas Grekas
+ */
+interface IntlFormatterInterface
+{
+ /**
+ * Formats a localized message using rules defined by ICU MessageFormat.
+ *
+ * @see http://icu-project.org/apiref/icu4c/classMessageFormat.html#details
+ */
+ public function formatIntl(string $message, string $locale, array $parameters = array()): string;
+}
diff --git a/vendor/symfony/translation/Formatter/MessageFormatter.php b/vendor/symfony/translation/Formatter/MessageFormatter.php
index e174be36..e36f242c 100644
--- a/vendor/symfony/translation/Formatter/MessageFormatter.php
+++ b/vendor/symfony/translation/Formatter/MessageFormatter.php
@@ -11,21 +11,32 @@
namespace Symfony\Component\Translation\Formatter;
+use Symfony\Component\Translation\IdentityTranslator;
use Symfony\Component\Translation\MessageSelector;
+use Symfony\Component\Translation\TranslatorInterface as LegacyTranslatorInterface;
+use Symfony\Contracts\Translation\TranslatorInterface;
/**
* @author Abdellatif Ait boudad
*/
-class MessageFormatter implements MessageFormatterInterface, ChoiceMessageFormatterInterface
+class MessageFormatter implements MessageFormatterInterface, IntlFormatterInterface, ChoiceMessageFormatterInterface
{
- private $selector;
+ private $translator;
+ private $intlFormatter;
/**
- * @param MessageSelector|null $selector The message selector for pluralization
+ * @param TranslatorInterface|null $translator An identity translator to use as selector for pluralization
*/
- public function __construct(MessageSelector $selector = null)
+ public function __construct($translator = null, IntlFormatterInterface $intlFormatter = null)
{
- $this->selector = $selector ?: new MessageSelector();
+ if ($translator instanceof MessageSelector) {
+ $translator = new IdentityTranslator($translator);
+ } elseif (null !== $translator && !$translator instanceof TranslatorInterface && !$translator instanceof LegacyTranslatorInterface) {
+ throw new \TypeError(sprintf('Argument 1 passed to %s() must be an instance of %s, %s given.', __METHOD__, TranslatorInterface::class, \is_object($translator) ? \get_class($translator) : \gettype($translator)));
+ }
+
+ $this->translator = $translator ?? new IdentityTranslator();
+ $this->intlFormatter = $intlFormatter ?? new IntlFormatter();
}
/**
@@ -33,16 +44,36 @@ class MessageFormatter implements MessageFormatterInterface, ChoiceMessageFormat
*/
public function format($message, $locale, array $parameters = array())
{
+ if ($this->translator instanceof TranslatorInterface) {
+ return $this->translator->trans($message, $parameters, null, $locale);
+ }
+
return strtr($message, $parameters);
}
/**
* {@inheritdoc}
*/
+ public function formatIntl(string $message, string $locale, array $parameters = array()): string
+ {
+ return $this->intlFormatter->formatIntl($message, $locale, $parameters);
+ }
+
+ /**
+ * {@inheritdoc}
+ *
+ * @deprecated since Symfony 4.2, use format() with a %count% parameter instead
+ */
public function choiceFormat($message, $number, $locale, array $parameters = array())
{
- $parameters = array_merge(array('%count%' => $number), $parameters);
+ @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.2, use the format() one instead with a %%count%% parameter.', __METHOD__), E_USER_DEPRECATED);
+
+ $parameters = array('%count%' => $number) + $parameters;
+
+ if ($this->translator instanceof TranslatorInterface) {
+ return $this->format($message, $locale, $parameters);
+ }
- return $this->format($this->selector->choose($message, (int) $number, $locale), $locale, $parameters);
+ return $this->format($this->translator->transChoice($message, $number, array(), null, $locale), $locale, $parameters);
}
}
diff --git a/vendor/symfony/translation/IdentityTranslator.php b/vendor/symfony/translation/IdentityTranslator.php
index 82b24701..31abdaab 100644
--- a/vendor/symfony/translation/IdentityTranslator.php
+++ b/vendor/symfony/translation/IdentityTranslator.php
@@ -11,53 +11,51 @@
namespace Symfony\Component\Translation;
+use Symfony\Component\Translation\TranslatorInterface as LegacyTranslatorInterface;
+use Symfony\Contracts\Translation\TranslatorInterface;
+use Symfony\Contracts\Translation\TranslatorTrait;
+
/**
* IdentityTranslator does not translate anything.
*
* @author Fabien Potencier
*/
-class IdentityTranslator implements TranslatorInterface
+class IdentityTranslator implements LegacyTranslatorInterface, TranslatorInterface
{
+ use TranslatorTrait;
+
private $selector;
- private $locale;
/**
* @param MessageSelector|null $selector The message selector for pluralization
*/
public function __construct(MessageSelector $selector = null)
{
- $this->selector = $selector ?: new MessageSelector();
- }
+ $this->selector = $selector;
- /**
- * {@inheritdoc}
- */
- public function setLocale($locale)
- {
- $this->locale = $locale;
+ if (__CLASS__ !== \get_class($this)) {
+ @trigger_error(sprintf('Calling "%s()" is deprecated since Symfony 4.2.'), E_USER_DEPRECATED);
+ }
}
/**
* {@inheritdoc}
+ *
+ * @deprecated since Symfony 4.2, use the trans() method instead with a %count% parameter
*/
- public function getLocale()
+ public function transChoice($id, $number, array $parameters = array(), $domain = null, $locale = null)
{
- return $this->locale ?: \Locale::getDefault();
- }
+ @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.2, use the trans() one instead with a "%count%" parameter.', __METHOD__), E_USER_DEPRECATED);
- /**
- * {@inheritdoc}
- */
- public function trans($id, array $parameters = array(), $domain = null, $locale = null)
- {
- return strtr((string) $id, $parameters);
+ if ($this->selector) {
+ return strtr($this->selector->choose((string) $id, $number, $locale ?: $this->getLocale()), $parameters);
+ }
+
+ return $this->trans($id, array('%count%' => $number) + $parameters, $domain, $locale);
}
- /**
- * {@inheritdoc}
- */
- public function transChoice($id, $number, array $parameters = array(), $domain = null, $locale = null)
+ private function getPluralizationRule(int $number, string $locale): int
{
- return strtr($this->selector->choose((string) $id, (int) $number, $locale ?: $this->getLocale()), $parameters);
+ return PluralizationRules::get($number, $locale, false);
}
}
diff --git a/vendor/symfony/translation/Interval.php b/vendor/symfony/translation/Interval.php
index 9e2cae64..a0e484da 100644
--- a/vendor/symfony/translation/Interval.php
+++ b/vendor/symfony/translation/Interval.php
@@ -11,6 +11,8 @@
namespace Symfony\Component\Translation;
+@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.2, use IdentityTranslator instead.', Interval::class), E_USER_DEPRECATED);
+
use Symfony\Component\Translation\Exception\InvalidArgumentException;
/**
@@ -32,6 +34,7 @@ use Symfony\Component\Translation\Exception\InvalidArgumentException;
* @author Fabien Potencier
*
* @see http://en.wikipedia.org/wiki/Interval_%28mathematics%29#The_ISO_notation
+ * @deprecated since Symfony 4.2, use IdentityTranslator instead
*/
class Interval
{
diff --git a/vendor/symfony/translation/Loader/XliffFileLoader.php b/vendor/symfony/translation/Loader/XliffFileLoader.php
index 9c6b8c9f..1106ec65 100644
--- a/vendor/symfony/translation/Loader/XliffFileLoader.php
+++ b/vendor/symfony/translation/Loader/XliffFileLoader.php
@@ -13,10 +13,10 @@ namespace Symfony\Component\Translation\Loader;
use Symfony\Component\Config\Resource\FileResource;
use Symfony\Component\Config\Util\XmlUtils;
-use Symfony\Component\Translation\Exception\InvalidArgumentException;
use Symfony\Component\Translation\Exception\InvalidResourceException;
use Symfony\Component\Translation\Exception\NotFoundResourceException;
use Symfony\Component\Translation\MessageCatalogue;
+use Symfony\Component\Translation\Util\XliffUtils;
/**
* XliffFileLoader loads translations from XLIFF files.
@@ -56,8 +56,10 @@ class XliffFileLoader implements LoaderInterface
throw new InvalidResourceException(sprintf('Unable to load "%s": %s', $resource, $e->getMessage()), $e->getCode(), $e);
}
- $xliffVersion = $this->getVersionNumber($dom);
- $this->validateSchema($xliffVersion, $dom, $this->getSchema($xliffVersion));
+ $xliffVersion = XliffUtils::getVersionNumber($dom);
+ if ($errors = XliffUtils::validateSchema($dom)) {
+ throw new InvalidResourceException(sprintf('Invalid resource provided: "%s"; Errors: %s', $xliffVersion, XliffUtils::getErrorsAsString($errors)));
+ }
if ('1.2' === $xliffVersion) {
$this->extractXliff1($dom, $catalogue, $domain);
@@ -91,7 +93,7 @@ class XliffFileLoader implements LoaderInterface
$source = isset($attributes['resname']) && $attributes['resname'] ? $attributes['resname'] : $translation->source;
// If the xlf file has another encoding specified, try to convert it because
// simple_xml will always return utf-8 encoded values
- $target = $this->utf8ToCharset((string) (isset($translation->target) ? $translation->target : $source), $encoding);
+ $target = $this->utf8ToCharset((string) (isset($translation->target) ? $translation->target : $translation->source), $encoding);
$catalogue->set((string) $source, $target, $domain);
@@ -169,123 +171,6 @@ class XliffFileLoader implements LoaderInterface
return $content;
}
- /**
- * Validates and parses the given file into a DOMDocument.
- *
- * @throws InvalidResourceException
- */
- private function validateSchema(string $file, \DOMDocument $dom, string $schema)
- {
- $internalErrors = libxml_use_internal_errors(true);
-
- $disableEntities = libxml_disable_entity_loader(false);
-
- if (!@$dom->schemaValidateSource($schema)) {
- libxml_disable_entity_loader($disableEntities);
-
- throw new InvalidResourceException(sprintf('Invalid resource provided: "%s"; Errors: %s', $file, implode("\n", $this->getXmlErrors($internalErrors))));
- }
-
- libxml_disable_entity_loader($disableEntities);
-
- $dom->normalizeDocument();
-
- libxml_clear_errors();
- libxml_use_internal_errors($internalErrors);
- }
-
- private function getSchema($xliffVersion)
- {
- if ('1.2' === $xliffVersion) {
- $schemaSource = file_get_contents(__DIR__.'/schema/dic/xliff-core/xliff-core-1.2-strict.xsd');
- $xmlUri = 'http://www.w3.org/2001/xml.xsd';
- } elseif ('2.0' === $xliffVersion) {
- $schemaSource = file_get_contents(__DIR__.'/schema/dic/xliff-core/xliff-core-2.0.xsd');
- $xmlUri = 'informativeCopiesOf3rdPartySchemas/w3c/xml.xsd';
- } else {
- throw new InvalidArgumentException(sprintf('No support implemented for loading XLIFF version "%s".', $xliffVersion));
- }
-
- return $this->fixXmlLocation($schemaSource, $xmlUri);
- }
-
- /**
- * Internally changes the URI of a dependent xsd to be loaded locally.
- */
- private function fixXmlLocation(string $schemaSource, string $xmlUri): string
- {
- $newPath = str_replace('\\', '/', __DIR__).'/schema/dic/xliff-core/xml.xsd';
- $parts = explode('/', $newPath);
- $locationstart = 'file:///';
- if (0 === stripos($newPath, 'phar://')) {
- $tmpfile = tempnam(sys_get_temp_dir(), 'symfony');
- if ($tmpfile) {
- copy($newPath, $tmpfile);
- $parts = explode('/', str_replace('\\', '/', $tmpfile));
- } else {
- array_shift($parts);
- $locationstart = 'phar:///';
- }
- }
-
- $drive = '\\' === \DIRECTORY_SEPARATOR ? array_shift($parts).'/' : '';
- $newPath = $locationstart.$drive.implode('/', array_map('rawurlencode', $parts));
-
- return str_replace($xmlUri, $newPath, $schemaSource);
- }
-
- /**
- * Returns the XML errors of the internal XML parser.
- */
- private function getXmlErrors(bool $internalErrors): array
- {
- $errors = array();
- foreach (libxml_get_errors() as $error) {
- $errors[] = sprintf('[%s %s] %s (in %s - line %d, column %d)',
- LIBXML_ERR_WARNING == $error->level ? 'WARNING' : 'ERROR',
- $error->code,
- trim($error->message),
- $error->file ?: 'n/a',
- $error->line,
- $error->column
- );
- }
-
- libxml_clear_errors();
- libxml_use_internal_errors($internalErrors);
-
- return $errors;
- }
-
- /**
- * Gets xliff file version based on the root "version" attribute.
- * Defaults to 1.2 for backwards compatibility.
- *
- * @throws InvalidArgumentException
- */
- private function getVersionNumber(\DOMDocument $dom): string
- {
- /** @var \DOMNode $xliff */
- foreach ($dom->getElementsByTagName('xliff') as $xliff) {
- $version = $xliff->attributes->getNamedItem('version');
- if ($version) {
- return $version->nodeValue;
- }
-
- $namespace = $xliff->attributes->getNamedItem('xmlns');
- if ($namespace) {
- if (0 !== substr_compare('urn:oasis:names:tc:xliff:document:', $namespace->nodeValue, 0, 34)) {
- throw new InvalidArgumentException(sprintf('Not a valid XLIFF namespace "%s"', $namespace));
- }
-
- return substr($namespace, 34);
- }
- }
-
- // Falls back to v1.2
- return '1.2';
- }
-
private function parseNotesMetadata(\SimpleXMLElement $noteElement = null, string $encoding = null): array
{
$notes = array();
diff --git a/vendor/symfony/translation/Loader/schema/dic/xliff-core/xliff-core-1.2-strict.xsd b/vendor/symfony/translation/Loader/schema/dic/xliff-core/xliff-core-1.2-strict.xsd
deleted file mode 100644
index 3ce2a8e8..00000000
--- a/vendor/symfony/translation/Loader/schema/dic/xliff-core/xliff-core-1.2-strict.xsd
+++ /dev/null
@@ -1,2223 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Values for the attribute 'context-type'.
-
-
-
-
- Indicates a database content.
-
-
-
-
- Indicates the content of an element within an XML document.
-
-
-
-
- Indicates the name of an element within an XML document.
-
-
-
-
- Indicates the line number from the sourcefile (see context-type="sourcefile") where the <source> is found.
-
-
-
-
- Indicates a the number of parameters contained within the <source>.
-
-
-
-
- Indicates notes pertaining to the parameters in the <source>.
-
-
-
-
- Indicates the content of a record within a database.
-
-
-
-
- Indicates the name of a record within a database.
-
-
-
-
- Indicates the original source file in the case that multiple files are merged to form the original file from which the XLIFF file is created. This differs from the original <file> attribute in that this sourcefile is one of many that make up that file.
-
-
-
-
-
-
- Values for the attribute 'count-type'.
-
-
-
-
- Indicates the count units are items that are used X times in a certain context; example: this is a reusable text unit which is used 42 times in other texts.
-
-
-
-
- Indicates the count units are translation units existing already in the same document.
-
-
-
-
- Indicates a total count.
-
-
-
-
-
-
- Values for the attribute 'ctype' when used other elements than <ph> or <x>.
-
-
-
-
- Indicates a run of bolded text.
-
-
-
-
- Indicates a run of text in italics.
-
-
-
-
- Indicates a run of underlined text.
-
-
-
-
- Indicates a run of hyper-text.
-
-
-
-
-
-
- Values for the attribute 'ctype' when used with <ph> or <x>.
-
-
-
-
- Indicates a inline image.
-
-
-
-
- Indicates a page break.
-
-
-
-
- Indicates a line break.
-
-
-
-
-
-
-
-
-
-
-
- Values for the attribute 'datatype'.
-
-
-
-
- Indicates Active Server Page data.
-
-
-
-
- Indicates C source file data.
-
-
-
-
- Indicates Channel Definition Format (CDF) data.
-
-
-
-
- Indicates ColdFusion data.
-
-
-
-
- Indicates C++ source file data.
-
-
-
-
- Indicates C-Sharp data.
-
-
-
-
- Indicates strings from C, ASM, and driver files data.
-
-
-
-
- Indicates comma-separated values data.
-
-
-
-
- Indicates database data.
-
-
-
-
- Indicates portions of document that follows data and contains metadata.
-
-
-
-
- Indicates portions of document that precedes data and contains metadata.
-
-
-
-
- Indicates data from standard UI file operations dialogs (e.g., Open, Save, Save As, Export, Import).
-
-
-
-
- Indicates standard user input screen data.
-
-
-
-
- Indicates HyperText Markup Language (HTML) data - document instance.
-
-
-
-
- Indicates content within an HTML document’s <body> element.
-
-
-
-
- Indicates Windows INI file data.
-
-
-
-
- Indicates Interleaf data.
-
-
-
-
- Indicates Java source file data (extension '.java').
-
-
-
-
- Indicates Java property resource bundle data.
-
-
-
-
- Indicates Java list resource bundle data.
-
-
-
-
- Indicates JavaScript source file data.
-
-
-
-
- Indicates JScript source file data.
-
-
-
-
- Indicates information relating to formatting.
-
-
-
-
- Indicates LISP source file data.
-
-
-
-
- Indicates information relating to margin formats.
-
-
-
-
- Indicates a file containing menu.
-
-
-
-
- Indicates numerically identified string table.
-
-
-
-
- Indicates Maker Interchange Format (MIF) data.
-
-
-
-
- Indicates that the datatype attribute value is a MIME Type value and is defined in the mime-type attribute.
-
-
-
-
- Indicates GNU Machine Object data.
-
-
-
-
- Indicates Message Librarian strings created by Novell's Message Librarian Tool.
-
-
-
-
- Indicates information to be displayed at the bottom of each page of a document.
-
-
-
-
- Indicates information to be displayed at the top of each page of a document.
-
-
-
-
- Indicates a list of property values (e.g., settings within INI files or preferences dialog).
-
-
-
-
- Indicates Pascal source file data.
-
-
-
-
- Indicates Hypertext Preprocessor data.
-
-
-
-
- Indicates plain text file (no formatting other than, possibly, wrapping).
-
-
-
-
- Indicates GNU Portable Object file.
-
-
-
-
- Indicates dynamically generated user defined document. e.g. Oracle Report, Crystal Report, etc.
-
-
-
-
- Indicates Windows .NET binary resources.
-
-
-
-
- Indicates Windows .NET Resources.
-
-
-
-
- Indicates Rich Text Format (RTF) data.
-
-
-
-
- Indicates Standard Generalized Markup Language (SGML) data - document instance.
-
-
-
-
- Indicates Standard Generalized Markup Language (SGML) data - Document Type Definition (DTD).
-
-
-
-
- Indicates Scalable Vector Graphic (SVG) data.
-
-
-
-
- Indicates VisualBasic Script source file.
-
-
-
-
- Indicates warning message.
-
-
-
-
- Indicates Windows (Win32) resources (i.e. resources extracted from an RC script, a message file, or a compiled file).
-
-
-
-
- Indicates Extensible HyperText Markup Language (XHTML) data - document instance.
-
-
-
-
- Indicates Extensible Markup Language (XML) data - document instance.
-
-
-
-
- Indicates Extensible Markup Language (XML) data - Document Type Definition (DTD).
-
-
-
-
- Indicates Extensible Stylesheet Language (XSL) data.
-
-
-
-
- Indicates XUL elements.
-
-
-
-
-
-
- Values for the attribute 'mtype'.
-
-
-
-
- Indicates the marked text is an abbreviation.
-
-
-
-
- ISO-12620 2.1.8: A term resulting from the omission of any part of the full term while designating the same concept.
-
-
-
-
- ISO-12620 2.1.8.1: An abbreviated form of a simple term resulting from the omission of some of its letters (e.g. 'adj.' for 'adjective').
-
-
-
-
- ISO-12620 2.1.8.4: An abbreviated form of a term made up of letters from the full form of a multiword term strung together into a sequence pronounced only syllabically (e.g. 'radar' for 'radio detecting and ranging').
-
-
-
-
- ISO-12620: A proper-name term, such as the name of an agency or other proper entity.
-
-
-
-
- ISO-12620 2.1.18.1: A recurrent word combination characterized by cohesion in that the components of the collocation must co-occur within an utterance or series of utterances, even though they do not necessarily have to maintain immediate proximity to one another.
-
-
-
-
- ISO-12620 2.1.5: A synonym for an international scientific term that is used in general discourse in a given language.
-
-
-
-
- Indicates the marked text is a date and/or time.
-
-
-
-
- ISO-12620 2.1.15: An expression used to represent a concept based on a statement that two mathematical expressions are, for instance, equal as identified by the equal sign (=), or assigned to one another by a similar sign.
-
-
-
-
- ISO-12620 2.1.7: The complete representation of a term for which there is an abbreviated form.
-
-
-
-
- ISO-12620 2.1.14: Figures, symbols or the like used to express a concept briefly, such as a mathematical or chemical formula.
-
-
-
-
- ISO-12620 2.1.1: The concept designation that has been chosen to head a terminological record.
-
-
-
-
- ISO-12620 2.1.8.3: An abbreviated form of a term consisting of some of the initial letters of the words making up a multiword term or the term elements making up a compound term when these letters are pronounced individually (e.g. 'BSE' for 'bovine spongiform encephalopathy').
-
-
-
-
- ISO-12620 2.1.4: A term that is part of an international scientific nomenclature as adopted by an appropriate scientific body.
-
-
-
-
- ISO-12620 2.1.6: A term that has the same or nearly identical orthographic or phonemic form in many languages.
-
-
-
-
- ISO-12620 2.1.16: An expression used to represent a concept based on mathematical or logical relations, such as statements of inequality, set relationships, Boolean operations, and the like.
-
-
-
-
- ISO-12620 2.1.17: A unit to track object.
-
-
-
-
- Indicates the marked text is a name.
-
-
-
-
- ISO-12620 2.1.3: A term that represents the same or a very similar concept as another term in the same language, but for which interchangeability is limited to some contexts and inapplicable in others.
-
-
-
-
- ISO-12620 2.1.17.2: A unique alphanumeric designation assigned to an object in a manufacturing system.
-
-
-
-
- Indicates the marked text is a phrase.
-
-
-
-
- ISO-12620 2.1.18: Any group of two or more words that form a unit, the meaning of which frequently cannot be deduced based on the combined sense of the words making up the phrase.
-
-
-
-
- Indicates the marked text should not be translated.
-
-
-
-
- ISO-12620 2.1.12: A form of a term resulting from an operation whereby non-Latin writing systems are converted to the Latin alphabet.
-
-
-
-
- Indicates that the marked text represents a segment.
-
-
-
-
- ISO-12620 2.1.18.2: A fixed, lexicalized phrase.
-
-
-
-
- ISO-12620 2.1.8.2: A variant of a multiword term that includes fewer words than the full form of the term (e.g. 'Group of Twenty-four' for 'Intergovernmental Group of Twenty-four on International Monetary Affairs').
-
-
-
-
- ISO-12620 2.1.17.1: Stock keeping unit, an inventory item identified by a unique alphanumeric designation assigned to an object in an inventory control system.
-
-
-
-
- ISO-12620 2.1.19: A fixed chunk of recurring text.
-
-
-
-
- ISO-12620 2.1.13: A designation of a concept by letters, numerals, pictograms or any combination thereof.
-
-
-
-
- ISO-12620 2.1.2: Any term that represents the same or a very similar concept as the main entry term in a term entry.
-
-
-
-
- ISO-12620 2.1.18.3: Phraseological unit in a language that expresses the same semantic content as another phrase in that same language.
-
-
-
-
- Indicates the marked text is a term.
-
-
-
-
- ISO-12620 2.1.11: A form of a term resulting from an operation whereby the characters of one writing system are represented by characters from another writing system, taking into account the pronunciation of the characters converted.
-
-
-
-
- ISO-12620 2.1.10: A form of a term resulting from an operation whereby the characters of an alphabetic writing system are represented by characters from another alphabetic writing system.
-
-
-
-
- ISO-12620 2.1.8.5: An abbreviated form of a term resulting from the omission of one or more term elements or syllables (e.g. 'flu' for 'influenza').
-
-
-
-
- ISO-12620 2.1.9: One of the alternate forms of a term.
-
-
-
-
-
-
- Values for the attribute 'restype'.
-
-
-
-
- Indicates a Windows RC AUTO3STATE control.
-
-
-
-
- Indicates a Windows RC AUTOCHECKBOX control.
-
-
-
-
- Indicates a Windows RC AUTORADIOBUTTON control.
-
-
-
-
- Indicates a Windows RC BEDIT control.
-
-
-
-
- Indicates a bitmap, for example a BITMAP resource in Windows.
-
-
-
-
- Indicates a button object, for example a BUTTON control Windows.
-
-
-
-
- Indicates a caption, such as the caption of a dialog box.
-
-
-
-
- Indicates the cell in a table, for example the content of the <td> element in HTML.
-
-
-
-
- Indicates check box object, for example a CHECKBOX control in Windows.
-
-
-
-
- Indicates a menu item with an associated checkbox.
-
-
-
-
- Indicates a list box, but with a check-box for each item.
-
-
-
-
- Indicates a color selection dialog.
-
-
-
-
- Indicates a combination of edit box and listbox object, for example a COMBOBOX control in Windows.
-
-
-
-
- Indicates an initialization entry of an extended combobox DLGINIT resource block. (code 0x1234).
-
-
-
-
- Indicates an initialization entry of a combobox DLGINIT resource block (code 0x0403).
-
-
-
-
- Indicates a UI base class element that cannot be represented by any other element.
-
-
-
-
- Indicates a context menu.
-
-
-
-
- Indicates a Windows RC CTEXT control.
-
-
-
-
- Indicates a cursor, for example a CURSOR resource in Windows.
-
-
-
-
- Indicates a date/time picker.
-
-
-
-
- Indicates a Windows RC DEFPUSHBUTTON control.
-
-
-
-
- Indicates a dialog box.
-
-
-
-
- Indicates a Windows RC DLGINIT resource block.
-
-
-
-
- Indicates an edit box object, for example an EDIT control in Windows.
-
-
-
-
- Indicates a filename.
-
-
-
-
- Indicates a file dialog.
-
-
-
-
- Indicates a footnote.
-
-
-
-
- Indicates a font name.
-
-
-
-
- Indicates a footer.
-
-
-
-
- Indicates a frame object.
-
-
-
-
- Indicates a XUL grid element.
-
-
-
-
- Indicates a groupbox object, for example a GROUPBOX control in Windows.
-
-
-
-
- Indicates a header item.
-
-
-
-
- Indicates a heading, such has the content of <h1>, <h2>, etc. in HTML.
-
-
-
-
- Indicates a Windows RC HEDIT control.
-
-
-
-
- Indicates a horizontal scrollbar.
-
-
-
-
- Indicates an icon, for example an ICON resource in Windows.
-
-
-
-
- Indicates a Windows RC IEDIT control.
-
-
-
-
- Indicates keyword list, such as the content of the Keywords meta-data in HTML, or a K footnote in WinHelp RTF.
-
-
-
-
- Indicates a label object.
-
-
-
-
- Indicates a label that is also a HTML link (not necessarily a URL).
-
-
-
-
- Indicates a list (a group of list-items, for example an <ol> or <ul> element in HTML).
-
-
-
-
- Indicates a listbox object, for example an LISTBOX control in Windows.
-
-
-
-
- Indicates an list item (an entry in a list).
-
-
-
-
- Indicates a Windows RC LTEXT control.
-
-
-
-
- Indicates a menu (a group of menu-items).
-
-
-
-
- Indicates a toolbar containing one or more tope level menus.
-
-
-
-
- Indicates a menu item (an entry in a menu).
-
-
-
-
- Indicates a XUL menuseparator element.
-
-
-
-
- Indicates a message, for example an entry in a MESSAGETABLE resource in Windows.
-
-
-
-
- Indicates a calendar control.
-
-
-
-
- Indicates an edit box beside a spin control.
-
-
-
-
- Indicates a catch all for rectangular areas.
-
-
-
-
- Indicates a standalone menu not necessarily associated with a menubar.
-
-
-
-
- Indicates a pushbox object, for example a PUSHBOX control in Windows.
-
-
-
-
- Indicates a Windows RC PUSHBUTTON control.
-
-
-
-
- Indicates a radio button object.
-
-
-
-
- Indicates a menuitem with associated radio button.
-
-
-
-
- Indicates raw data resources for an application.
-
-
-
-
- Indicates a row in a table.
-
-
-
-
- Indicates a Windows RC RTEXT control.
-
-
-
-
- Indicates a user navigable container used to show a portion of a document.
-
-
-
-
- Indicates a generic divider object (e.g. menu group separator).
-
-
-
-
- Windows accelerators, shortcuts in resource or property files.
-
-
-
-
- Indicates a UI control to indicate process activity but not progress.
-
-
-
-
- Indicates a splitter bar.
-
-
-
-
- Indicates a Windows RC STATE3 control.
-
-
-
-
- Indicates a window for providing feedback to the users, like 'read-only', etc.
-
-
-
-
- Indicates a string, for example an entry in a STRINGTABLE resource in Windows.
-
-
-
-
- Indicates a layers of controls with a tab to select layers.
-
-
-
-
- Indicates a display and edits regular two-dimensional tables of cells.
-
-
-
-
- Indicates a XUL textbox element.
-
-
-
-
- Indicates a UI button that can be toggled to on or off state.
-
-
-
-
- Indicates an array of controls, usually buttons.
-
-
-
-
- Indicates a pop up tool tip text.
-
-
-
-
- Indicates a bar with a pointer indicating a position within a certain range.
-
-
-
-
- Indicates a control that displays a set of hierarchical data.
-
-
-
-
- Indicates a URI (URN or URL).
-
-
-
-
- Indicates a Windows RC USERBUTTON control.
-
-
-
-
- Indicates a user-defined control like CONTROL control in Windows.
-
-
-
-
- Indicates the text of a variable.
-
-
-
-
- Indicates version information about a resource like VERSIONINFO in Windows.
-
-
-
-
- Indicates a vertical scrollbar.
-
-
-
-
- Indicates a graphical window.
-
-
-
-
-
-
- Values for the attribute 'size-unit'.
-
-
-
-
- Indicates a size in 8-bit bytes.
-
-
-
-
- Indicates a size in Unicode characters.
-
-
-
-
- Indicates a size in columns. Used for HTML text area.
-
-
-
-
- Indicates a size in centimeters.
-
-
-
-
- Indicates a size in dialog units, as defined in Windows resources.
-
-
-
-
- Indicates a size in 'font-size' units (as defined in CSS).
-
-
-
-
- Indicates a size in 'x-height' units (as defined in CSS).
-
-
-
-
- Indicates a size in glyphs. A glyph is considered to be one or more combined Unicode characters that represent a single displayable text character. Sometimes referred to as a 'grapheme cluster'
-
-
-
-
- Indicates a size in inches.
-
-
-
-
- Indicates a size in millimeters.
-
-
-
-
- Indicates a size in percentage.
-
-
-
-
- Indicates a size in pixels.
-
-
-
-
- Indicates a size in point.
-
-
-
-
- Indicates a size in rows. Used for HTML text area.
-
-
-
-
-
-
- Values for the attribute 'state'.
-
-
-
-
- Indicates the terminating state.
-
-
-
-
- Indicates only non-textual information needs adaptation.
-
-
-
-
- Indicates both text and non-textual information needs adaptation.
-
-
-
-
- Indicates only non-textual information needs review.
-
-
-
-
- Indicates both text and non-textual information needs review.
-
-
-
-
- Indicates that only the text of the item needs to be reviewed.
-
-
-
-
- Indicates that the item needs to be translated.
-
-
-
-
- Indicates that the item is new. For example, translation units that were not in a previous version of the document.
-
-
-
-
- Indicates that changes are reviewed and approved.
-
-
-
-
- Indicates that the item has been translated.
-
-
-
-
-
-
- Values for the attribute 'state-qualifier'.
-
-
-
-
- Indicates an exact match. An exact match occurs when a source text of a segment is exactly the same as the source text of a segment that was translated previously.
-
-
-
-
- Indicates a fuzzy match. A fuzzy match occurs when a source text of a segment is very similar to the source text of a segment that was translated previously (e.g. when the difference is casing, a few changed words, white-space discripancy, etc.).
-
-
-
-
- Indicates a match based on matching IDs (in addition to matching text).
-
-
-
-
- Indicates a translation derived from a glossary.
-
-
-
-
- Indicates a translation derived from existing translation.
-
-
-
-
- Indicates a translation derived from machine translation.
-
-
-
-
- Indicates a translation derived from a translation repository.
-
-
-
-
- Indicates a translation derived from a translation memory.
-
-
-
-
- Indicates the translation is suggested by machine translation.
-
-
-
-
- Indicates that the item has been rejected because of incorrect grammar.
-
-
-
-
- Indicates that the item has been rejected because it is incorrect.
-
-
-
-
- Indicates that the item has been rejected because it is too long or too short.
-
-
-
-
- Indicates that the item has been rejected because of incorrect spelling.
-
-
-
-
- Indicates the translation is suggested by translation memory.
-
-
-
-
-
-
- Values for the attribute 'unit'.
-
-
-
-
- Refers to words.
-
-
-
-
- Refers to pages.
-
-
-
-
- Refers to <trans-unit> elements.
-
-
-
-
- Refers to <bin-unit> elements.
-
-
-
-
- Refers to glyphs.
-
-
-
-
- Refers to <trans-unit> and/or <bin-unit> elements.
-
-
-
-
- Refers to the occurrences of instances defined by the count-type value.
-
-
-
-
- Refers to characters.
-
-
-
-
- Refers to lines.
-
-
-
-
- Refers to sentences.
-
-
-
-
- Refers to paragraphs.
-
-
-
-
- Refers to segments.
-
-
-
-
- Refers to placeables (inline elements).
-
-
-
-
-
-
- Values for the attribute 'priority'.
-
-
-
-
- Highest priority.
-
-
-
-
- High priority.
-
-
-
-
- High priority, but not as important as 2.
-
-
-
-
- High priority, but not as important as 3.
-
-
-
-
- Medium priority, but more important than 6.
-
-
-
-
- Medium priority, but less important than 5.
-
-
-
-
- Low priority, but more important than 8.
-
-
-
-
- Low priority, but more important than 9.
-
-
-
-
- Low priority.
-
-
-
-
- Lowest priority.
-
-
-
-
-
-
-
-
- This value indicates that all properties can be reformatted. This value must be used alone.
-
-
-
-
- This value indicates that no properties should be reformatted. This value must be used alone.
-
-
-
-
-
-
-
-
-
-
-
-
- This value indicates that all information in the coord attribute can be modified.
-
-
-
-
- This value indicates that the x information in the coord attribute can be modified.
-
-
-
-
- This value indicates that the y information in the coord attribute can be modified.
-
-
-
-
- This value indicates that the cx information in the coord attribute can be modified.
-
-
-
-
- This value indicates that the cy information in the coord attribute can be modified.
-
-
-
-
- This value indicates that all the information in the font attribute can be modified.
-
-
-
-
- This value indicates that the name information in the font attribute can be modified.
-
-
-
-
- This value indicates that the size information in the font attribute can be modified.
-
-
-
-
- This value indicates that the weight information in the font attribute can be modified.
-
-
-
-
- This value indicates that the information in the css-style attribute can be modified.
-
-
-
-
- This value indicates that the information in the style attribute can be modified.
-
-
-
-
- This value indicates that the information in the exstyle attribute can be modified.
-
-
-
-
-
-
-
-
-
-
-
-
- Indicates that the context is informational in nature, specifying for example, how a term should be translated. Thus, should be displayed to anyone editing the XLIFF document.
-
-
-
-
- Indicates that the context-group is used to specify where the term was found in the translatable source. Thus, it is not displayed.
-
-
-
-
- Indicates that the context information should be used during translation memory lookups. Thus, it is not displayed.
-
-
-
-
-
-
-
-
- Represents a translation proposal from a translation memory or other resource.
-
-
-
-
- Represents a previous version of the target element.
-
-
-
-
- Represents a rejected version of the target element.
-
-
-
-
- Represents a translation to be used for reference purposes only, for example from a related product or a different language.
-
-
-
-
- Represents a proposed translation that was used for the translation of the trans-unit, possibly modified.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Values for the attribute 'coord'.
-
-
-
-
-
-
-
- Version values: 1.0 and 1.1 are allowed for backward compatibility.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/vendor/symfony/translation/LoggingTranslator.php b/vendor/symfony/translation/LoggingTranslator.php
index 01456708..4fe756d7 100644
--- a/vendor/symfony/translation/LoggingTranslator.php
+++ b/vendor/symfony/translation/LoggingTranslator.php
@@ -13,11 +13,14 @@ namespace Symfony\Component\Translation;
use Psr\Log\LoggerInterface;
use Symfony\Component\Translation\Exception\InvalidArgumentException;
+use Symfony\Component\Translation\TranslatorInterface as LegacyTranslatorInterface;
+use Symfony\Contracts\Translation\LocaleAwareInterface;
+use Symfony\Contracts\Translation\TranslatorInterface;
/**
* @author Abdellatif Ait boudad
*/
-class LoggingTranslator implements TranslatorInterface, TranslatorBagInterface
+class LoggingTranslator implements TranslatorInterface, LegacyTranslatorInterface, TranslatorBagInterface
{
/**
* @var TranslatorInterface|TranslatorBagInterface
@@ -30,10 +33,13 @@ class LoggingTranslator implements TranslatorInterface, TranslatorBagInterface
* @param TranslatorInterface $translator The translator must implement TranslatorBagInterface
* @param LoggerInterface $logger
*/
- public function __construct(TranslatorInterface $translator, LoggerInterface $logger)
+ public function __construct($translator, LoggerInterface $logger)
{
- if (!$translator instanceof TranslatorBagInterface) {
- throw new InvalidArgumentException(sprintf('The Translator "%s" must implement TranslatorInterface and TranslatorBagInterface.', \get_class($translator)));
+ if (!$translator instanceof LegacyTranslatorInterface && !$translator instanceof TranslatorInterface) {
+ throw new \TypeError(sprintf('Argument 1 passed to %s() must be an instance of %s, %s given.', __METHOD__, TranslatorInterface::class, \is_object($translator) ? \get_class($translator) : \gettype($translator)));
+ }
+ if (!$translator instanceof TranslatorBagInterface || !$translator instanceof LocaleAwareInterface) {
+ throw new InvalidArgumentException(sprintf('The Translator "%s" must implement TranslatorInterface, TranslatorBagInterface and LocaleAwareInterface.', \get_class($translator)));
}
$this->translator = $translator;
@@ -53,10 +59,19 @@ class LoggingTranslator implements TranslatorInterface, TranslatorBagInterface
/**
* {@inheritdoc}
+ *
+ * @deprecated since Symfony 4.2, use the trans() method instead with a %count% parameter
*/
public function transChoice($id, $number, array $parameters = array(), $domain = null, $locale = null)
{
- $trans = $this->translator->transChoice($id, $number, $parameters, $domain, $locale);
+ @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.2, use the trans() one instead with a "%count%" parameter.', __METHOD__), E_USER_DEPRECATED);
+
+ if ($this->translator instanceof TranslatorInterface) {
+ $trans = $this->translator->trans($id, array('%count%' => $number) + $parameters, $domain, $locale);
+ } else {
+ $trans = $this->translator->transChoice($id, $number, $parameters, $domain, $locale);
+ }
+
$this->log($id, $domain, $locale);
return $trans;
@@ -89,7 +104,7 @@ class LoggingTranslator implements TranslatorInterface, TranslatorBagInterface
/**
* Gets the fallback locales.
*
- * @return array $locales The fallback locales
+ * @return array The fallback locales
*/
public function getFallbackLocales()
{
@@ -105,7 +120,7 @@ class LoggingTranslator implements TranslatorInterface, TranslatorBagInterface
*/
public function __call($method, $args)
{
- return \call_user_func_array(array($this->translator, $method), $args);
+ return $this->translator->{$method}(...$args);
}
/**
diff --git a/vendor/symfony/translation/MessageCatalogue.php b/vendor/symfony/translation/MessageCatalogue.php
index c36ea30e..7a7657c0 100644
--- a/vendor/symfony/translation/MessageCatalogue.php
+++ b/vendor/symfony/translation/MessageCatalogue.php
@@ -49,7 +49,17 @@ class MessageCatalogue implements MessageCatalogueInterface, MetadataAwareInterf
*/
public function getDomains()
{
- return array_keys($this->messages);
+ $domains = array();
+ $suffixLength = \strlen(self::INTL_DOMAIN_SUFFIX);
+
+ foreach ($this->messages as $domain => $messages) {
+ if (\strlen($domain) > $suffixLength && false !== $i = strpos($domain, self::INTL_DOMAIN_SUFFIX, -$suffixLength)) {
+ $domain = substr($domain, 0, $i);
+ }
+ $domains[$domain] = $domain;
+ }
+
+ return array_values($domains);
}
/**
@@ -57,11 +67,23 @@ class MessageCatalogue implements MessageCatalogueInterface, MetadataAwareInterf
*/
public function all($domain = null)
{
- if (null === $domain) {
- return $this->messages;
+ if (null !== $domain) {
+ return ($this->messages[$domain.self::INTL_DOMAIN_SUFFIX] ?? array()) + ($this->messages[$domain] ?? array());
+ }
+
+ $allMessages = array();
+ $suffixLength = \strlen(self::INTL_DOMAIN_SUFFIX);
+
+ foreach ($this->messages as $domain => $messages) {
+ if (\strlen($domain) > $suffixLength && false !== $i = strpos($domain, self::INTL_DOMAIN_SUFFIX, -$suffixLength)) {
+ $domain = substr($domain, 0, $i);
+ $allMessages[$domain] = $messages + ($allMessages[$domain] ?? array());
+ } else {
+ $allMessages[$domain] = ($allMessages[$domain] ?? array()) + $messages;
+ }
}
- return isset($this->messages[$domain]) ? $this->messages[$domain] : array();
+ return $allMessages;
}
/**
@@ -77,7 +99,7 @@ class MessageCatalogue implements MessageCatalogueInterface, MetadataAwareInterf
*/
public function has($id, $domain = 'messages')
{
- if (isset($this->messages[$domain][$id])) {
+ if (isset($this->messages[$domain][$id]) || isset($this->messages[$domain.self::INTL_DOMAIN_SUFFIX][$id])) {
return true;
}
@@ -93,7 +115,7 @@ class MessageCatalogue implements MessageCatalogueInterface, MetadataAwareInterf
*/
public function defines($id, $domain = 'messages')
{
- return isset($this->messages[$domain][$id]);
+ return isset($this->messages[$domain][$id]) || isset($this->messages[$domain.self::INTL_DOMAIN_SUFFIX][$id]);
}
/**
@@ -101,6 +123,10 @@ class MessageCatalogue implements MessageCatalogueInterface, MetadataAwareInterf
*/
public function get($id, $domain = 'messages')
{
+ if (isset($this->messages[$domain.self::INTL_DOMAIN_SUFFIX][$id])) {
+ return $this->messages[$domain.self::INTL_DOMAIN_SUFFIX][$id];
+ }
+
if (isset($this->messages[$domain][$id])) {
return $this->messages[$domain][$id];
}
@@ -117,7 +143,7 @@ class MessageCatalogue implements MessageCatalogueInterface, MetadataAwareInterf
*/
public function replace($messages, $domain = 'messages')
{
- $this->messages[$domain] = array();
+ unset($this->messages[$domain], $this->messages[$domain.self::INTL_DOMAIN_SUFFIX]);
$this->add($messages, $domain);
}
@@ -144,6 +170,10 @@ class MessageCatalogue implements MessageCatalogueInterface, MetadataAwareInterf
}
foreach ($catalogue->all() as $domain => $messages) {
+ if ($intlMessages = $catalogue->all($domain.self::INTL_DOMAIN_SUFFIX)) {
+ $this->add($intlMessages, $domain.self::INTL_DOMAIN_SUFFIX);
+ $messages = array_diff_key($messages, $intlMessages);
+ }
$this->add($messages, $domain);
}
diff --git a/vendor/symfony/translation/MessageCatalogueInterface.php b/vendor/symfony/translation/MessageCatalogueInterface.php
index e0dbb2bd..f3d3f5ea 100644
--- a/vendor/symfony/translation/MessageCatalogueInterface.php
+++ b/vendor/symfony/translation/MessageCatalogueInterface.php
@@ -20,6 +20,8 @@ use Symfony\Component\Config\Resource\ResourceInterface;
*/
interface MessageCatalogueInterface
{
+ const INTL_DOMAIN_SUFFIX = '+intl-icu';
+
/**
* Gets the catalogue locale.
*
diff --git a/vendor/symfony/translation/MessageSelector.php b/vendor/symfony/translation/MessageSelector.php
index 5de171c5..06639417 100644
--- a/vendor/symfony/translation/MessageSelector.php
+++ b/vendor/symfony/translation/MessageSelector.php
@@ -11,6 +11,8 @@
namespace Symfony\Component\Translation;
+@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.2, use IdentityTranslator instead.', MessageSelector::class), E_USER_DEPRECATED);
+
use Symfony\Component\Translation\Exception\InvalidArgumentException;
/**
@@ -18,6 +20,8 @@ use Symfony\Component\Translation\Exception\InvalidArgumentException;
*
* @author Fabien Potencier
* @author Bernhard Schussek
+ *
+ * @deprecated since Symfony 4.2, use IdentityTranslator instead.
*/
class MessageSelector
{
@@ -39,9 +43,9 @@ class MessageSelector
* The two methods can also be mixed:
* {0} There are no apples|one: There is one apple|more: There are %count% apples
*
- * @param string $message The message being translated
- * @param int $number The number of items represented for the message
- * @param string $locale The locale to use for choosing
+ * @param string $message The message being translated
+ * @param int|float $number The number of items represented for the message
+ * @param string $locale The locale to use for choosing
*
* @return string
*
diff --git a/vendor/symfony/translation/PluralizationRules.php b/vendor/symfony/translation/PluralizationRules.php
index 3aca0ba9..362f6a1f 100644
--- a/vendor/symfony/translation/PluralizationRules.php
+++ b/vendor/symfony/translation/PluralizationRules.php
@@ -15,6 +15,8 @@ namespace Symfony\Component\Translation;
* Returns the plural rules for a given locale.
*
* @author Fabien Potencier
+ *
+ * @deprecated since Symfony 4.2, use IdentityTranslator instead
*/
class PluralizationRules
{
@@ -28,8 +30,12 @@ class PluralizationRules
*
* @return int The plural position
*/
- public static function get($number, $locale)
+ public static function get($number, $locale/*, bool $triggerDeprecation = true*/)
{
+ if (3 > \func_num_args() || \func_get_arg(2)) {
+ @trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.2.', __CLASS__), E_USER_DEPRECATED);
+ }
+
if ('pt_BR' === $locale) {
// temporary set a locale for brazilian
$locale = 'xbr';
@@ -196,6 +202,8 @@ class PluralizationRules
*/
public static function set(callable $rule, $locale)
{
+ @trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.2.', __CLASS__), E_USER_DEPRECATED);
+
if ('pt_BR' === $locale) {
// temporary set a locale for brazilian
$locale = 'xbr';
diff --git a/vendor/symfony/translation/Resources/data/parents.json b/vendor/symfony/translation/Resources/data/parents.json
new file mode 100644
index 00000000..09709d23
--- /dev/null
+++ b/vendor/symfony/translation/Resources/data/parents.json
@@ -0,0 +1,136 @@
+{
+ "az_Cyrl": "root",
+ "bs_Cyrl": "root",
+ "en_150": "en_001",
+ "en_AG": "en_001",
+ "en_AI": "en_001",
+ "en_AT": "en_150",
+ "en_AU": "en_001",
+ "en_BB": "en_001",
+ "en_BE": "en_001",
+ "en_BM": "en_001",
+ "en_BS": "en_001",
+ "en_BW": "en_001",
+ "en_BZ": "en_001",
+ "en_CA": "en_001",
+ "en_CC": "en_001",
+ "en_CH": "en_150",
+ "en_CK": "en_001",
+ "en_CM": "en_001",
+ "en_CX": "en_001",
+ "en_CY": "en_001",
+ "en_DE": "en_150",
+ "en_DG": "en_001",
+ "en_DK": "en_150",
+ "en_DM": "en_001",
+ "en_ER": "en_001",
+ "en_FI": "en_150",
+ "en_FJ": "en_001",
+ "en_FK": "en_001",
+ "en_FM": "en_001",
+ "en_GB": "en_001",
+ "en_GD": "en_001",
+ "en_GG": "en_001",
+ "en_GH": "en_001",
+ "en_GI": "en_001",
+ "en_GM": "en_001",
+ "en_GY": "en_001",
+ "en_HK": "en_001",
+ "en_IE": "en_001",
+ "en_IL": "en_001",
+ "en_IM": "en_001",
+ "en_IN": "en_001",
+ "en_IO": "en_001",
+ "en_JE": "en_001",
+ "en_JM": "en_001",
+ "en_KE": "en_001",
+ "en_KI": "en_001",
+ "en_KN": "en_001",
+ "en_KY": "en_001",
+ "en_LC": "en_001",
+ "en_LR": "en_001",
+ "en_LS": "en_001",
+ "en_MG": "en_001",
+ "en_MO": "en_001",
+ "en_MS": "en_001",
+ "en_MT": "en_001",
+ "en_MU": "en_001",
+ "en_MW": "en_001",
+ "en_MY": "en_001",
+ "en_NA": "en_001",
+ "en_NF": "en_001",
+ "en_NG": "en_001",
+ "en_NL": "en_150",
+ "en_NR": "en_001",
+ "en_NU": "en_001",
+ "en_NZ": "en_001",
+ "en_PG": "en_001",
+ "en_PH": "en_001",
+ "en_PK": "en_001",
+ "en_PN": "en_001",
+ "en_PW": "en_001",
+ "en_RW": "en_001",
+ "en_SB": "en_001",
+ "en_SC": "en_001",
+ "en_SD": "en_001",
+ "en_SE": "en_150",
+ "en_SG": "en_001",
+ "en_SH": "en_001",
+ "en_SI": "en_150",
+ "en_SL": "en_001",
+ "en_SS": "en_001",
+ "en_SX": "en_001",
+ "en_SZ": "en_001",
+ "en_TC": "en_001",
+ "en_TK": "en_001",
+ "en_TO": "en_001",
+ "en_TT": "en_001",
+ "en_TV": "en_001",
+ "en_TZ": "en_001",
+ "en_UG": "en_001",
+ "en_VC": "en_001",
+ "en_VG": "en_001",
+ "en_VU": "en_001",
+ "en_WS": "en_001",
+ "en_ZA": "en_001",
+ "en_ZM": "en_001",
+ "en_ZW": "en_001",
+ "es_AR": "es_419",
+ "es_BO": "es_419",
+ "es_BR": "es_419",
+ "es_BZ": "es_419",
+ "es_CL": "es_419",
+ "es_CO": "es_419",
+ "es_CR": "es_419",
+ "es_CU": "es_419",
+ "es_DO": "es_419",
+ "es_EC": "es_419",
+ "es_GT": "es_419",
+ "es_HN": "es_419",
+ "es_MX": "es_419",
+ "es_NI": "es_419",
+ "es_PA": "es_419",
+ "es_PE": "es_419",
+ "es_PR": "es_419",
+ "es_PY": "es_419",
+ "es_SV": "es_419",
+ "es_US": "es_419",
+ "es_UY": "es_419",
+ "es_VE": "es_419",
+ "pa_Arab": "root",
+ "pt_AO": "pt_PT",
+ "pt_CH": "pt_PT",
+ "pt_CV": "pt_PT",
+ "pt_GQ": "pt_PT",
+ "pt_GW": "pt_PT",
+ "pt_LU": "pt_PT",
+ "pt_MO": "pt_PT",
+ "pt_MZ": "pt_PT",
+ "pt_ST": "pt_PT",
+ "pt_TL": "pt_PT",
+ "sr_Latn": "root",
+ "uz_Arab": "root",
+ "uz_Cyrl": "root",
+ "zh_Hant": "root",
+ "zh_Hant_MO": "zh_Hant_HK"
+}
diff --git a/vendor/symfony/translation/Resources/schemas/xliff-core-1.2-strict.xsd b/vendor/symfony/translation/Resources/schemas/xliff-core-1.2-strict.xsd
index 4102d647..dface628 100644
--- a/vendor/symfony/translation/Resources/schemas/xliff-core-1.2-strict.xsd
+++ b/vendor/symfony/translation/Resources/schemas/xliff-core-1.2-strict.xsd
@@ -30,7 +30,7 @@ Jan-10-2006
-->
-
+
diff --git a/vendor/symfony/translation/Loader/schema/dic/xliff-core/xliff-core-2.0.xsd b/vendor/symfony/translation/Resources/schemas/xliff-core-2.0.xsd
similarity index 100%
rename from vendor/symfony/translation/Loader/schema/dic/xliff-core/xliff-core-2.0.xsd
rename to vendor/symfony/translation/Resources/schemas/xliff-core-2.0.xsd
diff --git a/vendor/symfony/translation/Loader/schema/dic/xliff-core/xml.xsd b/vendor/symfony/translation/Resources/schemas/xml.xsd
similarity index 100%
rename from vendor/symfony/translation/Loader/schema/dic/xliff-core/xml.xsd
rename to vendor/symfony/translation/Resources/schemas/xml.xsd
diff --git a/vendor/symfony/translation/Tests/Catalogue/MergeOperationTest.php b/vendor/symfony/translation/Tests/Catalogue/MergeOperationTest.php
index 8b51c15d..9a688478 100644
--- a/vendor/symfony/translation/Tests/Catalogue/MergeOperationTest.php
+++ b/vendor/symfony/translation/Tests/Catalogue/MergeOperationTest.php
@@ -53,6 +53,20 @@ class MergeOperationTest extends AbstractOperationTest
);
}
+ public function testGetResultFromIntlDomain()
+ {
+ $this->assertEquals(
+ new MessageCatalogue('en', array(
+ 'messages' => array('a' => 'old_a', 'b' => 'old_b'),
+ 'messages+intl-icu' => array('d' => 'old_d', 'c' => 'new_c'),
+ )),
+ $this->createOperation(
+ new MessageCatalogue('en', array('messages' => array('a' => 'old_a', 'b' => 'old_b'), 'messages+intl-icu' => array('d' => 'old_d'))),
+ new MessageCatalogue('en', array('messages+intl-icu' => array('a' => 'new_a', 'c' => 'new_c')))
+ )->getResult()
+ );
+ }
+
public function testGetResultWithMetadata()
{
$leftCatalogue = new MessageCatalogue('en', array('messages' => array('a' => 'old_a', 'b' => 'old_b')));
diff --git a/vendor/symfony/translation/Tests/Catalogue/TargetOperationTest.php b/vendor/symfony/translation/Tests/Catalogue/TargetOperationTest.php
index 271d17fb..83b0550d 100644
--- a/vendor/symfony/translation/Tests/Catalogue/TargetOperationTest.php
+++ b/vendor/symfony/translation/Tests/Catalogue/TargetOperationTest.php
@@ -53,6 +53,20 @@ class TargetOperationTest extends AbstractOperationTest
);
}
+ public function testGetResultFromIntlDomain()
+ {
+ $this->assertEquals(
+ new MessageCatalogue('en', array(
+ 'messages' => array('a' => 'old_a'),
+ 'messages+intl-icu' => array('c' => 'new_c'),
+ )),
+ $this->createOperation(
+ new MessageCatalogue('en', array('messages' => array('a' => 'old_a'), 'messages+intl-icu' => array('b' => 'old_b'))),
+ new MessageCatalogue('en', array('messages' => array('a' => 'new_a'), 'messages+intl-icu' => array('c' => 'new_c')))
+ )->getResult()
+ );
+ }
+
public function testGetResultWithMetadata()
{
$leftCatalogue = new MessageCatalogue('en', array('messages' => array('a' => 'old_a', 'b' => 'old_b')));
diff --git a/vendor/symfony/translation/Tests/Command/XliffLintCommandTest.php b/vendor/symfony/translation/Tests/Command/XliffLintCommandTest.php
index e37600c3..758ac981 100644
--- a/vendor/symfony/translation/Tests/Command/XliffLintCommandTest.php
+++ b/vendor/symfony/translation/Tests/Command/XliffLintCommandTest.php
@@ -40,6 +40,38 @@ class XliffLintCommandTest extends TestCase
$this->assertContains('OK', trim($tester->getDisplay()));
}
+ public function testLintCorrectFiles()
+ {
+ $tester = $this->createCommandTester();
+ $filename1 = $this->createFile();
+ $filename2 = $this->createFile();
+
+ $tester->execute(
+ array('filename' => array($filename1, $filename2)),
+ array('verbosity' => OutputInterface::VERBOSITY_VERBOSE, 'decorated' => false)
+ );
+
+ $this->assertEquals(0, $tester->getStatusCode(), 'Returns 0 in case of success');
+ $this->assertContains('OK', trim($tester->getDisplay()));
+ }
+
+ /**
+ * @dataProvider provideStrictFilenames
+ */
+ public function testStrictFilenames($requireStrictFileNames, $fileNamePattern, $targetLanguage, $mustFail)
+ {
+ $tester = $this->createCommandTester($requireStrictFileNames);
+ $filename = $this->createFile('note', $targetLanguage, $fileNamePattern);
+
+ $tester->execute(
+ array('filename' => $filename),
+ array('verbosity' => OutputInterface::VERBOSITY_VERBOSE, 'decorated' => false)
+ );
+
+ $this->assertEquals($mustFail ? 1 : 0, $tester->getStatusCode());
+ $this->assertContains($mustFail ? '[WARNING] 0 XLIFF files have valid syntax and 1 contain errors.' : '[OK] All 1 XLIFF files contain valid syntax.', $tester->getDisplay());
+ }
+
public function testLintIncorrectXmlSyntax()
{
$tester = $this->createCommandTester();
@@ -59,7 +91,7 @@ class XliffLintCommandTest extends TestCase
$tester->execute(array('filename' => $filename), array('decorated' => false));
$this->assertEquals(1, $tester->getStatusCode(), 'Returns 1 in case of error');
- $this->assertContains('There is a mismatch between the file extension ("en.xlf") and the "es" value used in the "target-language" attribute of the file.', trim($tester->getDisplay()));
+ $this->assertContains('There is a mismatch between the language included in the file name ("messages.en.xlf") and the "es" value used in the "target-language" attribute of the file.', trim($tester->getDisplay()));
}
/**
@@ -102,7 +134,7 @@ EOF;
/**
* @return string Path to the new file
*/
- private function createFile($sourceContent = 'note', $targetLanguage = 'en')
+ private function createFile($sourceContent = 'note', $targetLanguage = 'en', $fileNamePattern = 'messages.%locale%.xlf')
{
$xliffContent = <<
@@ -118,7 +150,7 @@ EOF;
XLIFF;
- $filename = sprintf('%s/translation-xliff-lint-test/messages.en.xlf', sys_get_temp_dir());
+ $filename = sprintf('%s/translation-xliff-lint-test/%s', sys_get_temp_dir(), str_replace('%locale%', 'en', $fileNamePattern));
file_put_contents($filename, $xliffContent);
$this->files[] = $filename;
@@ -129,11 +161,11 @@ XLIFF;
/**
* @return CommandTester
*/
- private function createCommandTester($application = null)
+ private function createCommandTester($requireStrictFileNames = true, $application = null)
{
if (!$application) {
$application = new Application();
- $application->add(new XliffLintCommand());
+ $application->add(new XliffLintCommand(null, null, null, $requireStrictFileNames));
}
$command = $application->find('lint:xliff');
@@ -160,4 +192,16 @@ XLIFF;
}
rmdir(sys_get_temp_dir().'/translation-xliff-lint-test');
}
+
+ public function provideStrictFilenames()
+ {
+ yield array(false, 'messages.%locale%.xlf', 'en', false);
+ yield array(false, 'messages.%locale%.xlf', 'es', true);
+ yield array(false, '%locale%.messages.xlf', 'en', false);
+ yield array(false, '%locale%.messages.xlf', 'es', true);
+ yield array(true, 'messages.%locale%.xlf', 'en', false);
+ yield array(true, 'messages.%locale%.xlf', 'es', true);
+ yield array(true, '%locale%.messages.xlf', 'en', true);
+ yield array(true, '%locale%.messages.xlf', 'es', true);
+ }
}
diff --git a/vendor/symfony/translation/Tests/DataCollectorTranslatorTest.php b/vendor/symfony/translation/Tests/DataCollectorTranslatorTest.php
index 1cdd33b3..19e056c1 100644
--- a/vendor/symfony/translation/Tests/DataCollectorTranslatorTest.php
+++ b/vendor/symfony/translation/Tests/DataCollectorTranslatorTest.php
@@ -25,7 +25,7 @@ class DataCollectorTranslatorTest extends TestCase
$collector->trans('foo');
$collector->trans('bar');
- $collector->transChoice('choice', 0);
+ $collector->trans('choice', array('%count%' => 0));
$collector->trans('bar_ru');
$collector->trans('bar_ru', array('foo' => 'bar'));
@@ -54,7 +54,7 @@ class DataCollectorTranslatorTest extends TestCase
'locale' => 'en',
'domain' => 'messages',
'state' => DataCollectorTranslator::MESSAGE_MISSING,
- 'parameters' => array(),
+ 'parameters' => array('%count%' => 0),
'transChoiceNumber' => 0,
);
$expectedMessages[] = array(
@@ -79,6 +79,30 @@ class DataCollectorTranslatorTest extends TestCase
$this->assertEquals($expectedMessages, $collector->getCollectedMessages());
}
+ /**
+ * @group legacy
+ */
+ public function testCollectMessagesTransChoice()
+ {
+ $collector = $this->createCollector();
+ $collector->setFallbackLocales(array('fr', 'ru'));
+ $collector->transChoice('choice', 0);
+
+ $expectedMessages = array();
+
+ $expectedMessages[] = array(
+ 'id' => 'choice',
+ 'translation' => 'choice',
+ 'locale' => 'en',
+ 'domain' => 'messages',
+ 'state' => DataCollectorTranslator::MESSAGE_MISSING,
+ 'parameters' => array('%count%' => 0),
+ 'transChoiceNumber' => 0,
+ );
+
+ $this->assertEquals($expectedMessages, $collector->getCollectedMessages());
+ }
+
private function createCollector()
{
$translator = new Translator('en');
diff --git a/vendor/symfony/translation/Tests/Dumper/FileDumperTest.php b/vendor/symfony/translation/Tests/Dumper/FileDumperTest.php
index d1524d6e..908f22d7 100644
--- a/vendor/symfony/translation/Tests/Dumper/FileDumperTest.php
+++ b/vendor/symfony/translation/Tests/Dumper/FileDumperTest.php
@@ -32,6 +32,30 @@ class FileDumperTest extends TestCase
@unlink($tempDir.'/messages.en.concrete');
}
+ public function testDumpIntl()
+ {
+ $tempDir = sys_get_temp_dir();
+
+ $catalogue = new MessageCatalogue('en');
+ $catalogue->add(array('foo' => 'bar'), 'd1');
+ $catalogue->add(array('bar' => 'foo'), 'd1+intl-icu');
+ $catalogue->add(array('bar' => 'foo'), 'd2+intl-icu');
+
+ $dumper = new ConcreteFileDumper();
+ @unlink($tempDir.'/d2.en.concrete');
+ $dumper->dump($catalogue, array('path' => $tempDir));
+
+ $this->assertStringEqualsFile($tempDir.'/d1.en.concrete', 'foo=bar');
+ @unlink($tempDir.'/d1.en.concrete');
+
+ $this->assertStringEqualsFile($tempDir.'/d1+intl-icu.en.concrete', 'bar=foo');
+ @unlink($tempDir.'/d1+intl-icu.en.concrete');
+
+ $this->assertFileNotExists($tempDir.'/d2.en.concrete');
+ $this->assertStringEqualsFile($tempDir.'/d2+intl-icu.en.concrete', 'bar=foo');
+ @unlink($tempDir.'/d2+intl-icu.en.concrete');
+ }
+
public function testDumpCreatesNestedDirectoriesAndFile()
{
$tempDir = sys_get_temp_dir();
@@ -56,7 +80,7 @@ class ConcreteFileDumper extends FileDumper
{
public function formatCatalogue(MessageCatalogue $messages, $domain, array $options = array())
{
- return '';
+ return http_build_query($messages->all($domain), '', '&');
}
protected function getExtension()
diff --git a/vendor/symfony/translation/Tests/Formatter/IntlFormatterTest.php b/vendor/symfony/translation/Tests/Formatter/IntlFormatterTest.php
new file mode 100644
index 00000000..89eaa18f
--- /dev/null
+++ b/vendor/symfony/translation/Tests/Formatter/IntlFormatterTest.php
@@ -0,0 +1,96 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Translation\Tests\Formatter;
+
+use Symfony\Component\Translation\Exception\InvalidArgumentException;
+use Symfony\Component\Translation\Formatter\IntlFormatter;
+use Symfony\Component\Translation\Formatter\IntlFormatterInterface;
+
+/**
+ * @requires extension intl
+ */
+class IntlFormatterTest extends \PHPUnit\Framework\TestCase
+{
+ /**
+ * @dataProvider provideDataForFormat
+ */
+ public function testFormat($expected, $message, $arguments)
+ {
+ $this->assertEquals($expected, trim((new IntlFormatter())->formatIntl($message, 'en', $arguments)));
+ }
+
+ public function testInvalidFormat()
+ {
+ $this->expectException(InvalidArgumentException::class);
+ (new IntlFormatter())->formatIntl('{foo', 'en', array(2));
+ }
+
+ public function testFormatWithNamedArguments()
+ {
+ if (version_compare(INTL_ICU_VERSION, '4.8', '<')) {
+ $this->markTestSkipped('Format with named arguments can only be run with ICU 4.8 or higher and PHP >= 5.5');
+ }
+
+ $chooseMessage = <<<'_MSG_'
+{gender_of_host, select,
+ female {{num_guests, plural, offset:1
+ =0 {{host} does not give a party.}
+ =1 {{host} invites {guest} to her party.}
+ =2 {{host} invites {guest} and one other person to her party.}
+ other {{host} invites {guest} as one of the # people invited to her party.}}}
+ male {{num_guests, plural, offset:1
+ =0 {{host} does not give a party.}
+ =1 {{host} invites {guest} to his party.}
+ =2 {{host} invites {guest} and one other person to his party.}
+ other {{host} invites {guest} as one of the # people invited to his party.}}}
+ other {{num_guests, plural, offset:1
+ =0 {{host} does not give a party.}
+ =1 {{host} invites {guest} to their party.}
+ =2 {{host} invites {guest} and one other person to their party.}
+ other {{host} invites {guest} as one of the # people invited to their party.}}}}
+_MSG_;
+
+ $message = (new IntlFormatter())->formatIntl($chooseMessage, 'en', array(
+ 'gender_of_host' => 'male',
+ 'num_guests' => 10,
+ 'host' => 'Fabien',
+ 'guest' => 'Guilherme',
+ ));
+
+ $this->assertEquals('Fabien invites Guilherme as one of the 9 people invited to his party.', $message);
+ }
+
+ public function provideDataForFormat()
+ {
+ return array(
+ array(
+ 'There is one apple',
+ 'There is one apple',
+ array(),
+ ),
+ array(
+ '4,560 monkeys on 123 trees make 37.073 monkeys per tree',
+ '{0,number,integer} monkeys on {1,number,integer} trees make {2,number} monkeys per tree',
+ array(4560, 123, 4560 / 123),
+ ),
+ );
+ }
+
+ public function testPercentsAndBracketsAreTrimmed()
+ {
+ $formatter = new IntlFormatter();
+ $this->assertInstanceof(IntlFormatterInterface::class, $formatter);
+ $this->assertSame('Hello Fab', $formatter->formatIntl('Hello {name}', 'en', array('name' => 'Fab')));
+ $this->assertSame('Hello Fab', $formatter->formatIntl('Hello {name}', 'en', array('%name%' => 'Fab')));
+ $this->assertSame('Hello Fab', $formatter->formatIntl('Hello {name}', 'en', array('{{ name }}' => 'Fab')));
+ }
+}
diff --git a/vendor/symfony/translation/Tests/Formatter/MessageFormatterTest.php b/vendor/symfony/translation/Tests/Formatter/MessageFormatterTest.php
index 1fa736e7..f4c96aa1 100644
--- a/vendor/symfony/translation/Tests/Formatter/MessageFormatterTest.php
+++ b/vendor/symfony/translation/Tests/Formatter/MessageFormatterTest.php
@@ -26,6 +26,7 @@ class MessageFormatterTest extends TestCase
/**
* @dataProvider getTransChoiceMessages
+ * @group legacy
*/
public function testFormatPlural($expected, $message, $number, $parameters)
{
diff --git a/vendor/symfony/translation/Tests/IdentityTranslatorTest.php b/vendor/symfony/translation/Tests/IdentityTranslatorTest.php
index 78288da4..be0a548a 100644
--- a/vendor/symfony/translation/Tests/IdentityTranslatorTest.php
+++ b/vendor/symfony/translation/Tests/IdentityTranslatorTest.php
@@ -11,86 +11,13 @@
namespace Symfony\Component\Translation\Tests;
-use PHPUnit\Framework\TestCase;
-use Symfony\Component\Intl\Util\IntlTestHelper;
use Symfony\Component\Translation\IdentityTranslator;
+use Symfony\Contracts\Tests\Translation\TranslatorTest;
-class IdentityTranslatorTest extends TestCase
+class IdentityTranslatorTest extends TranslatorTest
{
- /**
- * @dataProvider getTransTests
- */
- public function testTrans($expected, $id, $parameters)
+ public function getTranslator()
{
- $translator = new IdentityTranslator();
-
- $this->assertEquals($expected, $translator->trans($id, $parameters));
- }
-
- /**
- * @dataProvider getTransChoiceTests
- */
- public function testTransChoiceWithExplicitLocale($expected, $id, $number, $parameters)
- {
- $translator = new IdentityTranslator();
- $translator->setLocale('en');
-
- $this->assertEquals($expected, $translator->transChoice($id, $number, $parameters));
- }
-
- /**
- * @dataProvider getTransChoiceTests
- */
- public function testTransChoiceWithDefaultLocale($expected, $id, $number, $parameters)
- {
- \Locale::setDefault('en');
-
- $translator = new IdentityTranslator();
-
- $this->assertEquals($expected, $translator->transChoice($id, $number, $parameters));
- }
-
- public function testGetSetLocale()
- {
- $translator = new IdentityTranslator();
- $translator->setLocale('en');
-
- $this->assertEquals('en', $translator->getLocale());
- }
-
- public function testGetLocaleReturnsDefaultLocaleIfNotSet()
- {
- // in order to test with "pt_BR"
- IntlTestHelper::requireFullIntl($this, false);
-
- $translator = new IdentityTranslator();
-
- \Locale::setDefault('en');
- $this->assertEquals('en', $translator->getLocale());
-
- \Locale::setDefault('pt_BR');
- $this->assertEquals('pt_BR', $translator->getLocale());
- }
-
- public function getTransTests()
- {
- return array(
- array('Symfony is great!', 'Symfony is great!', array()),
- array('Symfony is awesome!', 'Symfony is %what%!', array('%what%' => 'awesome')),
- );
- }
-
- public function getTransChoiceTests()
- {
- return array(
- array('There are no apples', '{0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples', 0, array('%count%' => 0)),
- array('There is one apple', '{0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples', 1, array('%count%' => 1)),
- array('There are 10 apples', '{0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples', 10, array('%count%' => 10)),
- array('There are 0 apples', 'There is 1 apple|There are %count% apples', 0, array('%count%' => 0)),
- array('There is 1 apple', 'There is 1 apple|There are %count% apples', 1, array('%count%' => 1)),
- array('There are 10 apples', 'There is 1 apple|There are %count% apples', 10, array('%count%' => 10)),
- // custom validation messages may be coded with a fixed value
- array('There are 2 apples', 'There are 2 apples', 2, array('%count%' => 2)),
- );
+ return new IdentityTranslator();
}
}
diff --git a/vendor/symfony/translation/Tests/IntervalTest.php b/vendor/symfony/translation/Tests/IntervalTest.php
index 99b209a7..a8dd18ca 100644
--- a/vendor/symfony/translation/Tests/IntervalTest.php
+++ b/vendor/symfony/translation/Tests/IntervalTest.php
@@ -14,6 +14,9 @@ namespace Symfony\Component\Translation\Tests;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Translation\Interval;
+/**
+ * @group legacy
+ */
class IntervalTest extends TestCase
{
/**
diff --git a/vendor/symfony/translation/Tests/Loader/XliffFileLoaderTest.php b/vendor/symfony/translation/Tests/Loader/XliffFileLoaderTest.php
index 94406fd5..c6958486 100644
--- a/vendor/symfony/translation/Tests/Loader/XliffFileLoaderTest.php
+++ b/vendor/symfony/translation/Tests/Loader/XliffFileLoaderTest.php
@@ -66,7 +66,7 @@ class XliffFileLoaderTest extends TestCase
$loader = new XliffFileLoader();
$catalogue = $loader->load(__DIR__.'/../fixtures/resname.xlf', 'en', 'domain1');
- $this->assertEquals(array('foo' => 'bar', 'bar' => 'baz', 'baz' => 'foo'), $catalogue->all('domain1'));
+ $this->assertEquals(array('foo' => 'bar', 'bar' => 'baz', 'baz' => 'foo', 'qux' => 'qux source'), $catalogue->all('domain1'));
}
public function testIncompleteResource()
diff --git a/vendor/symfony/translation/Tests/LoggingTranslatorTest.php b/vendor/symfony/translation/Tests/LoggingTranslatorTest.php
index 022379e9..0e43cbec 100644
--- a/vendor/symfony/translation/Tests/LoggingTranslatorTest.php
+++ b/vendor/symfony/translation/Tests/LoggingTranslatorTest.php
@@ -21,17 +21,19 @@ class LoggingTranslatorTest extends TestCase
public function testTransWithNoTranslationIsLogged()
{
$logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock();
- $logger->expects($this->exactly(2))
+ $logger->expects($this->exactly(1))
->method('warning')
->with('Translation not found.')
;
$translator = new Translator('ar');
$loggableTranslator = new LoggingTranslator($translator, $logger);
- $loggableTranslator->transChoice('some_message2', 10, array('%count%' => 10));
$loggableTranslator->trans('bar');
}
+ /**
+ * @group legacy
+ */
public function testTransChoiceFallbackIsLogged()
{
$logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock();
@@ -47,4 +49,20 @@ class LoggingTranslatorTest extends TestCase
$loggableTranslator = new LoggingTranslator($translator, $logger);
$loggableTranslator->transChoice('some_message2', 10, array('%count%' => 10));
}
+
+ /**
+ * @group legacy
+ */
+ public function testTransChoiceWithNoTranslationIsLogged()
+ {
+ $logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock();
+ $logger->expects($this->exactly(1))
+ ->method('warning')
+ ->with('Translation not found.')
+ ;
+
+ $translator = new Translator('ar');
+ $loggableTranslator = new LoggingTranslator($translator, $logger);
+ $loggableTranslator->transChoice('some_message2', 10, array('%count%' => 10));
+ }
}
diff --git a/vendor/symfony/translation/Tests/MessageCatalogueTest.php b/vendor/symfony/translation/Tests/MessageCatalogueTest.php
index 1ab82469..3339f3db 100644
--- a/vendor/symfony/translation/Tests/MessageCatalogueTest.php
+++ b/vendor/symfony/translation/Tests/MessageCatalogueTest.php
@@ -25,9 +25,9 @@ class MessageCatalogueTest extends TestCase
public function testGetDomains()
{
- $catalogue = new MessageCatalogue('en', array('domain1' => array(), 'domain2' => array()));
+ $catalogue = new MessageCatalogue('en', array('domain1' => array(), 'domain2' => array(), 'domain2+intl-icu' => array(), 'domain3+intl-icu' => array()));
- $this->assertEquals(array('domain1', 'domain2'), $catalogue->getDomains());
+ $this->assertEquals(array('domain1', 'domain2', 'domain3'), $catalogue->getDomains());
}
public function testAll()
@@ -37,24 +37,43 @@ class MessageCatalogueTest extends TestCase
$this->assertEquals(array('foo' => 'foo'), $catalogue->all('domain1'));
$this->assertEquals(array(), $catalogue->all('domain88'));
$this->assertEquals($messages, $catalogue->all());
+
+ $messages = array('domain1+intl-icu' => array('foo' => 'bar')) + $messages + array(
+ 'domain2+intl-icu' => array('bar' => 'foo'),
+ 'domain3+intl-icu' => array('biz' => 'biz'),
+ );
+ $catalogue = new MessageCatalogue('en', $messages);
+
+ $this->assertEquals(array('foo' => 'bar'), $catalogue->all('domain1'));
+ $this->assertEquals(array('bar' => 'foo'), $catalogue->all('domain2'));
+ $this->assertEquals(array('biz' => 'biz'), $catalogue->all('domain3'));
+
+ $messages = array(
+ 'domain1' => array('foo' => 'bar'),
+ 'domain2' => array('bar' => 'foo'),
+ 'domain3' => array('biz' => 'biz'),
+ );
+ $this->assertEquals($messages, $catalogue->all());
}
public function testHas()
{
- $catalogue = new MessageCatalogue('en', array('domain1' => array('foo' => 'foo'), 'domain2' => array('bar' => 'bar')));
+ $catalogue = new MessageCatalogue('en', array('domain1' => array('foo' => 'foo'), 'domain2+intl-icu' => array('bar' => 'bar')));
$this->assertTrue($catalogue->has('foo', 'domain1'));
+ $this->assertTrue($catalogue->has('bar', 'domain2'));
$this->assertFalse($catalogue->has('bar', 'domain1'));
$this->assertFalse($catalogue->has('foo', 'domain88'));
}
public function testGetSet()
{
- $catalogue = new MessageCatalogue('en', array('domain1' => array('foo' => 'foo'), 'domain2' => array('bar' => 'bar')));
+ $catalogue = new MessageCatalogue('en', array('domain1' => array('foo' => 'foo'), 'domain2' => array('bar' => 'bar'), 'domain2+intl-icu' => array('bar' => 'foo')));
$catalogue->set('foo1', 'foo1', 'domain1');
$this->assertEquals('foo', $catalogue->get('foo', 'domain1'));
$this->assertEquals('foo1', $catalogue->get('foo1', 'domain1'));
+ $this->assertEquals('foo', $catalogue->get('bar', 'domain2'));
}
public function testAdd()
@@ -75,7 +94,7 @@ class MessageCatalogueTest extends TestCase
public function testReplace()
{
- $catalogue = new MessageCatalogue('en', array('domain1' => array('foo' => 'foo'), 'domain2' => array('bar' => 'bar')));
+ $catalogue = new MessageCatalogue('en', array('domain1' => array('foo' => 'foo'), 'domain1+intl-icu' => array('bar' => 'bar')));
$catalogue->replace($messages = array('foo1' => 'foo1'), 'domain1');
$this->assertEquals($messages, $catalogue->all('domain1'));
@@ -89,16 +108,18 @@ class MessageCatalogueTest extends TestCase
$r1 = $this->getMockBuilder('Symfony\Component\Config\Resource\ResourceInterface')->getMock();
$r1->expects($this->any())->method('__toString')->will($this->returnValue('r1'));
- $catalogue = new MessageCatalogue('en', array('domain1' => array('foo' => 'foo'), 'domain2' => array('bar' => 'bar')));
+ $catalogue = new MessageCatalogue('en', array('domain1' => array('foo' => 'foo')));
$catalogue->addResource($r);
- $catalogue1 = new MessageCatalogue('en', array('domain1' => array('foo1' => 'foo1')));
+ $catalogue1 = new MessageCatalogue('en', array('domain1' => array('foo1' => 'foo1'), 'domain2+intl-icu' => array('bar' => 'bar')));
$catalogue1->addResource($r1);
$catalogue->addCatalogue($catalogue1);
$this->assertEquals('foo', $catalogue->get('foo', 'domain1'));
$this->assertEquals('foo1', $catalogue->get('foo1', 'domain1'));
+ $this->assertEquals('bar', $catalogue->get('bar', 'domain2'));
+ $this->assertEquals('bar', $catalogue->get('bar', 'domain2+intl-icu'));
$this->assertEquals(array($r, $r1), $catalogue->getResources());
}
diff --git a/vendor/symfony/translation/Tests/MessageSelectorTest.php b/vendor/symfony/translation/Tests/MessageSelectorTest.php
index 42b7e0a3..5f85c5b2 100644
--- a/vendor/symfony/translation/Tests/MessageSelectorTest.php
+++ b/vendor/symfony/translation/Tests/MessageSelectorTest.php
@@ -14,6 +14,9 @@ namespace Symfony\Component\Translation\Tests;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Translation\MessageSelector;
+/**
+ * @group legacy
+ */
class MessageSelectorTest extends TestCase
{
/**
diff --git a/vendor/symfony/translation/Tests/PluralizationRulesTest.php b/vendor/symfony/translation/Tests/PluralizationRulesTest.php
index 5eb6c01f..0da8757a 100644
--- a/vendor/symfony/translation/Tests/PluralizationRulesTest.php
+++ b/vendor/symfony/translation/Tests/PluralizationRulesTest.php
@@ -26,6 +26,8 @@ use Symfony\Component\Translation\PluralizationRules;
* The goal to cover all languages is to far fetched so this test case is smaller.
*
* @author Clemens Tolboom clemens@build2be.nl
+ *
+ * @group legacy
*/
class PluralizationRulesTest extends TestCase
{
diff --git a/vendor/symfony/translation/Tests/TranslatorCacheTest.php b/vendor/symfony/translation/Tests/TranslatorCacheTest.php
index 3e71ae74..13ae9cb1 100644
--- a/vendor/symfony/translation/Tests/TranslatorCacheTest.php
+++ b/vendor/symfony/translation/Tests/TranslatorCacheTest.php
@@ -24,7 +24,7 @@ class TranslatorCacheTest extends TestCase
protected function setUp()
{
- $this->tmpDir = sys_get_temp_dir().'/sf2_translation';
+ $this->tmpDir = sys_get_temp_dir().'/sf_translation';
$this->deleteTmpDir();
}
@@ -66,13 +66,17 @@ class TranslatorCacheTest extends TestCase
$translator = new Translator($locale, null, $this->tmpDir, $debug);
$translator->addLoader($format, new ArrayLoader());
$translator->addResource($format, array($msgid => 'OK'), $locale);
+ $translator->addResource($format, array($msgid.'+intl' => 'OK'), $locale, 'messages+intl-icu');
$translator->trans($msgid);
+ $translator->trans($msgid.'+intl', array(), 'messages+intl-icu');
// Try again and see we get a valid result whilst no loader can be used
$translator = new Translator($locale, null, $this->tmpDir, $debug);
$translator->addLoader($format, $this->createFailingLoader());
$translator->addResource($format, array($msgid => 'OK'), $locale);
+ $translator->addResource($format, array($msgid.'+intl' => 'OK'), $locale, 'messages+intl-icu');
$this->assertEquals('OK', $translator->trans($msgid), '-> caching does not work in '.($debug ? 'debug' : 'production'));
+ $this->assertEquals('OK', $translator->trans($msgid.'+intl', array(), 'messages+intl-icu'));
}
public function testCatalogueIsReloadedWhenResourcesAreNoLongerFresh()
@@ -212,6 +216,7 @@ class TranslatorCacheTest extends TestCase
$translator->addResource('array', array('foo' => 'foo (a)'), 'a');
$translator->addResource('array', array('foo' => 'foo (b)'), 'b');
$translator->addResource('array', array('bar' => 'bar (b)'), 'b');
+ $translator->addResource('array', array('baz' => 'baz (b)'), 'b', 'messages+intl-icu');
$catalogue = $translator->getCatalogue('a');
$this->assertFalse($catalogue->defines('bar')); // Sure, the "a" catalogue does not contain that message.
@@ -230,12 +235,14 @@ class TranslatorCacheTest extends TestCase
$translator->addResource('array', array('foo' => 'foo (a)'), 'a');
$translator->addResource('array', array('foo' => 'foo (b)'), 'b');
$translator->addResource('array', array('bar' => 'bar (b)'), 'b');
+ $translator->addResource('array', array('baz' => 'baz (b)'), 'b', 'messages+intl-icu');
$catalogue = $translator->getCatalogue('a');
$this->assertFalse($catalogue->defines('bar'));
$fallback = $catalogue->getFallbackCatalogue();
$this->assertTrue($fallback->defines('foo'));
+ $this->assertTrue($fallback->defines('baz', 'messages+intl-icu'));
}
public function testRefreshCacheWhenResourcesAreNoLongerFresh()
diff --git a/vendor/symfony/translation/Tests/TranslatorTest.php b/vendor/symfony/translation/Tests/TranslatorTest.php
index 3e54839f..bbc8ce2d 100644
--- a/vendor/symfony/translation/Tests/TranslatorTest.php
+++ b/vendor/symfony/translation/Tests/TranslatorTest.php
@@ -234,6 +234,42 @@ class TranslatorTest extends TestCase
$this->assertEquals('bar', $translator->trans('foo', array(), 'resources'));
}
+ public function testTransWithIcuFallbackLocale()
+ {
+ $translator = new Translator('en_GB');
+ $translator->addLoader('array', new ArrayLoader());
+ $translator->addResource('array', array('foo' => 'foofoo'), 'en_GB');
+ $translator->addResource('array', array('bar' => 'foobar'), 'en_001');
+ $translator->addResource('array', array('baz' => 'foobaz'), 'en');
+ $this->assertSame('foofoo', $translator->trans('foo'));
+ $this->assertSame('foobar', $translator->trans('bar'));
+ $this->assertSame('foobaz', $translator->trans('baz'));
+ }
+
+ public function testTransWithIcuVariantFallbackLocale()
+ {
+ $translator = new Translator('en_GB_scouse');
+ $translator->addLoader('array', new ArrayLoader());
+ $translator->addResource('array', array('foo' => 'foofoo'), 'en_GB_scouse');
+ $translator->addResource('array', array('bar' => 'foobar'), 'en_GB');
+ $translator->addResource('array', array('baz' => 'foobaz'), 'en_001');
+ $translator->addResource('array', array('qux' => 'fooqux'), 'en');
+ $this->assertSame('foofoo', $translator->trans('foo'));
+ $this->assertSame('foobar', $translator->trans('bar'));
+ $this->assertSame('foobaz', $translator->trans('baz'));
+ $this->assertSame('fooqux', $translator->trans('qux'));
+ }
+
+ public function testTransWithIcuRootFallbackLocale()
+ {
+ $translator = new Translator('az_Cyrl');
+ $translator->addLoader('array', new ArrayLoader());
+ $translator->addResource('array', array('foo' => 'foofoo'), 'az_Cyrl');
+ $translator->addResource('array', array('bar' => 'foobar'), 'az');
+ $this->assertSame('foofoo', $translator->trans('foo'));
+ $this->assertSame('bar', $translator->trans('bar'));
+ }
+
public function testTransWithFallbackLocaleBis()
{
$translator = new Translator('en_US');
@@ -357,6 +393,7 @@ class TranslatorTest extends TestCase
/**
* @dataProvider getTransChoiceTests
+ * @group legacy
*/
public function testTransChoice($expected, $id, $translation, $number, $parameters, $locale, $domain)
{
@@ -370,6 +407,7 @@ class TranslatorTest extends TestCase
/**
* @dataProvider getInvalidLocalesTests
* @expectedException \Symfony\Component\Translation\Exception\InvalidArgumentException
+ * @group legacy
*/
public function testTransChoiceInvalidLocale($locale)
{
@@ -382,6 +420,7 @@ class TranslatorTest extends TestCase
/**
* @dataProvider getValidLocalesTests
+ * @group legacy
*/
public function testTransChoiceValidLocale($locale)
{
@@ -463,7 +502,7 @@ class TranslatorTest extends TestCase
array('Il y a 0 pomme', new StringClass('{0} There are no appless|{1} There is one apple|]1,Inf] There is %count% apples'), '[0,1] Il y a %count% pomme|]1,Inf] Il y a %count% pommes', 0, array(), 'fr', ''),
// Override %count% with a custom value
- array('Il y a quelques pommes', 'one: There is one apple|more: There are %count% apples', 'one: Il y a %count% pomme|more: Il y a %count% pommes', 2, array('%count%' => 'quelques'), 'fr', ''),
+ array('Il y a quelques pommes', 'one: There is one apple|more: There are %count% apples', 'one: Il y a %count% pomme|more: Il y a quelques pommes', 2, array('%count%' => 'quelques'), 'fr', ''),
);
}
@@ -501,6 +540,24 @@ class TranslatorTest extends TestCase
);
}
+ /**
+ * @requires extension intl
+ */
+ public function testIntlFormattedDomain()
+ {
+ $translator = new Translator('en');
+ $translator->addLoader('array', new ArrayLoader());
+
+ $translator->addResource('array', array('some_message' => 'Hello %name%'), 'en');
+ $this->assertSame('Hello Bob', $translator->trans('some_message', array('%name%' => 'Bob')));
+
+ $translator->addResource('array', array('some_message' => 'Hi {name}'), 'en', 'messages+intl-icu');
+ $this->assertSame('Hi Bob', $translator->trans('some_message', array('%name%' => 'Bob')));
+ }
+
+ /**
+ * @group legacy
+ */
public function testTransChoiceFallback()
{
$translator = new Translator('ru');
@@ -511,6 +568,9 @@ class TranslatorTest extends TestCase
$this->assertEquals('10 things', $translator->transChoice('some_message2', 10, array('%count%' => 10)));
}
+ /**
+ * @group legacy
+ */
public function testTransChoiceFallbackBis()
{
$translator = new Translator('ru');
@@ -521,6 +581,9 @@ class TranslatorTest extends TestCase
$this->assertEquals('10 things', $translator->transChoice('some_message2', 10, array('%count%' => 10)));
}
+ /**
+ * @group legacy
+ */
public function testTransChoiceFallbackWithNoTranslation()
{
$translator = new Translator('ru');
diff --git a/vendor/symfony/translation/Tests/fixtures/resname.xlf b/vendor/symfony/translation/Tests/fixtures/resname.xlf
index 2df16af9..4fa5c001 100644
--- a/vendor/symfony/translation/Tests/fixtures/resname.xlf
+++ b/vendor/symfony/translation/Tests/fixtures/resname.xlf
@@ -14,6 +14,9 @@
baz
foo
+
+ qux source
+