diff --git a/app/vendor/bin/doctrine-dbal b/app/vendor/bin/doctrine-dbal new file mode 120000 index 000000000..58a8a89c2 --- /dev/null +++ b/app/vendor/bin/doctrine-dbal @@ -0,0 +1 @@ +../doctrine/dbal/bin/doctrine-dbal \ No newline at end of file diff --git a/app/vendor/cakephp/bake/templates/bake/Template/add.twig b/app/vendor/cakephp/bake/templates/bake/Template/add.twig index 35b66d4da..068f8d44c 100644 --- a/app/vendor/cakephp/bake/templates/bake/Template/add.twig +++ b/app/vendor/cakephp/bake/templates/bake/Template/add.twig @@ -17,6 +17,19 @@ /** * @var \{{ namespace }}\View\AppView $this * @var \{{ entityClass }} ${{ singularVar }} + {{- "\n" }} +{%- if associations.BelongsTo is defined %} + {%- for assocName, assocData in associations.BelongsTo %} + * @var \Cake\Collection\CollectionInterface|string[] ${{ assocData.variable }} + {{- "\n" }} + {%- endfor %} +{% endif %} +{%- if associations.BelongsToMany is defined %} + {%- for assocName, assocData in associations.BelongsToMany %} + * @var \Cake\Collection\CollectionInterface|string[] ${{ assocData.variable }} + {{- "\n" }} + {%- endfor %} +{% endif %} */ ?> {{ element('Bake.form') }} \ No newline at end of file diff --git a/app/vendor/cakephp/bake/templates/bake/Template/edit.twig b/app/vendor/cakephp/bake/templates/bake/Template/edit.twig index 35b66d4da..c0df18eb5 100644 --- a/app/vendor/cakephp/bake/templates/bake/Template/edit.twig +++ b/app/vendor/cakephp/bake/templates/bake/Template/edit.twig @@ -17,6 +17,19 @@ /** * @var \{{ namespace }}\View\AppView $this * @var \{{ entityClass }} ${{ singularVar }} + {{- "\n" }} +{%- if associations.BelongsTo is defined %} + {%- for assocName, assocData in associations.BelongsTo %} + * @var string[]|\Cake\Collection\CollectionInterface ${{ assocData.variable }} + {{- "\n" }} + {%- endfor %} +{% endif %} +{%- if associations.BelongsToMany is defined %} + {%- for assocName, assocData in associations.BelongsToMany %} + * @var string[]|\Cake\Collection\CollectionInterface ${{ assocData.variable }} + {{- "\n" }} + {%- endfor %} +{% endif %} */ ?> {{ element('Bake.form') }} \ No newline at end of file diff --git a/app/vendor/cakephp/bake/templates/bake/tests/test_case.twig b/app/vendor/cakephp/bake/templates/bake/tests/test_case.twig index 1c2d60f17..0ca9bc303 100644 --- a/app/vendor/cakephp/bake/templates/bake/tests/test_case.twig +++ b/app/vendor/cakephp/bake/templates/bake/tests/test_case.twig @@ -130,6 +130,7 @@ class {{ className }}Test extends TestCase * Test {{ method }} method * * @return void + * @uses \{{ fullClassName }}::{{ method }}() */ public function test{{ method|camelize }}(): void { diff --git a/app/vendor/cakephp/cakephp/VERSION.txt b/app/vendor/cakephp/cakephp/VERSION.txt index faddcb5f0..8b1a2d88f 100644 --- a/app/vendor/cakephp/cakephp/VERSION.txt +++ b/app/vendor/cakephp/cakephp/VERSION.txt @@ -16,4 +16,4 @@ // @license https://opensource.org/licenses/mit-license.php MIT License // +--------------------------------------------------------------------------------------------+ // //////////////////////////////////////////////////////////////////////////////////////////////////// -4.2.7 +4.2.9 diff --git a/app/vendor/cakephp/cakephp/composer.json b/app/vendor/cakephp/cakephp/composer.json index 84d07107a..2575cda2d 100644 --- a/app/vendor/cakephp/cakephp/composer.json +++ b/app/vendor/cakephp/cakephp/composer.json @@ -108,7 +108,7 @@ "@phpstan", "@psalm" ], - "stan-setup": "cp composer.json composer.backup && composer require --dev phpstan/phpstan:0.12.88 psalm/phar:~4.7.0 && mv composer.backup composer.json", + "stan-setup": "cp composer.json composer.backup && composer require --dev phpstan/phpstan:0.12.94 psalm/phar:~4.9.3 && mv composer.backup composer.json", "test": "phpunit", "test-coverage": "phpunit --coverage-clover=clover.xml" }, diff --git a/app/vendor/cakephp/cakephp/src/Command/I18nExtractCommand.php b/app/vendor/cakephp/cakephp/src/Command/I18nExtractCommand.php index 98a4f87c3..a90815bd1 100644 --- a/app/vendor/cakephp/cakephp/src/Command/I18nExtractCommand.php +++ b/app/vendor/cakephp/cakephp/src/Command/I18nExtractCommand.php @@ -504,7 +504,8 @@ protected function _parse(ConsoleIo $io, string $functionName, array $map): void if ($mapCount === count($strings)) { $singular = ''; $plural = $context = null; - extract(array_combine($map, $strings)); + $vars = array_combine($map, $strings); + extract($vars); $domain = $domain ?? 'default'; $details = [ 'file' => $this->_file, diff --git a/app/vendor/cakephp/cakephp/src/Controller/ComponentRegistry.php b/app/vendor/cakephp/cakephp/src/Controller/ComponentRegistry.php index 892cb1590..3e4142544 100644 --- a/app/vendor/cakephp/cakephp/src/Controller/ComponentRegistry.php +++ b/app/vendor/cakephp/cakephp/src/Controller/ComponentRegistry.php @@ -125,7 +125,7 @@ protected function _throwMissingClassError(string $class, ?string $plugin): void * @param array $config An array of config to use for the component. * @return \Cake\Controller\Component The constructed component class. * @psalm-suppress MoreSpecificImplementedParamType - * @psalm-var class-string $class + * @psalm-param class-string $class */ protected function _create($class, string $alias, array $config): Component { diff --git a/app/vendor/cakephp/cakephp/src/Core/App.php b/app/vendor/cakephp/cakephp/src/Core/App.php index 02754e83b..9330b5ca2 100644 --- a/app/vendor/cakephp/cakephp/src/Core/App.php +++ b/app/vendor/cakephp/cakephp/src/Core/App.php @@ -51,7 +51,6 @@ class App * @param string $suffix Class name suffix * @return string|null Namespaced class name, null if the class is not found. * @psalm-return class-string|null - * @psalm-var class-string $class */ public static function className(string $class, string $type = '', string $suffix = ''): ?string { diff --git a/app/vendor/cakephp/cakephp/src/Core/Exception/CakeException.php b/app/vendor/cakephp/cakephp/src/Core/Exception/CakeException.php index 9b3d42201..e65d05daf 100644 --- a/app/vendor/cakephp/cakephp/src/Core/Exception/CakeException.php +++ b/app/vendor/cakephp/cakephp/src/Core/Exception/CakeException.php @@ -115,5 +115,5 @@ public function responseHeader($header = null, $value = null): ?array } // phpcs:disable -class_exists('Cake\Core\Exception\CakeException'); +class_exists('Cake\Core\Exception\Exception'); // phpcs:enable diff --git a/app/vendor/cakephp/cakephp/src/Core/PluginCollection.php b/app/vendor/cakephp/cakephp/src/Core/PluginCollection.php index 69d6de883..793e8422d 100644 --- a/app/vendor/cakephp/cakephp/src/Core/PluginCollection.php +++ b/app/vendor/cakephp/cakephp/src/Core/PluginCollection.php @@ -229,7 +229,6 @@ public function get(string $name): PluginInterface * @param array $config Configuration options for the plugin. * @return \Cake\Core\PluginInterface * @throws \Cake\Core\Exception\MissingPluginException When plugin instance could not be created. - * @psalm-var class-string<\Cake\Core\PluginInterface> $name */ public function create(string $name, array $config = []): PluginInterface { diff --git a/app/vendor/cakephp/cakephp/src/Database/Schema/SqlserverSchemaDialect.php b/app/vendor/cakephp/cakephp/src/Database/Schema/SqlserverSchemaDialect.php index afae48ab7..2178e3ab3 100644 --- a/app/vendor/cakephp/cakephp/src/Database/Schema/SqlserverSchemaDialect.php +++ b/app/vendor/cakephp/cakephp/src/Database/Schema/SqlserverSchemaDialect.php @@ -649,7 +649,9 @@ public function truncateTableSql(TableSchema $schema): array $column = $schema->getColumn($pk[0]); if (in_array($column['type'], ['integer', 'biginteger'])) { $queries[] = sprintf( - "DBCC CHECKIDENT('%s', RESEED, 0)", + "IF EXISTS (SELECT * FROM sys.identity_columns WHERE OBJECT_NAME(OBJECT_ID) = '%s' AND " . + "last_value IS NOT NULL) DBCC CHECKIDENT('%s', RESEED, 0)", + $schema->name(), $schema->name() ); } diff --git a/app/vendor/cakephp/cakephp/src/Datasource/Paginator.php b/app/vendor/cakephp/cakephp/src/Datasource/Paginator.php index 8c67c9858..3cabf61de 100644 --- a/app/vendor/cakephp/cakephp/src/Datasource/Paginator.php +++ b/app/vendor/cakephp/cakephp/src/Datasource/Paginator.php @@ -669,7 +669,7 @@ protected function _prefix(RepositoryInterface $object, array $order, bool $allo public function checkLimit(array $options): array { $options['limit'] = (int)$options['limit']; - if (empty($options['limit']) || $options['limit'] < 1) { + if ($options['limit'] < 1) { $options['limit'] = 1; } $options['limit'] = max(min($options['limit'], $options['maxLimit']), 1); diff --git a/app/vendor/cakephp/cakephp/src/Datasource/QueryTrait.php b/app/vendor/cakephp/cakephp/src/Datasource/QueryTrait.php index 3201f24db..729cbdc61 100644 --- a/app/vendor/cakephp/cakephp/src/Datasource/QueryTrait.php +++ b/app/vendor/cakephp/cakephp/src/Datasource/QueryTrait.php @@ -534,6 +534,7 @@ public function firstOrFail() * @see \Cake\Datasource\QueryInterface::applyOptions() to read about the options that will * be processed by this class and not returned by this function * @return array + * @see applyOptions() */ public function getOptions(): array { diff --git a/app/vendor/cakephp/cakephp/src/Error/Debugger.php b/app/vendor/cakephp/cakephp/src/Error/Debugger.php index 7f8859ec7..e4bac37e5 100644 --- a/app/vendor/cakephp/cakephp/src/Error/Debugger.php +++ b/app/vendor/cakephp/cakephp/src/Error/Debugger.php @@ -460,6 +460,7 @@ public static function formatTrace($backtrace, array $options = []) return $back; } + /** @psalm-suppress InvalidArgument */ return implode("\n", $back); } diff --git a/app/vendor/cakephp/cakephp/src/Http/CallbackStream.php b/app/vendor/cakephp/cakephp/src/Http/CallbackStream.php index 4f930e276..4ceed68e4 100644 --- a/app/vendor/cakephp/cakephp/src/Http/CallbackStream.php +++ b/app/vendor/cakephp/cakephp/src/Http/CallbackStream.php @@ -40,7 +40,8 @@ public function getContents(): string { $callback = $this->detach(); $result = ''; - if (is_callable($callback)) { + /** @psalm-suppress TypeDoesNotContainType */ + if ($callback !== null) { $result = $callback(); } if (!is_string($result)) { diff --git a/app/vendor/cakephp/cakephp/src/Http/Client.php b/app/vendor/cakephp/cakephp/src/Http/Client.php index 74d0aee38..277911405 100644 --- a/app/vendor/cakephp/cakephp/src/Http/Client.php +++ b/app/vendor/cakephp/cakephp/src/Http/Client.php @@ -221,7 +221,6 @@ public static function createFromUrl(string $url) } $config = array_intersect_key($parts, ['scheme' => '', 'port' => '', 'host' => '', 'path' => '']); - $config = array_merge(['scheme' => '', 'host' => ''], $config); if (empty($config['scheme']) || empty($config['host'])) { throw new InvalidArgumentException('The URL was parsed but did not contain a scheme or host'); diff --git a/app/vendor/cakephp/cakephp/src/Http/Client/Adapter/Curl.php b/app/vendor/cakephp/cakephp/src/Http/Client/Adapter/Curl.php index e4db3d04e..7fc5df08b 100644 --- a/app/vendor/cakephp/cakephp/src/Http/Client/Adapter/Curl.php +++ b/app/vendor/cakephp/cakephp/src/Http/Client/Adapter/Curl.php @@ -191,12 +191,14 @@ protected function getProtocolVersion(RequestInterface $request): int /** * Convert the raw curl response into an Http\Client\Response * - * @param resource $handle Curl handle + * @param resource|\CurlHandle $handle Curl handle * @param string $responseData string The response data from curl_exec * @return \Cake\Http\Client\Response[] + * @psalm-suppress UndefinedDocblockClass */ protected function createResponse($handle, $responseData): array { + /** @psalm-suppress PossiblyInvalidArgument */ $headerSize = curl_getinfo($handle, CURLINFO_HEADER_SIZE); $headers = trim(substr($responseData, 0, $headerSize)); $body = substr($responseData, $headerSize); @@ -208,11 +210,13 @@ protected function createResponse($handle, $responseData): array /** * Execute the curl handle. * - * @param resource $ch Curl Resource handle + * @param resource|\CurlHandle $ch Curl Resource handle * @return string|bool + * @psalm-suppress UndefinedDocblockClass */ protected function exec($ch) { + /** @psalm-suppress PossiblyInvalidArgument */ return curl_exec($ch); } } diff --git a/app/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php b/app/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php index a0779bb8a..a55a082cf 100644 --- a/app/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php +++ b/app/vendor/cakephp/cakephp/src/Http/ResponseEmitter.php @@ -232,6 +232,7 @@ protected function setCookie($cookie): bool } if (PHP_VERSION_ID >= 70300) { + /** @psalm-suppress InvalidArgument */ return setcookie($cookie->getName(), $cookie->getScalarValue(), $cookie->getOptions()); } diff --git a/app/vendor/cakephp/cakephp/src/I18n/DateFormatTrait.php b/app/vendor/cakephp/cakephp/src/I18n/DateFormatTrait.php index ac790245e..8b13e8440 100644 --- a/app/vendor/cakephp/cakephp/src/I18n/DateFormatTrait.php +++ b/app/vendor/cakephp/cakephp/src/I18n/DateFormatTrait.php @@ -251,7 +251,7 @@ protected function _formatObject($date, $format, ?string $locale): string $calendar, $pattern ); - if ($formatter === false) { + if (empty($formatter)) { throw new RuntimeException( 'Your version of icu does not support creating a date formatter for ' . "`$key`. You should try to upgrade libicu and the intl extension." diff --git a/app/vendor/cakephp/cakephp/src/I18n/Number.php b/app/vendor/cakephp/cakephp/src/I18n/Number.php index 5312aac4f..03f53f996 100644 --- a/app/vendor/cakephp/cakephp/src/I18n/Number.php +++ b/app/vendor/cakephp/cakephp/src/I18n/Number.php @@ -141,7 +141,7 @@ public static function toPercentage($value, int $precision = 2, array $options = { $options += ['multiply' => false, 'type' => NumberFormatter::PERCENT]; if (!$options['multiply']) { - $value /= 100; + $value = (float)$value / 100; } return static::precision($value, $precision, $options); diff --git a/app/vendor/cakephp/cakephp/src/Mailer/Transport/MailTransport.php b/app/vendor/cakephp/cakephp/src/Mailer/Transport/MailTransport.php index 4719c22ba..3442bd921 100644 --- a/app/vendor/cakephp/cakephp/src/Mailer/Transport/MailTransport.php +++ b/app/vendor/cakephp/cakephp/src/Mailer/Transport/MailTransport.php @@ -41,7 +41,7 @@ public function send(Message $message): array $to = $message->getHeaders(['to'])['To']; $to = str_replace("\r\n", '', $to); - $eol = $this->getConfig('eol', PHP_EOL); + $eol = $this->getConfig('eol', version_compare(PHP_VERSION, '8.0', '>=') ? "\r\n" : "\n"); $headers = $message->getHeadersString( [ 'from', diff --git a/app/vendor/cakephp/cakephp/src/ORM/Behavior/Translate/ShadowTableStrategy.php b/app/vendor/cakephp/cakephp/src/ORM/Behavior/Translate/ShadowTableStrategy.php index efcfecee4..f1391aa5d 100644 --- a/app/vendor/cakephp/cakephp/src/ORM/Behavior/Translate/ShadowTableStrategy.php +++ b/app/vendor/cakephp/cakephp/src/ORM/Behavior/Translate/ShadowTableStrategy.php @@ -263,6 +263,7 @@ function ($c, &$field) use ($fields, $alias, $mainTableAlias, $mainTableFields, return $c; } + /** @psalm-suppress ParadoxicalCondition */ if (in_array($field, $fields, true)) { $joinRequired = true; $field = "$alias.$field"; @@ -319,6 +320,7 @@ function ($expression) use ($fields, $alias, $mainTableAlias, $mainTableFields, return; } + /** @psalm-suppress ParadoxicalCondition */ if (in_array($field, $mainTableFields, true)) { $expression->setField("$mainTableAlias.$field"); } diff --git a/app/vendor/cakephp/cakephp/src/ORM/Query.php b/app/vendor/cakephp/cakephp/src/ORM/Query.php index 101723b82..d7dba8ece 100644 --- a/app/vendor/cakephp/cakephp/src/ORM/Query.php +++ b/app/vendor/cakephp/cakephp/src/ORM/Query.php @@ -766,7 +766,9 @@ public function notMatching(string $assoc, ?callable $builder = null) /** * Populates or adds parts to current query clauses using an array. - * This is handy for passing all query clauses at once. The option array accepts: + * This is handy for passing all query clauses at once. + * + * The method accepts the following query clause related options: * * - fields: Maps to the select method * - conditions: Maps to the where method @@ -779,6 +781,10 @@ public function notMatching(string $assoc, ?callable $builder = null) * - join: Maps to the join method * - page: Maps to the page method * + * All other options will not affect the query, but will be stored + * as custom options that can be read via `getOptions()`. Furthermore + * they are automatically passed to `Model.beforeFind`. + * * ### Example: * * ``` @@ -787,7 +793,7 @@ public function notMatching(string $assoc, ?callable $builder = null) * 'conditions' => [ * 'created >=' => '2013-01-01' * ], - * 'limit' => 10 + * 'limit' => 10, * ]); * ``` * @@ -800,8 +806,26 @@ public function notMatching(string $assoc, ?callable $builder = null) * ->limit(10) * ``` * - * @param array $options the options to be applied + * Custom options can be read via `getOptions()`: + * + * ``` + * $query->applyOptions([ + * 'fields' => ['id', 'name'], + * 'custom' => 'value', + * ]); + * ``` + * + * Here `$options` will hold `['custom' => 'value']` (the `fields` + * option will be applied to the query instead of being stored, as + * it's a query clause related option): + * + * ``` + * $options = $query->getOptions(); + * ``` + * + * @param array $options The options to be applied * @return $this + * @see getOptions() */ public function applyOptions(array $options) { diff --git a/app/vendor/cakephp/cakephp/src/ORM/Table.php b/app/vendor/cakephp/cakephp/src/ORM/Table.php index 2cb3e9583..bc837d5b1 100644 --- a/app/vendor/cakephp/cakephp/src/ORM/Table.php +++ b/app/vendor/cakephp/cakephp/src/ORM/Table.php @@ -1320,7 +1320,7 @@ public function findAll(Query $query, array $options): Query * 'valueField' => ['first_name', 'last_name'], * 'valueSeparator' => ' | ', * ]); - * + * ``` * * The results of this finder will be in the following form: * diff --git a/app/vendor/cakephp/cakephp/src/Validation/ValidatorAwareTrait.php b/app/vendor/cakephp/cakephp/src/Validation/ValidatorAwareTrait.php index 3327914b9..5d1c68c61 100644 --- a/app/vendor/cakephp/cakephp/src/Validation/ValidatorAwareTrait.php +++ b/app/vendor/cakephp/cakephp/src/Validation/ValidatorAwareTrait.php @@ -68,11 +68,12 @@ trait ValidatorAwareTrait * ``` * public function validationForSubscription($validator) * { - * return $validator - * ->add('email', 'valid-email', ['rule' => 'email']) - * ->add('password', 'valid', ['rule' => 'notBlank']) - * ->requirePresence('username'); + * return $validator + * ->add('email', 'valid-email', ['rule' => 'email']) + * ->add('password', 'valid', ['rule' => 'notBlank']) + * ->requirePresence('username'); * } + * * $validator = $this->getValidator('forSubscription'); * ``` * @@ -143,11 +144,11 @@ protected function createValidator(string $name): Validator * You can build the object by yourself and store it in your object: * * ``` - * $validator = new \Cake\Validation\Validator($table); + * $validator = new \Cake\Validation\Validator(); * $validator - * ->add('email', 'valid-email', ['rule' => 'email']) - * ->add('password', 'valid', ['rule' => 'notBlank']) - * ->allowEmpty('bio'); + * ->add('email', 'valid-email', ['rule' => 'email']) + * ->add('password', 'valid', ['rule' => 'notBlank']) + * ->allowEmpty('bio'); * $this->setValidator('forSubscription', $validator); * ``` * diff --git a/app/vendor/cakephp/cakephp/src/View/Exception/MissingTemplateException.php b/app/vendor/cakephp/cakephp/src/View/Exception/MissingTemplateException.php index 9b57df477..d5fcfff8d 100644 --- a/app/vendor/cakephp/cakephp/src/View/Exception/MissingTemplateException.php +++ b/app/vendor/cakephp/cakephp/src/View/Exception/MissingTemplateException.php @@ -22,6 +22,11 @@ */ class MissingTemplateException extends CakeException { + /** + * @var string|null + */ + protected $templateName; + /** * @var string */ @@ -47,7 +52,13 @@ class MissingTemplateException extends CakeException */ public function __construct($file, array $paths = [], ?int $code = null, ?Throwable $previous = null) { - $this->file = is_array($file) ? array_pop($file) : $file; + if (is_array($file)) { + $this->file = array_pop($file); + $this->templateName = array_pop($file); + } else { + $this->file = $file; + $this->templateName = null; + } $this->paths = $paths; parent::__construct($this->formatMessage(), $code, $previous); @@ -60,7 +71,8 @@ public function __construct($file, array $paths = [], ?int $code = null, ?Throwa */ public function formatMessage(): string { - $message = "{$this->type} file `{$this->file}` could not be found."; + $name = $this->templateName ?? $this->file; + $message = "{$this->type} file `{$name}` could not be found."; if ($this->paths) { $message .= "\n\nThe following paths were searched:\n\n"; foreach ($this->paths as $path) { diff --git a/app/vendor/cakephp/cakephp/src/View/Helper/PaginatorHelper.php b/app/vendor/cakephp/cakephp/src/View/Helper/PaginatorHelper.php index 3334e15f6..0c9591a19 100644 --- a/app/vendor/cakephp/cakephp/src/View/Helper/PaginatorHelper.php +++ b/app/vendor/cakephp/cakephp/src/View/Helper/PaginatorHelper.php @@ -567,20 +567,18 @@ public function generateUrlParams(array $options = [], ?string $model = null, ar ) { $options['sort'] = $options['direction'] = null; } - + $baseUrl = $this->_config['options']['url'] ?? []; if (!empty($paging['scope'])) { $scope = $paging['scope']; - $currentParams = $this->_config['options']['url']; - - if (isset($currentParams['?'][$scope]) && is_array($currentParams['?'][$scope])) { - $options += $currentParams['?'][$scope]; + if (isset($baseUrl['?'][$scope]) && is_array($baseUrl['?'][$scope])) { + $options += $baseUrl['?'][$scope]; + unset($baseUrl['?'][$scope]); } $options = [$scope => $options]; } - if (!empty($this->_config['options']['url'])) { - $key = implode('.', array_filter(['options.url', Hash::get($paging, 'scope', null)])); - $url = Hash::merge($url, Hash::get($this->_config, $key, [])); + if (!empty($baseUrl)) { + $url = Hash::merge($url, $baseUrl); } if (!isset($url['?'])) { diff --git a/app/vendor/cakephp/cakephp/src/View/View.php b/app/vendor/cakephp/cakephp/src/View/View.php index 916e97770..11796b3d9 100644 --- a/app/vendor/cakephp/cakephp/src/View/View.php +++ b/app/vendor/cakephp/cakephp/src/View/View.php @@ -656,9 +656,9 @@ public function element(string $name, array $data = [], array $options = []): st } if (empty($options['ignoreMissing'])) { - [$plugin] = $this->pluginSplit($name, $pluginCheck); + [$plugin, $elementName] = $this->pluginSplit($name, $pluginCheck); $paths = iterator_to_array($this->getElementPaths($plugin)); - throw new MissingElementException($name . $this->_ext, $paths); + throw new MissingElementException([$name . $this->_ext, $elementName . $this->_ext], $paths); } return ''; diff --git a/app/vendor/cakephp/cakephp/src/View/Widget/RadioWidget.php b/app/vendor/cakephp/cakephp/src/View/Widget/RadioWidget.php index 587dc3244..95f840236 100644 --- a/app/vendor/cakephp/cakephp/src/View/Widget/RadioWidget.php +++ b/app/vendor/cakephp/cakephp/src/View/Widget/RadioWidget.php @@ -169,7 +169,7 @@ protected function _renderInput($val, $text, $data, $context): string if (empty($radio['id'])) { if (isset($data['id'])) { - $radio['id'] = $data['id'] . '-' . trim( + $radio['id'] = $data['id'] . '-' . rtrim( $this->_idSuffix((string)$radio['value']), '-' ); diff --git a/app/vendor/cakephp/debug_kit/config/routes.php b/app/vendor/cakephp/debug_kit/config/routes.php index bd5052c90..624414af3 100644 --- a/app/vendor/cakephp/debug_kit/config/routes.php +++ b/app/vendor/cakephp/debug_kit/config/routes.php @@ -15,6 +15,10 @@ '/toolbar/*', ['controller' => 'Requests', 'action' => 'view'] ); + $routes->connect( + '/panels/view/latest-history', + ['controller' => 'Panels', 'action' => 'latestHistory'] + ); $routes->connect( '/panels/view/*', ['controller' => 'Panels', 'action' => 'view'] diff --git a/app/vendor/cakephp/debug_kit/docs/en/index.rst b/app/vendor/cakephp/debug_kit/docs/en/index.rst index 6c83c8c1e..45cfea1c5 100644 --- a/app/vendor/cakephp/debug_kit/docs/en/index.rst +++ b/app/vendor/cakephp/debug_kit/docs/en/index.rst @@ -165,7 +165,7 @@ In order to preview emails before sending them, you need to create a preview class that defines the receipient and required template variables for your mailer methods:: - // in src/Mailer/MailPreview/WelcomePreview.php + // in src/Mailer/Preview/WelcomePreview.php namespace App\Mailer\Preview; use DebugKit\Mailer\MailPreview; diff --git a/app/vendor/cakephp/debug_kit/src/Cache/Engine/DebugEngine.php b/app/vendor/cakephp/debug_kit/src/Cache/Engine/DebugEngine.php index 4220918ef..f8d279cd7 100644 --- a/app/vendor/cakephp/debug_kit/src/Cache/Engine/DebugEngine.php +++ b/app/vendor/cakephp/debug_kit/src/Cache/Engine/DebugEngine.php @@ -253,10 +253,10 @@ public function delete($key): bool /** * @inheritDoc */ - public function deleteMultiple($data): bool + public function deleteMultiple($keys): bool { $start = microtime(true); - $result = $this->_engine->deleteMultiple($data); + $result = $this->_engine->deleteMultiple($keys); $duration = microtime(true) - $start; $this->track('delete'); diff --git a/app/vendor/cakephp/debug_kit/src/Controller/PanelsController.php b/app/vendor/cakephp/debug_kit/src/Controller/PanelsController.php index 536bb1091..0f5a0f1a8 100644 --- a/app/vendor/cakephp/debug_kit/src/Controller/PanelsController.php +++ b/app/vendor/cakephp/debug_kit/src/Controller/PanelsController.php @@ -83,11 +83,40 @@ public function index($requestId = null) public function view($id = null) { $this->set('sort', $this->request->getCookie('debugKit_sort')); - $panel = $this->Panels->get($id); + $panel = $this->Panels->get($id, ['contain' => ['Requests']]); $this->set('panel', $panel); // @codingStandardsIgnoreStart $this->set(@unserialize($panel->content)); // @codingStandardsIgnoreEnd } + + /** + * Get Latest request history panel + * + * @return \Cake\Http\Response|null + */ + public function latestHistory() + { + /** @var array{id:string}|null $request */ + $request = $this->Panels->Requests->find('recent') + ->select(['id']) + ->disableHydration() + ->first(); + if (!$request) { + throw new NotFoundException('No requests found'); + } + /** @var array{id:string}|null $historyPanel */ + $historyPanel = $this->Panels->find('byRequest', ['requestId' => $request['id']]) + ->where(['title' => 'History']) + ->select(['id']) + ->first(); + if (!$historyPanel) { + throw new NotFoundException('History Panel from latest request not found'); + } + + return $this->redirect([ + 'action' => 'view', $historyPanel['id'], + ]); + } } diff --git a/app/vendor/cakephp/debug_kit/src/Model/Entity/Panel.php b/app/vendor/cakephp/debug_kit/src/Model/Entity/Panel.php index 6ed488189..f862fd959 100644 --- a/app/vendor/cakephp/debug_kit/src/Model/Entity/Panel.php +++ b/app/vendor/cakephp/debug_kit/src/Model/Entity/Panel.php @@ -23,6 +23,8 @@ * @property string $title * @property string $element * @property string $content + * + * @property \DebugKit\Model\Entity\Request $request */ class Panel extends Entity { diff --git a/app/vendor/cakephp/debug_kit/src/Model/Table/PanelsTable.php b/app/vendor/cakephp/debug_kit/src/Model/Table/PanelsTable.php index 60d6777e3..f70b773fc 100644 --- a/app/vendor/cakephp/debug_kit/src/Model/Table/PanelsTable.php +++ b/app/vendor/cakephp/debug_kit/src/Model/Table/PanelsTable.php @@ -21,6 +21,7 @@ * The panels table collects the information for each panel on * each request. * + * @property \DebugKit\Model\Table\RequestsTable&\Cake\ORM\Association\BelongsTo $Requests * @method \DebugKit\Model\Entity\Panel get($primaryKey, $options = []) * @method \DebugKit\Model\Entity\Panel newEntity($data = null, array $options = []) * @method \DebugKit\Model\Entity\Panel[] newEntities(array $data, array $options = []) diff --git a/app/vendor/cakephp/debug_kit/src/Plugin.php b/app/vendor/cakephp/debug_kit/src/Plugin.php index dc8a9744f..ba4a8f2b7 100644 --- a/app/vendor/cakephp/debug_kit/src/Plugin.php +++ b/app/vendor/cakephp/debug_kit/src/Plugin.php @@ -60,16 +60,16 @@ public function bootstrap(PluginApplicationInterface $app): void /** * Add middleware for the plugin. * - * @param \Cake\Http\MiddlewareQueue $middleware The middleware queue to update. + * @param \Cake\Http\MiddlewareQueue $middlewareQueue The middleware queue to update. * @return \Cake\Http\MiddlewareQueue */ - public function middleware(MiddlewareQueue $middleware): MiddlewareQueue + public function middleware(MiddlewareQueue $middlewareQueue): MiddlewareQueue { if ($this->service) { - $middleware->insertAt(0, new DebugKitMiddleware($this->service)); + $middlewareQueue->insertAt(0, new DebugKitMiddleware($this->service)); } - return $middleware; + return $middlewareQueue; } /** diff --git a/app/vendor/cakephp/debug_kit/src/ToolbarService.php b/app/vendor/cakephp/debug_kit/src/ToolbarService.php index 301652ec9..668507355 100644 --- a/app/vendor/cakephp/debug_kit/src/ToolbarService.php +++ b/app/vendor/cakephp/debug_kit/src/ToolbarService.php @@ -230,19 +230,23 @@ public function initializePanels() */ public function saveData(ServerRequest $request, ResponseInterface $response) { - $ignorePathsPattern = $this->getConfig('ignorePathsPattern'); $path = $request->getUri()->getPath(); - $statusCode = $response->getStatusCode(); + $dashboardUrl = '/debug-kit'; + if (strpos($path, 'debug_kit') !== false || strpos($path, 'debug-kit') !== false) { + if (!($path === $dashboardUrl || $path === $dashboardUrl . '/')) { + // internal debug-kit request + return false; + } + // debug-kit dashboard, save request and show toolbar + } + $ignorePathsPattern = $this->getConfig('ignorePathsPattern'); + $statusCode = $response->getStatusCode(); if ( - strpos($path, 'debug_kit') !== false || - strpos($path, 'debug-kit') !== false || - ( - $ignorePathsPattern && - $statusCode >= 200 && - $statusCode <= 299 && - preg_match($ignorePathsPattern, $path) - ) + $ignorePathsPattern && + $statusCode >= 200 && + $statusCode <= 299 && + preg_match($ignorePathsPattern, $path) ) { return false; } diff --git a/app/vendor/cakephp/debug_kit/templates/element/history_panel.php b/app/vendor/cakephp/debug_kit/templates/element/history_panel.php index cf2f65759..1ace07940 100644 --- a/app/vendor/cakephp/debug_kit/templates/element/history_panel.php +++ b/app/vendor/cakephp/debug_kit/templates/element/history_panel.php @@ -11,7 +11,6 @@ * @since DebugKit 1.1 * @license http://www.opensource.org/licenses/mit-license.php MIT License */ - /** * @var \DebugKit\View\AjaxView $this * @var \DebugKit\Model\Entity\Panel $panel @@ -20,16 +19,25 @@ ?>
-

+

+ + +

-

+

+ + +

diff --git a/app/vendor/cakephp/twig-view/README.md b/app/vendor/cakephp/twig-view/README.md index 74ce3c511..fca06df62 100644 --- a/app/vendor/cakephp/twig-view/README.md +++ b/app/vendor/cakephp/twig-view/README.md @@ -1,6 +1,6 @@ # TwigView plugin for CakePHP -[![Build Status](https://img.shields.io/travis/com/cakephp/twig-view?style=flat-square)](https://travis-ci.com/cakephp/twig-view) +![Build Status](https://github.com/cakephp/twig-view/actions/workflows/ci.yml/badge.svg?branch=master) [![Latest Stable Version](https://img.shields.io/github/v/release/cakephp/twig-view?sort=semver&style=flat-square)](https://packagist.org/packages/cakephp/twig-view) [![Total Downloads](https://img.shields.io/packagist/dt/cakephp/twig-view?style=flat-square)](https://packagist.org/packages/cakephp/twig-view/stats) [![Code Coverage](https://img.shields.io/coveralls/cakephp/twig-view/master.svg?style=flat-square)](https://coveralls.io/r/cakephp/twig-view?branch=master) @@ -174,6 +174,12 @@ Layout templates are supported and loaded the same way as `View` layouts. ``` +The layout can be set from the template using the `layout` tag. + +```twig +{% layout 'Error' %} +``` + ### Accessing View You can access the `View` instance using the `_view` global. @@ -258,7 +264,7 @@ See `jasny/twig-extensions` for the filters they provide. * `__dn` maps to [`__dn`](https://book.cakephp.org/4/en/core-libraries/internationalization-and-localization.html) * `defaultCurrency` maps to [`Cake\I18n\Number::getDefaultCurrency`](https://book.cakephp.org/4/en/core-libraries/number.html#Cake\\I18n\\Number::getDefaultCurrency) * `uuid` maps to [`Cake\Utility\Text::uuid`](https://book.cakephp.org/4/en/core-libraries/text.html#generating-uuids) -* `time` passed the first and optional second argument into [`new \Cake\I18n\Time()`](https://book.cakephp.org/4/en/core-libraries/time.html#creating-time-instances) -* `timezones` maps to `Cake\I18n\Time::listTimezones` +* `time` passed the first and optional second argument into [`new \Cake\I18n\FrozenTime()`](https://book.cakephp.org/4/en/core-libraries/time.html#creating-time-instances) +* `timezones` maps to `Cake\I18n\FrozenTime::listTimezones` See `jasny/twig-extensions` for the functions they provide. diff --git a/app/vendor/cakephp/twig-view/src/Twig/Extension/TimeExtension.php b/app/vendor/cakephp/twig-view/src/Twig/Extension/TimeExtension.php index d06a81966..190e718ed 100644 --- a/app/vendor/cakephp/twig-view/src/Twig/Extension/TimeExtension.php +++ b/app/vendor/cakephp/twig-view/src/Twig/Extension/TimeExtension.php @@ -18,7 +18,7 @@ namespace Cake\TwigView\Twig\Extension; -use Cake\I18n\Time as CakeTime; +use Cake\I18n\FrozenTime; use Twig\Extension\AbstractExtension; use Twig\TwigFunction; @@ -36,9 +36,9 @@ public function getFunctions(): array { return [ new TwigFunction('time', function ($time = null, $timezone = null) { - return new CakeTime($time, $timezone); + return new FrozenTime($time, $timezone); }), - new TwigFunction('timezones', 'Cake\I18n\Time::listTimezones'), + new TwigFunction('timezones', 'Cake\I18n\FrozenTime::listTimezones'), ]; } } diff --git a/app/vendor/composer/ClassLoader.php b/app/vendor/composer/ClassLoader.php index 6d0c3f2d0..1a58957d2 100644 --- a/app/vendor/composer/ClassLoader.php +++ b/app/vendor/composer/ClassLoader.php @@ -42,8 +42,6 @@ */ class ClassLoader { - private $vendorDir; - // PSR-4 private $prefixLengthsPsr4 = array(); private $prefixDirsPsr4 = array(); @@ -59,13 +57,6 @@ class ClassLoader private $missingClasses = array(); private $apcuPrefix; - private static $registeredLoaders = array(); - - public function __construct($vendorDir = null) - { - $this->vendorDir = $vendorDir; - } - public function getPrefixes() { if (!empty($this->prefixesPsr0)) { @@ -309,17 +300,6 @@ public function getApcuPrefix() public function register($prepend = false) { spl_autoload_register(array($this, 'loadClass'), true, $prepend); - - if (null === $this->vendorDir) { - return; - } - - if ($prepend) { - self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders; - } else { - unset(self::$registeredLoaders[$this->vendorDir]); - self::$registeredLoaders[$this->vendorDir] = $this; - } } /** @@ -328,17 +308,13 @@ public function register($prepend = false) public function unregister() { spl_autoload_unregister(array($this, 'loadClass')); - - if (null !== $this->vendorDir) { - unset(self::$registeredLoaders[$this->vendorDir]); - } } /** * Loads the given class or interface. * * @param string $class The name of the class - * @return true|null True if loaded, null otherwise + * @return bool|null True if loaded, null otherwise */ public function loadClass($class) { @@ -347,8 +323,6 @@ public function loadClass($class) return true; } - - return null; } /** @@ -393,16 +367,6 @@ public function findFile($class) return $file; } - /** - * Returns the currently registered loaders indexed by their corresponding vendor directories. - * - * @return self[] - */ - public static function getRegisteredLoaders() - { - return self::$registeredLoaders; - } - private function findFileWithExtension($class, $ext) { // PSR-4 lookup diff --git a/app/vendor/composer/InstalledVersions.php b/app/vendor/composer/InstalledVersions.php index b3a4e1611..f06c911b9 100644 --- a/app/vendor/composer/InstalledVersions.php +++ b/app/vendor/composer/InstalledVersions.php @@ -1,337 +1,1259 @@ - * Jordi Boggiano - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ + + + + + + + + + namespace Composer; -use Composer\Autoload\ClassLoader; use Composer\Semver\VersionParser; -/** - * This class is copied in every Composer installed project and available to all - * - * See also https://getcomposer.org/doc/07-runtime.md#installed-versions - * - * To require it's presence, you can require `composer-runtime-api ^2.0` - */ + + + + + class InstalledVersions { - private static $installed; - private static $canGetVendors; - private static $installedByVendor = array(); - - /** - * Returns a list of all package names which are present, either by being installed, replaced or provided - * - * @return string[] - * @psalm-return list - */ - public static function getInstalledPackages() - { - $packages = array(); - foreach (self::getInstalled() as $installed) { - $packages[] = array_keys($installed['versions']); - } - - if (1 === \count($packages)) { - return $packages[0]; - } - - return array_keys(array_flip(\call_user_func_array('array_merge', $packages))); - } - - /** - * Returns a list of all package names with a specific type e.g. 'library' - * - * @param string $type - * @return string[] - * @psalm-return list - */ - public static function getInstalledPackagesByType($type) - { - $packagesByType = array(); - - foreach (self::getInstalled() as $installed) { - foreach ($installed['versions'] as $name => $package) { - if (isset($package['type']) && $package['type'] === $type) { - $packagesByType[] = $name; - } - } - } - - return $packagesByType; - } - - /** - * Checks whether the given package is installed - * - * This also returns true if the package name is provided or replaced by another package - * - * @param string $packageName - * @param bool $includeDevRequirements - * @return bool - */ - public static function isInstalled($packageName, $includeDevRequirements = true) - { - foreach (self::getInstalled() as $installed) { - if (isset($installed['versions'][$packageName])) { - return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']); - } - } - - return false; - } - - /** - * Checks whether the given package satisfies a version constraint - * - * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call: - * - * Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3') - * - * @param VersionParser $parser Install composer/semver to have access to this class and functionality - * @param string $packageName - * @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package - * @return bool - */ - public static function satisfies(VersionParser $parser, $packageName, $constraint) - { - $constraint = $parser->parseConstraints($constraint); - $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); - - return $provided->matches($constraint); - } - - /** - * Returns a version constraint representing all the range(s) which are installed for a given package - * - * It is easier to use this via isInstalled() with the $constraint argument if you need to check - * whether a given version of a package is installed, and not just whether it exists - * - * @param string $packageName - * @return string Version constraint usable with composer/semver - */ - public static function getVersionRanges($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - $ranges = array(); - if (isset($installed['versions'][$packageName]['pretty_version'])) { - $ranges[] = $installed['versions'][$packageName]['pretty_version']; - } - if (array_key_exists('aliases', $installed['versions'][$packageName])) { - $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']); - } - if (array_key_exists('replaced', $installed['versions'][$packageName])) { - $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']); - } - if (array_key_exists('provided', $installed['versions'][$packageName])) { - $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']); - } - - return implode(' || ', $ranges); - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @param string $packageName - * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present - */ - public static function getVersion($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - if (!isset($installed['versions'][$packageName]['version'])) { - return null; - } - - return $installed['versions'][$packageName]['version']; - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @param string $packageName - * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present - */ - public static function getPrettyVersion($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - if (!isset($installed['versions'][$packageName]['pretty_version'])) { - return null; - } - - return $installed['versions'][$packageName]['pretty_version']; - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @param string $packageName - * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference - */ - public static function getReference($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - if (!isset($installed['versions'][$packageName]['reference'])) { - return null; - } - - return $installed['versions'][$packageName]['reference']; - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @param string $packageName - * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path. - */ - public static function getInstallPath($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null; - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @return array - * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string} - */ - public static function getRootPackage() - { - $installed = self::getInstalled(); - - return $installed[0]['root']; - } - - /** - * Returns the raw installed.php data for custom implementations - * - * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect. - * @return array[] - * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array} - */ - public static function getRawData() - { - @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED); - - if (null === self::$installed) { - // only require the installed.php file if this file is loaded from its dumped location, - // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 - if (substr(__DIR__, -8, 1) !== 'C') { - self::$installed = include __DIR__ . '/installed.php'; - } else { - self::$installed = array(); - } - } - - return self::$installed; - } - - /** - * Returns the raw data of all installed.php which are currently loaded for custom implementations - * - * @return array[] - * @psalm-return list}> - */ - public static function getAllRawData() - { - return self::getInstalled(); - } - - /** - * Lets you reload the static array from another file - * - * This is only useful for complex integrations in which a project needs to use - * this class but then also needs to execute another project's autoloader in process, - * and wants to ensure both projects have access to their version of installed.php. - * - * A typical case would be PHPUnit, where it would need to make sure it reads all - * the data it needs from this class, then call reload() with - * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure - * the project in which it runs can then also use this class safely, without - * interference between PHPUnit's dependencies and the project's dependencies. - * - * @param array[] $data A vendor/composer/installed.php data set - * @return void - * - * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array} $data - */ - public static function reload($data) - { - self::$installed = $data; - self::$installedByVendor = array(); - } - - /** - * @return array[] - * @psalm-return list}> - */ - private static function getInstalled() - { - if (null === self::$canGetVendors) { - self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders'); - } - - $installed = array(); - - if (self::$canGetVendors) { - foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { - if (isset(self::$installedByVendor[$vendorDir])) { - $installed[] = self::$installedByVendor[$vendorDir]; - } elseif (is_file($vendorDir.'/composer/installed.php')) { - $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php'; - if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { - self::$installed = $installed[count($installed) - 1]; - } - } - } - } - - if (null === self::$installed) { - // only require the installed.php file if this file is loaded from its dumped location, - // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 - if (substr(__DIR__, -8, 1) !== 'C') { - self::$installed = require __DIR__ . '/installed.php'; - } else { - self::$installed = array(); - } - } - $installed[] = self::$installed; - - return $installed; - } +private static $installed = array ( + 'root' => + array ( + 'pretty_version' => 'dev-develop', + 'version' => 'dev-develop', + 'aliases' => + array ( + ), + 'reference' => 'e9e35cc04f182202ee69f7923f435979daf95502', + 'name' => 'cakephp/app', + ), + 'versions' => + array ( + 'brick/varexporter' => + array ( + 'pretty_version' => '0.3.5', + 'version' => '0.3.5.0', + 'aliases' => + array ( + ), + 'reference' => '05241f28dfcba2b51b11e2d750e296316ebbe518', + ), + 'cakephp/app' => + array ( + 'pretty_version' => 'dev-develop', + 'version' => 'dev-develop', + 'aliases' => + array ( + ), + 'reference' => 'e9e35cc04f182202ee69f7923f435979daf95502', + ), + 'cakephp/bake' => + array ( + 'pretty_version' => '2.5.2', + 'version' => '2.5.2.0', + 'aliases' => + array ( + ), + 'reference' => 'bfb856afcfbc70c5cf5341669c3036a45ca15d94', + ), + 'cakephp/cache' => + array ( + 'replaced' => + array ( + 0 => '4.2.9', + ), + ), + 'cakephp/cakephp' => + array ( + 'pretty_version' => '4.2.9', + 'version' => '4.2.9.0', + 'aliases' => + array ( + ), + 'reference' => '6cb068fd328219d79a02ef6df439b73459071368', + ), + 'cakephp/cakephp-codesniffer' => + array ( + 'pretty_version' => '4.2.4', + 'version' => '4.2.4.0', + 'aliases' => + array ( + ), + 'reference' => 'c5bb1faeebf09cd4a3604bdb0c84f7bc92dc5475', + ), + 'cakephp/chronos' => + array ( + 'pretty_version' => '2.2.0', + 'version' => '2.2.0.0', + 'aliases' => + array ( + ), + 'reference' => '556e14da67307ffc2e68beeb7df0694dc8d1207d', + ), + 'cakephp/collection' => + array ( + 'replaced' => + array ( + 0 => '4.2.9', + ), + ), + 'cakephp/console' => + array ( + 'replaced' => + array ( + 0 => '4.2.9', + ), + ), + 'cakephp/core' => + array ( + 'replaced' => + array ( + 0 => '4.2.9', + ), + ), + 'cakephp/database' => + array ( + 'replaced' => + array ( + 0 => '4.2.9', + ), + ), + 'cakephp/datasource' => + array ( + 'replaced' => + array ( + 0 => '4.2.9', + ), + ), + 'cakephp/debug_kit' => + array ( + 'pretty_version' => '4.4.4', + 'version' => '4.4.4.0', + 'aliases' => + array ( + ), + 'reference' => '10d7d9ba36945844211f1d8763e59618917e1784', + ), + 'cakephp/event' => + array ( + 'replaced' => + array ( + 0 => '4.2.9', + ), + ), + 'cakephp/filesystem' => + array ( + 'replaced' => + array ( + 0 => '4.2.9', + ), + ), + 'cakephp/form' => + array ( + 'replaced' => + array ( + 0 => '4.2.9', + ), + ), + 'cakephp/http' => + array ( + 'replaced' => + array ( + 0 => '4.2.9', + ), + ), + 'cakephp/i18n' => + array ( + 'replaced' => + array ( + 0 => '4.2.9', + ), + ), + 'cakephp/log' => + array ( + 'replaced' => + array ( + 0 => '4.2.9', + ), + ), + 'cakephp/migrations' => + array ( + 'pretty_version' => '3.1.0', + 'version' => '3.1.0.0', + 'aliases' => + array ( + ), + 'reference' => 'd22737c31243db89774abfe6a077d254c0eae75a', + ), + 'cakephp/orm' => + array ( + 'replaced' => + array ( + 0 => '4.2.9', + ), + ), + 'cakephp/plugin-installer' => + array ( + 'pretty_version' => '1.3.1', + 'version' => '1.3.1.0', + 'aliases' => + array ( + ), + 'reference' => 'e27027aa2d3d8ab64452c6817629558685a064cb', + ), + 'cakephp/twig-view' => + array ( + 'pretty_version' => '1.3.0', + 'version' => '1.3.0.0', + 'aliases' => + array ( + ), + 'reference' => '14df50360b809a171d0688020fbdfe513763f89b', + ), + 'cakephp/utility' => + array ( + 'replaced' => + array ( + 0 => '4.2.9', + ), + ), + 'cakephp/validation' => + array ( + 'replaced' => + array ( + 0 => '4.2.9', + ), + ), + 'composer/ca-bundle' => + array ( + 'pretty_version' => '1.2.11', + 'version' => '1.2.11.0', + 'aliases' => + array ( + ), + 'reference' => '0b072d51c5a9c6f3412f7ea3ab043d6603cb2582', + ), + 'composer/composer' => + array ( + 'pretty_version' => '2.1.9', + 'version' => '2.1.9.0', + 'aliases' => + array ( + ), + 'reference' => 'e558c88f28d102d497adec4852802c0dc14c7077', + ), + 'composer/metadata-minifier' => + array ( + 'pretty_version' => '1.0.0', + 'version' => '1.0.0.0', + 'aliases' => + array ( + ), + 'reference' => 'c549d23829536f0d0e984aaabbf02af91f443207', + ), + 'composer/package-versions-deprecated' => + array ( + 'pretty_version' => '1.11.99.4', + 'version' => '1.11.99.4', + 'aliases' => + array ( + ), + 'reference' => 'b174585d1fe49ceed21928a945138948cb394600', + ), + 'composer/semver' => + array ( + 'pretty_version' => '3.2.5', + 'version' => '3.2.5.0', + 'aliases' => + array ( + ), + 'reference' => '31f3ea725711245195f62e54ffa402d8ef2fdba9', + ), + 'composer/spdx-licenses' => + array ( + 'pretty_version' => '1.5.5', + 'version' => '1.5.5.0', + 'aliases' => + array ( + ), + 'reference' => 'de30328a7af8680efdc03e396aad24befd513200', + ), + 'composer/xdebug-handler' => + array ( + 'pretty_version' => '2.0.2', + 'version' => '2.0.2.0', + 'aliases' => + array ( + ), + 'reference' => '84674dd3a7575ba617f5a76d7e9e29a7d3891339', + ), + 'dealerdirect/phpcodesniffer-composer-installer' => + array ( + 'pretty_version' => 'v0.7.1', + 'version' => '0.7.1.0', + 'aliases' => + array ( + ), + 'reference' => 'fe390591e0241955f22eb9ba327d137e501c771c', + ), + 'doctrine/cache' => + array ( + 'pretty_version' => '2.1.1', + 'version' => '2.1.1.0', + 'aliases' => + array ( + ), + 'reference' => '331b4d5dbaeab3827976273e9356b3b453c300ce', + ), + 'doctrine/dbal' => + array ( + 'pretty_version' => '3.1.3', + 'version' => '3.1.3.0', + 'aliases' => + array ( + ), + 'reference' => '96b0053775a544b4a6ab47654dac0621be8b4cf8', + ), + 'doctrine/deprecations' => + array ( + 'pretty_version' => 'v0.5.3', + 'version' => '0.5.3.0', + 'aliases' => + array ( + ), + 'reference' => '9504165960a1f83cc1480e2be1dd0a0478561314', + ), + 'doctrine/event-manager' => + array ( + 'pretty_version' => '1.1.1', + 'version' => '1.1.1.0', + 'aliases' => + array ( + ), + 'reference' => '41370af6a30faa9dc0368c4a6814d596e81aba7f', + ), + 'doctrine/instantiator' => + array ( + 'pretty_version' => '1.4.0', + 'version' => '1.4.0.0', + 'aliases' => + array ( + ), + 'reference' => 'd56bf6102915de5702778fe20f2de3b2fe570b5b', + ), + 'jasny/twig-extensions' => + array ( + 'pretty_version' => 'v1.3.0', + 'version' => '1.3.0.0', + 'aliases' => + array ( + ), + 'reference' => 'a694eb02f6fc14ff8e2fceb8b80882c0c926102b', + ), + 'jdorn/sql-formatter' => + array ( + 'pretty_version' => 'v1.2.17', + 'version' => '1.2.17.0', + 'aliases' => + array ( + ), + 'reference' => '64990d96e0959dff8e059dfcdc1af130728d92bc', + ), + 'josegonzalez/dotenv' => + array ( + 'pretty_version' => '3.2.0', + 'version' => '3.2.0.0', + 'aliases' => + array ( + ), + 'reference' => 'f19174d9d7213a6c20e8e5e268aa7dd042d821ca', + ), + 'justinrainbow/json-schema' => + array ( + 'pretty_version' => '5.2.11', + 'version' => '5.2.11.0', + 'aliases' => + array ( + ), + 'reference' => '2ab6744b7296ded80f8cc4f9509abbff393399aa', + ), + 'laminas/laminas-diactoros' => + array ( + 'pretty_version' => '2.8.0', + 'version' => '2.8.0.0', + 'aliases' => + array ( + ), + 'reference' => '0c26ef1d95b6d7e6e3943a243ba3dc0797227199', + ), + 'laminas/laminas-httphandlerrunner' => + array ( + 'pretty_version' => '1.5.0', + 'version' => '1.5.0.0', + 'aliases' => + array ( + ), + 'reference' => '5f94e55d93f756e8ad07b9049aeb3d6d84582d0e', + ), + 'laminas/laminas-zendframework-bridge' => + array ( + 'pretty_version' => '1.4.0', + 'version' => '1.4.0.0', + 'aliases' => + array ( + ), + 'reference' => 'bf180a382393e7db5c1e8d0f2ec0c4af9c724baf', + ), + 'league/container' => + array ( + 'pretty_version' => '3.4.1', + 'version' => '3.4.1.0', + 'aliases' => + array ( + ), + 'reference' => '84ecbc2dbecc31bd23faf759a0e329ee49abddbd', + ), + 'm1/env' => + array ( + 'pretty_version' => '2.2.0', + 'version' => '2.2.0.0', + 'aliases' => + array ( + ), + 'reference' => '5c296e3e13450a207e12b343f3af1d7ab569f6f3', + ), + 'mobiledetect/mobiledetectlib' => + array ( + 'pretty_version' => '2.8.37', + 'version' => '2.8.37.0', + 'aliases' => + array ( + ), + 'reference' => '9841e3c46f5bd0739b53aed8ac677fa712943df7', + ), + 'myclabs/deep-copy' => + array ( + 'pretty_version' => '1.10.2', + 'version' => '1.10.2.0', + 'aliases' => + array ( + ), + 'reference' => '776f831124e9c62e1a2c601ecc52e776d8bb7220', + 'replaced' => + array ( + 0 => '1.10.2', + ), + ), + 'nikic/php-parser' => + array ( + 'pretty_version' => 'v4.13.0', + 'version' => '4.13.0.0', + 'aliases' => + array ( + ), + 'reference' => '50953a2691a922aa1769461637869a0a2faa3f53', + ), + 'ocramius/package-versions' => + array ( + 'replaced' => + array ( + 0 => '1.11.99', + ), + ), + 'orno/di' => + array ( + 'replaced' => + array ( + 0 => '~2.0', + ), + ), + 'phar-io/manifest' => + array ( + 'pretty_version' => '2.0.3', + 'version' => '2.0.3.0', + 'aliases' => + array ( + ), + 'reference' => '97803eca37d319dfa7826cc2437fc020857acb53', + ), + 'phar-io/version' => + array ( + 'pretty_version' => '3.1.0', + 'version' => '3.1.0.0', + 'aliases' => + array ( + ), + 'reference' => 'bae7c545bef187884426f042434e561ab1ddb182', + ), + 'phpdocumentor/reflection-common' => + array ( + 'pretty_version' => '2.2.0', + 'version' => '2.2.0.0', + 'aliases' => + array ( + ), + 'reference' => '1d01c49d4ed62f25aa84a747ad35d5a16924662b', + ), + 'phpdocumentor/reflection-docblock' => + array ( + 'pretty_version' => '5.2.2', + 'version' => '5.2.2.0', + 'aliases' => + array ( + ), + 'reference' => '069a785b2141f5bcf49f3e353548dc1cce6df556', + ), + 'phpdocumentor/type-resolver' => + array ( + 'pretty_version' => '1.5.1', + 'version' => '1.5.1.0', + 'aliases' => + array ( + ), + 'reference' => 'a12f7e301eb7258bb68acd89d4aefa05c2906cae', + ), + 'phpspec/prophecy' => + array ( + 'pretty_version' => '1.14.0', + 'version' => '1.14.0.0', + 'aliases' => + array ( + ), + 'reference' => 'd86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e', + ), + 'phpstan/phpdoc-parser' => + array ( + 'pretty_version' => '0.4.9', + 'version' => '0.4.9.0', + 'aliases' => + array ( + ), + 'reference' => '98a088b17966bdf6ee25c8a4b634df313d8aa531', + ), + 'phpunit/php-code-coverage' => + array ( + 'pretty_version' => '9.2.7', + 'version' => '9.2.7.0', + 'aliases' => + array ( + ), + 'reference' => 'd4c798ed8d51506800b441f7a13ecb0f76f12218', + ), + 'phpunit/php-file-iterator' => + array ( + 'pretty_version' => '3.0.5', + 'version' => '3.0.5.0', + 'aliases' => + array ( + ), + 'reference' => 'aa4be8575f26070b100fccb67faabb28f21f66f8', + ), + 'phpunit/php-invoker' => + array ( + 'pretty_version' => '3.1.1', + 'version' => '3.1.1.0', + 'aliases' => + array ( + ), + 'reference' => '5a10147d0aaf65b58940a0b72f71c9ac0423cc67', + ), + 'phpunit/php-text-template' => + array ( + 'pretty_version' => '2.0.4', + 'version' => '2.0.4.0', + 'aliases' => + array ( + ), + 'reference' => '5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28', + ), + 'phpunit/php-timer' => + array ( + 'pretty_version' => '5.0.3', + 'version' => '5.0.3.0', + 'aliases' => + array ( + ), + 'reference' => '5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2', + ), + 'phpunit/phpunit' => + array ( + 'pretty_version' => '9.5.10', + 'version' => '9.5.10.0', + 'aliases' => + array ( + ), + 'reference' => 'c814a05837f2edb0d1471d6e3f4ab3501ca3899a', + ), + 'psr/container' => + array ( + 'pretty_version' => '1.1.1', + 'version' => '1.1.1.0', + 'aliases' => + array ( + ), + 'reference' => '8622567409010282b7aeebe4bb841fe98b58dcaf', + ), + 'psr/container-implementation' => + array ( + 'provided' => + array ( + 0 => '^1.0', + ), + ), + 'psr/http-client' => + array ( + 'pretty_version' => '1.0.1', + 'version' => '1.0.1.0', + 'aliases' => + array ( + ), + 'reference' => '2dfb5f6c5eff0e91e20e913f8c5452ed95b86621', + ), + 'psr/http-factory' => + array ( + 'pretty_version' => '1.0.1', + 'version' => '1.0.1.0', + 'aliases' => + array ( + ), + 'reference' => '12ac7fcd07e5b077433f5f2bee95b3a771bf61be', + ), + 'psr/http-factory-implementation' => + array ( + 'provided' => + array ( + 0 => '1.0', + ), + ), + 'psr/http-message' => + array ( + 'pretty_version' => '1.0.1', + 'version' => '1.0.1.0', + 'aliases' => + array ( + ), + 'reference' => 'f6561bf28d520154e4b0ec72be95418abe6d9363', + ), + 'psr/http-message-implementation' => + array ( + 'provided' => + array ( + 0 => '1.0', + ), + ), + 'psr/http-server-handler' => + array ( + 'pretty_version' => '1.0.1', + 'version' => '1.0.1.0', + 'aliases' => + array ( + ), + 'reference' => 'aff2f80e33b7f026ec96bb42f63242dc50ffcae7', + ), + 'psr/http-server-middleware' => + array ( + 'pretty_version' => '1.0.1', + 'version' => '1.0.1.0', + 'aliases' => + array ( + ), + 'reference' => '2296f45510945530b9dceb8bcedb5cb84d40c5f5', + ), + 'psr/log' => + array ( + 'pretty_version' => '1.1.4', + 'version' => '1.1.4.0', + 'aliases' => + array ( + ), + 'reference' => 'd49695b909c3b7628b6289db5479a1c204601f11', + ), + 'psr/log-implementation' => + array ( + 'provided' => + array ( + 0 => '1.0|2.0', + ), + ), + 'psr/simple-cache' => + array ( + 'pretty_version' => '1.0.1', + 'version' => '1.0.1.0', + 'aliases' => + array ( + ), + 'reference' => '408d5eafb83c57f6365a3ca330ff23aa4a5fa39b', + ), + 'psy/psysh' => + array ( + 'pretty_version' => 'v0.10.9', + 'version' => '0.10.9.0', + 'aliases' => + array ( + ), + 'reference' => '01281336c4ae557fe4a994544f30d3a1bc204375', + ), + 'react/promise' => + array ( + 'pretty_version' => 'v2.8.0', + 'version' => '2.8.0.0', + 'aliases' => + array ( + ), + 'reference' => 'f3cff96a19736714524ca0dd1d4130de73dbbbc4', + ), + 'robmorgan/phinx' => + array ( + 'pretty_version' => '0.12.8', + 'version' => '0.12.8.0', + 'aliases' => + array ( + ), + 'reference' => 'd2ed1b452cc90f4cae4ea6b5976b94fb9e5ed2a2', + ), + 'sebastian/cli-parser' => + array ( + 'pretty_version' => '1.0.1', + 'version' => '1.0.1.0', + 'aliases' => + array ( + ), + 'reference' => '442e7c7e687e42adc03470c7b668bc4b2402c0b2', + ), + 'sebastian/code-unit' => + array ( + 'pretty_version' => '1.0.8', + 'version' => '1.0.8.0', + 'aliases' => + array ( + ), + 'reference' => '1fc9f64c0927627ef78ba436c9b17d967e68e120', + ), + 'sebastian/code-unit-reverse-lookup' => + array ( + 'pretty_version' => '2.0.3', + 'version' => '2.0.3.0', + 'aliases' => + array ( + ), + 'reference' => 'ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5', + ), + 'sebastian/comparator' => + array ( + 'pretty_version' => '4.0.6', + 'version' => '4.0.6.0', + 'aliases' => + array ( + ), + 'reference' => '55f4261989e546dc112258c7a75935a81a7ce382', + ), + 'sebastian/complexity' => + array ( + 'pretty_version' => '2.0.2', + 'version' => '2.0.2.0', + 'aliases' => + array ( + ), + 'reference' => '739b35e53379900cc9ac327b2147867b8b6efd88', + ), + 'sebastian/diff' => + array ( + 'pretty_version' => '4.0.4', + 'version' => '4.0.4.0', + 'aliases' => + array ( + ), + 'reference' => '3461e3fccc7cfdfc2720be910d3bd73c69be590d', + ), + 'sebastian/environment' => + array ( + 'pretty_version' => '5.1.3', + 'version' => '5.1.3.0', + 'aliases' => + array ( + ), + 'reference' => '388b6ced16caa751030f6a69e588299fa09200ac', + ), + 'sebastian/exporter' => + array ( + 'pretty_version' => '4.0.3', + 'version' => '4.0.3.0', + 'aliases' => + array ( + ), + 'reference' => 'd89cc98761b8cb5a1a235a6b703ae50d34080e65', + ), + 'sebastian/global-state' => + array ( + 'pretty_version' => '5.0.3', + 'version' => '5.0.3.0', + 'aliases' => + array ( + ), + 'reference' => '23bd5951f7ff26f12d4e3242864df3e08dec4e49', + ), + 'sebastian/lines-of-code' => + array ( + 'pretty_version' => '1.0.3', + 'version' => '1.0.3.0', + 'aliases' => + array ( + ), + 'reference' => 'c1c2e997aa3146983ed888ad08b15470a2e22ecc', + ), + 'sebastian/object-enumerator' => + array ( + 'pretty_version' => '4.0.4', + 'version' => '4.0.4.0', + 'aliases' => + array ( + ), + 'reference' => '5c9eeac41b290a3712d88851518825ad78f45c71', + ), + 'sebastian/object-reflector' => + array ( + 'pretty_version' => '2.0.4', + 'version' => '2.0.4.0', + 'aliases' => + array ( + ), + 'reference' => 'b4f479ebdbf63ac605d183ece17d8d7fe49c15c7', + ), + 'sebastian/recursion-context' => + array ( + 'pretty_version' => '4.0.4', + 'version' => '4.0.4.0', + 'aliases' => + array ( + ), + 'reference' => 'cd9d8cf3c5804de4341c283ed787f099f5506172', + ), + 'sebastian/resource-operations' => + array ( + 'pretty_version' => '3.0.3', + 'version' => '3.0.3.0', + 'aliases' => + array ( + ), + 'reference' => '0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8', + ), + 'sebastian/type' => + array ( + 'pretty_version' => '2.3.4', + 'version' => '2.3.4.0', + 'aliases' => + array ( + ), + 'reference' => 'b8cd8a1c753c90bc1a0f5372170e3e489136f914', + ), + 'sebastian/version' => + array ( + 'pretty_version' => '3.0.2', + 'version' => '3.0.2.0', + 'aliases' => + array ( + ), + 'reference' => 'c6c1022351a901512170118436c764e473f6de8c', + ), + 'seld/jsonlint' => + array ( + 'pretty_version' => '1.8.3', + 'version' => '1.8.3.0', + 'aliases' => + array ( + ), + 'reference' => '9ad6ce79c342fbd44df10ea95511a1b24dee5b57', + ), + 'seld/phar-utils' => + array ( + 'pretty_version' => '1.1.2', + 'version' => '1.1.2.0', + 'aliases' => + array ( + ), + 'reference' => '749042a2315705d2dfbbc59234dd9ceb22bf3ff0', + ), + 'slevomat/coding-standard' => + array ( + 'pretty_version' => '6.4.1', + 'version' => '6.4.1.0', + 'aliases' => + array ( + ), + 'reference' => '696dcca217d0c9da2c40d02731526c1e25b65346', + ), + 'squizlabs/php_codesniffer' => + array ( + 'pretty_version' => '3.5.8', + 'version' => '3.5.8.0', + 'aliases' => + array ( + ), + 'reference' => '9d583721a7157ee997f235f327de038e7ea6dac4', + ), + 'symfony/config' => + array ( + 'pretty_version' => 'v5.3.4', + 'version' => '5.3.4.0', + 'aliases' => + array ( + ), + 'reference' => '4268f3059c904c61636275182707f81645517a37', + ), + 'symfony/console' => + array ( + 'pretty_version' => 'v5.3.7', + 'version' => '5.3.7.0', + 'aliases' => + array ( + ), + 'reference' => '8b1008344647462ae6ec57559da166c2bfa5e16a', + ), + 'symfony/deprecation-contracts' => + array ( + 'pretty_version' => 'v2.4.0', + 'version' => '2.4.0.0', + 'aliases' => + array ( + ), + 'reference' => '5f38c8804a9e97d23e0c8d63341088cd8a22d627', + ), + 'symfony/filesystem' => + array ( + 'pretty_version' => 'v5.3.4', + 'version' => '5.3.4.0', + 'aliases' => + array ( + ), + 'reference' => '343f4fe324383ca46792cae728a3b6e2f708fb32', + ), + 'symfony/finder' => + array ( + 'pretty_version' => 'v5.3.7', + 'version' => '5.3.7.0', + 'aliases' => + array ( + ), + 'reference' => 'a10000ada1e600d109a6c7632e9ac42e8bf2fb93', + ), + 'symfony/polyfill-ctype' => + array ( + 'pretty_version' => 'v1.23.0', + 'version' => '1.23.0.0', + 'aliases' => + array ( + ), + 'reference' => '46cd95797e9df938fdd2b03693b5fca5e64b01ce', + ), + 'symfony/polyfill-intl-grapheme' => + array ( + 'pretty_version' => 'v1.23.1', + 'version' => '1.23.1.0', + 'aliases' => + array ( + ), + 'reference' => '16880ba9c5ebe3642d1995ab866db29270b36535', + ), + 'symfony/polyfill-intl-normalizer' => + array ( + 'pretty_version' => 'v1.23.0', + 'version' => '1.23.0.0', + 'aliases' => + array ( + ), + 'reference' => '8590a5f561694770bdcd3f9b5c69dde6945028e8', + ), + 'symfony/polyfill-mbstring' => + array ( + 'pretty_version' => 'v1.23.1', + 'version' => '1.23.1.0', + 'aliases' => + array ( + ), + 'reference' => '9174a3d80210dca8daa7f31fec659150bbeabfc6', + ), + 'symfony/polyfill-php73' => + array ( + 'pretty_version' => 'v1.23.0', + 'version' => '1.23.0.0', + 'aliases' => + array ( + ), + 'reference' => 'fba8933c384d6476ab14fb7b8526e5287ca7e010', + ), + 'symfony/polyfill-php80' => + array ( + 'pretty_version' => 'v1.23.1', + 'version' => '1.23.1.0', + 'aliases' => + array ( + ), + 'reference' => '1100343ed1a92e3a38f9ae122fc0eb21602547be', + ), + 'symfony/polyfill-php81' => + array ( + 'pretty_version' => 'v1.23.0', + 'version' => '1.23.0.0', + 'aliases' => + array ( + ), + 'reference' => 'e66119f3de95efc359483f810c4c3e6436279436', + ), + 'symfony/process' => + array ( + 'pretty_version' => 'v5.3.7', + 'version' => '5.3.7.0', + 'aliases' => + array ( + ), + 'reference' => '38f26c7d6ed535217ea393e05634cb0b244a1967', + ), + 'symfony/service-contracts' => + array ( + 'pretty_version' => 'v2.4.0', + 'version' => '2.4.0.0', + 'aliases' => + array ( + ), + 'reference' => 'f040a30e04b57fbcc9c6cbcf4dbaa96bd318b9bb', + ), + 'symfony/string' => + array ( + 'pretty_version' => 'v5.3.7', + 'version' => '5.3.7.0', + 'aliases' => + array ( + ), + 'reference' => '8d224396e28d30f81969f083a58763b8b9ceb0a5', + ), + 'symfony/var-dumper' => + array ( + 'pretty_version' => 'v5.3.8', + 'version' => '5.3.8.0', + 'aliases' => + array ( + ), + 'reference' => 'eaaea4098be1c90c8285543e1356a09c8aa5c8da', + ), + 'theseer/tokenizer' => + array ( + 'pretty_version' => '1.2.1', + 'version' => '1.2.1.0', + 'aliases' => + array ( + ), + 'reference' => '34a41e998c2183e22995f158c581e7b5e755ab9e', + ), + 'twig/markdown-extra' => + array ( + 'pretty_version' => 'v3.3.3', + 'version' => '3.3.3.0', + 'aliases' => + array ( + ), + 'reference' => '725a4ef89d93bb80fc63c67cf261bf7512649290', + ), + 'twig/twig' => + array ( + 'pretty_version' => 'v3.3.3', + 'version' => '3.3.3.0', + 'aliases' => + array ( + ), + 'reference' => 'a27fa056df8a6384316288ca8b0fa3a35fdeb569', + ), + 'webmozart/assert' => + array ( + 'pretty_version' => '1.10.0', + 'version' => '1.10.0.0', + 'aliases' => + array ( + ), + 'reference' => '6964c76c7804814a842473e0c8fd15bab0f18e25', + ), + 'zendframework/zend-httphandlerrunner' => + array ( + 'replaced' => + array ( + 0 => '^1.1.0', + ), + ), + ), +); + + + + + + + +public static function getInstalledPackages() +{ +return array_keys(self::$installed['versions']); +} + + + + + + + + + +public static function isInstalled($packageName) +{ +return isset(self::$installed['versions'][$packageName]); +} + + + + + + + + + + + + + + +public static function satisfies(VersionParser $parser, $packageName, $constraint) +{ +$constraint = $parser->parseConstraints($constraint); +$provided = $parser->parseConstraints(self::getVersionRanges($packageName)); + +return $provided->matches($constraint); +} + + + + + + + + + + +public static function getVersionRanges($packageName) +{ +if (!isset(self::$installed['versions'][$packageName])) { +throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); +} + +$ranges = array(); +if (isset(self::$installed['versions'][$packageName]['pretty_version'])) { +$ranges[] = self::$installed['versions'][$packageName]['pretty_version']; +} +if (array_key_exists('aliases', self::$installed['versions'][$packageName])) { +$ranges = array_merge($ranges, self::$installed['versions'][$packageName]['aliases']); +} +if (array_key_exists('replaced', self::$installed['versions'][$packageName])) { +$ranges = array_merge($ranges, self::$installed['versions'][$packageName]['replaced']); +} +if (array_key_exists('provided', self::$installed['versions'][$packageName])) { +$ranges = array_merge($ranges, self::$installed['versions'][$packageName]['provided']); +} + +return implode(' || ', $ranges); +} + + + + + +public static function getVersion($packageName) +{ +if (!isset(self::$installed['versions'][$packageName])) { +throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); +} + +if (!isset(self::$installed['versions'][$packageName]['version'])) { +return null; +} + +return self::$installed['versions'][$packageName]['version']; +} + + + + + +public static function getPrettyVersion($packageName) +{ +if (!isset(self::$installed['versions'][$packageName])) { +throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); +} + +if (!isset(self::$installed['versions'][$packageName]['pretty_version'])) { +return null; +} + +return self::$installed['versions'][$packageName]['pretty_version']; +} + + + + + +public static function getReference($packageName) +{ +if (!isset(self::$installed['versions'][$packageName])) { +throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); +} + +if (!isset(self::$installed['versions'][$packageName]['reference'])) { +return null; +} + +return self::$installed['versions'][$packageName]['reference']; +} + + + + + +public static function getRootPackage() +{ +return self::$installed['root']; +} + + + + + + + +public static function getRawData() +{ +return self::$installed; +} + + + + + + + + + + + + + + + + + + + +public static function reload($data) +{ +self::$installed = $data; +} } diff --git a/app/vendor/composer/autoload_files.php b/app/vendor/composer/autoload_files.php index 35db014e6..a483e2c54 100644 --- a/app/vendor/composer/autoload_files.php +++ b/app/vendor/composer/autoload_files.php @@ -6,19 +6,17 @@ $baseDir = dirname($vendorDir); return array( - '320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php', 'ec07570ca5a812141189b1fa81503674' => $vendorDir . '/phpunit/phpunit/src/Framework/Assert/Functions.php', 'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php', + '320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php', '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php', '6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php', '23c18046f52bef3eea034657bafda50f' => $vendorDir . '/symfony/polyfill-php81/bootstrap.php', 'e69f7f6ee287b969198c3c9d6777bd38' => $vendorDir . '/symfony/polyfill-intl-normalizer/bootstrap.php', '8825ede83f2f289127722d4e842cf7e8' => $vendorDir . '/symfony/polyfill-intl-grapheme/bootstrap.php', - '667aeda72477189d0494fecd327c3641' => $vendorDir . '/symfony/var-dumper/Resources/functions/dump.php', - 'b6b991a57620e2fb6b2f66f03fe9ddc2' => $vendorDir . '/symfony/string/Resources/functions.php', '0d59ee240a4cd96ddbb4ff164fccea4d' => $vendorDir . '/symfony/polyfill-php73/bootstrap.php', + 'b6b991a57620e2fb6b2f66f03fe9ddc2' => $vendorDir . '/symfony/string/Resources/functions.php', 'ad155f8f1cf0d418fe49e248db8c661b' => $vendorDir . '/react/promise/src/functions_include.php', - '7e9bd612cc444b3eed788ebbe46263a0' => $vendorDir . '/laminas/laminas-zendframework-bridge/src/autoload.php', '07d7f1a47144818725fd8d91a907ac57' => $vendorDir . '/laminas/laminas-diactoros/src/functions/create_uploaded_file.php', 'da94ac5d3ca7d2dbab84ce561ce72bfd' => $vendorDir . '/laminas/laminas-diactoros/src/functions/marshal_headers_from_sapi.php', '3d97c8dcdfba8cb85d3b34f116bb248b' => $vendorDir . '/laminas/laminas-diactoros/src/functions/marshal_method_from_sapi.php', @@ -36,11 +34,13 @@ '786bf90caabc9e09b6ad4cc5ca8f0e30' => $vendorDir . '/laminas/laminas-diactoros/src/functions/normalize_uploaded_files.legacy.php', '751a5a3f463e4be759be31748b61737c' => $vendorDir . '/laminas/laminas-diactoros/src/functions/parse_cookie_header.legacy.php', '34122c0574b76bf21c9a8db62b5b9cf3' => $vendorDir . '/cakephp/chronos/src/carbon_compat.php', + '7e9bd612cc444b3eed788ebbe46263a0' => $vendorDir . '/laminas/laminas-zendframework-bridge/src/autoload.php', 'c720f792236cd163ece8049879166850' => $vendorDir . '/cakephp/cakephp/src/Core/functions.php', 'ede59e3a405fb689cd1cebb7bb1db3fb' => $vendorDir . '/cakephp/cakephp/src/Collection/functions.php', '90236b492da7ca2983a2ad6e33e4152e' => $vendorDir . '/cakephp/cakephp/src/I18n/functions.php', '2cb76c05856dfb60ada40ef54138d49a' => $vendorDir . '/cakephp/cakephp/src/Routing/functions.php', 'b1fc73705e1bec51cd2b20a32cf1c60a' => $vendorDir . '/cakephp/cakephp/src/Utility/bootstrap.php', + '667aeda72477189d0494fecd327c3641' => $vendorDir . '/symfony/var-dumper/Resources/functions/dump.php', '6124b4c8570aa390c21fafd04a26c69f' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/deep_copy.php', '801c31d8ed748cfa537fa45402288c95' => $vendorDir . '/psy/psysh/src/functions.php', ); diff --git a/app/vendor/composer/autoload_psr4.php b/app/vendor/composer/autoload_psr4.php index 4037ef683..8dc35eadb 100644 --- a/app/vendor/composer/autoload_psr4.php +++ b/app/vendor/composer/autoload_psr4.php @@ -6,7 +6,7 @@ $baseDir = dirname($vendorDir); return array( - 'phpDocumentor\\Reflection\\' => array($vendorDir . '/phpdocumentor/reflection-common/src', $vendorDir . '/phpdocumentor/type-resolver/src', $vendorDir . '/phpdocumentor/reflection-docblock/src'), + 'phpDocumentor\\Reflection\\' => array($vendorDir . '/phpdocumentor/reflection-common/src', $vendorDir . '/phpdocumentor/reflection-docblock/src', $vendorDir . '/phpdocumentor/type-resolver/src'), 'Webmozart\\Assert\\' => array($vendorDir . '/webmozart/assert/src'), 'Twig\\Extra\\Markdown\\' => array($vendorDir . '/twig/markdown-extra'), 'Twig\\' => array($vendorDir . '/twig/twig/src'), @@ -33,12 +33,13 @@ 'Psr\\SimpleCache\\' => array($vendorDir . '/psr/simple-cache/src'), 'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'), 'Psr\\Http\\Server\\' => array($vendorDir . '/psr/http-server-handler/src', $vendorDir . '/psr/http-server-middleware/src'), - 'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-message/src', $vendorDir . '/psr/http-factory/src'), + 'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-factory/src', $vendorDir . '/psr/http-message/src'), 'Psr\\Http\\Client\\' => array($vendorDir . '/psr/http-client/src'), 'Psr\\Container\\' => array($vendorDir . '/psr/container/src'), 'Prophecy\\' => array($vendorDir . '/phpspec/prophecy/src/Prophecy'), 'PhpParser\\' => array($vendorDir . '/nikic/php-parser/lib/PhpParser'), 'Phinx\\' => array($vendorDir . '/robmorgan/phinx/src/Phinx'), + 'PackageVersions\\' => array($vendorDir . '/composer/package-versions-deprecated/src/PackageVersions'), 'PHPStan\\PhpDocParser\\' => array($vendorDir . '/phpstan/phpdoc-parser/src'), 'Migrations\\' => array($vendorDir . '/cakephp/migrations/src'), 'M1\\Env\\' => array($vendorDir . '/m1/env/src'), @@ -49,6 +50,10 @@ 'JsonSchema\\' => array($vendorDir . '/justinrainbow/json-schema/src/JsonSchema'), 'Jasny\\Twig\\' => array($vendorDir . '/jasny/twig-extensions/src'), 'Doctrine\\Instantiator\\' => array($vendorDir . '/doctrine/instantiator/src/Doctrine/Instantiator'), + 'Doctrine\\Deprecations\\' => array($vendorDir . '/doctrine/deprecations/lib/Doctrine/Deprecations'), + 'Doctrine\\DBAL\\' => array($vendorDir . '/doctrine/dbal/src'), + 'Doctrine\\Common\\Cache\\' => array($vendorDir . '/doctrine/cache/lib/Doctrine/Common/Cache'), + 'Doctrine\\Common\\' => array($vendorDir . '/doctrine/event-manager/lib/Doctrine/Common'), 'DeepCopy\\' => array($vendorDir . '/myclabs/deep-copy/src/DeepCopy'), 'DebugKit\\Test\\Fixture\\' => array($vendorDir . '/cakephp/debug_kit/tests/Fixture'), 'DebugKit\\' => array($vendorDir . '/cakephp/debug_kit/src'), diff --git a/app/vendor/composer/autoload_real.php b/app/vendor/composer/autoload_real.php index 0209e6f28..aac91c05c 100644 --- a/app/vendor/composer/autoload_real.php +++ b/app/vendor/composer/autoload_real.php @@ -25,7 +25,7 @@ public static function getLoader() require __DIR__ . '/platform_check.php'; spl_autoload_register(array('ComposerAutoloaderInitb25f76eec921984aa94dcf4015a4846e', 'loadClassLoader'), true, true); - self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__))); + self::$loader = $loader = new \Composer\Autoload\ClassLoader(); spl_autoload_unregister(array('ComposerAutoloaderInitb25f76eec921984aa94dcf4015a4846e', 'loadClassLoader')); $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); diff --git a/app/vendor/composer/autoload_static.php b/app/vendor/composer/autoload_static.php index 3d4ef9666..b78566ba4 100644 --- a/app/vendor/composer/autoload_static.php +++ b/app/vendor/composer/autoload_static.php @@ -7,19 +7,17 @@ class ComposerStaticInitb25f76eec921984aa94dcf4015a4846e { public static $files = array ( - '320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php', 'ec07570ca5a812141189b1fa81503674' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Assert/Functions.php', 'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php', + '320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php', '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php', '6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php', '23c18046f52bef3eea034657bafda50f' => __DIR__ . '/..' . '/symfony/polyfill-php81/bootstrap.php', 'e69f7f6ee287b969198c3c9d6777bd38' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/bootstrap.php', '8825ede83f2f289127722d4e842cf7e8' => __DIR__ . '/..' . '/symfony/polyfill-intl-grapheme/bootstrap.php', - '667aeda72477189d0494fecd327c3641' => __DIR__ . '/..' . '/symfony/var-dumper/Resources/functions/dump.php', - 'b6b991a57620e2fb6b2f66f03fe9ddc2' => __DIR__ . '/..' . '/symfony/string/Resources/functions.php', '0d59ee240a4cd96ddbb4ff164fccea4d' => __DIR__ . '/..' . '/symfony/polyfill-php73/bootstrap.php', + 'b6b991a57620e2fb6b2f66f03fe9ddc2' => __DIR__ . '/..' . '/symfony/string/Resources/functions.php', 'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php', - '7e9bd612cc444b3eed788ebbe46263a0' => __DIR__ . '/..' . '/laminas/laminas-zendframework-bridge/src/autoload.php', '07d7f1a47144818725fd8d91a907ac57' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/create_uploaded_file.php', 'da94ac5d3ca7d2dbab84ce561ce72bfd' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/marshal_headers_from_sapi.php', '3d97c8dcdfba8cb85d3b34f116bb248b' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/marshal_method_from_sapi.php', @@ -37,11 +35,13 @@ class ComposerStaticInitb25f76eec921984aa94dcf4015a4846e '786bf90caabc9e09b6ad4cc5ca8f0e30' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/normalize_uploaded_files.legacy.php', '751a5a3f463e4be759be31748b61737c' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/parse_cookie_header.legacy.php', '34122c0574b76bf21c9a8db62b5b9cf3' => __DIR__ . '/..' . '/cakephp/chronos/src/carbon_compat.php', + '7e9bd612cc444b3eed788ebbe46263a0' => __DIR__ . '/..' . '/laminas/laminas-zendframework-bridge/src/autoload.php', 'c720f792236cd163ece8049879166850' => __DIR__ . '/..' . '/cakephp/cakephp/src/Core/functions.php', 'ede59e3a405fb689cd1cebb7bb1db3fb' => __DIR__ . '/..' . '/cakephp/cakephp/src/Collection/functions.php', '90236b492da7ca2983a2ad6e33e4152e' => __DIR__ . '/..' . '/cakephp/cakephp/src/I18n/functions.php', '2cb76c05856dfb60ada40ef54138d49a' => __DIR__ . '/..' . '/cakephp/cakephp/src/Routing/functions.php', 'b1fc73705e1bec51cd2b20a32cf1c60a' => __DIR__ . '/..' . '/cakephp/cakephp/src/Utility/bootstrap.php', + '667aeda72477189d0494fecd327c3641' => __DIR__ . '/..' . '/symfony/var-dumper/Resources/functions/dump.php', '6124b4c8570aa390c21fafd04a26c69f' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/deep_copy.php', '801c31d8ed748cfa537fa45402288c95' => __DIR__ . '/..' . '/psy/psysh/src/functions.php', ); @@ -97,6 +97,7 @@ class ComposerStaticInitb25f76eec921984aa94dcf4015a4846e 'Prophecy\\' => 9, 'PhpParser\\' => 10, 'Phinx\\' => 6, + 'PackageVersions\\' => 16, 'PHPStan\\PhpDocParser\\' => 21, ), 'M' => @@ -119,6 +120,10 @@ class ComposerStaticInitb25f76eec921984aa94dcf4015a4846e 'D' => array ( 'Doctrine\\Instantiator\\' => 22, + 'Doctrine\\Deprecations\\' => 22, + 'Doctrine\\DBAL\\' => 14, + 'Doctrine\\Common\\Cache\\' => 22, + 'Doctrine\\Common\\' => 16, 'DeepCopy\\' => 9, 'DebugKit\\Test\\Fixture\\' => 22, 'DebugKit\\' => 9, @@ -155,8 +160,8 @@ class ComposerStaticInitb25f76eec921984aa94dcf4015a4846e 'phpDocumentor\\Reflection\\' => array ( 0 => __DIR__ . '/..' . '/phpdocumentor/reflection-common/src', - 1 => __DIR__ . '/..' . '/phpdocumentor/type-resolver/src', - 2 => __DIR__ . '/..' . '/phpdocumentor/reflection-docblock/src', + 1 => __DIR__ . '/..' . '/phpdocumentor/reflection-docblock/src', + 2 => __DIR__ . '/..' . '/phpdocumentor/type-resolver/src', ), 'Webmozart\\Assert\\' => array ( @@ -265,8 +270,8 @@ class ComposerStaticInitb25f76eec921984aa94dcf4015a4846e ), 'Psr\\Http\\Message\\' => array ( - 0 => __DIR__ . '/..' . '/psr/http-message/src', - 1 => __DIR__ . '/..' . '/psr/http-factory/src', + 0 => __DIR__ . '/..' . '/psr/http-factory/src', + 1 => __DIR__ . '/..' . '/psr/http-message/src', ), 'Psr\\Http\\Client\\' => array ( @@ -288,6 +293,10 @@ class ComposerStaticInitb25f76eec921984aa94dcf4015a4846e array ( 0 => __DIR__ . '/..' . '/robmorgan/phinx/src/Phinx', ), + 'PackageVersions\\' => + array ( + 0 => __DIR__ . '/..' . '/composer/package-versions-deprecated/src/PackageVersions', + ), 'PHPStan\\PhpDocParser\\' => array ( 0 => __DIR__ . '/..' . '/phpstan/phpdoc-parser/src', @@ -328,6 +337,22 @@ class ComposerStaticInitb25f76eec921984aa94dcf4015a4846e array ( 0 => __DIR__ . '/..' . '/doctrine/instantiator/src/Doctrine/Instantiator', ), + 'Doctrine\\Deprecations\\' => + array ( + 0 => __DIR__ . '/..' . '/doctrine/deprecations/lib/Doctrine/Deprecations', + ), + 'Doctrine\\DBAL\\' => + array ( + 0 => __DIR__ . '/..' . '/doctrine/dbal/src', + ), + 'Doctrine\\Common\\Cache\\' => + array ( + 0 => __DIR__ . '/..' . '/doctrine/cache/lib/Doctrine/Common/Cache', + ), + 'Doctrine\\Common\\' => + array ( + 0 => __DIR__ . '/..' . '/doctrine/event-manager/lib/Doctrine/Common', + ), 'DeepCopy\\' => array ( 0 => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy', diff --git a/app/vendor/composer/ca-bundle/composer.json b/app/vendor/composer/ca-bundle/composer.json index 5213e9763..ed6a1b364 100644 --- a/app/vendor/composer/ca-bundle/composer.json +++ b/app/vendor/composer/ca-bundle/composer.json @@ -30,7 +30,7 @@ "symfony/phpunit-bridge": "^4.2 || ^5", "phpstan/phpstan": "^0.12.55", "psr/log": "^1.0", - "symfony/process": "^2.5 || ^3.0 || ^4.0 || ^5.0" + "symfony/process": "^2.5 || ^3.0 || ^4.0 || ^5.0 || ^6.0" }, "autoload": { "psr-4": { diff --git a/app/vendor/composer/ca-bundle/res/cacert.pem b/app/vendor/composer/ca-bundle/res/cacert.pem index 264923b3e..456003b9e 100644 --- a/app/vendor/composer/ca-bundle/res/cacert.pem +++ b/app/vendor/composer/ca-bundle/res/cacert.pem @@ -1,7 +1,7 @@ ## ## Bundle of CA Root Certificates ## -## Certificate data from Mozilla as of: Tue May 25 03:12:05 2021 GMT +## Certificate data from Mozilla as of: Mon Jul 5 21:35:54 2021 GMT ## ## This is a bundle of X.509 certificates of public Certificate Authorities ## (CA). These were automatically extracted from Mozilla's root certificates @@ -14,7 +14,9 @@ ## Just configure this file as the SSLCACertificateFile. ## ## Conversion done with mk-ca-bundle.pl version 1.28. -## SHA256: e292bd4e2d500c86df45b830d89417be5c42ee670408f1d2c454c63d8a782865 +## SHA256: c8f6733d1ff4e6a4769c182971a1234f95ae079247a9c439a13423fe8ba5c24f +## +## Modified to remove expiring DST Root CA X3: 2021-09-25. ## @@ -156,38 +158,6 @@ Rt0vxuBqw8M0Ayx9lt1awg6nCpnBBYurDC/zXDrPbDdVCYfeU0BsWO/8tqtlbgT2G9w84FoVxp7Z 12yxow+ev+to51byrvLjKzg6CYG1a4XXvi3tPxq3smPi9WIsgtRqAEFQ8TmDn5XpNpaYbg== -----END CERTIFICATE----- -QuoVadis Root CA -================ ------BEGIN CERTIFICATE----- -MIIF0DCCBLigAwIBAgIEOrZQizANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJCTTEZMBcGA1UE -ChMQUXVvVmFkaXMgTGltaXRlZDElMCMGA1UECxMcUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0 -eTEuMCwGA1UEAxMlUXVvVmFkaXMgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wMTAz -MTkxODMzMzNaFw0yMTAzMTcxODMzMzNaMH8xCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRp -cyBMaW1pdGVkMSUwIwYDVQQLExxSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MS4wLAYDVQQD -EyVRdW9WYWRpcyBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEF -AAOCAQ8AMIIBCgKCAQEAv2G1lVO6V/z68mcLOhrfEYBklbTRvM16z/Ypli4kVEAkOPcahdxYTMuk -J0KX0J+DisPkBgNbAKVRHnAEdOLB1Dqr1607BxgFjv2DrOpm2RgbaIr1VxqYuvXtdj182d6UajtL -F8HVj71lODqV0D1VNk7feVcxKh7YWWVJWCCYfqtffp/p1k3sg3Spx2zY7ilKhSoGFPlU5tPaZQeL -YzcS19Dsw3sgQUSj7cugF+FxZc4dZjH3dgEZyH0DWLaVSR2mEiboxgx24ONmy+pdpibu5cxfvWen -AScOospUxbF6lR1xHkopigPcakXBpBlebzbNw6Kwt/5cOOJSvPhEQ+aQuwIDAQABo4ICUjCCAk4w -PQYIKwYBBQUHAQEEMTAvMC0GCCsGAQUFBzABhiFodHRwczovL29jc3AucXVvdmFkaXNvZmZzaG9y -ZS5jb20wDwYDVR0TAQH/BAUwAwEB/zCCARoGA1UdIASCAREwggENMIIBCQYJKwYBBAG+WAABMIH7 -MIHUBggrBgEFBQcCAjCBxxqBxFJlbGlhbmNlIG9uIHRoZSBRdW9WYWRpcyBSb290IENlcnRpZmlj -YXRlIGJ5IGFueSBwYXJ0eSBhc3N1bWVzIGFjY2VwdGFuY2Ugb2YgdGhlIHRoZW4gYXBwbGljYWJs -ZSBzdGFuZGFyZCB0ZXJtcyBhbmQgY29uZGl0aW9ucyBvZiB1c2UsIGNlcnRpZmljYXRpb24gcHJh -Y3RpY2VzLCBhbmQgdGhlIFF1b1ZhZGlzIENlcnRpZmljYXRlIFBvbGljeS4wIgYIKwYBBQUHAgEW -Fmh0dHA6Ly93d3cucXVvdmFkaXMuYm0wHQYDVR0OBBYEFItLbe3TKbkGGew5Oanwl4Rqy+/fMIGu -BgNVHSMEgaYwgaOAFItLbe3TKbkGGew5Oanwl4Rqy+/foYGEpIGBMH8xCzAJBgNVBAYTAkJNMRkw -FwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMSUwIwYDVQQLExxSb290IENlcnRpZmljYXRpb24gQXV0 -aG9yaXR5MS4wLAYDVQQDEyVRdW9WYWRpcyBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5ggQ6 -tlCLMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOCAQEAitQUtf70mpKnGdSkfnIYj9lo -fFIk3WdvOXrEql494liwTXCYhGHoG+NpGA7O+0dQoE7/8CQfvbLO9Sf87C9TqnN7Az10buYWnuul -LsS/VidQK2K6vkscPFVcQR0kvoIgR13VRH56FmjffU1RcHhXHTMe/QKZnAzNCgVPx7uOpHX6Sm2x -gI4JVrmcGmD+XcHXetwReNDWXcG31a0ymQM6isxUJTkxgXsTIlG6Rmyhu576BGxJJnSP0nPrzDCi -5upZIof4l/UO/erMkqQWxFIY6iHOsfHmhIHluqmGKPJDWl0Snawe2ajlCmqnf6CHKc/yiU3U7MXi -5nrQNiOKSnQ2+Q== ------END CERTIFICATE----- - QuoVadis Root CA 2 ================== -----BEGIN CERTIFICATE----- @@ -275,26 +245,6 @@ s58+OmJYxUmtYg5xpTKqL8aJdkNAExNnPaJUJRDL8Try2frbSVa7pv6nQTXD4IhhyYjH3zYQIphZ FL39vmwLAw== -----END CERTIFICATE----- -Sonera Class 2 Root CA -====================== ------BEGIN CERTIFICATE----- -MIIDIDCCAgigAwIBAgIBHTANBgkqhkiG9w0BAQUFADA5MQswCQYDVQQGEwJGSTEPMA0GA1UEChMG -U29uZXJhMRkwFwYDVQQDExBTb25lcmEgQ2xhc3MyIENBMB4XDTAxMDQwNjA3Mjk0MFoXDTIxMDQw -NjA3Mjk0MFowOTELMAkGA1UEBhMCRkkxDzANBgNVBAoTBlNvbmVyYTEZMBcGA1UEAxMQU29uZXJh -IENsYXNzMiBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJAXSjWdyvANlsdE+hY3 -/Ei9vX+ALTU74W+oZ6m/AxxNjG8yR9VBaKQTBME1DJqEQ/xcHf+Js+gXGM2RX/uJ4+q/Tl18GybT -dXnt5oTjV+WtKcT0OijnpXuENmmz/V52vaMtmdOQTiMofRhj8VQ7Jp12W5dCsv+u8E7s3TmVToMG -f+dJQMjFAbJUWmYdPfz56TwKnoG4cPABi+QjVHzIrviQHgCWctRUz2EjvOr7nQKV0ba5cTppCD8P -tOFCx4j1P5iop7oc4HFx71hXgVB6XGt0Rg6DA5jDjqhu8nYybieDwnPz3BjotJPqdURrBGAgcVeH -nfO+oJAjPYok4doh28MCAwEAAaMzMDEwDwYDVR0TAQH/BAUwAwEB/zARBgNVHQ4ECgQISqCqWITT -XjwwCwYDVR0PBAQDAgEGMA0GCSqGSIb3DQEBBQUAA4IBAQBazof5FnIVV0sd2ZvnoiYw7JNn39Yt -0jSv9zilzqsWuasvfDXLrNAPtEwr/IDva4yRXzZ299uzGxnq9LIR/WFxRL8oszodv7ND6J+/3DEI -cbCdjdY0RzKQxmUk96BKfARzjzlvF4xytb1LyHr4e4PDKE6cCepnP7JnBBvDFNr450kkkdAdavph -Oe9r5yF1BgfYErQhIHBCcYHaPJo2vqZbDWpsmh+Re/n570K6Tk6ezAyNlNzZRZxe7EJQY670XcSx -EtzKO6gunRRaBXW37Ndj4ro1tgQIkejanZz2ZrUYrAqmVCY0M9IbwdR/GjqOC6oybtv8TyWf2TLH -llpwrN9M ------END CERTIFICATE----- - XRamp Global CA Root ==================== -----BEGIN CERTIFICATE----- @@ -433,26 +383,6 @@ mNEVX58Svnw2Yzi9RKR/5CYrCsSXaQ3pjOLAEFe4yHYSkVXySGnYvCoCWw9E1CAx2/S6cCZdkGCe vEsXCS+0yx5DaMkHJ8HSXPfqIbloEpw8nL+e/IBcm2PN7EeqJSdnoDfzAIJ9VNep+OkuE6N36B9K -----END CERTIFICATE----- -DST Root CA X3 -============== ------BEGIN CERTIFICATE----- -MIIDSjCCAjKgAwIBAgIQRK+wgNajJ7qJMDmGLvhAazANBgkqhkiG9w0BAQUFADA/MSQwIgYDVQQK -ExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMTDkRTVCBSb290IENBIFgzMB4X -DTAwMDkzMDIxMTIxOVoXDTIxMDkzMDE0MDExNVowPzEkMCIGA1UEChMbRGlnaXRhbCBTaWduYXR1 -cmUgVHJ1c3QgQ28uMRcwFQYDVQQDEw5EU1QgUm9vdCBDQSBYMzCCASIwDQYJKoZIhvcNAQEBBQAD -ggEPADCCAQoCggEBAN+v6ZdQCINXtMxiZfaQguzH0yxrMMpb7NnDfcdAwRgUi+DoM3ZJKuM/IUmT -rE4Orz5Iy2Xu/NMhD2XSKtkyj4zl93ewEnu1lcCJo6m67XMuegwGMoOifooUMM0RoOEqOLl5CjH9 -UL2AZd+3UWODyOKIYepLYYHsUmu5ouJLGiifSKOeDNoJjj4XLh7dIN9bxiqKqy69cK3FCxolkHRy -xXtqqzTWMIn/5WgTe1QLyNau7Fqckh49ZLOMxt+/yUFw7BZy1SbsOFU5Q9D8/RhcQPGX69Wam40d -utolucbY38EVAjqr2m7xPi71XAicPNaDaeQQmxkqtilX4+U9m5/wAl0CAwEAAaNCMEAwDwYDVR0T -AQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFMSnsaR7LHH62+FLkHX/xBVghYkQ -MA0GCSqGSIb3DQEBBQUAA4IBAQCjGiybFwBcqR7uKGY3Or+Dxz9LwwmglSBd49lZRNI+DT69ikug -dB/OEIKcdBodfpga3csTS7MgROSR6cz8faXbauX+5v3gTt23ADq1cEmv8uXrAvHRAosZy5Q6XkjE -GB5YGV8eAlrwDPGxrancWYaLbumR9YbK+rlmM6pZW87ipxZzR8srzJmwN0jP41ZL9c8PDHIyh8bw -RLtTcm1D9SZImlJnt1ir/md2cXjbDaJWFBM5JDGFoqgCWjBH4d1QB7wCCZAA62RjYJsWvIjJEubS -fZGL+T0yjWW06XyxV3bqxbYoOb8VZRzI9neWagqNdwvYkQsEjgfbKbYK7p2CNTUQ ------END CERTIFICATE----- - SwissSign Gold CA - G2 ====================== -----BEGIN CERTIFICATE----- @@ -1194,27 +1124,6 @@ OR/qnuOf0GZvBeyqdn6/axag67XH/JJULysRJyU3eExRarDzzFhdFPFqSBX/wge2sY0PjlxQRrM9 vwGYT7JZVEc+NHt4bVaTLnPqZih4zR0Uv6CPLy64Lo7yFIrM6bV8+2ydDKXhlg== -----END CERTIFICATE----- -Trustis FPS Root CA -=================== ------BEGIN CERTIFICATE----- -MIIDZzCCAk+gAwIBAgIQGx+ttiD5JNM2a/fH8YygWTANBgkqhkiG9w0BAQUFADBFMQswCQYDVQQG -EwJHQjEYMBYGA1UEChMPVHJ1c3RpcyBMaW1pdGVkMRwwGgYDVQQLExNUcnVzdGlzIEZQUyBSb290 -IENBMB4XDTAzMTIyMzEyMTQwNloXDTI0MDEyMTExMzY1NFowRTELMAkGA1UEBhMCR0IxGDAWBgNV -BAoTD1RydXN0aXMgTGltaXRlZDEcMBoGA1UECxMTVHJ1c3RpcyBGUFMgUm9vdCBDQTCCASIwDQYJ -KoZIhvcNAQEBBQADggEPADCCAQoCggEBAMVQe547NdDfxIzNjpvto8A2mfRC6qc+gIMPpqdZh8mQ -RUN+AOqGeSoDvT03mYlmt+WKVoaTnGhLaASMk5MCPjDSNzoiYYkchU59j9WvezX2fihHiTHcDnlk -H5nSW7r+f2C/revnPDgpai/lkQtV/+xvWNUtyd5MZnGPDNcE2gfmHhjjvSkCqPoc4Vu5g6hBSLwa -cY3nYuUtsuvffM/bq1rKMfFMIvMFE/eC+XN5DL7XSxzA0RU8k0Fk0ea+IxciAIleH2ulrG6nS4zt -o3Lmr2NNL4XSFDWaLk6M6jKYKIahkQlBOrTh4/L68MkKokHdqeMDx4gVOxzUGpTXn2RZEm0CAwEA -AaNTMFEwDwYDVR0TAQH/BAUwAwEB/zAfBgNVHSMEGDAWgBS6+nEleYtXQSUhhgtx67JkDoshZzAd -BgNVHQ4EFgQUuvpxJXmLV0ElIYYLceuyZA6LIWcwDQYJKoZIhvcNAQEFBQADggEBAH5Y//01GX2c -GE+esCu8jowU/yyg2kdbw++BLa8F6nRIW/M+TgfHbcWzk88iNVy2P3UnXwmWzaD+vkAMXBJV+JOC -yinpXj9WV4s4NvdFGkwozZ5BuO1WTISkQMi4sKUraXAEasP41BIy+Q7DsdwyhEQsb8tGD+pmQQ9P -8Vilpg0ND2HepZ5dfWWhPBfnqFVO76DH7cZEf1T1o+CP8HxVIo8ptoGj4W1OLBuAZ+ytIJ8MYmHV -l/9D7S3B2l0pKoU/rGXuhg8FjZBf3+6f9L/uHfuY5H+QK4R4EA5sSVPvFVtlRkpdr7r7OnIdzfYl -iB6XzCGcKQENZetX2fNXlrtIzYE= ------END CERTIFICATE----- - Buypass Class 2 Root CA ======================= -----BEGIN CERTIFICATE----- @@ -3136,3 +3045,112 @@ gLWi5h+xEk8blTAKBggqhkjOPQQDAwNoADBlAjEA31SQ7Zvvi5QCkxeCmb6zniz2C5GMn0oUsfZk vLtoURMMA/cVi4RguYv/Uo7njLwcAjA8+RHUjE7AwWHCFUyqqx0LMV87HOIAl0Qx5v5zli/altP+ CAezNIm8BZ/3Hobui3A= -----END CERTIFICATE----- + +GLOBALTRUST 2020 +================ +-----BEGIN CERTIFICATE----- +MIIFgjCCA2qgAwIBAgILWku9WvtPilv6ZeUwDQYJKoZIhvcNAQELBQAwTTELMAkGA1UEBhMCQVQx +IzAhBgNVBAoTGmUtY29tbWVyY2UgbW9uaXRvcmluZyBHbWJIMRkwFwYDVQQDExBHTE9CQUxUUlVT +VCAyMDIwMB4XDTIwMDIxMDAwMDAwMFoXDTQwMDYxMDAwMDAwMFowTTELMAkGA1UEBhMCQVQxIzAh +BgNVBAoTGmUtY29tbWVyY2UgbW9uaXRvcmluZyBHbWJIMRkwFwYDVQQDExBHTE9CQUxUUlVTVCAy +MDIwMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAri5WrRsc7/aVj6B3GyvTY4+ETUWi +D59bRatZe1E0+eyLinjF3WuvvcTfk0Uev5E4C64OFudBc/jbu9G4UeDLgztzOG53ig9ZYybNpyrO +VPu44sB8R85gfD+yc/LAGbaKkoc1DZAoouQVBGM+uq/ufF7MpotQsjj3QWPKzv9pj2gOlTblzLmM +CcpL3TGQlsjMH/1WljTbjhzqLL6FLmPdqqmV0/0plRPwyJiT2S0WR5ARg6I6IqIoV6Lr/sCMKKCm +fecqQjuCgGOlYx8ZzHyyZqjC0203b+J+BlHZRYQfEs4kUmSFC0iAToexIiIwquuuvuAC4EDosEKA +A1GqtH6qRNdDYfOiaxaJSaSjpCuKAsR49GiKweR6NrFvG5Ybd0mN1MkGco/PU+PcF4UgStyYJ9OR +JitHHmkHr96i5OTUawuzXnzUJIBHKWk7buis/UDr2O1xcSvy6Fgd60GXIsUf1DnQJ4+H4xj04KlG +DfV0OoIu0G4skaMxXDtG6nsEEFZegB31pWXogvziB4xiRfUg3kZwhqG8k9MedKZssCz3AwyIDMvU +clOGvGBG85hqwvG/Q/lwIHfKN0F5VVJjjVsSn8VoxIidrPIwq7ejMZdnrY8XD2zHc+0klGvIg5rQ +mjdJBKuxFshsSUktq6HQjJLyQUp5ISXbY9e2nKd+Qmn7OmMCAwEAAaNjMGEwDwYDVR0TAQH/BAUw +AwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFNwuH9FhN3nkq9XVsxJxaD1qaJwiMB8GA1Ud +IwQYMBaAFNwuH9FhN3nkq9XVsxJxaD1qaJwiMA0GCSqGSIb3DQEBCwUAA4ICAQCR8EICaEDuw2jA +VC/f7GLDw56KoDEoqoOOpFaWEhCGVrqXctJUMHytGdUdaG/7FELYjQ7ztdGl4wJCXtzoRlgHNQIw +4Lx0SsFDKv/bGtCwr2zD/cuz9X9tAy5ZVp0tLTWMstZDFyySCstd6IwPS3BD0IL/qMy/pJTAvoe9 +iuOTe8aPmxadJ2W8esVCgmxcB9CpwYhgROmYhRZf+I/KARDOJcP5YBugxZfD0yyIMaK9MOzQ0MAS +8cE54+X1+NZK3TTN+2/BT+MAi1bikvcoskJ3ciNnxz8RFbLEAwW+uxF7Cr+obuf/WEPPm2eggAe2 +HcqtbepBEX4tdJP7wry+UUTF72glJ4DjyKDUEuzZpTcdN3y0kcra1LGWge9oXHYQSa9+pTeAsRxS +vTOBTI/53WXZFM2KJVj04sWDpQmQ1GwUY7VA3+vA/MRYfg0UFodUJ25W5HCEuGwyEn6CMUO+1918 +oa2u1qsgEu8KwxCMSZY13At1XrFP1U80DhEgB3VDRemjEdqso5nCtnkn4rnvyOL2NSl6dPrFf4IF +YqYK6miyeUcGbvJXqBUzxvd4Sj1Ce2t+/vdG6tHrju+IaFvowdlxfv1k7/9nR4hYJS8+hge9+6jl +gqispdNpQ80xiEmEU5LAsTkbOYMBMMTyqfrQA71yN2BWHzZ8vTmR9W0Nv3vXkg== +-----END CERTIFICATE----- + +ANF Secure Server Root CA +========================= +-----BEGIN CERTIFICATE----- +MIIF7zCCA9egAwIBAgIIDdPjvGz5a7EwDQYJKoZIhvcNAQELBQAwgYQxEjAQBgNVBAUTCUc2MzI4 +NzUxMDELMAkGA1UEBhMCRVMxJzAlBgNVBAoTHkFORiBBdXRvcmlkYWQgZGUgQ2VydGlmaWNhY2lv +bjEUMBIGA1UECxMLQU5GIENBIFJhaXoxIjAgBgNVBAMTGUFORiBTZWN1cmUgU2VydmVyIFJvb3Qg +Q0EwHhcNMTkwOTA0MTAwMDM4WhcNMzkwODMwMTAwMDM4WjCBhDESMBAGA1UEBRMJRzYzMjg3NTEw +MQswCQYDVQQGEwJFUzEnMCUGA1UEChMeQU5GIEF1dG9yaWRhZCBkZSBDZXJ0aWZpY2FjaW9uMRQw +EgYDVQQLEwtBTkYgQ0EgUmFpejEiMCAGA1UEAxMZQU5GIFNlY3VyZSBTZXJ2ZXIgUm9vdCBDQTCC +AiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBANvrayvmZFSVgpCjcqQZAZ2cC4Ffc0m6p6zz +BE57lgvsEeBbphzOG9INgxwruJ4dfkUyYA8H6XdYfp9qyGFOtibBTI3/TO80sh9l2Ll49a2pcbnv +T1gdpd50IJeh7WhM3pIXS7yr/2WanvtH2Vdy8wmhrnZEE26cLUQ5vPnHO6RYPUG9tMJJo8gN0pcv +B2VSAKduyK9o7PQUlrZXH1bDOZ8rbeTzPvY1ZNoMHKGESy9LS+IsJJ1tk0DrtSOOMspvRdOoiXse +zx76W0OLzc2oD2rKDF65nkeP8Nm2CgtYZRczuSPkdxl9y0oukntPLxB3sY0vaJxizOBQ+OyRp1RM +VwnVdmPF6GUe7m1qzwmd+nxPrWAI/VaZDxUse6mAq4xhj0oHdkLePfTdsiQzW7i1o0TJrH93PB0j +7IKppuLIBkwC/qxcmZkLLxCKpvR/1Yd0DVlJRfbwcVw5Kda/SiOL9V8BY9KHcyi1Swr1+KuCLH5z +JTIdC2MKF4EA/7Z2Xue0sUDKIbvVgFHlSFJnLNJhiQcND85Cd8BEc5xEUKDbEAotlRyBr+Qc5RQe +8TZBAQIvfXOn3kLMTOmJDVb3n5HUA8ZsyY/b2BzgQJhdZpmYgG4t/wHFzstGH6wCxkPmrqKEPMVO +Hj1tyRRM4y5Bu8o5vzY8KhmqQYdOpc5LMnndkEl/AgMBAAGjYzBhMB8GA1UdIwQYMBaAFJxf0Gxj +o1+TypOYCK2Mh6UsXME3MB0GA1UdDgQWBBScX9BsY6Nfk8qTmAitjIelLFzBNzAOBgNVHQ8BAf8E +BAMCAYYwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAgEATh65isagmD9uw2nAalxJ +UqzLK114OMHVVISfk/CHGT0sZonrDUL8zPB1hT+L9IBdeeUXZ701guLyPI59WzbLWoAAKfLOKyzx +j6ptBZNscsdW699QIyjlRRA96Gejrw5VD5AJYu9LWaL2U/HANeQvwSS9eS9OICI7/RogsKQOLHDt +dD+4E5UGUcjohybKpFtqFiGS3XNgnhAY3jyB6ugYw3yJ8otQPr0R4hUDqDZ9MwFsSBXXiJCZBMXM +5gf0vPSQ7RPi6ovDj6MzD8EpTBNO2hVWcXNyglD2mjN8orGoGjR0ZVzO0eurU+AagNjqOknkJjCb +5RyKqKkVMoaZkgoQI1YS4PbOTOK7vtuNknMBZi9iPrJyJ0U27U1W45eZ/zo1PqVUSlJZS2Db7v54 +EX9K3BR5YLZrZAPbFYPhor72I5dQ8AkzNqdxliXzuUJ92zg/LFis6ELhDtjTO0wugumDLmsx2d1H +hk9tl5EuT+IocTUW0fJz/iUrB0ckYyfI+PbZa/wSMVYIwFNCr5zQM378BvAxRAMU8Vjq8moNqRGy +g77FGr8H6lnco4g175x2MjxNBiLOFeXdntiP2t7SxDnlF4HPOEfrf4htWRvfn0IUrn7PqLBmZdo3 +r5+qPeoott7VMVgWglvquxl1AnMaykgaIZOQCo6ThKd9OyMYkomgjaw= +-----END CERTIFICATE----- + +Certum EC-384 CA +================ +-----BEGIN CERTIFICATE----- +MIICZTCCAeugAwIBAgIQeI8nXIESUiClBNAt3bpz9DAKBggqhkjOPQQDAzB0MQswCQYDVQQGEwJQ +TDEhMB8GA1UEChMYQXNzZWNvIERhdGEgU3lzdGVtcyBTLkEuMScwJQYDVQQLEx5DZXJ0dW0gQ2Vy +dGlmaWNhdGlvbiBBdXRob3JpdHkxGTAXBgNVBAMTEENlcnR1bSBFQy0zODQgQ0EwHhcNMTgwMzI2 +MDcyNDU0WhcNNDMwMzI2MDcyNDU0WjB0MQswCQYDVQQGEwJQTDEhMB8GA1UEChMYQXNzZWNvIERh +dGEgU3lzdGVtcyBTLkEuMScwJQYDVQQLEx5DZXJ0dW0gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkx +GTAXBgNVBAMTEENlcnR1bSBFQy0zODQgQ0EwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAATEKI6rGFtq +vm5kN2PkzeyrOvfMobgOgknXhimfoZTy42B4mIF4Bk3y7JoOV2CDn7TmFy8as10CW4kjPMIRBSqn +iBMY81CE1700LCeJVf/OTOffph8oxPBUw7l8t1Ot68KjQjBAMA8GA1UdEwEB/wQFMAMBAf8wHQYD +VR0OBBYEFI0GZnQkdjrzife81r1HfS+8EF9LMA4GA1UdDwEB/wQEAwIBBjAKBggqhkjOPQQDAwNo +ADBlAjADVS2m5hjEfO/JUG7BJw+ch69u1RsIGL2SKcHvlJF40jocVYli5RsJHrpka/F2tNQCMQC0 +QoSZ/6vnnvuRlydd3LBbMHHOXjgaatkl5+r3YZJW+OraNsKHZZYuciUvf9/DE8k= +-----END CERTIFICATE----- + +Certum Trusted Root CA +====================== +-----BEGIN CERTIFICATE----- +MIIFwDCCA6igAwIBAgIQHr9ZULjJgDdMBvfrVU+17TANBgkqhkiG9w0BAQ0FADB6MQswCQYDVQQG +EwJQTDEhMB8GA1UEChMYQXNzZWNvIERhdGEgU3lzdGVtcyBTLkEuMScwJQYDVQQLEx5DZXJ0dW0g +Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkxHzAdBgNVBAMTFkNlcnR1bSBUcnVzdGVkIFJvb3QgQ0Ew +HhcNMTgwMzE2MTIxMDEzWhcNNDMwMzE2MTIxMDEzWjB6MQswCQYDVQQGEwJQTDEhMB8GA1UEChMY +QXNzZWNvIERhdGEgU3lzdGVtcyBTLkEuMScwJQYDVQQLEx5DZXJ0dW0gQ2VydGlmaWNhdGlvbiBB +dXRob3JpdHkxHzAdBgNVBAMTFkNlcnR1bSBUcnVzdGVkIFJvb3QgQ0EwggIiMA0GCSqGSIb3DQEB +AQUAA4ICDwAwggIKAoICAQDRLY67tzbqbTeRn06TpwXkKQMlzhyC93yZn0EGze2jusDbCSzBfN8p +fktlL5On1AFrAygYo9idBcEq2EXxkd7fO9CAAozPOA/qp1x4EaTByIVcJdPTsuclzxFUl6s1wB52 +HO8AU5853BSlLCIls3Jy/I2z5T4IHhQqNwuIPMqw9MjCoa68wb4pZ1Xi/K1ZXP69VyywkI3C7Te2 +fJmItdUDmj0VDT06qKhF8JVOJVkdzZhpu9PMMsmN74H+rX2Ju7pgE8pllWeg8xn2A1bUatMn4qGt +g/BKEiJ3HAVz4hlxQsDsdUaakFjgao4rpUYwBI4Zshfjvqm6f1bxJAPXsiEodg42MEx51UGamqi4 +NboMOvJEGyCI98Ul1z3G4z5D3Yf+xOr1Uz5MZf87Sst4WmsXXw3Hw09Omiqi7VdNIuJGmj8PkTQk +fVXjjJU30xrwCSss0smNtA0Aq2cpKNgB9RkEth2+dv5yXMSFytKAQd8FqKPVhJBPC/PgP5sZ0jeJ +P/J7UhyM9uH3PAeXjA6iWYEMspA90+NZRu0PqafegGtaqge2Gcu8V/OXIXoMsSt0Puvap2ctTMSY +njYJdmZm/Bo/6khUHL4wvYBQv3y1zgD2DGHZ5yQD4OMBgQ692IU0iL2yNqh7XAjlRICMb/gv1SHK +HRzQ+8S1h9E6Tsd2tTVItQIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBSM+xx1 +vALTn04uSNn5YFSqxLNP+jAOBgNVHQ8BAf8EBAMCAQYwDQYJKoZIhvcNAQENBQADggIBAEii1QAL +LtA/vBzVtVRJHlpr9OTy4EA34MwUe7nJ+jW1dReTagVphZzNTxl4WxmB82M+w85bj/UvXgF2Ez8s +ALnNllI5SW0ETsXpD4YN4fqzX4IS8TrOZgYkNCvozMrnadyHncI013nR03e4qllY/p0m+jiGPp2K +h2RX5Rc64vmNueMzeMGQ2Ljdt4NR5MTMI9UGfOZR0800McD2RrsLrfw9EAUqO0qRJe6M1ISHgCq8 +CYyqOhNf6DR5UMEQGfnTKB7U0VEwKbOukGfWHwpjscWpxkIxYxeU72nLL/qMFH3EQxiJ2fAyQOaA +4kZf5ePBAFmo+eggvIksDkc0C+pXwlM2/KfUrzHN/gLldfq5Jwn58/U7yn2fqSLLiMmq0Uc9Nneo +WWRrJ8/vJ8HjJLWG965+Mk2weWjROeiQWMODvA8s1pfrzgzhIMfatz7DP78v3DSk+yshzWePS/Tj +6tQ/50+6uaWTRRxmHyH6ZF5v4HaUMst19W7l9o/HuKTMqJZ9ZPskWkoDbGs4xugDQ5r3V7mzKWmT +OPQD8rv7gmsHINFSH5pkAnuYZttcTVoP0ISVoDwUQwbKytu4QTbaakRnh6+v40URFWkIsr4WOZck +bxJF0WddCajJFdr60qZfE2Efv4WstK2tBZQIgx51F9NxO5NQI1mg7TyRVJ12AMXDuDjb +-----END CERTIFICATE----- diff --git a/app/vendor/composer/composer/.gitignore b/app/vendor/composer/composer/.gitignore index aada402fa..0b1fb77c0 100644 --- a/app/vendor/composer/composer/.gitignore +++ b/app/vendor/composer/composer/.gitignore @@ -4,6 +4,7 @@ /composer.phar /vendor /nbproject +.phpunit.result.cache phpunit.xml .vagrant Vagrantfile diff --git a/app/vendor/composer/composer/CHANGELOG.md b/app/vendor/composer/composer/CHANGELOG.md index 6e5b79e3f..983bc68a3 100644 --- a/app/vendor/composer/composer/CHANGELOG.md +++ b/app/vendor/composer/composer/CHANGELOG.md @@ -1,3 +1,56 @@ +### [2.1.9] 2021-10-05 + + * Security: Fixed command injection vulnerability on Windows (GHSA-frqg-7g38-6gcf / CVE-2021-41116) + * Fixed classmap parsing with a new class parser which does not rely on regexes anymore (#10107) + * Fixed inline git credentials showing up in output in some conditions (#10115) + * Fixed support for running updates while offline as long as the cache contains enough information (#10116) + * Fixed `show --all foo/bar` which as of 2.0.0 was not showing all versions anymore but only the installed one (#10095) + * Fixed VCS repos ignoring some versions silently when the API rate limit is reached (#10132) + * Fixed CA bundle to remove the expired Let's Encrypt root CA + +### [2.1.8] 2021-09-15 + + * Fixed regression in 2.1.7 when parsing classmaps in files containing invalid Unicode (#10102) + +### [2.1.7] 2021-09-14 + + * Added many type annotations internally, which may have an effect on CI/static analysis for people using Composer as a dependency. This work will continue in following releases + * Fixed regression in 2.1.6 when parsing classmaps with empty heredocs (#10067) + * Fixed regression in 2.1.6 where list command was not showing plugin commands (#10075) + * Fixed issue handling package updates where the package type changed (#10076) + * Fixed docker being detected as WSL when run inside WSL (#10094) + +### [2.1.6] 2021-08-19 + + * Updated internal PHAR signatures to be SHA512 instead of SHA1 + * Fixed uncaught exception handler regression (#10022) + * Fixed more PHP 8.1 deprecation warnings (#10036, #10038, #10061) + * Fixed corrupted zips in the cache from blocking installs until a cache clear, the bad archives are now deleted automatically on first failure (#10028) + * Fixed URL sanitizer handling of new github tokens (#10048) + * Fixed issue finding classes with very long heredocs in classmap autoload (#10050) + * Fixed proc_open being required for simple installs from zip, as well as diagnose (#9253) + * Fixed path repository bug causing symlinks to be left behind after a package is uninstalled (#10023) + * Fixed issue in 7-zip support on windows with certain archives (#10058) + * Fixed bootstrapping process to avoid loading the composer.json and plugins until necessary, speeding things up slightly (#10064) + * Fixed lib-openssl detection on FreeBSD (#10046) + * Fixed support for `ircs://` protocol for support.irc composer.json entries + +### [2.1.5] 2021-07-23 + + * Fixed `create-project` creating a `php:` directory in the directory it was executed in (#10020, #10021) + * Fixed curl downloader to respect default_socket_timeout if it is bigger than our default 300s (#10018) + +### [2.1.4] 2021-07-22 + + * Fixed PHP 8.1 deprecation warnings (#10008) + * Fixed support for working within UNC/WSL paths on Windows (#9993) + * Fixed 7-zip support to also be looked up on Linux/macOS as 7z or 7zz (#9951) + * Fixed repositories' `only`/`exclude` properties to avoid matching names as sub-strings of full package names (#10001) + * Fixed open_basedir regression from #9855 + * Fixed schema errors being reported incorrectly in some conditions (#9986) + * Fixed `archive` command not working with async archive extraction + * Fixed `init` command being able to generate an invalid composer.json (#9986) + ### [2.1.3] 2021-06-09 * Add "symlink" option for "bin-compat" config to force symlinking even on WSL/Windows (#9959) @@ -277,6 +330,10 @@ * Fixed suggest output being very spammy, it now is only one line long and shows more rarely * Fixed conflict rules like e.g. >=5 from matching dev-master, as it is not normalized to 9999999-dev internally anymore +### [1.10.23] 2021-10-05 + + * Security: Fixed command injection vulnerability on Windows (GHSA-frqg-7g38-6gcf / CVE-2021-41116) + ### [1.10.22] 2021-04-27 * Security: Fixed command injection vulnerability in HgDriver/HgDownloader and hardened other VCS drivers and downloaders (GHSA-h5h8-pc6h-jvvx / CVE-2021-29472) @@ -1217,6 +1274,12 @@ * Initial release +[2.1.9]: https://github.com/composer/composer/compare/2.1.8...2.1.9 +[2.1.8]: https://github.com/composer/composer/compare/2.1.7...2.1.8 +[2.1.7]: https://github.com/composer/composer/compare/2.1.6...2.1.7 +[2.1.6]: https://github.com/composer/composer/compare/2.1.5...2.1.6 +[2.1.5]: https://github.com/composer/composer/compare/2.1.4...2.1.5 +[2.1.4]: https://github.com/composer/composer/compare/2.1.3...2.1.4 [2.1.3]: https://github.com/composer/composer/compare/2.1.2...2.1.3 [2.1.2]: https://github.com/composer/composer/compare/2.1.1...2.1.2 [2.1.1]: https://github.com/composer/composer/compare/2.1.0...2.1.1 @@ -1242,6 +1305,7 @@ [2.0.0-alpha3]: https://github.com/composer/composer/compare/2.0.0-alpha2...2.0.0-alpha3 [2.0.0-alpha2]: https://github.com/composer/composer/compare/2.0.0-alpha1...2.0.0-alpha2 [2.0.0-alpha1]: https://github.com/composer/composer/compare/1.10.7...2.0.0-alpha1 +[1.10.23]: https://github.com/composer/composer/compare/1.10.22...1.10.23 [1.10.22]: https://github.com/composer/composer/compare/1.10.21...1.10.22 [1.10.21]: https://github.com/composer/composer/compare/1.10.20...1.10.21 [1.10.20]: https://github.com/composer/composer/compare/1.10.19...1.10.20 diff --git a/app/vendor/composer/composer/bin/composer b/app/vendor/composer/composer/bin/composer index a4ca314db..62c18974d 100755 --- a/app/vendor/composer/composer/bin/composer +++ b/app/vendor/composer/composer/bin/composer @@ -11,6 +11,7 @@ require __DIR__.'/../src/bootstrap.php'; use Composer\Console\Application; use Composer\XdebugHandler\XdebugHandler; use Composer\Util\Platform; +use Composer\Util\ErrorHandler; error_reporting(-1); @@ -60,6 +61,8 @@ if (function_exists('ini_set')) { Platform::putEnv('COMPOSER_BINARY', realpath($_SERVER['argv'][0])); +ErrorHandler::register(); + // run the command application $application = new Application(); $application->run(); diff --git a/app/vendor/composer/composer/composer.json b/app/vendor/composer/composer/composer.json index 7705678ac..9225f2e5f 100644 --- a/app/vendor/composer/composer/composer.json +++ b/app/vendor/composer/composer/composer.json @@ -28,7 +28,7 @@ "composer/semver": "^3.0", "composer/spdx-licenses": "^1.2", "composer/xdebug-handler": "^2.0", - "justinrainbow/json-schema": "^5.2.10", + "justinrainbow/json-schema": "^5.2.11", "psr/log": "^1.0", "seld/jsonlint": "^1.4", "seld/phar-utils": "^1.0", @@ -78,14 +78,23 @@ ], "scripts": { "compile": "@php -dphar.readonly=0 bin/compile", - "test": "simple-phpunit" + "test": "simple-phpunit", + "phpstan-setup": [ + "@composer config platform --unset", + "@php composer.phar update", + "@composer require --dev phpstan/phpstan:^0.12.93 phpstan/phpstan-phpunit:^0.12.17 phpunit/phpunit:^7.5.20 --with-all-dependencies", + "git checkout composer.json composer.lock" + ], + "phpstan": "@php vendor/bin/phpstan analyse --configuration=phpstan/config.neon" }, "scripts-descriptions": { "compile": "Compile composer.phar", - "test": "Run all tests" + "test": "Run all tests", + "phpstan-setup": "Prepare environment to run PHPStan locally (must be run with PHP7.4)", + "phpstan": "Runs PHPStan (after phpstan-setup was executed, must be run with PHP7.4)" }, "support": { "issues": "https://github.com/composer/composer/issues", - "irc": "irc://irc.freenode.org/composer" + "irc": "ircs://irc.libera.chat:6697/composer" } } diff --git a/app/vendor/composer/composer/composer.lock b/app/vendor/composer/composer/composer.lock index 9f464f86f..22981a039 100644 --- a/app/vendor/composer/composer/composer.lock +++ b/app/vendor/composer/composer/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "bff3f5b355e45125612dff36a8f71737", + "content-hash": "dfe550a024c0c2bb0784765e457968af", "packages": [ { "name": "composer/ca-bundle", - "version": "1.2.10", + "version": "1.2.11", "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", - "reference": "9fdb22c2e97a614657716178093cd1da90a64aa8" + "reference": "0b072d51c5a9c6f3412f7ea3ab043d6603cb2582" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/9fdb22c2e97a614657716178093cd1da90a64aa8", - "reference": "9fdb22c2e97a614657716178093cd1da90a64aa8", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/0b072d51c5a9c6f3412f7ea3ab043d6603cb2582", + "reference": "0b072d51c5a9c6f3412f7ea3ab043d6603cb2582", "shasum": "" }, "require": { @@ -29,7 +29,7 @@ "phpstan/phpstan": "^0.12.55", "psr/log": "^1.0", "symfony/phpunit-bridge": "^4.2 || ^5", - "symfony/process": "^2.5 || ^3.0 || ^4.0 || ^5.0" + "symfony/process": "^2.5 || ^3.0 || ^4.0 || ^5.0 || ^6.0" }, "type": "library", "extra": { @@ -64,7 +64,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/ca-bundle/issues", - "source": "https://github.com/composer/ca-bundle/tree/1.2.10" + "source": "https://github.com/composer/ca-bundle/tree/1.2.11" }, "funding": [ { @@ -80,7 +80,7 @@ "type": "tidelift" } ], - "time": "2021-06-07T13:58:28+00:00" + "time": "2021-09-25T20:32:43+00:00" }, { "name": "composer/metadata-minifier", @@ -313,21 +313,21 @@ }, { "name": "composer/xdebug-handler", - "version": "2.0.1", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "964adcdd3a28bf9ed5d9ac6450064e0d71ed7496" + "reference": "84674dd3a7575ba617f5a76d7e9e29a7d3891339" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/964adcdd3a28bf9ed5d9ac6450064e0d71ed7496", - "reference": "964adcdd3a28bf9ed5d9ac6450064e0d71ed7496", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/84674dd3a7575ba617f5a76d7e9e29a7d3891339", + "reference": "84674dd3a7575ba617f5a76d7e9e29a7d3891339", "shasum": "" }, "require": { "php": "^5.3.2 || ^7.0 || ^8.0", - "psr/log": "^1.0" + "psr/log": "^1 || ^2 || ^3" }, "require-dev": { "phpstan/phpstan": "^0.12.55", @@ -357,7 +357,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/xdebug-handler/issues", - "source": "https://github.com/composer/xdebug-handler/tree/2.0.1" + "source": "https://github.com/composer/xdebug-handler/tree/2.0.2" }, "funding": [ { @@ -373,20 +373,20 @@ "type": "tidelift" } ], - "time": "2021-05-05T19:37:51+00:00" + "time": "2021-07-31T17:03:58+00:00" }, { "name": "justinrainbow/json-schema", - "version": "5.2.10", + "version": "5.2.11", "source": { "type": "git", "url": "https://github.com/justinrainbow/json-schema.git", - "reference": "2ba9c8c862ecd5510ed16c6340aa9f6eadb4f31b" + "reference": "2ab6744b7296ded80f8cc4f9509abbff393399aa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/2ba9c8c862ecd5510ed16c6340aa9f6eadb4f31b", - "reference": "2ba9c8c862ecd5510ed16c6340aa9f6eadb4f31b", + "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/2ab6744b7296ded80f8cc4f9509abbff393399aa", + "reference": "2ab6744b7296ded80f8cc4f9509abbff393399aa", "shasum": "" }, "require": { @@ -441,9 +441,9 @@ ], "support": { "issues": "https://github.com/justinrainbow/json-schema/issues", - "source": "https://github.com/justinrainbow/json-schema/tree/5.2.10" + "source": "https://github.com/justinrainbow/json-schema/tree/5.2.11" }, - "time": "2020-05-27T16:41:55+00:00" + "time": "2021-07-22T09:24:00+00:00" }, { "name": "psr/log", @@ -608,16 +608,16 @@ }, { "name": "seld/phar-utils", - "version": "1.1.1", + "version": "1.1.2", "source": { "type": "git", "url": "https://github.com/Seldaek/phar-utils.git", - "reference": "8674b1d84ffb47cc59a101f5d5a3b61e87d23796" + "reference": "749042a2315705d2dfbbc59234dd9ceb22bf3ff0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/phar-utils/zipball/8674b1d84ffb47cc59a101f5d5a3b61e87d23796", - "reference": "8674b1d84ffb47cc59a101f5d5a3b61e87d23796", + "url": "https://api.github.com/repos/Seldaek/phar-utils/zipball/749042a2315705d2dfbbc59234dd9ceb22bf3ff0", + "reference": "749042a2315705d2dfbbc59234dd9ceb22bf3ff0", "shasum": "" }, "require": { @@ -650,9 +650,9 @@ ], "support": { "issues": "https://github.com/Seldaek/phar-utils/issues", - "source": "https://github.com/Seldaek/phar-utils/tree/master" + "source": "https://github.com/Seldaek/phar-utils/tree/1.1.2" }, - "time": "2020-07-07T18:42:57+00:00" + "time": "2021-08-19T21:01:38+00:00" }, { "name": "symfony/console", diff --git a/app/vendor/composer/composer/doc/04-schema.md b/app/vendor/composer/composer/doc/04-schema.md index 05149d331..849e5ee68 100644 --- a/app/vendor/composer/composer/doc/04-schema.md +++ b/app/vendor/composer/composer/doc/04-schema.md @@ -160,7 +160,7 @@ The recommended notation for the most common licenses is (alphabetical): Optional, but it is highly recommended to supply this. More identifiers are listed at the [SPDX Open Source License Registry](https://spdx.org/licenses/). -For closed-source software, you may use `"proprietary"` as the license identifier. +> **Note:** For closed-source software, you may use `"proprietary"` as the license identifier. An Example: diff --git a/app/vendor/composer/composer/doc/05-repositories.md b/app/vendor/composer/composer/doc/05-repositories.md index 7624c054e..f8a68fa30 100644 --- a/app/vendor/composer/composer/doc/05-repositories.md +++ b/app/vendor/composer/composer/doc/05-repositories.md @@ -149,6 +149,102 @@ number. This field is optional. +### metadata-url, available-packages and available-package-patterns + +The `metadata-url` field allows you to provide a URL template to serve all +packages which are in the repository. It must contain the placeholder +`%package%`. + +This field is new in Composer v2, and is prioritised over the +`provider-includes` and `providers-url` fields if both are present. +For compatibility with both Composer v1 and v2 you ideally want +to provide both. New repository implementations may only need to +support v2 however. + +An example: + +```json +{ + "metadata-url": "/p2/%package%.json" +} +``` + +Whenever Composer looks for a package, it will replace `%package%` by the +package name, and fetch that URL. If dev stability is allowed for the package, +it will also load the URL again with `$packageName~dev` (e.g. +`/p2/foo/bar~dev.json` to look for `foo/bar`'s dev versions). + +The `foo/bar.json` and `foo/bar~dev.json` files containing package versions +MUST contain only versions for the foo/bar package, as +`{"packages":{"foo/bar":[ ... versions here ... ]}}`. + +Caching is done via the use of If-Modified-Since header, so make sure you +return Last-Modified headers and that they are accurate. + +The array of versions can also optionally be minified using +`Composer\MetadataMinifier\MetadataMinifier::minify()` from +[composer/metadata-minifier](https://packagist.org/packages/composer/metadata-minifier). +If you do that, you should add a `"minified": "composer/2.0"` key +at the top level to indicate to Composer it must expand the version +list back into the original data. See +https://repo.packagist.org/p2/monolog/monolog.json for an example. + +Any requested package which does not exist MUST return a 404 status code, +which will indicate to Composer that this package does not exist in your +repository. Make sure the 404 response is fast to avoid blocking Composer. +Avoid redirects to alternative 404 pages. + +If your repository only has a small number of packages, and you want to avoid +the 404-requests, you can also specify an `"available-packages"` key in +`packages.json` which should be an array with all the package names that your +repository contain. Alternatively you can specify an +`"available-package-patterns"` key which is an array of package name patterns +(with `*` matching any string, e.g. `vendor/*` would make composer look up +every matching package name in this repository). + +This field is optional. + +### providers-api + +The `providers-api` field allows you to provide a URL template to serve all +packages which provide a given package name, but not the package which has +that name. It must contain the placeholder `%package%`. + +For example https://packagist.org/providers/monolog/monolog.json lists some +package which have a "provide" rule for monolog/monolog, but it does not list +monolog/monolog itself. + +```json +{ + "providers-api": "https://packagist.org/providers/%package%.json", +} +``` + +This field is optional. + +### list + +The `list` field allows you to return the names of packages which match a +given field (or all names if no filter is present). It should accept an +optional `?filter=xx` query param, which can contain `*` as wildcards matching +any substring. + +Replace/provide rules should not be considered here. + +It must return an array of package names: +```json +{ + "packageNames": [ + "a/b", + "c/d" + ] +} +``` + +See for example. + +This field is optional. + #### provider-includes and providers-url The `provider-includes` field allows you to list a set of files that list @@ -159,6 +255,9 @@ The `providers-url` describes how provider files are found on the server. It is an absolute path from the repository root. It must contain the placeholders `%package%` and `%hash%`. +These fields are used by Composer v1, or if your repository does not have the +`metadata-url` field set. + An example: ```json diff --git a/app/vendor/composer/composer/doc/08-community.md b/app/vendor/composer/composer/doc/08-community.md index fc140e0c7..7c48a94a8 100644 --- a/app/vendor/composer/composer/doc/08-community.md +++ b/app/vendor/composer/composer/doc/08-community.md @@ -21,15 +21,16 @@ The most important guidelines are described as follows: > To ensure a consistent code base, you should make sure the code follows > the [PSR-2 Coding Standards](https://www.php-fig.org/psr/psr-2/). -## IRC / mailing list +## Support -Mailing lists for [user support](https://groups.google.com/group/composer-users) and -[development](https://groups.google.com/group/composer-dev). +The IRC channel is on irc.libera.chat: [#composer](ircs://irc.libera.chat:6697/composer). -IRC channels are on irc.freenode.org: [#composer](irc://irc.freenode.org/composer) -for users and [#composer-dev](irc://irc.freenode.org/composer-dev) for development. +[Stack Overflow](https://stackoverflow.com/questions/tagged/composer-php) and +[GitHub Discussions](https://github.com/composer/composer/discussions) both have a +collection of Composer related questions. + +For paid support, we do provide Composer-related support via chat and email to +[Private Packagist](https://packagist.com) customers. -Stack Overflow has a growing collection of -[Composer related questions](https://stackoverflow.com/questions/tagged/composer-php). ← [Config](07-runtime.md) diff --git a/app/vendor/composer/composer/doc/articles/plugins.md b/app/vendor/composer/composer/doc/articles/plugins.md index 5242ef7ca..df374405b 100644 --- a/app/vendor/composer/composer/doc/articles/plugins.md +++ b/app/vendor/composer/composer/doc/articles/plugins.md @@ -39,7 +39,7 @@ requirements: The required version of the `composer-plugin-api` follows the same [rules][7] as a normal package's. -The current Composer plugin API version is `2.0.0`. +The current Composer plugin API version is `2.1.0`. An example of a valid plugin `composer.json` file (with the autoloading part omitted and an optional require-dev dependency on `composer/composer` for IDE auto completion): diff --git a/app/vendor/composer/composer/doc/articles/troubleshooting.md b/app/vendor/composer/composer/doc/articles/troubleshooting.md index 13ed340ed..669d4ce55 100644 --- a/app/vendor/composer/composer/doc/articles/troubleshooting.md +++ b/app/vendor/composer/composer/doc/articles/troubleshooting.md @@ -7,22 +7,22 @@ This is a list of common pitfalls on using Composer, and how to avoid them. ## General -1. Before asking anyone, run [`composer diagnose`](../03-cli.md#diagnose) to check - for common problems. If it all checks out, proceed to the next steps. - -2. When facing any kind of problems using Composer, be sure to **work with the +1. When facing any kind of problems using Composer, be sure to **work with the latest version**. See [self-update](../03-cli.md#self-update) for details. + +2. Before asking anyone, run [`composer diagnose`](../03-cli.md#diagnose) to check + for common problems. If it all checks out, proceed to the next steps. 3. Make sure you have no problems with your setup by running the installer's checks via `curl -sS https://getcomposer.org/installer | php -- --check`. -4. Ensure you're **installing vendors straight from your `composer.json`** via +4. Try clearing Composer's cache by running `composer clear-cache`. + +5. Ensure you're **installing vendors straight from your `composer.json`** via `rm -rf vendor && composer update -v` when troubleshooting, excluding any possible interferences with existing vendor installations or `composer.lock` entries. -5. Try clearing Composer's cache by running `composer clear-cache`. - ## Package not found 1. Double-check you **don't have typos** in your `composer.json` or repository diff --git a/app/vendor/composer/composer/doc/articles/versions.md b/app/vendor/composer/composer/doc/articles/versions.md index b1f71f0fc..47f1f8910 100644 --- a/app/vendor/composer/composer/doc/articles/versions.md +++ b/app/vendor/composer/composer/doc/articles/versions.md @@ -124,6 +124,11 @@ will be treated as a **logical OR**. AND has higher precedence than OR. > unexpectedly installing versions that break backwards compatibility. > Consider using the [caret](#caret-version-range-) operator instead for safety. + +> **Note:** In older versions of Composer the single pipe (`|`) was the +> recommended alternative to the **logical OR**. Thus for backwards compatibility +> the single pipe (`|`) will still be treated as a **logical OR**. + Examples: * `>=1.0` diff --git a/app/vendor/composer/composer/src/Composer/Autoload/AutoloadGenerator.php b/app/vendor/composer/composer/src/Composer/Autoload/AutoloadGenerator.php index 6a8848976..47c888ab7 100644 --- a/app/vendor/composer/composer/src/Composer/Autoload/AutoloadGenerator.php +++ b/app/vendor/composer/composer/src/Composer/Autoload/AutoloadGenerator.php @@ -41,7 +41,7 @@ class AutoloadGenerator private $eventDispatcher; /** - * @var IOInterface + * @var ?IOInterface */ private $io; @@ -667,7 +667,7 @@ protected function getPathCode(Filesystem $filesystem, $basePath, $vendorPath, $ $baseDir = "'phar://' . " . $baseDir; } - return $baseDir . (($path !== false) ? var_export($path, true) : ""); + return $baseDir . var_export($path, true); } protected function getPlatformCheck(array $packageMap, array $ignorePlatformReqs, $checkPlatform, array $devPackageNames) diff --git a/app/vendor/composer/composer/src/Composer/Autoload/ClassLoader.php b/app/vendor/composer/composer/src/Composer/Autoload/ClassLoader.php index 6d0c3f2d0..0cd6055d1 100644 --- a/app/vendor/composer/composer/src/Composer/Autoload/ClassLoader.php +++ b/app/vendor/composer/composer/src/Composer/Autoload/ClassLoader.php @@ -42,30 +42,75 @@ */ class ClassLoader { + /** @var ?string */ private $vendorDir; // PSR-4 + /** + * @var array[] + * @psalm-var array> + */ private $prefixLengthsPsr4 = array(); + /** + * @var array[] + * @psalm-var array> + */ private $prefixDirsPsr4 = array(); + /** + * @var array[] + * @psalm-var array + */ private $fallbackDirsPsr4 = array(); // PSR-0 + /** + * @var array[] + * @psalm-var array> + */ private $prefixesPsr0 = array(); + /** + * @var array[] + * @psalm-var array + */ private $fallbackDirsPsr0 = array(); + /** @var bool */ private $useIncludePath = false; + + /** + * @var string[] + * @psalm-var array + */ private $classMap = array(); + + /** @var bool */ private $classMapAuthoritative = false; + + /** + * @var bool[] + * @psalm-var array + */ private $missingClasses = array(); + + /** @var ?string */ private $apcuPrefix; + /** + * @var self[] + */ private static $registeredLoaders = array(); + /** + * @param ?string $vendorDir + */ public function __construct($vendorDir = null) { $this->vendorDir = $vendorDir; } + /** + * @return string[] + */ public function getPrefixes() { if (!empty($this->prefixesPsr0)) { @@ -75,28 +120,47 @@ public function getPrefixes() return array(); } + /** + * @return array[] + * @psalm-return array> + */ public function getPrefixesPsr4() { return $this->prefixDirsPsr4; } + /** + * @return array[] + * @psalm-return array + */ public function getFallbackDirs() { return $this->fallbackDirsPsr0; } + /** + * @return array[] + * @psalm-return array + */ public function getFallbackDirsPsr4() { return $this->fallbackDirsPsr4; } + /** + * @return string[] Array of classname => path + * @psalm-var array + */ public function getClassMap() { return $this->classMap; } /** - * @param array $classMap Class to filename map + * @param string[] $classMap Class to filename map + * @psalm-param array $classMap + * + * @return void */ public function addClassMap(array $classMap) { @@ -111,9 +175,11 @@ public function addClassMap(array $classMap) * Registers a set of PSR-0 directories for a given prefix, either * appending or prepending to the ones previously set for this prefix. * - * @param string $prefix The prefix - * @param array|string $paths The PSR-0 root directories - * @param bool $prepend Whether to prepend the directories + * @param string $prefix The prefix + * @param string[]|string $paths The PSR-0 root directories + * @param bool $prepend Whether to prepend the directories + * + * @return void */ public function add($prefix, $paths, $prepend = false) { @@ -156,11 +222,13 @@ public function add($prefix, $paths, $prepend = false) * Registers a set of PSR-4 directories for a given namespace, either * appending or prepending to the ones previously set for this namespace. * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param array|string $paths The PSR-4 base directories - * @param bool $prepend Whether to prepend the directories + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param string[]|string $paths The PSR-4 base directories + * @param bool $prepend Whether to prepend the directories * * @throws \InvalidArgumentException + * + * @return void */ public function addPsr4($prefix, $paths, $prepend = false) { @@ -204,8 +272,10 @@ public function addPsr4($prefix, $paths, $prepend = false) * Registers a set of PSR-0 directories for a given prefix, * replacing any others previously set for this prefix. * - * @param string $prefix The prefix - * @param array|string $paths The PSR-0 base directories + * @param string $prefix The prefix + * @param string[]|string $paths The PSR-0 base directories + * + * @return void */ public function set($prefix, $paths) { @@ -220,10 +290,12 @@ public function set($prefix, $paths) * Registers a set of PSR-4 directories for a given namespace, * replacing any others previously set for this namespace. * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param array|string $paths The PSR-4 base directories + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param string[]|string $paths The PSR-4 base directories * * @throws \InvalidArgumentException + * + * @return void */ public function setPsr4($prefix, $paths) { @@ -243,6 +315,8 @@ public function setPsr4($prefix, $paths) * Turns on searching the include path for class files. * * @param bool $useIncludePath + * + * @return void */ public function setUseIncludePath($useIncludePath) { @@ -265,6 +339,8 @@ public function getUseIncludePath() * that have not been registered with the class map. * * @param bool $classMapAuthoritative + * + * @return void */ public function setClassMapAuthoritative($classMapAuthoritative) { @@ -285,6 +361,8 @@ public function isClassMapAuthoritative() * APCu prefix to use to cache found/not-found classes, if the extension is enabled. * * @param string|null $apcuPrefix + * + * @return void */ public function setApcuPrefix($apcuPrefix) { @@ -305,6 +383,8 @@ public function getApcuPrefix() * Registers this instance as an autoloader. * * @param bool $prepend Whether to prepend the autoloader or not + * + * @return void */ public function register($prepend = false) { @@ -324,6 +404,8 @@ public function register($prepend = false) /** * Unregisters this instance as an autoloader. + * + * @return void */ public function unregister() { @@ -403,6 +485,11 @@ public static function getRegisteredLoaders() return self::$registeredLoaders; } + /** + * @param string $class + * @param string $ext + * @return string|false + */ private function findFileWithExtension($class, $ext) { // PSR-4 lookup @@ -474,6 +561,10 @@ private function findFileWithExtension($class, $ext) * Scope isolated include. * * Prevents access to $this/self from included files. + * + * @param string $file + * @return void + * @private */ function includeFile($file) { diff --git a/app/vendor/composer/composer/src/Composer/Autoload/ClassMapGenerator.php b/app/vendor/composer/composer/src/Composer/Autoload/ClassMapGenerator.php index abb0d5e9a..1bb204362 100644 --- a/app/vendor/composer/composer/src/Composer/Autoload/ClassMapGenerator.php +++ b/app/vendor/composer/composer/src/Composer/Autoload/ClassMapGenerator.php @@ -33,8 +33,8 @@ class ClassMapGenerator /** * Generate a class map file * - * @param \Traversable $dirs Directories or a single path to search in - * @param string $file The name of the class map file + * @param \Traversable|array $dirs Directories or a single path to search in + * @param string $file The name of the class map file */ public static function dump($dirs, $file) { @@ -50,11 +50,11 @@ public static function dump($dirs, $file) /** * Iterate over all files in the given directory searching for classes * - * @param \Iterator|string $path The path to search in or an iterator - * @param string $excluded Regex that matches file paths to be excluded from the classmap - * @param IOInterface $io IO object - * @param string $namespace Optional namespace prefix to filter by - * @param string $autoloadType psr-0|psr-4 Optional autoload standard to use mapping rules + * @param \Traversable|string|array $path The path to search in or an iterator + * @param string $excluded Regex that matches file paths to be excluded from the classmap + * @param ?IOInterface $io IO object + * @param ?string $namespace Optional namespace prefix to filter by + * @param ?string $autoloadType psr-0|psr-4 Optional autoload standard to use mapping rules * * @throws \RuntimeException When the path is neither an existing file nor directory * @return array A class map array @@ -147,13 +147,13 @@ public static function createMap($path, $excluded = null, IOInterface $io = null /** * Remove classes which could not have been loaded by namespace autoloaders * - * @param array $classes found classes in given file - * @param string $filePath current file - * @param string $baseNamespace prefix of given autoload mapping - * @param string $namespaceType psr-0|psr-4 - * @param string $basePath root directory of given autoload mapping - * @param IOInterface $io IO object - * @return array valid classes + * @param array $classes found classes in given file + * @param string $filePath current file + * @param string $baseNamespace prefix of given autoload mapping + * @param string $namespaceType psr-0|psr-4 + * @param string $basePath root directory of given autoload mapping + * @param ?IOInterface $io IO object + * @return array valid classes */ private static function filterByNamespace($classes, $filePath, $baseNamespace, $namespaceType, $basePath, $io) { @@ -214,10 +214,7 @@ private static function filterByNamespace($classes, $filePath, $baseNamespace, $ */ private static function findClasses($path) { - $extraTypes = PHP_VERSION_ID < 50400 ? '' : '|trait'; - if (PHP_VERSION_ID >= 80100 || (defined('HHVM_VERSION') && version_compare(HHVM_VERSION, '3.3', '>='))) { - $extraTypes .= '|enum'; - } + $extraTypes = self::getExtraTypes(); // Use @ here instead of Silencer to actively suppress 'unhelpful' output // @link https://github.com/composer/composer/pull/4886 @@ -241,32 +238,14 @@ private static function findClasses($path) } // return early if there is no chance of matching anything in this file - if (!preg_match('{\b(?:class|interface'.$extraTypes.')\s}i', $contents)) { + preg_match_all('{\b(?:class|interface'.$extraTypes.')\s}i', $contents, $matches); + if (!$matches) { return array(); } - // strip heredocs/nowdocs - $contents = preg_replace('{<<<[ \t]*([\'"]?)(\w+)\\1(?:\r\n|\n|\r)(?:.*?)(?:\r\n|\n|\r)(?:\s*)\\2(?=\s+|[;,.)])}s', 'null', $contents); - // strip strings - $contents = preg_replace('{"[^"\\\\]*+(\\\\.[^"\\\\]*+)*+"|\'[^\'\\\\]*+(\\\\.[^\'\\\\]*+)*+\'}s', 'null', $contents); - // strip leading non-php code if needed - if (strpos($contents, '(?:[^<]++|<(?!\?))*+<\?}s', '?>'); - if (false !== $pos && false === strpos(substr($contents, $pos), 'clean(); + unset($p); preg_match_all('{ (?: @@ -303,4 +282,18 @@ private static function findClasses($path) return $classes; } + + private static function getExtraTypes() + { + static $extraTypes = null; + if (null === $extraTypes) { + $extraTypes = PHP_VERSION_ID < 50400 ? '' : '|trait'; + if (PHP_VERSION_ID >= 80100 || (defined('HHVM_VERSION') && version_compare(HHVM_VERSION, '3.3', '>='))) { + $extraTypes .= '|enum'; + } + PhpFileCleaner::setTypeConfig(array_merge(array('class', 'interface'), array_filter(explode('|', $extraTypes)))); + } + + return $extraTypes; + } } diff --git a/app/vendor/composer/composer/src/Composer/Autoload/PhpFileCleaner.php b/app/vendor/composer/composer/src/Composer/Autoload/PhpFileCleaner.php new file mode 100644 index 000000000..9b0872aad --- /dev/null +++ b/app/vendor/composer/composer/src/Composer/Autoload/PhpFileCleaner.php @@ -0,0 +1,228 @@ + + * @internal + */ +class PhpFileCleaner +{ + /** @var array */ + private static $typeConfig; + /** @var string */ + private static $restPattern; + + /** + * @readonly + * @var string + */ + private $contents; + + /** + * @readonly + * @var int + */ + private $len; + + /** + * @readonly + * @var int + */ + private $maxMatches; + + /** @var int */ + private $index = 0; + + public static function setTypeConfig($types) + { + foreach ($types as $type) { + self::$typeConfig[$type[0]] = array( + 'name' => $type, + 'length' => \strlen($type), + 'pattern' => '{.\b(?])'.$type.'\s++[a-zA-Z_\x7f-\xff:][a-zA-Z0-9_\x7f-\xff:\-]*+}Ais', + ); + } + + self::$restPattern = '{[^?"\'contents = $contents; + $this->len = \strlen($this->contents); + $this->maxMatches = $maxMatches; + } + + public function clean() + { + $clean = ''; + + while ($this->index < $this->len) { + $this->skipToPhp(); + $clean .= 'index < $this->len) { + $char = $this->contents[$this->index]; + if ($char === '?' && $this->peek('>')) { + $clean .= '?>'; + $this->index += 2; + continue 2; + } + + if ($char === '"') { + $this->skipString('"'); + $clean .= 'null'; + continue; + } + + if ($char === "'") { + $this->skipString("'"); + $clean .= 'null'; + continue; + } + + if ($char === "<" && $this->peek('<') && $this->match('{<<<[ \t]*+([\'"]?)([a-zA-Z_\x80-\xff][a-zA-Z0-9_\x80-\xff]*+)\\1(?:\r\n|\n|\r)}A', $match)) { + $this->index += \strlen($match[0]); + $this->skipHeredoc($match[2]); + $clean .= 'null'; + continue; + } + + if ($char === '/') { + if ($this->peek('/')) { + $this->skipToNewline(); + continue; + } + if ($this->peek('*')) { + $this->skipComment(); + } + } + + if ($this->maxMatches === 1 && isset(self::$typeConfig[$char])) { + $type = self::$typeConfig[$char]; + if ( + \substr($this->contents, $this->index, $type['length']) === $type['name'] + && \preg_match($type['pattern'], $this->contents, $match, 0, $this->index - 1) + ) { + $clean .= $match[0]; + return $clean; + } + } + + $this->index += 1; + if ($this->match(self::$restPattern, $match)) { + $clean .= $char . $match[0]; + $this->index += \strlen($match[0]); + } else { + $clean .= $char; + } + } + } + + return $clean; + } + + private function skipToPhp() + { + while ($this->index < $this->len) { + if ($this->contents[$this->index] === '<' && $this->peek('?')) { + $this->index += 2; + break; + } + + $this->index += 1; + } + } + + private function skipString($delimiter) + { + $this->index += 1; + while ($this->index < $this->len) { + if ($this->contents[$this->index] === '\\' && ($this->peek('\\') || $this->peek($delimiter))) { + $this->index += 2; + continue; + } + if ($this->contents[$this->index] === $delimiter) { + $this->index += 1; + break; + } + $this->index += 1; + } + } + + private function skipComment() + { + $this->index += 2; + while ($this->index < $this->len) { + if ($this->contents[$this->index] === '*' && $this->peek('/')) { + $this->index += 2; + break; + } + + $this->index += 1; + } + } + + private function skipToNewline() + { + while ($this->index < $this->len) { + if ($this->contents[$this->index] === "\r" || $this->contents[$this->index] === "\n") { + return; + } + $this->index += 1; + } + } + + private function skipHeredoc($delimiter) + { + $firstDelimiterChar = $delimiter[0]; + $delimiterLength = \strlen($delimiter); + $delimiterPattern = '{'.preg_quote($delimiter).'(?![a-zA-Z0-9_\x80-\xff])}A'; + + while ($this->index < $this->len) { + // check if we find the delimiter after some spaces/tabs + switch ($this->contents[$this->index]) { + case "\t": + case " ": + $this->index += 1; + continue 2; + case $firstDelimiterChar: + if ( + \substr($this->contents, $this->index, $delimiterLength) === $delimiter + && $this->match($delimiterPattern) + ) { + $this->index += $delimiterLength; + return; + } + break; + } + + // skip the rest of the line + while ($this->index < $this->len) { + $this->skipToNewline(); + + // skip newlines + while ($this->index < $this->len && ($this->contents[$this->index] === "\r" || $this->contents[$this->index] === "\n")) { + $this->index += 1; + } + + break; + } + } + } + + private function peek($char) + { + return $this->index + 1 < $this->len && $this->contents[$this->index + 1] === $char; + } + + private function match($regex, array &$match = null) + { + if (\preg_match($regex, $this->contents, $match, 0, $this->index)) { + return true; + } + + return false; + } +} diff --git a/app/vendor/composer/composer/src/Composer/Command/ArchiveCommand.php b/app/vendor/composer/composer/src/Composer/Command/ArchiveCommand.php index 6f30d5f24..3acf4fd04 100644 --- a/app/vendor/composer/composer/src/Composer/Command/ArchiveCommand.php +++ b/app/vendor/composer/composer/src/Composer/Command/ArchiveCommand.php @@ -49,7 +49,7 @@ protected function configure() new InputOption('dir', null, InputOption::VALUE_REQUIRED, 'Write the archive to this directory'), new InputOption('file', null, InputOption::VALUE_REQUIRED, 'Write the archive with the given file name.' .' Note that the format will be appended.'), - new InputOption('ignore-filters', false, InputOption::VALUE_NONE, 'Ignore filters when saving package'), + new InputOption('ignore-filters', null, InputOption::VALUE_NONE, 'Ignore filters when saving package'), )) ->setHelp( <<composer = $application->getComposer($required, $disablePlugins); + /** @phpstan-ignore-next-line */ } elseif ($required) { throw new \RuntimeException( 'Could not create a Composer\Composer instance, you must inject '. @@ -109,8 +110,8 @@ public function getIO() if (null === $this->io) { $application = $this->getApplication(); if ($application instanceof Application) { - /* @var $application Application */ $this->io = $application->getIO(); + /** @phpstan-ignore-next-line */ } else { $this->io = new NullIO(); } diff --git a/app/vendor/composer/composer/src/Composer/Command/BaseDependencyCommand.php b/app/vendor/composer/composer/src/Composer/Command/BaseDependencyCommand.php index aabacd995..962c1b2ce 100644 --- a/app/vendor/composer/composer/src/Composer/Command/BaseDependencyCommand.php +++ b/app/vendor/composer/composer/src/Composer/Command/BaseDependencyCommand.php @@ -40,6 +40,7 @@ class BaseDependencyCommand extends BaseCommand const OPTION_RECURSIVE = 'recursive'; const OPTION_TREE = 'tree'; + /** @var ?string[] */ protected $colors; /** @@ -202,7 +203,7 @@ protected function printTree($results, $prefix = '', $level = 1) /** * @var PackageInterface $package * @var Link $link - * @var array|bool $children + * @var array|bool $children */ list($package, $link, $children) = $result; diff --git a/app/vendor/composer/composer/src/Composer/Command/CreateProjectCommand.php b/app/vendor/composer/composer/src/Composer/Command/CreateProjectCommand.php index 465b7762e..b64b01e18 100644 --- a/app/vendor/composer/composer/src/Composer/Command/CreateProjectCommand.php +++ b/app/vendor/composer/composer/src/Composer/Command/CreateProjectCommand.php @@ -25,7 +25,7 @@ use Composer\Repository\RepositoryFactory; use Composer\Repository\CompositeRepository; use Composer\Repository\PlatformRepository; -use Composer\Repository\InstalledFilesystemRepository; +use Composer\Repository\InstalledArrayRepository; use Composer\Repository\RepositorySet; use Composer\Script\ScriptEvents; use Composer\Util\Silencer; @@ -439,7 +439,7 @@ protected function installRootPackage(IOInterface $io, Config $config, $packageN $im = $composer->getInstallationManager(); $im->setOutputProgress(!$noProgress); $im->addInstaller($projectInstaller); - $im->execute(new InstalledFilesystemRepository(new JsonFile('php://memory')), array(new InstallOperation($package))); + $im->execute(new InstalledArrayRepository(), array(new InstallOperation($package))); $im->notifyInstalls($io); // collect suggestions diff --git a/app/vendor/composer/composer/src/Composer/Command/DiagnoseCommand.php b/app/vendor/composer/composer/src/Composer/Command/DiagnoseCommand.php index f36ee3343..2fdd99bf2 100644 --- a/app/vendor/composer/composer/src/Composer/Command/DiagnoseCommand.php +++ b/app/vendor/composer/composer/src/Composer/Command/DiagnoseCommand.php @@ -177,17 +177,19 @@ protected function execute(InputInterface $input, OutputInterface $output) $finder = new ExecutableFinder; $hasSystemUnzip = (bool) $finder->find('unzip'); - if (Platform::isWindows()) { - $hasSystem7zip = (bool) $finder->find('7z', null, array('C:\Program Files\7-Zip')); - $windows7z = ', ' . ($hasSystem7zip ? '7-Zip present' : '7-Zip not available'); - } else { - $windows7z = ''; + $bin7zip = ''; + if ($hasSystem7zip = (bool) $finder->find('7z', null, array('C:\Program Files\7-Zip'))) { + $bin7zip = '7z'; + } + if (!Platform::isWindows() && !$hasSystem7zip && $hasSystem7zip = (bool) $finder->find('7zz')) { + $bin7zip = '7zz'; } $io->write( 'zip: ' . (extension_loaded('zip') ? 'extension present' : 'extension not loaded') . ', ' . ($hasSystemUnzip ? 'unzip present' : 'unzip not available') - . $windows7z + . ', ' . ($hasSystem7zip ? '7-Zip present ('.$bin7zip.')' : '7-Zip not available') + . (($hasSystem7zip || $hasSystemUnzip) && !function_exists('proc_open') ? ', proc_open is disabled or not present, unzip/7-z will not be usable' : '') ); return $this->exitCode; @@ -219,6 +221,10 @@ private function checkComposerSchema() private function checkGit() { + if (!function_exists('proc_open')) { + return 'proc_open is not available, git cannot be used'; + } + $this->process->execute('git config color.ui', $output); if (strtolower(trim($output)) === 'always') { return 'Your git color.ui setting is set to always, this is known to create issues. Use "git config --global color.ui true" to set it correctly.'; @@ -298,9 +304,11 @@ private function checkGithubOauth($domain, $token) try { $url = $domain === 'github.com' ? 'https://api.'.$domain.'/' : 'https://'.$domain.'/api/v3/'; - return $this->httpDownloader->get($url, array( + $this->httpDownloader->get($url, array( 'retry-auth-failure' => false, - )) ? true : 'Unexpected error'; + )); + + return true; } catch (\Exception $e) { if ($e instanceof TransportException && $e->getCode() === 401) { return 'The oauth token for '.$domain.' seems invalid, run "composer config --global --unset github-oauth.'.$domain.'" to remove it'; @@ -413,7 +421,7 @@ private function getCurlVersion() } /** - * @param bool|string|\Exception $result + * @param bool|string|string[]|\Exception $result */ private function outputResult($result) { diff --git a/app/vendor/composer/composer/src/Composer/Command/HomeCommand.php b/app/vendor/composer/composer/src/Composer/Command/HomeCommand.php index 8e43f39a4..1a228b871 100644 --- a/app/vendor/composer/composer/src/Composer/Command/HomeCommand.php +++ b/app/vendor/composer/composer/src/Composer/Command/HomeCommand.php @@ -129,7 +129,7 @@ private function openBrowser($url) $process = new ProcessExecutor($this->getIO()); if (Platform::isWindows()) { - return $process->execute('start "web" explorer "' . $url . '"', $output); + return $process->execute('start "web" explorer ' . $url, $output); } $linux = $process->execute('which xdg-open', $output); diff --git a/app/vendor/composer/composer/src/Composer/Command/InitCommand.php b/app/vendor/composer/composer/src/Composer/Command/InitCommand.php index f824d6516..c8888f07e 100644 --- a/app/vendor/composer/composer/src/Composer/Command/InitCommand.php +++ b/app/vendor/composer/composer/src/Composer/Command/InitCommand.php @@ -14,6 +14,7 @@ use Composer\Factory; use Composer\Json\JsonFile; +use Composer\Json\JsonValidationException; use Composer\Package\BasePackage; use Composer\Package\CompletePackageInterface; use Composer\Package\Package; @@ -27,6 +28,7 @@ use Composer\Util\Filesystem; use Composer\Util\ProcessExecutor; use Composer\Semver\Constraint\Constraint; +use Composer\Util\Silencer; use Symfony\Component\Console\Input\ArrayInput; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; @@ -41,10 +43,10 @@ */ class InitCommand extends BaseCommand { - /** @var CompositeRepository */ + /** @var ?CompositeRepository */ protected $repos; - /** @var array */ + /** @var array */ private $gitConfig; /** @var RepositorySet[] */ @@ -95,6 +97,12 @@ protected function execute(InputInterface $input, OutputInterface $output) $allowlist = array('name', 'description', 'author', 'type', 'homepage', 'require', 'require-dev', 'stability', 'license', 'autoload'); $options = array_filter(array_intersect_key($input->getOptions(), array_flip($allowlist))); + if (isset($options['name']) && !preg_match('{^[a-z0-9_.-]+/[a-z0-9_.-]+$}D', $options['name'])) { + throw new \InvalidArgumentException( + 'The package name '.$options['name'].' is invalid, it should be lowercase and have a vendor name, a forward slash, and a package name, matching: [a-z0-9_.-]+/[a-z0-9_.-]+' + ); + } + if (isset($options['author'])) { $options['authors'] = $this->formatAuthors($options['author']); unset($options['author']); @@ -152,10 +160,20 @@ protected function execute(InputInterface $input, OutputInterface $output) throw new \RuntimeException('You have to run this command in interactive mode, or specify at least some data using --name, --require, etc.'); } - $io->writeError('Writing composer.json'); + $io->writeError('Writing '.$file->getPath()); } $file->write($options); + try { + $file->validateSchema(JsonFile::LAX_SCHEMA); + } catch (JsonValidationException $e) { + $io->writeError('Schema validation error, aborting'); + $errors = ' - ' . implode(PHP_EOL . ' - ', $e->getErrors()); + $io->writeError($e->getMessage() . ':' . PHP_EOL . $errors); + Silencer::call('unlink', $file->getPath()); + + return 1; + } // --autoload - Create src folder if ($autoloadPath) { @@ -273,12 +291,6 @@ protected function interact(InputInterface $input, OutputInterface $output) $name .= '/' . $name; } $name = strtolower($name); - } else { - if (!preg_match('{^[a-z0-9_.-]+/[a-z0-9_.-]+$}D', $name)) { - throw new \InvalidArgumentException( - 'The package name '.$name.' is invalid, it should be lowercase and have a vendor name, a forward slash, and a package name, matching: [a-z0-9_.-]+/[a-z0-9_.-]+' - ); - } } $name = $io->askAndValidate( @@ -693,10 +705,11 @@ protected function getGitConfig() $finder = new ExecutableFinder(); $gitBin = $finder->find('git'); - // TODO in v3 always call with an array + // TODO in v2.3 always call with an array if (method_exists('Symfony\Component\Process\Process', 'fromShellCommandline')) { $cmd = new Process(array($gitBin, 'config', '-l')); } else { + // @phpstan-ignore-next-line $cmd = new Process(sprintf('%s config -l', ProcessExecutor::escape($gitBin))); } $cmd->run(); @@ -830,6 +843,7 @@ private function findBestVersionAndNameForPackage(InputInterface $input, $name, // find the latest version allowed in this repo set $versionSelector = new VersionSelector($this->getRepositorySet($input, $minimumStability), $platformRepo); + $effectiveMinimumStability = $minimumStability ?: $this->getMinimumStability($input); $package = $versionSelector->findBestCandidate($name, $requiredVersion, $preferredStability, $ignorePlatformReqs); @@ -860,7 +874,7 @@ private function findBestVersionAndNameForPackage(InputInterface $input, $name, throw new \InvalidArgumentException(sprintf( 'Could not find a version of package %s matching your minimum-stability (%s). Require it with an explicit version constraint allowing its desired stability.', $name, - $this->getMinimumStability($input) + $effectiveMinimumStability )); } // Check whether the required version was the problem @@ -873,16 +887,22 @@ private function findBestVersionAndNameForPackage(InputInterface $input, $name, } throw new \InvalidArgumentException(sprintf( - 'Could not find package %s in a version matching %s', + 'Could not find package %s in a version matching "%s" and a stability matching "'.$effectiveMinimumStability.'".', $name, $requiredVersion )); } // Check whether the PHP version was the problem for all versions - if (true !== $ignorePlatformReqs && ($candidate = $versionSelector->findBestCandidate($name, null, $preferredStability, true))) { + if (true !== $ignorePlatformReqs && ($candidate = $versionSelector->findBestCandidate($name, null, $preferredStability, true, RepositorySet::ALLOW_UNACCEPTABLE_STABILITIES))) { + $additional = ''; + if (false === $versionSelector->findBestCandidate($name, null, $preferredStability, true)) { + $additional = PHP_EOL.PHP_EOL.'Additionally, the package was only found with a stability of "'.$candidate->getStability().'" while your minimum stability is "'.$effectiveMinimumStability.'".'; + } + throw new \InvalidArgumentException(sprintf( - 'Could not find package %s in any version matching your PHP version, PHP extensions and Composer version' . $this->getPlatformExceptionDetails($candidate, $platformRepo), - $name + 'Could not find package %s in any version matching your PHP version, PHP extensions and Composer version' . $this->getPlatformExceptionDetails($candidate, $platformRepo) . '%s', + $name, + $additional )); } @@ -906,7 +926,7 @@ private function findBestVersionAndNameForPackage(InputInterface $input, $name, throw new \InvalidArgumentException(sprintf( 'Could not find a matching version of package %s. Check the package spelling, your version constraint and that the package is available in a stability which matches your minimum-stability (%s).', $name, - $this->getMinimumStability($input) + $effectiveMinimumStability )); } @@ -924,9 +944,12 @@ private function getPlatformExceptionDetails(PackageInterface $candidate, Platfo } foreach ($candidate->getRequires() as $link) { + if (!PlatformRepository::isPlatformPackage($link->getTarget())) { + continue; + } $platformPkg = $platformRepo->findPackage($link->getTarget(), '*'); if (!$platformPkg) { - $details[] = $candidate->getName().' requires '.$link->getTarget().' '.$link->getPrettyConstraint().' but it is not present.'; + $details[] = $candidate->getPrettyName().' '.$candidate->getPrettyVersion().' requires '.$link->getTarget().' '.$link->getPrettyConstraint().' but it is not present.'; continue; } if (!$link->getConstraint()->matches(new Constraint('==', $platformPkg->getVersion()))) { @@ -935,7 +958,7 @@ private function getPlatformExceptionDetails(PackageInterface $candidate, Platfo if (isset($platformExtra['config.platform']) && $platformPkg instanceof CompletePackageInterface) { $platformPkgVersion .= ' ('.$platformPkg->getDescription().')'; } - $details[] = $candidate->getName().' requires '.$link->getTarget().' '.$link->getPrettyConstraint().' which does not match your installed version '.$platformPkgVersion.'.'; + $details[] = $candidate->getPrettyName().' '.$candidate->getPrettyVersion().' requires '.$link->getTarget().' '.$link->getPrettyConstraint().' which does not match your installed version '.$platformPkgVersion.'.'; } } diff --git a/app/vendor/composer/composer/src/Composer/Command/RequireCommand.php b/app/vendor/composer/composer/src/Composer/Command/RequireCommand.php index c502cabf2..578e2a208 100644 --- a/app/vendor/composer/composer/src/Composer/Command/RequireCommand.php +++ b/app/vendor/composer/composer/src/Composer/Command/RequireCommand.php @@ -38,10 +38,15 @@ */ class RequireCommand extends InitCommand { + /** @var bool */ private $newlyCreated; + /** @var bool */ private $firstRequire; + /** @var JsonFile */ private $json; + /** @var string */ private $file; + /** @var string */ private $composerBackup; /** @var string file name */ private $lock; @@ -320,7 +325,7 @@ private function doUpdate(InputInterface $input, OutputInterface $output, IOInte 'require-dev' => $rootPackage->getDevRequires(), ); $loader = new ArrayLoader(); - $newLinks = $loader->parseLinks($rootPackage->getName(), $rootPackage->getPrettyVersion(), BasePackage::$supportedLinkTypes[$requireKey]['description'], $requirements); + $newLinks = $loader->parseLinks($rootPackage->getName(), $rootPackage->getPrettyVersion(), BasePackage::$supportedLinkTypes[$requireKey]['method'], $requirements); $links[$requireKey] = array_merge($links[$requireKey], $newLinks); foreach ($requirements as $package => $constraint) { unset($links[$removeKey][$package]); diff --git a/app/vendor/composer/composer/src/Composer/Command/RunScriptCommand.php b/app/vendor/composer/composer/src/Composer/Command/RunScriptCommand.php index 1ecf1e0c1..81b625786 100644 --- a/app/vendor/composer/composer/src/Composer/Command/RunScriptCommand.php +++ b/app/vendor/composer/composer/src/Composer/Command/RunScriptCommand.php @@ -27,7 +27,7 @@ class RunScriptCommand extends BaseCommand { /** - * @var array Array with command events + * @var string[] Array with command events */ protected $scriptEvents = array( ScriptEvents::PRE_INSTALL_CMD, diff --git a/app/vendor/composer/composer/src/Composer/Command/ScriptAliasCommand.php b/app/vendor/composer/composer/src/Composer/Command/ScriptAliasCommand.php index 455f7420c..63f0f9e6a 100644 --- a/app/vendor/composer/composer/src/Composer/Command/ScriptAliasCommand.php +++ b/app/vendor/composer/composer/src/Composer/Command/ScriptAliasCommand.php @@ -22,7 +22,9 @@ */ class ScriptAliasCommand extends BaseCommand { + /** @var string */ private $script; + /** @var string */ private $description; public function __construct($script, $description) diff --git a/app/vendor/composer/composer/src/Composer/Command/SearchCommand.php b/app/vendor/composer/composer/src/Composer/Command/SearchCommand.php index 1302a196f..8b51d530a 100644 --- a/app/vendor/composer/composer/src/Composer/Command/SearchCommand.php +++ b/app/vendor/composer/composer/src/Composer/Command/SearchCommand.php @@ -29,12 +29,6 @@ */ class SearchCommand extends BaseCommand { - protected $matches; - protected $lowMatches = array(); - protected $tokens; - protected $output; - protected $onlyName; - protected function configure() { $this diff --git a/app/vendor/composer/composer/src/Composer/Command/ShowCommand.php b/app/vendor/composer/composer/src/Composer/Command/ShowCommand.php index 765788772..75fb8ffdc 100644 --- a/app/vendor/composer/composer/src/Composer/Command/ShowCommand.php +++ b/app/vendor/composer/composer/src/Composer/Command/ShowCommand.php @@ -27,6 +27,7 @@ use Composer\Repository\InstalledArrayRepository; use Composer\Repository\ComposerRepository; use Composer\Repository\CompositeRepository; +use Composer\Repository\FilterRepository; use Composer\Repository\PlatformRepository; use Composer\Repository\RepositoryFactory; use Composer\Repository\InstalledRepository; @@ -52,9 +53,10 @@ class ShowCommand extends BaseCommand { /** @var VersionParser */ protected $versionParser; + /** @var string[] */ protected $colors; - /** @var RepositorySet */ + /** @var ?RepositorySet */ private $repositorySet; protected function configure() @@ -183,7 +185,7 @@ protected function execute(InputInterface $input, OutputInterface $output) } else { $installedRepo = new InstalledRepository(array($localRepo, $platformRepo)); } - $repos = new CompositeRepository(array_merge(array($installedRepo), $composer->getRepositoryManager()->getRepositories())); + $repos = new CompositeRepository(array_merge(array(new FilterRepository($installedRepo, array('canonical' => false))), $composer->getRepositoryManager()->getRepositories())); } elseif ($input->getOption('all')) { $defaultRepos = RepositoryFactory::defaultRepos($io); $io->writeError('No composer.json found in the current directory, showing available packages from ' . implode(', ', array_keys($defaultRepos))); @@ -311,12 +313,6 @@ protected function execute(InputInterface $input, OutputInterface $output) return 0; } - if ($repos instanceof CompositeRepository) { - $repos = $repos->getRepositories(); - } elseif (!is_array($repos)) { - $repos = array($repos); - } - // list packages $packages = array(); $packageFilterRegex = null; @@ -334,7 +330,7 @@ protected function execute(InputInterface $input, OutputInterface $output) $input->setOption('path', false); } - foreach ($repos as $repo) { + foreach ($repos->getRepositories() as $repo) { if ($repo === $platformRepo) { $type = 'platform'; } elseif ($lockedRepo !== null && $repo === $lockedRepo) { @@ -1245,6 +1241,9 @@ private function findLatestPackage(PackageInterface $package, Composer $composer return $candidate; } + /** + * @return RepositorySet + */ private function getRepositorySet(Composer $composer) { if (!$this->repositorySet) { diff --git a/app/vendor/composer/composer/src/Composer/Command/UpdateCommand.php b/app/vendor/composer/composer/src/Composer/Command/UpdateCommand.php index 86167c1b3..0fe582299 100644 --- a/app/vendor/composer/composer/src/Composer/Command/UpdateCommand.php +++ b/app/vendor/composer/composer/src/Composer/Command/UpdateCommand.php @@ -315,6 +315,7 @@ private function appendConstraintToLink(Link $link, $constraint) $link->getSource(), $link->getTarget(), $newConstraint, + /** @phpstan-ignore-next-line */ $link->getDescription(), $link->getPrettyConstraint() . ', ' . $constraint ); diff --git a/app/vendor/composer/composer/src/Composer/Compiler.php b/app/vendor/composer/composer/src/Composer/Compiler.php index 444f44584..8476a529f 100644 --- a/app/vendor/composer/composer/src/Composer/Compiler.php +++ b/app/vendor/composer/composer/src/Composer/Compiler.php @@ -43,13 +43,25 @@ public function compile($pharFile = 'composer.phar') unlink($pharFile); } - $process = new Process('git log --pretty="%H" -n1 HEAD', __DIR__); + // TODO in v2.3 always call with an array + if (method_exists('Symfony\Component\Process\Process', 'fromShellCommandline')) { + $process = new Process(array('git', 'log', '--pretty="%H"', '-n1', 'HEAD'), __DIR__); + } else { + // @phpstan-ignore-next-line + $process = new Process('git log --pretty="%H" -n1 HEAD', __DIR__); + } if ($process->run() != 0) { throw new \RuntimeException('Can\'t run git log. You must ensure to run compile from composer git repository clone and that git binary is available.'); } $this->version = trim($process->getOutput()); - $process = new Process('git log -n1 --pretty=%ci HEAD', __DIR__); + // TODO in v2.3 always call with an array + if (method_exists('Symfony\Component\Process\Process', 'fromShellCommandline')) { + $process = new Process(array('git', 'log', '-n1', '--pretty=%ci', 'HEAD'), __DIR__); + } else { + // @phpstan-ignore-next-line + $process = new Process('git log -n1 --pretty=%ci HEAD', __DIR__); + } if ($process->run() != 0) { throw new \RuntimeException('Can\'t run git log. You must ensure to run compile from composer git repository clone and that git binary is available.'); } @@ -57,7 +69,13 @@ public function compile($pharFile = 'composer.phar') $this->versionDate = new \DateTime(trim($process->getOutput())); $this->versionDate->setTimezone(new \DateTimeZone('UTC')); - $process = new Process('git describe --tags --exact-match HEAD'); + // TODO in v2.3 always call with an array + if (method_exists('Symfony\Component\Process\Process', 'fromShellCommandline')) { + $process = new Process(array('git', 'describe', '--tags', '--exact-match', 'HEAD'), __DIR__); + } else { + // @phpstan-ignore-next-line + $process = new Process('git describe --tags --exact-match HEAD'); + } if ($process->run() == 0) { $this->version = trim($process->getOutput()); } else { @@ -71,7 +89,7 @@ public function compile($pharFile = 'composer.phar') } $phar = new \Phar($pharFile, 0, 'composer.phar'); - $phar->setSignatureAlgorithm(\Phar::SHA1); + $phar->setSignatureAlgorithm(\Phar::SHA512); $phar->startBuffering(); @@ -173,7 +191,7 @@ public function compile($pharFile = 'composer.phar') // re-sign the phar with reproducible timestamp / signature $util = new Timestamps($pharFile); $util->updateTimestamps($this->versionDate); - $util->save($pharFile, \Phar::SHA1); + $util->save($pharFile, \Phar::SHA512); Linter::lint($pharFile); } @@ -284,6 +302,11 @@ private function getStub() } } +if (!class_exists('Phar')) { + echo 'PHP\'s phar extension is missing. Composer requires it to run. Enable the extension or recompile php without --disable-phar then try again.' . PHP_EOL; + exit(1); +} + Phar::mapPhar('composer.phar'); EOF; diff --git a/app/vendor/composer/composer/src/Composer/Composer.php b/app/vendor/composer/composer/src/Composer/Composer.php index e053258b4..8d06dd7a0 100644 --- a/app/vendor/composer/composer/src/Composer/Composer.php +++ b/app/vendor/composer/composer/src/Composer/Composer.php @@ -51,9 +51,9 @@ class Composer * const RELEASE_DATE = '@release_date@'; * const SOURCE_VERSION = '1.8-dev+source'; */ - const VERSION = '2.1.3'; + const VERSION = '2.1.9'; const BRANCH_ALIAS_VERSION = ''; - const RELEASE_DATE = '2021-06-09 16:31:20'; + const RELEASE_DATE = '2021-10-05 09:47:38'; const SOURCE_VERSION = ''; /** @@ -88,9 +88,9 @@ public static function getVersion() private $package; /** - * @var Locker + * @var ?Locker */ - private $locker; + private $locker = null; /** * @var Loop @@ -179,7 +179,7 @@ public function setLocker(Locker $locker) } /** - * @return Locker + * @return ?Locker */ public function getLocker() { diff --git a/app/vendor/composer/composer/src/Composer/Console/Application.php b/app/vendor/composer/composer/src/Composer/Console/Application.php index 177f7220a..bdc9b2a32 100644 --- a/app/vendor/composer/composer/src/Composer/Console/Application.php +++ b/app/vendor/composer/composer/src/Composer/Console/Application.php @@ -56,6 +56,7 @@ class Application extends BaseApplication */ protected $io; + /** @var string */ private static $logo = ' ______ / ____/___ ____ ___ ____ ____ ________ _____ / / / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/ @@ -64,7 +65,9 @@ class Application extends BaseApplication /_/ '; + /** @var bool */ private $hasPluginCommands = false; + /** @var bool */ private $disablePluginsByDefault = false; /** @@ -77,8 +80,8 @@ public function __construct() static $shutdownRegistered = false; if (function_exists('ini_set') && extension_loaded('xdebug')) { - ini_set('xdebug.show_exception_trace', false); - ini_set('xdebug.scream', false); + ini_set('xdebug.show_exception_trace', '0'); + ini_set('xdebug.scream', '0'); } if (function_exists('date_default_timezone_set') && function_exists('date_default_timezone_get')) { @@ -139,6 +142,8 @@ public function doRun(InputInterface $input, OutputInterface $output) $io = $this->io = new ConsoleIO($input, $output, new HelperSet(array( new QuestionHelper(), ))); + + // Register error handler again to pass it the IO instance ErrorHandler::register($io); if ($input->hasParameterOption('--no-cache')) { @@ -184,7 +189,17 @@ public function doRun(InputInterface $input, OutputInterface $output) } } - if (!$this->disablePluginsByDefault && !$this->hasPluginCommands && 'global' !== $commandName) { + // avoid loading plugins/initializing the Composer instance earlier than necessary if no plugin command is needed + // if showing the version, we never need plugin commands + $mayNeedPluginCommand = false === $input->hasParameterOption(array('--version', '-V')) + && ( + // not a composer command, so try loading plugin ones + false === $commandName + // list command requires plugin commands to show them + || in_array($commandName, array('', 'list'), true) + ); + + if ($mayNeedPluginCommand && !$this->disablePluginsByDefault && !$this->hasPluginCommands && 'global' !== $commandName) { try { foreach ($this->getPluginCommands() as $command) { if ($this->has($command->getName())) { @@ -403,7 +418,8 @@ private function hintCommonErrors($exception) * @param bool $required * @param bool|null $disablePlugins * @throws JsonValidationException - * @return \Composer\Composer + * @throws \InvalidArgumentException + * @return ?\Composer\Composer If $required is true then the return value is guaranteed */ public function getComposer($required = true, $disablePlugins = null) { @@ -417,12 +433,16 @@ public function getComposer($required = true, $disablePlugins = null) } catch (\InvalidArgumentException $e) { if ($required) { $this->io->writeError($e->getMessage()); - exit(1); + // TODO composer 2.3 simplify to $this->areExceptionsCaught() + if (!method_exists($this, 'areExceptionsCaught') || $this->areExceptionsCaught()) { + exit(1); + } + throw $e; } } catch (JsonValidationException $e) { - $errors = ' - ' . implode(PHP_EOL . ' - ', $e->getErrors()); - $message = $e->getMessage() . ':' . PHP_EOL . $errors; - throw new JsonValidationException($message); + if ($required) { + throw $e; + } } } @@ -435,7 +455,7 @@ public function getComposer($required = true, $disablePlugins = null) public function resetComposer() { $this->composer = null; - if ($this->getIO() && method_exists($this->getIO(), 'resetAuthentications')) { + if (method_exists($this->getIO(), 'resetAuthentications')) { $this->getIO()->resetAuthentications(); } } diff --git a/app/vendor/composer/composer/src/Composer/Console/HtmlOutputFormatter.php b/app/vendor/composer/composer/src/Composer/Console/HtmlOutputFormatter.php index 994fcbcd5..acef97325 100644 --- a/app/vendor/composer/composer/src/Composer/Console/HtmlOutputFormatter.php +++ b/app/vendor/composer/composer/src/Composer/Console/HtmlOutputFormatter.php @@ -19,6 +19,7 @@ */ class HtmlOutputFormatter extends OutputFormatter { + /** @var array */ private static $availableForegroundColors = array( 30 => 'black', 31 => 'red', @@ -29,6 +30,7 @@ class HtmlOutputFormatter extends OutputFormatter 36 => 'cyan', 37 => 'white', ); + /** @var array */ private static $availableBackgroundColors = array( 40 => 'black', 41 => 'red', @@ -39,6 +41,7 @@ class HtmlOutputFormatter extends OutputFormatter 46 => 'cyan', 47 => 'white', ); + /** @var array */ private static $availableOptions = array( 1 => 'bold', 4 => 'underscore', diff --git a/app/vendor/composer/composer/src/Composer/DependencyResolver/Decisions.php b/app/vendor/composer/composer/src/Composer/DependencyResolver/Decisions.php index 648b533df..799a0a1fa 100644 --- a/app/vendor/composer/composer/src/Composer/DependencyResolver/Decisions.php +++ b/app/vendor/composer/composer/src/Composer/DependencyResolver/Decisions.php @@ -16,17 +16,21 @@ * Stores decisions on installing, removing or keeping packages * * @author Nils Adermann + * @implements \Iterator */ class Decisions implements \Iterator, \Countable { const DECISION_LITERAL = 0; const DECISION_REASON = 1; + /** @var Pool */ protected $pool; + /** @var array */ protected $decisionMap; + /** @var array */ protected $decisionQueue = array(); - public function __construct($pool) + public function __construct(Pool $pool) { $this->pool = $pool; $this->decisionMap = array(); @@ -142,31 +146,37 @@ public function revertLast() array_pop($this->decisionQueue); } + #[\ReturnTypeWillChange] public function count() { return \count($this->decisionQueue); } + #[\ReturnTypeWillChange] public function rewind() { end($this->decisionQueue); } + #[\ReturnTypeWillChange] public function current() { return current($this->decisionQueue); } + #[\ReturnTypeWillChange] public function key() { return key($this->decisionQueue); } + #[\ReturnTypeWillChange] public function next() { prev($this->decisionQueue); } + #[\ReturnTypeWillChange] public function valid() { return false !== current($this->decisionQueue); diff --git a/app/vendor/composer/composer/src/Composer/DependencyResolver/DefaultPolicy.php b/app/vendor/composer/composer/src/Composer/DependencyResolver/DefaultPolicy.php index dc8e17736..832a009e5 100644 --- a/app/vendor/composer/composer/src/Composer/DependencyResolver/DefaultPolicy.php +++ b/app/vendor/composer/composer/src/Composer/DependencyResolver/DefaultPolicy.php @@ -23,7 +23,9 @@ */ class DefaultPolicy implements PolicyInterface { + /** @var bool */ private $preferStable; + /** @var bool */ private $preferLowest; public function __construct($preferStable = false, $preferLowest = false) diff --git a/app/vendor/composer/composer/src/Composer/DependencyResolver/GenericRule.php b/app/vendor/composer/composer/src/Composer/DependencyResolver/GenericRule.php index 10ea9c335..61d95275f 100644 --- a/app/vendor/composer/composer/src/Composer/DependencyResolver/GenericRule.php +++ b/app/vendor/composer/composer/src/Composer/DependencyResolver/GenericRule.php @@ -14,18 +14,18 @@ use Composer\Package\BasePackage; use Composer\Package\Link; +use Composer\Semver\Constraint\ConstraintInterface; /** * @author Nils Adermann */ class GenericRule extends Rule { + /** @var int[] */ protected $literals; /** - * @param array $literals - * @param int|null $reason A RULE_* constant describing the reason for generating this rule - * @param Link|BasePackage|int|null $reasonData + * @param int[] $literals */ public function __construct(array $literals, $reason, $reasonData) { diff --git a/app/vendor/composer/composer/src/Composer/DependencyResolver/LockTransaction.php b/app/vendor/composer/composer/src/Composer/DependencyResolver/LockTransaction.php index eb5dead6b..3a3d94505 100644 --- a/app/vendor/composer/composer/src/Composer/DependencyResolver/LockTransaction.php +++ b/app/vendor/composer/composer/src/Composer/DependencyResolver/LockTransaction.php @@ -13,7 +13,8 @@ namespace Composer\DependencyResolver; use Composer\Package\AliasPackage; -use Composer\Package\RootAliasPackage; +use Composer\Package\BasePackage; +use Composer\Package\Package; /** * @author Nils Adermann @@ -23,22 +24,32 @@ class LockTransaction extends Transaction { /** * packages in current lock file, platform repo or otherwise present - * @var array + * + * Indexed by spl_object_hash + * + * @var array */ protected $presentMap; /** * Packages which cannot be mapped, platform repo, root package, other fixed repos - * @var array + * + * Indexed by package id + * + * @var array */ protected $unlockableMap; /** - * @var array + * @var array{dev: BasePackage[], non-dev: BasePackage[], all: BasePackage[]} */ protected $resultPackages; - public function __construct(Pool $pool, $presentMap, $unlockableMap, $decisions) + /** + * @param array $presentMap + * @param array $unlockableMap + */ + public function __construct(Pool $pool, array $presentMap, array $unlockableMap, Decisions $decisions) { $this->presentMap = $presentMap; $this->unlockableMap = $unlockableMap; @@ -88,7 +99,7 @@ public function getNewLockPackages($devMode, $updateMirrors = false) { $packages = array(); foreach ($this->resultPackages[$devMode ? 'dev' : 'non-dev'] as $package) { - if (!($package instanceof AliasPackage) && !($package instanceof RootAliasPackage)) { + if (!$package instanceof AliasPackage) { // if we're just updating mirrors we need to reset references to the same as currently "present" packages' references to keep the lock file as-is // we do not reset references if the currently present package didn't have any, or if the type of VCS has changed if ($updateMirrors && !isset($this->presentMap[spl_object_hash($package)])) { @@ -97,7 +108,7 @@ public function getNewLockPackages($devMode, $updateMirrors = false) if ($presentPackage->getSourceReference() && $presentPackage->getSourceType() === $package->getSourceType()) { $package->setSourceDistReferences($presentPackage->getSourceReference()); } - if ($presentPackage->getReleaseDate()) { + if ($presentPackage->getReleaseDate() && $package instanceof Package) { $package->setReleaseDate($presentPackage->getReleaseDate()); } } diff --git a/app/vendor/composer/composer/src/Composer/DependencyResolver/MultiConflictRule.php b/app/vendor/composer/composer/src/Composer/DependencyResolver/MultiConflictRule.php index 262f34504..16a7bd9e2 100644 --- a/app/vendor/composer/composer/src/Composer/DependencyResolver/MultiConflictRule.php +++ b/app/vendor/composer/composer/src/Composer/DependencyResolver/MultiConflictRule.php @@ -22,12 +22,11 @@ */ class MultiConflictRule extends Rule { + /** @var int[] */ protected $literals; /** - * @param array $literals - * @param int $reason A RULE_* constant describing the reason for generating this rule - * @param Link|BasePackage $reasonData + * @param int[] $literals */ public function __construct(array $literals, $reason, $reasonData) { diff --git a/app/vendor/composer/composer/src/Composer/DependencyResolver/Pool.php b/app/vendor/composer/composer/src/Composer/DependencyResolver/Pool.php index 348583513..733b0edf5 100644 --- a/app/vendor/composer/composer/src/Composer/DependencyResolver/Pool.php +++ b/app/vendor/composer/composer/src/Composer/DependencyResolver/Pool.php @@ -30,7 +30,9 @@ class Pool implements \Countable protected $packages = array(); /** @var array */ protected $packageByName = array(); + /** @var VersionParser */ protected $versionParser; + /** @var array> */ protected $providerCache = array(); /** @var BasePackage[] */ protected $unacceptableFixedOrLockedPackages; @@ -79,6 +81,7 @@ public function packageById($id) /** * Returns how many packages have been loaded into the pool */ + #[\ReturnTypeWillChange] public function count() { return \count($this->packages); @@ -201,7 +204,7 @@ public function __toString() $str = "Pool:\n"; foreach ($this->packages as $package) { - $str .= '- '.str_pad($package->id, 6, ' ', STR_PAD_LEFT).': '.$package->getName()."\n"; + $str .= '- '.str_pad((string) $package->id, 6, ' ', STR_PAD_LEFT).': '.$package->getName()."\n"; } return $str; diff --git a/app/vendor/composer/composer/src/Composer/DependencyResolver/PoolBuilder.php b/app/vendor/composer/composer/src/Composer/DependencyResolver/PoolBuilder.php index f4500cc0d..97159a3c8 100644 --- a/app/vendor/composer/composer/src/Composer/DependencyResolver/PoolBuilder.php +++ b/app/vendor/composer/composer/src/Composer/DependencyResolver/PoolBuilder.php @@ -17,6 +17,7 @@ use Composer\Package\AliasPackage; use Composer\Package\BasePackage; use Composer\Package\CompleteAliasPackage; +use Composer\Package\CompletePackage; use Composer\Package\CompletePackageInterface; use Composer\Package\PackageInterface; use Composer\Package\Version\StabilityFilter; @@ -38,10 +39,12 @@ class PoolBuilder { /** * @var int[] + * @phpstan-var array */ private $acceptableStabilities; /** * @var int[] + * @phpstan-var array */ private $stabilityFlags; /** @@ -55,7 +58,7 @@ class PoolBuilder */ private $rootReferences; /** - * @var EventDispatcher + * @var ?EventDispatcher */ private $eventDispatcher; /** @@ -91,7 +94,9 @@ class PoolBuilder * @phpstan-var list */ private $unacceptableFixedOrLockedPackages = array(); + /** @var string[] */ private $updateAllowList = array(); + /** @var array */ private $skippedLoad = array(); /** @@ -101,6 +106,8 @@ class PoolBuilder * * Packages get cleared from this list if they get unlocked as in that case * we need to actually load them + * + * @var array */ private $maxExtendedReqs = array(); /** @@ -109,6 +116,7 @@ class PoolBuilder */ private $updateAllowWarned = array(); + /** @var int */ private $indexCounter = 0; /** @@ -340,7 +348,7 @@ private function loadPackagesMarkedForLoading(Request $request, $repositories) } } - private function loadPackage(Request $request, PackageInterface $package, $propagateUpdate = true) + private function loadPackage(Request $request, BasePackage $package, $propagateUpdate = true) { $index = $this->indexCounter++; $this->packages[$index] = $package; @@ -370,7 +378,7 @@ private function loadPackage(Request $request, PackageInterface $package, $propa } else { $basePackage = $package; } - if ($basePackage instanceof CompletePackageInterface) { + if ($basePackage instanceof CompletePackage) { $aliasPackage = new CompleteAliasPackage($basePackage, $alias['alias_normalized'], $alias['alias']); } else { $aliasPackage = new AliasPackage($basePackage, $alias['alias_normalized'], $alias['alias']); diff --git a/app/vendor/composer/composer/src/Composer/DependencyResolver/Problem.php b/app/vendor/composer/composer/src/Composer/DependencyResolver/Problem.php index 5248dbadf..35ce3b045 100644 --- a/app/vendor/composer/composer/src/Composer/DependencyResolver/Problem.php +++ b/app/vendor/composer/composer/src/Composer/DependencyResolver/Problem.php @@ -18,6 +18,7 @@ use Composer\Repository\RepositorySet; use Composer\Repository\LockArrayRepository; use Composer\Semver\Constraint\Constraint; +use Composer\Semver\Constraint\ConstraintInterface; use Composer\Package\Version\VersionParser; /** @@ -29,16 +30,17 @@ class Problem { /** * A map containing the id of each rule part of this problem as a key - * @var array + * @var array */ protected $reasonSeen; /** * A set of reasons for the problem, each is a rule or a root require and a rule - * @var array + * @var array> */ protected $reasons = array(); + /** @var int */ protected $section = 0; /** @@ -459,7 +461,7 @@ private static function computeCheckForLowerPrioRepo($isVerbose, $packageName, $ /** * Turns a constraint into text usable in a sentence describing a request * - * @param \Composer\Semver\Constraint\ConstraintInterface $constraint + * @param ?ConstraintInterface $constraint * @return string */ protected static function constraintToText($constraint) diff --git a/app/vendor/composer/composer/src/Composer/DependencyResolver/Request.php b/app/vendor/composer/composer/src/Composer/DependencyResolver/Request.php index 5167ce63c..3514bd4c8 100644 --- a/app/vendor/composer/composer/src/Composer/DependencyResolver/Request.php +++ b/app/vendor/composer/composer/src/Composer/DependencyResolver/Request.php @@ -40,12 +40,19 @@ class Request */ const UPDATE_LISTED_WITH_TRANSITIVE_DEPS = 2; + /** @var ?LockArrayRepository */ protected $lockedRepository; + /** @var array */ protected $requires = array(); + /** @var array */ protected $fixedPackages = array(); + /** @var array */ protected $lockedPackages = array(); + /** @var array */ protected $fixedLockedPackages = array(); + /** @var string[] */ protected $updateAllowList = array(); + /** @var false|self::UPDATE_* */ protected $updateAllowTransitiveDependencies = false; public function __construct(LockArrayRepository $lockedRepository = null) @@ -169,12 +176,12 @@ public function getPresentMap($packageIds = false) if ($this->lockedRepository) { foreach ($this->lockedRepository->getPackages() as $package) { - $presentMap[$packageIds ? $package->id : spl_object_hash($package)] = $package; + $presentMap[$packageIds ? $package->getId() : spl_object_hash($package)] = $package; } } foreach ($this->fixedPackages as $package) { - $presentMap[$packageIds ? $package->id : spl_object_hash($package)] = $package; + $presentMap[$packageIds ? $package->getId() : spl_object_hash($package)] = $package; } return $presentMap; @@ -185,7 +192,7 @@ public function getFixedPackagesMap() $fixedPackagesMap = array(); foreach ($this->fixedPackages as $package) { - $fixedPackagesMap[$package->id] = $package; + $fixedPackagesMap[$package->getId()] = $package; } return $fixedPackagesMap; diff --git a/app/vendor/composer/composer/src/Composer/DependencyResolver/Rule.php b/app/vendor/composer/composer/src/Composer/DependencyResolver/Rule.php index 4eb9f7dd7..edc486496 100644 --- a/app/vendor/composer/composer/src/Composer/DependencyResolver/Rule.php +++ b/app/vendor/composer/composer/src/Composer/DependencyResolver/Rule.php @@ -19,35 +19,45 @@ use Composer\Repository\PlatformRepository; use Composer\Package\Version\VersionParser; use Composer\Semver\Constraint\Constraint; +use Composer\Semver\Constraint\ConstraintInterface; /** * @author Nils Adermann * @author Ruben Gonzalez + * @phpstan-type ReasonData Link|BasePackage|string|int|array{packageName: string, constraint: ConstraintInterface}|array{package: BasePackage} */ abstract class Rule { - // reason constants - const RULE_ROOT_REQUIRE = 2; - const RULE_FIXED = 3; - const RULE_PACKAGE_CONFLICT = 6; - const RULE_PACKAGE_REQUIRES = 7; - const RULE_PACKAGE_SAME_NAME = 10; - const RULE_LEARNED = 12; - const RULE_PACKAGE_ALIAS = 13; - const RULE_PACKAGE_INVERSE_ALIAS = 14; + // reason constants and // their reason data contents + const RULE_ROOT_REQUIRE = 2; // array{packageName: string, constraint: ConstraintInterface} + const RULE_FIXED = 3; // array{package: BasePackage} + const RULE_PACKAGE_CONFLICT = 6; // Link + const RULE_PACKAGE_REQUIRES = 7; // Link + const RULE_PACKAGE_SAME_NAME = 10; // string (package name) + const RULE_LEARNED = 12; // int (rule id) + const RULE_PACKAGE_ALIAS = 13; // BasePackage + const RULE_PACKAGE_INVERSE_ALIAS = 14; // BasePackage // bitfield defs const BITFIELD_TYPE = 0; const BITFIELD_REASON = 8; const BITFIELD_DISABLED = 16; + /** @var int */ protected $bitfield; + /** @var Request */ protected $request; + /** + * @var Link|BasePackage|ConstraintInterface|string + * @phpstan-var ReasonData + */ protected $reasonData; /** - * @param int $reason A RULE_* constant describing the reason for generating this rule - * @param Link|BasePackage $reasonData + * @param self::RULE_* $reason A RULE_* constant describing the reason for generating this rule + * @param Link|BasePackage|ConstraintInterface|string $reasonData + * + * @phpstan-param ReasonData $reasonData */ public function __construct($reason, $reasonData) { @@ -76,6 +86,9 @@ public function getReasonData() return $this->reasonData; } + /** + * @return ?string + */ public function getRequiredPackage() { $reason = $this->getReason(); @@ -91,6 +104,8 @@ public function getRequiredPackage() if ($reason === self::RULE_PACKAGE_REQUIRES) { return $this->reasonData->getTarget(); } + + return null; } public function setType($type) @@ -248,17 +263,19 @@ public function getPrettyString(RepositorySet $repositorySet, Request $request, case self::RULE_PACKAGE_REQUIRES: $sourceLiteral = array_shift($literals); $sourcePackage = $this->deduplicateDefaultBranchAlias($pool->literalToPackage($sourceLiteral)); + /** @var Link */ + $reasonData = $this->reasonData; $requires = array(); foreach ($literals as $literal) { $requires[] = $pool->literalToPackage($literal); } - $text = $this->reasonData->getPrettyString($sourcePackage); + $text = $reasonData->getPrettyString($sourcePackage); if ($requires) { $text .= ' -> satisfiable by ' . $this->formatPackagesUnique($pool, $requires, $isVerbose) . '.'; } else { - $targetName = $this->reasonData->getTarget(); + $targetName = $reasonData->getTarget(); $reason = Problem::getMissingPackageReason($repositorySet, $request, $pool, $isVerbose, $targetName, $this->reasonData->getConstraint()); diff --git a/app/vendor/composer/composer/src/Composer/DependencyResolver/Rule2Literals.php b/app/vendor/composer/composer/src/Composer/DependencyResolver/Rule2Literals.php index 6a3eb7c94..6a4c599ce 100644 --- a/app/vendor/composer/composer/src/Composer/DependencyResolver/Rule2Literals.php +++ b/app/vendor/composer/composer/src/Composer/DependencyResolver/Rule2Literals.php @@ -20,14 +20,14 @@ */ class Rule2Literals extends Rule { + /** @var int */ protected $literal1; + /** @var int */ protected $literal2; /** * @param int $literal1 * @param int $literal2 - * @param int $reason A RULE_* constant describing the reason for generating this rule - * @param Link|BasePackage $reasonData */ public function __construct($literal1, $literal2, $reason, $reasonData) { @@ -42,11 +42,13 @@ public function __construct($literal1, $literal2, $reason, $reasonData) } } + /** @return int[] */ public function getLiterals() { return array($this->literal1, $this->literal2); } + /** @return string */ public function getHash() { return $this->literal1.','.$this->literal2; @@ -91,6 +93,7 @@ public function equals(Rule $rule) return true; } + /** @return false */ public function isAssertion() { return false; diff --git a/app/vendor/composer/composer/src/Composer/DependencyResolver/RuleSet.php b/app/vendor/composer/composer/src/Composer/DependencyResolver/RuleSet.php index aff0d4c65..ba9aeaee2 100644 --- a/app/vendor/composer/composer/src/Composer/DependencyResolver/RuleSet.php +++ b/app/vendor/composer/composer/src/Composer/DependencyResolver/RuleSet.php @@ -16,6 +16,7 @@ /** * @author Nils Adermann + * @implements \IteratorAggregate */ class RuleSet implements \IteratorAggregate, \Countable { @@ -27,10 +28,11 @@ class RuleSet implements \IteratorAggregate, \Countable /** * READ-ONLY: Lookup table for rule id to rule object * - * @var Rule[] + * @var array */ - public $ruleById; + public $ruleById = array(); + /** @var array<255|0|1|4, string> */ protected static $types = array( 255 => 'UNKNOWN', self::TYPE_PACKAGE => 'PACKAGE', @@ -38,20 +40,20 @@ class RuleSet implements \IteratorAggregate, \Countable self::TYPE_LEARNED => 'LEARNED', ); + /** @var array */ protected $rules; - protected $nextRuleId; - protected $rulesByHash; + /** @var int */ + protected $nextRuleId = 0; + + /** @var array */ + protected $rulesByHash = array(); public function __construct() { - $this->nextRuleId = 0; - foreach ($this->getTypes() as $type) { $this->rules[$type] = array(); } - - $this->rulesByHash = array(); } public function add(Rule $rule, $type) @@ -98,6 +100,7 @@ public function add(Rule $rule, $type) } } + #[\ReturnTypeWillChange] public function count() { return $this->nextRuleId; @@ -108,6 +111,7 @@ public function ruleById($id) return $this->ruleById[$id]; } + /** @return array */ public function getRules() { return $this->rules; @@ -116,11 +120,16 @@ public function getRules() /** * @return RuleSetIterator */ + #[\ReturnTypeWillChange] public function getIterator() { return new RuleSetIterator($this->getRules()); } + /** + * @param self::TYPE_*|array $types + * @return RuleSetIterator + */ public function getIteratorFor($types) { if (!\is_array($types)) { @@ -128,6 +137,8 @@ public function getIteratorFor($types) } $allRules = $this->getRules(); + + /** @var array $rules */ $rules = array(); foreach ($types as $type) { @@ -152,6 +163,7 @@ public function getIteratorWithout($types) return new RuleSetIterator($rules); } + /** @return array{0: 0, 1: 1, 2: 4} */ public function getTypes() { $types = self::$types; diff --git a/app/vendor/composer/composer/src/Composer/DependencyResolver/RuleSetGenerator.php b/app/vendor/composer/composer/src/Composer/DependencyResolver/RuleSetGenerator.php index d9da5e062..245f1fdda 100644 --- a/app/vendor/composer/composer/src/Composer/DependencyResolver/RuleSetGenerator.php +++ b/app/vendor/composer/composer/src/Composer/DependencyResolver/RuleSetGenerator.php @@ -14,25 +14,31 @@ use Composer\Package\BasePackage; use Composer\Package\AliasPackage; +use Composer\Package\PackageInterface; use Composer\Repository\PlatformRepository; /** * @author Nils Adermann + * @phpstan-import-type ReasonData from Rule */ class RuleSetGenerator { + /** @var PolicyInterface */ protected $policy; + /** @var Pool */ protected $pool; + /** @var RuleSet */ protected $rules; - protected $addedMap; - protected $conflictAddedMap; - protected $addedPackagesByNames; - protected $conflictsForName; + /** @var array */ + protected $addedMap = array(); + /** @var array */ + protected $addedPackagesByNames = array(); public function __construct(PolicyInterface $policy, Pool $pool) { $this->policy = $policy; $this->pool = $pool; + $this->rules = new RuleSet; } /** @@ -41,13 +47,15 @@ public function __construct(PolicyInterface $policy, Pool $pool) * This rule is of the form (-A|B|C), where B and C are the providers of * one requirement of the package A. * - * @param BasePackage $package The package with a requirement - * @param array $providers The providers of the requirement - * @param int $reason A RULE_* constant describing the - * reason for generating this rule - * @param mixed $reasonData Any data, e.g. the requirement name, - * that goes with the reason - * @return Rule|null The generated rule or null if tautological + * @param BasePackage $package The package with a requirement + * @param array $providers The providers of the requirement + * @param Rule::RULE_* $reason A RULE_* constant describing the + * reason for generating this rule + * @param mixed $reasonData Any data, e.g. the requirement name, + * that goes with the reason + * @return Rule|null The generated rule or null if tautological + * + * @phpstan-param ReasonData $reasonData */ protected function createRequireRule(BasePackage $package, array $providers, $reason, $reasonData = null) { @@ -71,10 +79,12 @@ protected function createRequireRule(BasePackage $package, array $providers, $re * set of packages is empty an impossible rule is generated. * * @param BasePackage[] $packages The set of packages to choose from - * @param int $reason A RULE_* constant describing the reason for + * @param Rule::RULE_* $reason A RULE_* constant describing the reason for * generating this rule * @param array $reasonData Additional data like the root require or fix request info * @return Rule The generated rule + * + * @phpstan-param ReasonData $reasonData */ protected function createInstallOneOfRule(array $packages, $reason, $reasonData) { @@ -92,13 +102,15 @@ protected function createInstallOneOfRule(array $packages, $reason, $reasonData) * The rule for conflicting packages A and B is (-A|-B). A is called the issuer * and B the provider. * - * @param BasePackage $issuer The package declaring the conflict - * @param BasePackage $provider The package causing the conflict - * @param int $reason A RULE_* constant describing the - * reason for generating this rule - * @param mixed $reasonData Any data, e.g. the package name, that - * goes with the reason - * @return Rule|null The generated rule + * @param BasePackage $issuer The package declaring the conflict + * @param BasePackage $provider The package causing the conflict + * @param Rule::RULE_* $reason A RULE_* constant describing the + * reason for generating this rule + * @param mixed $reasonData Any data, e.g. the package name, that + * goes with the reason + * @return Rule|null The generated rule + * + * @phpstan-param ReasonData $reasonData */ protected function createRule2Literals(BasePackage $issuer, BasePackage $provider, $reason, $reasonData = null) { @@ -144,11 +156,11 @@ private function addRule($type, Rule $newRule = null) protected function addRulesForPackage(BasePackage $package, $ignorePlatformReqs) { + /** @var \SplQueue */ $workQueue = new \SplQueue; $workQueue->enqueue($package); while (!$workQueue->isEmpty()) { - /** @var BasePackage $package */ $package = $workQueue->dequeue(); if (isset($this->addedMap[$package->id])) { continue; @@ -286,13 +298,6 @@ protected function addRulesForRootAliases($ignorePlatformReqs) */ public function getRulesFor(Request $request, $ignorePlatformReqs = false) { - $this->rules = new RuleSet; - - $this->addedMap = array(); - $this->conflictAddedMap = array(); - $this->addedPackagesByNames = array(); - $this->conflictsForName = array(); - $this->addRulesForRequest($request, $ignorePlatformReqs); $this->addRulesForRootAliases($ignorePlatformReqs); @@ -300,8 +305,12 @@ public function getRulesFor(Request $request, $ignorePlatformReqs = false) $this->addConflictRules($ignorePlatformReqs); // Remove references to packages - $this->addedMap = $this->addedPackagesByNames = null; + $this->addedMap = $this->addedPackagesByNames = array(); + + $rules = $this->rules; + + $this->rules = new RuleSet; - return $this->rules; + return $rules; } } diff --git a/app/vendor/composer/composer/src/Composer/DependencyResolver/RuleSetIterator.php b/app/vendor/composer/composer/src/Composer/DependencyResolver/RuleSetIterator.php index 50d72dc93..2726253d2 100644 --- a/app/vendor/composer/composer/src/Composer/DependencyResolver/RuleSetIterator.php +++ b/app/vendor/composer/composer/src/Composer/DependencyResolver/RuleSetIterator.php @@ -14,16 +14,25 @@ /** * @author Nils Adermann + * @implements \Iterator */ class RuleSetIterator implements \Iterator { + /** @var array */ protected $rules; + /** @var array */ protected $types; + /** @var int */ protected $currentOffset; + /** @var RuleSet::TYPE_*|-1 */ protected $currentType; + /** @var int */ protected $currentTypeOffset; + /** + * @param array $rules + */ public function __construct(array $rules) { $this->rules = $rules; @@ -33,16 +42,19 @@ public function __construct(array $rules) $this->rewind(); } + #[\ReturnTypeWillChange] public function current() { return $this->rules[$this->currentType][$this->currentOffset]; } + #[\ReturnTypeWillChange] public function key() { return $this->currentType; } + #[\ReturnTypeWillChange] public function next() { $this->currentOffset++; @@ -67,6 +79,7 @@ public function next() } } + #[\ReturnTypeWillChange] public function rewind() { $this->currentOffset = 0; @@ -86,6 +99,7 @@ public function rewind() } while (isset($this->types[$this->currentTypeOffset]) && !\count($this->rules[$this->currentType])); } + #[\ReturnTypeWillChange] public function valid() { return isset($this->rules[$this->currentType], $this->rules[$this->currentType][$this->currentOffset]); diff --git a/app/vendor/composer/composer/src/Composer/DependencyResolver/RuleWatchChain.php b/app/vendor/composer/composer/src/Composer/DependencyResolver/RuleWatchChain.php index 2fea0d6ee..52795ea89 100644 --- a/app/vendor/composer/composer/src/Composer/DependencyResolver/RuleWatchChain.php +++ b/app/vendor/composer/composer/src/Composer/DependencyResolver/RuleWatchChain.php @@ -19,11 +19,10 @@ * method to set the internal iterator to a particular offset. * * @author Nils Adermann + * @extends \SplDoublyLinkedList */ class RuleWatchChain extends \SplDoublyLinkedList { - protected $offset = 0; - /** * Moves the internal iterator to the specified offset * diff --git a/app/vendor/composer/composer/src/Composer/DependencyResolver/RuleWatchGraph.php b/app/vendor/composer/composer/src/Composer/DependencyResolver/RuleWatchGraph.php index 42bcfd551..76b6abb55 100644 --- a/app/vendor/composer/composer/src/Composer/DependencyResolver/RuleWatchGraph.php +++ b/app/vendor/composer/composer/src/Composer/DependencyResolver/RuleWatchGraph.php @@ -24,6 +24,7 @@ */ class RuleWatchGraph { + /** @var array */ protected $watchChains = array(); /** @@ -153,7 +154,7 @@ public function propagateLiteral($decidedLiteral, $level, $decisions) * @param int $toLiteral A literal the node should watch now * @param RuleWatchNode $node The rule node to be moved */ - protected function moveWatch($fromLiteral, $toLiteral, $node) + protected function moveWatch($fromLiteral, $toLiteral, RuleWatchNode $node) { if (!isset($this->watchChains[$toLiteral])) { $this->watchChains[$toLiteral] = new RuleWatchChain; diff --git a/app/vendor/composer/composer/src/Composer/DependencyResolver/RuleWatchNode.php b/app/vendor/composer/composer/src/Composer/DependencyResolver/RuleWatchNode.php index 0986b08b1..24fccd8d3 100644 --- a/app/vendor/composer/composer/src/Composer/DependencyResolver/RuleWatchNode.php +++ b/app/vendor/composer/composer/src/Composer/DependencyResolver/RuleWatchNode.php @@ -21,9 +21,12 @@ */ class RuleWatchNode { + /** @var int */ public $watch1; + /** @var int */ public $watch2; + /** @var Rule */ protected $rule; /** @@ -31,7 +34,7 @@ class RuleWatchNode * * @param Rule $rule The rule to wrap */ - public function __construct($rule) + public function __construct(Rule $rule) { $this->rule = $rule; diff --git a/app/vendor/composer/composer/src/Composer/DependencyResolver/Solver.php b/app/vendor/composer/composer/src/Composer/DependencyResolver/Solver.php index 4b5330923..7454ea74e 100644 --- a/app/vendor/composer/composer/src/Composer/DependencyResolver/Solver.php +++ b/app/vendor/composer/composer/src/Composer/DependencyResolver/Solver.php @@ -45,9 +45,9 @@ class Solver protected $branches = array(); /** @var Problem[] */ protected $problems = array(); - /** @var array */ + /** @var array */ protected $learnedPool = array(); - /** @var array */ + /** @var array */ protected $learnedWhy = array(); /** @var bool */ diff --git a/app/vendor/composer/composer/src/Composer/DependencyResolver/SolverProblemsException.php b/app/vendor/composer/composer/src/Composer/DependencyResolver/SolverProblemsException.php index c6844e25c..93eab3e63 100644 --- a/app/vendor/composer/composer/src/Composer/DependencyResolver/SolverProblemsException.php +++ b/app/vendor/composer/composer/src/Composer/DependencyResolver/SolverProblemsException.php @@ -14,15 +14,22 @@ use Composer\Util\IniHelper; use Composer\Repository\RepositorySet; +use Composer\Package\PackageInterface; /** * @author Nils Adermann */ class SolverProblemsException extends \RuntimeException { + /** @var Problem[] */ protected $problems; + /** @var array */ protected $learnedPool; + /** + * @param Problem[] $problems + * @param array $learnedPool + */ public function __construct(array $problems, array $learnedPool) { $this->problems = $problems; @@ -108,7 +115,8 @@ private function hasExtensionProblems(array $reasonSets) { foreach ($reasonSets as $reasonSet) { foreach ($reasonSet as $rule) { - if (0 === strpos($rule->getRequiredPackage(), 'ext-')) { + $required = $rule->getRequiredPackage(); + if (null !== $required && 0 === strpos($required, 'ext-')) { return true; } } diff --git a/app/vendor/composer/composer/src/Composer/DependencyResolver/Transaction.php b/app/vendor/composer/composer/src/Composer/DependencyResolver/Transaction.php index 66b9b9a3e..1cda16927 100644 --- a/app/vendor/composer/composer/src/Composer/DependencyResolver/Transaction.php +++ b/app/vendor/composer/composer/src/Composer/DependencyResolver/Transaction.php @@ -16,6 +16,7 @@ use Composer\Package\Link; use Composer\Package\PackageInterface; use Composer\Repository\PlatformRepository; +use Composer\DependencyResolver\Operation\OperationInterface; /** * @author Nils Adermann @@ -24,24 +25,24 @@ class Transaction { /** - * @var array + * @var OperationInterface[] */ protected $operations; /** * Packages present at the beginning of the transaction - * @var array + * @var PackageInterface[] */ protected $presentPackages; /** * Package set resulting from this transaction - * @var array + * @var array */ protected $resultPackageMap; /** - * @var array + * @var array */ protected $resultPackagesByName = array(); @@ -52,6 +53,7 @@ public function __construct($presentPackages, $resultPackages) $this->operations = $this->calculateOperations(); } + /** @return OperationInterface[] */ public function getOperations() { return $this->operations; @@ -201,7 +203,7 @@ protected function calculateOperations() * These serve as a starting point to enumerate packages in a topological order despite potential cycles. * If there are packages with a cycle on the top level the package with the lowest name gets picked * - * @return array + * @return array */ protected function getRootPackages() { @@ -245,8 +247,8 @@ protected function getProvidersInResult(Link $link) * it at least fixes the symptoms and makes usage of composer possible (again) * in such scenarios. * - * @param Operation\OperationInterface[] $operations - * @return Operation\OperationInterface[] reordered operation list + * @param OperationInterface[] $operations + * @return OperationInterface[] reordered operation list */ private function movePluginsToFront(array $operations) { @@ -322,8 +324,8 @@ private function movePluginsToFront(array $operations) * Removals of packages should be executed before installations in * case two packages resolve to the same path (due to custom installers) * - * @param Operation\OperationInterface[] $operations - * @return Operation\OperationInterface[] reordered operation list + * @param OperationInterface[] $operations + * @return OperationInterface[] reordered operation list */ private function moveUninstallsToFront(array $operations) { diff --git a/app/vendor/composer/composer/src/Composer/Downloader/DownloadManager.php b/app/vendor/composer/composer/src/Composer/Downloader/DownloadManager.php index f55cb9a28..7616229cb 100644 --- a/app/vendor/composer/composer/src/Composer/Downloader/DownloadManager.php +++ b/app/vendor/composer/composer/src/Composer/Downloader/DownloadManager.php @@ -402,6 +402,7 @@ protected function resolvePackageInstallPreference(PackageInterface $package) /** * @return string[] + * @phpstan-return array<'dist'|'source'>&non-empty-array */ private function getAvailableSources(PackageInterface $package, PackageInterface $prevPackage = null) { diff --git a/app/vendor/composer/composer/src/Composer/Downloader/FileDownloader.php b/app/vendor/composer/composer/src/Composer/Downloader/FileDownloader.php index 0062d22b8..e915d6995 100644 --- a/app/vendor/composer/composer/src/Composer/Downloader/FileDownloader.php +++ b/app/vendor/composer/composer/src/Composer/Downloader/FileDownloader.php @@ -51,16 +51,19 @@ class FileDownloader implements DownloaderInterface, ChangeReportInterface protected $httpDownloader; /** @var Filesystem */ protected $filesystem; - /** @var Cache */ + /** @var ?Cache */ protected $cache; - /** @var EventDispatcher */ + /** @var ?EventDispatcher */ protected $eventDispatcher; /** @var ProcessExecutor */ protected $process; /** * @private this is only public for php 5.3 support in closures + * + * @var array Map of package name to cache key */ public $lastCacheWrites = array(); + /** @var array Map of package name to list of paths */ private $additionalCleanupPaths = array(); /** @@ -142,7 +145,7 @@ public function download(PackageInterface $package, $path, PackageInterface $pre $accept = null; $reject = null; - $download = function () use ($io, $output, $httpDownloader, $cache, $cacheKeyGenerator, $eventDispatcher, $package, $fileName, &$urls, &$accept, &$reject) { + $download = function () use ($io, $output, $httpDownloader, $cache, $cacheKeyGenerator, $eventDispatcher, $package, $fileName, &$urls, &$accept, &$reject, $self) { /** @var array{base: string, processed: string, cacheKey: string} $url */ $url = reset($urls); $index = key($urls); @@ -168,6 +171,12 @@ public function download(PackageInterface $package, $path, PackageInterface $pre if ($output) { $io->writeError(" - Loading " . $package->getName() . " (" . $package->getFullPrettyVersion() . ") from cache", true, IOInterface::VERY_VERBOSE); } + // mark the file as having been written in cache even though it is only read from cache, so that if + // the cache is corrupt the archive will be deleted and the next attempt will re-download it + // see https://github.com/composer/composer/issues/10028 + if (!$cache->isReadOnly()) { + $self->lastCacheWrites[$package->getName()] = $cacheKey; + } $result = \React\Promise\resolve($fileName); } else { if ($output) { diff --git a/app/vendor/composer/composer/src/Composer/Downloader/PathDownloader.php b/app/vendor/composer/composer/src/Composer/Downloader/PathDownloader.php index bdcf39984..be1b1262d 100644 --- a/app/vendor/composer/composer/src/Composer/Downloader/PathDownloader.php +++ b/app/vendor/composer/composer/src/Composer/Downloader/PathDownloader.php @@ -184,7 +184,14 @@ public function remove(PackageInterface $package, $path, $output = true) return \React\Promise\resolve(); } - if (realpath($path) === realpath($package->getDistUrl())) { + // ensure that the source path (dist url) is not the same as the install path, which + // can happen when using custom installers, see https://github.com/composer/composer/pull/9116 + // not using realpath here as we do not want to resolve the symlink to the original dist url + // it points to + $fs = new Filesystem; + $absPath = $fs->isAbsolutePath($path) ? $path : getcwd() . '/' . $path; + $absDistUrl = $fs->isAbsolutePath($package->getDistUrl()) ? $package->getDistUrl() : getcwd() . '/' . $package->getDistUrl(); + if ($fs->normalizePath($absPath) === $fs->normalizePath($absDistUrl)) { if ($output) { $this->io->writeError(" - " . UninstallOperation::format($package).", source is still present in $path"); } diff --git a/app/vendor/composer/composer/src/Composer/Downloader/SvnDownloader.php b/app/vendor/composer/composer/src/Composer/Downloader/SvnDownloader.php index 2a5880aac..f36b04917 100644 --- a/app/vendor/composer/composer/src/Composer/Downloader/SvnDownloader.php +++ b/app/vendor/composer/composer/src/Composer/Downloader/SvnDownloader.php @@ -23,6 +23,7 @@ */ class SvnDownloader extends VcsDownloader { + /** @var bool */ protected $cacheCredentials = true; /** diff --git a/app/vendor/composer/composer/src/Composer/Downloader/TransportException.php b/app/vendor/composer/composer/src/Composer/Downloader/TransportException.php index 68c73542f..a478e5807 100644 --- a/app/vendor/composer/composer/src/Composer/Downloader/TransportException.php +++ b/app/vendor/composer/composer/src/Composer/Downloader/TransportException.php @@ -17,9 +17,13 @@ */ class TransportException extends \RuntimeException { + /** @var ?array */ protected $headers; + /** @var ?string */ protected $response; + /** @var ?int */ protected $statusCode; + /** @var ?array */ protected $responseInfo = array(); public function setHeaders($headers) diff --git a/app/vendor/composer/composer/src/Composer/Downloader/VcsDownloader.php b/app/vendor/composer/composer/src/Composer/Downloader/VcsDownloader.php index b44c7264b..53c573679 100644 --- a/app/vendor/composer/composer/src/Composer/Downloader/VcsDownloader.php +++ b/app/vendor/composer/composer/src/Composer/Downloader/VcsDownloader.php @@ -38,7 +38,7 @@ abstract class VcsDownloader implements DownloaderInterface, ChangeReportInterfa protected $process; /** @var Filesystem */ protected $filesystem; - /** @var array */ + /** @var array */ protected $hasCleanedChanges = array(); public function __construct(IOInterface $io, Config $config, ProcessExecutor $process = null, Filesystem $fs = null) diff --git a/app/vendor/composer/composer/src/Composer/Downloader/ZipDownloader.php b/app/vendor/composer/composer/src/Composer/Downloader/ZipDownloader.php index 4475c5e8f..2a93c9f9c 100644 --- a/app/vendor/composer/composer/src/Composer/Downloader/ZipDownloader.php +++ b/app/vendor/composer/composer/src/Composer/Downloader/ZipDownloader.php @@ -25,8 +25,11 @@ */ class ZipDownloader extends ArchiveDownloader { + /** @var array */ private static $unzipCommands; + /** @var bool */ private static $hasZipArchive; + /** @var bool */ private static $isWindows; /** @var ZipArchive|null */ @@ -46,6 +49,18 @@ public function download(PackageInterface $package, $path, PackageInterface $pre if ($cmd = $finder->find('unzip')) { self::$unzipCommands[] = array('unzip', ProcessExecutor::escape($cmd).' -qq %s -d %s'); } + if (!Platform::isWindows() && ($cmd = $finder->find('7z'))) { // 7z linux/macOS support is only used if unzip is not present + self::$unzipCommands[] = array('7z', ProcessExecutor::escape($cmd).' x -bb0 -y %s -o%s'); + } + if (!Platform::isWindows() && ($cmd = $finder->find('7zz'))) { // 7zz linux/macOS support is only used if unzip is not present + self::$unzipCommands[] = array('7zz', ProcessExecutor::escape($cmd).' x -bb0 -y %s -o%s'); + } + } + + $procOpenMissing = false; + if (!function_exists('proc_open')) { + self::$unzipCommands = array(); + $procOpenMissing = true; } if (null === self::$hasZipArchive) { @@ -55,7 +70,11 @@ public function download(PackageInterface $package, $path, PackageInterface $pre if (!self::$hasZipArchive && !self::$unzipCommands) { // php.ini path is added to the error message to help users find the correct file $iniMessage = IniHelper::getMessage(); - $error = "The zip extension and unzip/7z commands are both missing, skipping.\n" . $iniMessage; + if ($procOpenMissing) { + $error = "The zip extension is missing and unzip/7z commands cannot be called as proc_open is disabled, skipping.\n" . $iniMessage; + } else { + $error = "The zip extension and unzip/7z commands are both missing, skipping.\n" . $iniMessage; + } throw new \RuntimeException($error); } @@ -64,9 +83,15 @@ public function download(PackageInterface $package, $path, PackageInterface $pre self::$isWindows = Platform::isWindows(); if (!self::$isWindows && !self::$unzipCommands) { - $this->io->writeError("As there is no 'unzip' nor '7z' command installed zip files are being unpacked using the PHP zip extension."); - $this->io->writeError("This may cause invalid reports of corrupted archives. Besides, any UNIX permissions (e.g. executable) defined in the archives will be lost."); - $this->io->writeError("Installing 'unzip' or '7z' may remediate them."); + if ($procOpenMissing) { + $this->io->writeError("proc_open is disabled so 'unzip' and '7z' commands cannot be used, zip files are being unpacked using the PHP zip extension."); + $this->io->writeError("This may cause invalid reports of corrupted archives. Besides, any UNIX permissions (e.g. executable) defined in the archives will be lost."); + $this->io->writeError("Enabling proc_open and installing 'unzip' or '7z' may remediate them."); + } else { + $this->io->writeError("As there is no 'unzip' nor '7z' command installed zip files are being unpacked using the PHP zip extension."); + $this->io->writeError("This may cause invalid reports of corrupted archives. Besides, any UNIX permissions (e.g. executable) defined in the archives will be lost."); + $this->io->writeError("Installing 'unzip' or '7z' may remediate them."); + } } } @@ -93,6 +118,12 @@ private function extractWithSystemUnzip(PackageInterface $package, $file, $path) $commandSpec = reset(self::$unzipCommands); $command = sprintf($commandSpec[1], ProcessExecutor::escape($file), ProcessExecutor::escape($path)); + // normalize separators to backslashes to avoid problems with 7-zip on windows + // see https://github.com/composer/composer/issues/10058 + if (Platform::isWindows()) { + $command = sprintf($commandSpec[1], ProcessExecutor::escape(strtr($file, '/', '\\')), ProcessExecutor::escape(strtr($path, '/', '\\'))); + } + $executable = $commandSpec[0]; $self = $this; diff --git a/app/vendor/composer/composer/src/Composer/EventDispatcher/Event.php b/app/vendor/composer/composer/src/Composer/EventDispatcher/Event.php index 2091f6be0..51cfda4f8 100644 --- a/app/vendor/composer/composer/src/Composer/EventDispatcher/Event.php +++ b/app/vendor/composer/composer/src/Composer/EventDispatcher/Event.php @@ -25,12 +25,12 @@ class Event protected $name; /** - * @var array Arguments passed by the user, these will be forwarded to CLI script handlers + * @var string[] Arguments passed by the user, these will be forwarded to CLI script handlers */ protected $args; /** - * @var array Flags usable in PHP script handlers + * @var mixed[] Flags usable in PHP script handlers */ protected $flags; @@ -42,9 +42,9 @@ class Event /** * Constructor. * - * @param string $name The event name - * @param array $args Arguments passed by the user - * @param array $flags Optional flags to pass data not as argument + * @param string $name The event name + * @param string[] $args Arguments passed by the user + * @param mixed[] $flags Optional flags to pass data not as argument */ public function __construct($name, array $args = array(), array $flags = array()) { @@ -66,7 +66,7 @@ public function getName() /** * Returns the event's arguments. * - * @return array The event arguments + * @return string[] The event arguments */ public function getArguments() { @@ -76,7 +76,7 @@ public function getArguments() /** * Returns the event's flags. * - * @return array The event flags + * @return mixed[] The event flags */ public function getFlags() { diff --git a/app/vendor/composer/composer/src/Composer/Factory.php b/app/vendor/composer/composer/src/Composer/Factory.php index a7ba027c1..d67ccf29a 100644 --- a/app/vendor/composer/composer/src/Composer/Factory.php +++ b/app/vendor/composer/composer/src/Composer/Factory.php @@ -37,6 +37,8 @@ use Composer\Autoload\AutoloadGenerator; use Composer\Package\Version\VersionParser; use Composer\Downloader\TransportException; +use Composer\Json\JsonValidationException; +use Composer\Repository\InstalledRepositoryInterface; use Seld\JsonLint\JsonParser; /** @@ -304,11 +306,17 @@ public function createComposer(IOInterface $io, $localConfig = null, $disablePlu } else { $message = 'Composer could not find the config file: '.$localConfig; } - $instructions = $fullLoad ? 'To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section' : ''; + $instructions = $fullLoad ? 'To initialize a project, please create a composer.json file. See https://getcomposer.org/basic-usage' : ''; throw new \InvalidArgumentException($message.PHP_EOL.$instructions); } - $file->validateSchema(JsonFile::LAX_SCHEMA); + try { + $file->validateSchema(JsonFile::LAX_SCHEMA); + } catch (JsonValidationException $e) { + $errors = ' - ' . implode(PHP_EOL . ' - ', $e->getErrors()); + $message = $e->getMessage() . ':' . PHP_EOL . $errors; + throw new JsonValidationException($message); + } $jsonParser = new JsonParser; try { $jsonParser->parse(file_get_contents($localConfig), JsonParser::DETECT_KEY_CONFLICTS); @@ -378,7 +386,7 @@ public function createComposer(IOInterface $io, $localConfig = null, $disablePlu $composer->setPackage($package); // load local repository - $this->addLocalRepository($io, $rm, $vendorDir, $package); + $this->addLocalRepository($io, $rm, $vendorDir, $package, $process); // initialize installation manager $im = $this->createInstallationManager($loop, $io, $dispatcher); @@ -427,9 +435,7 @@ public function createComposer(IOInterface $io, $localConfig = null, $disablePlu // once everything is initialized we can // purge packages from local repos if they have been deleted on the filesystem - if ($rm->getLocalRepository()) { - $this->purgePackages($rm->getLocalRepository(), $im); - } + $this->purgePackages($rm->getLocalRepository(), $im); } return $composer; @@ -451,9 +457,14 @@ public static function createGlobal(IOInterface $io, $disablePlugins = false) * @param Repository\RepositoryManager $rm * @param string $vendorDir */ - protected function addLocalRepository(IOInterface $io, RepositoryManager $rm, $vendorDir, RootPackageInterface $rootPackage) + protected function addLocalRepository(IOInterface $io, RepositoryManager $rm, $vendorDir, RootPackageInterface $rootPackage, ProcessExecutor $process = null) { - $rm->setLocalRepository(new Repository\InstalledFilesystemRepository(new JsonFile($vendorDir.'/composer/installed.json', null, $io), true, $rootPackage)); + $fs = null; + if ($process) { + $fs = new Filesystem($process); + } + + $rm->setLocalRepository(new Repository\InstalledFilesystemRepository(new JsonFile($vendorDir.'/composer/installed.json', null, $io), true, $rootPackage, $fs)); } /** @@ -573,10 +584,10 @@ protected function createDefaultInstallers(Installer\InstallationManager $im, Co } /** - * @param WritableRepositoryInterface $repo repository to purge packages from + * @param InstalledRepositoryInterface $repo repository to purge packages from * @param Installer\InstallationManager $im manager to check whether packages are still installed */ - protected function purgePackages(WritableRepositoryInterface $repo, Installer\InstallationManager $im) + protected function purgePackages(InstalledRepositoryInterface $repo, Installer\InstallationManager $im) { foreach ($repo->getPackages() as $package) { if (!$im->isPackageInstalled($repo, $package)) { @@ -620,7 +631,7 @@ public static function createHttpDownloader(IOInterface $io, Config $config, $op if (isset($_SERVER['argv']) && in_array('disable-tls', $_SERVER['argv']) && (in_array('conf', $_SERVER['argv']) || in_array('config', $_SERVER['argv']))) { $warned = true; $disableTls = !extension_loaded('openssl'); - } elseif ($config && $config->get('disable-tls') === true) { + } elseif ($config->get('disable-tls') === true) { if (!$warned) { $io->writeError('You are running Composer with SSL/TLS protection disabled.'); } @@ -632,10 +643,10 @@ public static function createHttpDownloader(IOInterface $io, Config $config, $op } $httpDownloaderOptions = array(); if ($disableTls === false) { - if ($config && $config->get('cafile')) { + if ($config->get('cafile')) { $httpDownloaderOptions['ssl']['cafile'] = $config->get('cafile'); } - if ($config && $config->get('capath')) { + if ($config->get('capath')) { $httpDownloaderOptions['ssl']['capath'] = $config->get('capath'); } $httpDownloaderOptions = array_replace_recursive($httpDownloaderOptions, $options); diff --git a/app/vendor/composer/composer/src/Composer/IO/BaseIO.php b/app/vendor/composer/composer/src/Composer/IO/BaseIO.php index 44bd73062..380902fa7 100644 --- a/app/vendor/composer/composer/src/Composer/IO/BaseIO.php +++ b/app/vendor/composer/composer/src/Composer/IO/BaseIO.php @@ -18,6 +18,7 @@ abstract class BaseIO implements IOInterface { + /** @var array */ protected $authentications = array(); /** diff --git a/app/vendor/composer/composer/src/Composer/IO/ConsoleIO.php b/app/vendor/composer/composer/src/Composer/IO/ConsoleIO.php index d756d9b9d..d6aa538c1 100644 --- a/app/vendor/composer/composer/src/Composer/IO/ConsoleIO.php +++ b/app/vendor/composer/composer/src/Composer/IO/ConsoleIO.php @@ -36,9 +36,9 @@ class ConsoleIO extends BaseIO /** @var HelperSet */ protected $helperSet; /** @var string */ - protected $lastMessage; + protected $lastMessage = ''; /** @var string */ - protected $lastMessageErr; + protected $lastMessageErr = ''; /** @var float */ private $startTime; @@ -159,13 +159,6 @@ private function doWrite($messages, $newline, $stderr, $verbosity, $raw = false) return; } - // hack to keep our usage BC with symfony<2.8 versions - // this removes the quiet output but there is no way around it - // see https://github.com/composer/composer/pull/4913 - if (OutputInterface::VERBOSITY_QUIET === 0) { - $sfVerbosity = OutputInterface::OUTPUT_NORMAL; - } - if ($raw) { if ($sfVerbosity === OutputInterface::OUTPUT_NORMAL) { $sfVerbosity = OutputInterface::OUTPUT_RAW; diff --git a/app/vendor/composer/composer/src/Composer/InstalledVersions.php b/app/vendor/composer/composer/src/Composer/InstalledVersions.php index b3a4e1611..7c5502ca4 100644 --- a/app/vendor/composer/composer/src/Composer/InstalledVersions.php +++ b/app/vendor/composer/composer/src/Composer/InstalledVersions.php @@ -20,7 +20,7 @@ * * See also https://getcomposer.org/doc/07-runtime.md#installed-versions * - * To require it's presence, you can require `composer-runtime-api ^2.0` + * To require its presence, you can require `composer-runtime-api ^2.0` */ class InstalledVersions { @@ -228,7 +228,7 @@ public static function getInstallPath($packageName) /** * @return array - * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string} + * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string} */ public static function getRootPackage() { @@ -242,7 +242,7 @@ public static function getRootPackage() * * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect. * @return array[] - * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array} + * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array} */ public static function getRawData() { @@ -265,7 +265,7 @@ public static function getRawData() * Returns the raw data of all installed.php which are currently loaded for custom implementations * * @return array[] - * @psalm-return list}> + * @psalm-return list}> */ public static function getAllRawData() { @@ -288,7 +288,7 @@ public static function getAllRawData() * @param array[] $data A vendor/composer/installed.php data set * @return void * - * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array} $data + * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array} $data */ public static function reload($data) { @@ -298,7 +298,7 @@ public static function reload($data) /** * @return array[] - * @psalm-return list}> + * @psalm-return list}> */ private static function getInstalled() { diff --git a/app/vendor/composer/composer/src/Composer/Installer.php b/app/vendor/composer/composer/src/Composer/Installer.php index 6cf057172..d04005132 100644 --- a/app/vendor/composer/composer/src/Composer/Installer.php +++ b/app/vendor/composer/composer/src/Composer/Installer.php @@ -152,7 +152,7 @@ class Installer protected $suggestedPackagesReporter; /** - * @var RepositoryInterface + * @var ?RepositoryInterface */ protected $additionalFixedRepository; @@ -180,6 +180,7 @@ public function __construct(IOInterface $io, Config $config, RootPackageInterfac $this->installationManager = $installationManager; $this->eventDispatcher = $eventDispatcher; $this->autoloadGenerator = $autoloadGenerator; + $this->suggestedPackagesReporter = new SuggestedPackagesReporter($this->io); $this->writeLock = $config->get('lock'); } @@ -238,10 +239,6 @@ public function run() $localRepo = $this->repositoryManager->getLocalRepository(); - if (!$this->suggestedPackagesReporter) { - $this->suggestedPackagesReporter = new SuggestedPackagesReporter($this->io); - } - try { if ($this->update) { $res = $this->doUpdate($localRepo, $this->install); diff --git a/app/vendor/composer/composer/src/Composer/Installer/BinaryInstaller.php b/app/vendor/composer/composer/src/Composer/Installer/BinaryInstaller.php index cdbd1074c..c692e72b3 100644 --- a/app/vendor/composer/composer/src/Composer/Installer/BinaryInstaller.php +++ b/app/vendor/composer/composer/src/Composer/Installer/BinaryInstaller.php @@ -28,9 +28,13 @@ */ class BinaryInstaller { + /** @var string */ protected $binDir; + /** @var string */ protected $binCompat; + /** @var IOInterface */ protected $io; + /** @var Filesystem */ protected $filesystem; /** diff --git a/app/vendor/composer/composer/src/Composer/Installer/InstallationManager.php b/app/vendor/composer/composer/src/Composer/Installer/InstallationManager.php index fb3e28f78..5b254384e 100644 --- a/app/vendor/composer/composer/src/Composer/Installer/InstallationManager.php +++ b/app/vendor/composer/composer/src/Composer/Installer/InstallationManager.php @@ -47,7 +47,7 @@ class InstallationManager private $loop; /** @var IOInterface */ private $io; - /** @var EventDispatcher */ + /** @var ?EventDispatcher */ private $eventDispatcher; /** @var bool */ private $outputProgress; @@ -179,6 +179,7 @@ public function ensureBinariesPresence(PackageInterface $package) */ public function execute(InstalledRepositoryInterface $repo, array $operations, $devMode = true, $runScripts = true) { + /** @var PromiseInterface[] */ $cleanupPromises = array(); $loop = $this->loop; @@ -510,7 +511,7 @@ public function update(InstalledRepositoryInterface $repo, UpdateOperation $oper } $installer = $this->getInstaller($targetType); - $promise->then(function () use ($installer, $repo, $target) { + $promise = $promise->then(function () use ($installer, $repo, $target) { return $installer->install($repo, $target); }); } diff --git a/app/vendor/composer/composer/src/Composer/Installer/LibraryInstaller.php b/app/vendor/composer/composer/src/Composer/Installer/LibraryInstaller.php index 82a32520a..239e5d129 100644 --- a/app/vendor/composer/composer/src/Composer/Installer/LibraryInstaller.php +++ b/app/vendor/composer/composer/src/Composer/Installer/LibraryInstaller.php @@ -20,6 +20,7 @@ use Composer\Util\Silencer; use Composer\Util\Platform; use React\Promise\PromiseInterface; +use Composer\Downloader\DownloadManager; /** * Package installation manager. @@ -29,14 +30,19 @@ */ class LibraryInstaller implements InstallerInterface, BinaryPresenceInterface { + /** @var Composer */ protected $composer; + /** @var string */ protected $vendorDir; - protected $binDir; + /** @var DownloadManager */ protected $downloadManager; + /** @var IOInterface */ protected $io; + /** @var string */ protected $type; + /** @var Filesystem */ protected $filesystem; - protected $binCompat; + /** @var BinaryInstaller */ protected $binaryInstaller; /** diff --git a/app/vendor/composer/composer/src/Composer/Installer/MetapackageInstaller.php b/app/vendor/composer/composer/src/Composer/Installer/MetapackageInstaller.php index f5a2a43b6..936f72536 100644 --- a/app/vendor/composer/composer/src/Composer/Installer/MetapackageInstaller.php +++ b/app/vendor/composer/composer/src/Composer/Installer/MetapackageInstaller.php @@ -26,6 +26,7 @@ */ class MetapackageInstaller implements InstallerInterface { + /** @var IOInterface */ private $io; public function __construct(IOInterface $io) diff --git a/app/vendor/composer/composer/src/Composer/Installer/PluginInstaller.php b/app/vendor/composer/composer/src/Composer/Installer/PluginInstaller.php index b334ac43e..120253216 100644 --- a/app/vendor/composer/composer/src/Composer/Installer/PluginInstaller.php +++ b/app/vendor/composer/composer/src/Composer/Installer/PluginInstaller.php @@ -99,7 +99,7 @@ public function update(InstalledRepositoryInterface $repo, PackageInterface $ini return $promise->then(function () use ($self, $pluginManager, $initial, $target, $repo) { try { Platform::workaroundFilesystemIssues(); - $pluginManager->deactivatePackage($initial, true); + $pluginManager->deactivatePackage($initial); $pluginManager->registerPackage($target, true); } catch (\Exception $e) { $self->rollbackInstall($e, $repo, $target); @@ -109,7 +109,7 @@ public function update(InstalledRepositoryInterface $repo, PackageInterface $ini public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package) { - $this->composer->getPluginManager()->uninstallPackage($package, true); + $this->composer->getPluginManager()->uninstallPackage($package); return parent::uninstall($repo, $package); } diff --git a/app/vendor/composer/composer/src/Composer/Installer/ProjectInstaller.php b/app/vendor/composer/composer/src/Composer/Installer/ProjectInstaller.php index 5bae889dc..d03e97521 100644 --- a/app/vendor/composer/composer/src/Composer/Installer/ProjectInstaller.php +++ b/app/vendor/composer/composer/src/Composer/Installer/ProjectInstaller.php @@ -25,8 +25,11 @@ */ class ProjectInstaller implements InstallerInterface { + /** @var string */ private $installPath; + /** @var DownloadManager */ private $downloadManager; + /** @var Filesystem */ private $filesystem; public function __construct($installPath, DownloadManager $dm, Filesystem $fs) diff --git a/app/vendor/composer/composer/src/Composer/Installer/SuggestedPackagesReporter.php b/app/vendor/composer/composer/src/Composer/Installer/SuggestedPackagesReporter.php index 0e28e9d50..4db5931d3 100644 --- a/app/vendor/composer/composer/src/Composer/Installer/SuggestedPackagesReporter.php +++ b/app/vendor/composer/composer/src/Composer/Installer/SuggestedPackagesReporter.php @@ -29,7 +29,7 @@ class SuggestedPackagesReporter const MODE_BY_SUGGESTION = 4; /** - * @var array + * @var array */ protected $suggestedPackages = array(); diff --git a/app/vendor/composer/composer/src/Composer/Json/JsonFile.php b/app/vendor/composer/composer/src/Composer/Json/JsonFile.php index 1b662fa91..1f830452c 100644 --- a/app/vendor/composer/composer/src/Composer/Json/JsonFile.php +++ b/app/vendor/composer/composer/src/Composer/Json/JsonFile.php @@ -36,16 +36,19 @@ class JsonFile const COMPOSER_SCHEMA_PATH = '/../../../res/composer-schema.json'; + /** @var string */ private $path; + /** @var ?HttpDownloader */ private $httpDownloader; + /** @var ?IOInterface */ private $io; /** * Initializes json file reader/parser. * * @param string $path path to a lockfile - * @param HttpDownloader $httpDownloader required for loading http/https json files - * @param IOInterface $io + * @param ?HttpDownloader $httpDownloader required for loading http/https json files + * @param ?IOInterface $io * @throws \InvalidArgumentException */ public function __construct($path, HttpDownloader $httpDownloader = null, IOInterface $io = null) @@ -291,7 +294,7 @@ private static function throwEncodeError($code) /** * Parses json string and returns hash. * - * @param string $json json string + * @param ?string $json json string * @param string $file the json file * * @throws ParsingException @@ -300,7 +303,7 @@ private static function throwEncodeError($code) public static function parseJson($json, $file = null) { if (null === $json) { - return; + return null; } $data = json_decode($json, true); if (null === $data && JSON_ERROR_NONE !== json_last_error()) { diff --git a/app/vendor/composer/composer/src/Composer/Json/JsonManipulator.php b/app/vendor/composer/composer/src/Composer/Json/JsonManipulator.php index ecb15878b..b1c82a687 100644 --- a/app/vendor/composer/composer/src/Composer/Json/JsonManipulator.php +++ b/app/vendor/composer/composer/src/Composer/Json/JsonManipulator.php @@ -19,6 +19,7 @@ */ class JsonManipulator { + /** @var string */ private static $DEFINES = '(?(DEFINE) (? -? (?= [1-9]|0(?!\d) ) \d++ (\.\d++)? ([eE] [+-]?+ \d++)? ) (? true | false | null ) @@ -29,8 +30,11 @@ class JsonManipulator (? \s*+ (?: (?&number) | (?&boolean) | (?&string) | (?&array) | (?&object) ) ) )'; + /** @var string */ private $contents; + /** @var string */ private $newline; + /** @var string */ private $indent; public function __construct($contents) diff --git a/app/vendor/composer/composer/src/Composer/Json/JsonValidationException.php b/app/vendor/composer/composer/src/Composer/Json/JsonValidationException.php index 2fa5eb489..e4533f672 100644 --- a/app/vendor/composer/composer/src/Composer/Json/JsonValidationException.php +++ b/app/vendor/composer/composer/src/Composer/Json/JsonValidationException.php @@ -19,14 +19,24 @@ */ class JsonValidationException extends Exception { + /** + * @var string[] + */ protected $errors; + /** + * @param string $message + * @param string[] $errors + */ public function __construct($message, $errors = array(), Exception $previous = null) { $this->errors = $errors; - parent::__construct($message, 0, $previous); + parent::__construct((string) $message, 0, $previous); } + /** + * @return string[] + */ public function getErrors() { return $this->errors; diff --git a/app/vendor/composer/composer/src/Composer/Package/AliasPackage.php b/app/vendor/composer/composer/src/Composer/Package/AliasPackage.php index 42d38b6b6..c993230c6 100644 --- a/app/vendor/composer/composer/src/Composer/Package/AliasPackage.php +++ b/app/vendor/composer/composer/src/Composer/Package/AliasPackage.php @@ -113,6 +113,7 @@ public function getRequires() /** * {@inheritDoc} + * @return array */ public function getConflicts() { @@ -121,6 +122,7 @@ public function getConflicts() /** * {@inheritDoc} + * @return array */ public function getProvides() { @@ -129,6 +131,7 @@ public function getProvides() /** * {@inheritDoc} + * @return array */ public function getReplaces() { @@ -167,8 +170,8 @@ public function isRootPackageAlias() } /** - * @param Link[] $links - * @param string $linkType + * @param Link[] $links + * @param Link::TYPE_* $linkType * * @return Link[] */ diff --git a/app/vendor/composer/composer/src/Composer/Package/Archiver/ArchivableFilesFilter.php b/app/vendor/composer/composer/src/Composer/Package/Archiver/ArchivableFilesFilter.php index 4a9a5af1f..f49486a04 100644 --- a/app/vendor/composer/composer/src/Composer/Package/Archiver/ArchivableFilesFilter.php +++ b/app/vendor/composer/composer/src/Composer/Package/Archiver/ArchivableFilesFilter.php @@ -22,6 +22,7 @@ class ArchivableFilesFilter extends FilterIterator /** * @return bool true if the current element is acceptable, otherwise false. */ + #[\ReturnTypeWillChange] public function accept() { $file = $this->getInnerIterator()->current(); diff --git a/app/vendor/composer/composer/src/Composer/Package/Archiver/ArchivableFilesFinder.php b/app/vendor/composer/composer/src/Composer/Package/Archiver/ArchivableFilesFinder.php index 4a8042abe..98cdf941b 100644 --- a/app/vendor/composer/composer/src/Composer/Package/Archiver/ArchivableFilesFinder.php +++ b/app/vendor/composer/composer/src/Composer/Package/Archiver/ArchivableFilesFinder.php @@ -89,6 +89,7 @@ public function __construct($sources, array $excludes, $ignoreFilters = false) parent::__construct($this->finder->getIterator()); } + #[\ReturnTypeWillChange] public function accept() { /** @var SplFileInfo $current */ diff --git a/app/vendor/composer/composer/src/Composer/Package/Archiver/ArchiveManager.php b/app/vendor/composer/composer/src/Composer/Package/Archiver/ArchiveManager.php index 3025878d7..356c53646 100644 --- a/app/vendor/composer/composer/src/Composer/Package/Archiver/ArchiveManager.php +++ b/app/vendor/composer/composer/src/Composer/Package/Archiver/ArchiveManager.php @@ -16,6 +16,7 @@ use Composer\Package\RootPackageInterface; use Composer\Util\Filesystem; use Composer\Util\Loop; +use Composer\Util\SyncHelper; use Composer\Json\JsonFile; use Composer\Package\CompletePackageInterface; @@ -87,7 +88,7 @@ public function getPackageFilename(CompletePackageInterface $package) } $nameParts = array($baseName); - if (preg_match('{^[a-f0-9]{40}$}', $package->getDistReference())) { + if (null !== $package->getDistReference() && preg_match('{^[a-f0-9]{40}$}', $package->getDistReference())) { array_push($nameParts, $package->getDistReference(), $package->getDistType()); } else { array_push($nameParts, $package->getPrettyVersion(), $package->getDistReference()); @@ -149,8 +150,9 @@ public function archive(CompletePackageInterface $package, $format, $targetDir, try { // Download sources $promise = $this->downloadManager->download($package, $sourcePath); - $this->loop->wait(array($promise)); - $this->downloadManager->install($package, $sourcePath); + SyncHelper::await($this->loop, $promise); + $promise = $this->downloadManager->install($package, $sourcePath); + SyncHelper::await($this->loop, $promise); } catch (\Exception $e) { $filesystem->removeDirectory($sourcePath); throw $e; diff --git a/app/vendor/composer/composer/src/Composer/Package/Archiver/PharArchiver.php b/app/vendor/composer/composer/src/Composer/Package/Archiver/PharArchiver.php index f9a392353..955d1b3c9 100644 --- a/app/vendor/composer/composer/src/Composer/Package/Archiver/PharArchiver.php +++ b/app/vendor/composer/composer/src/Composer/Package/Archiver/PharArchiver.php @@ -52,7 +52,12 @@ public function archive($sources, $target, $format, array $excludes = array(), $ $target = $filename . '.tar'; } - $phar = new \PharData($target, null, null, static::$formats[$format]); + $phar = new \PharData( + $target, + \FilesystemIterator::KEY_AS_PATHNAME | \FilesystemIterator::CURRENT_AS_FILEINFO, + '', + static::$formats[$format] + ); $files = new ArchivableFilesFinder($sources, $excludes, $ignoreFilters); $filesOnly = new ArchivableFilesFilter($files); $phar->buildFromIterator($filesOnly, $sources); diff --git a/app/vendor/composer/composer/src/Composer/Package/Archiver/ZipArchiver.php b/app/vendor/composer/composer/src/Composer/Package/Archiver/ZipArchiver.php index ec241a026..c0ce41d65 100644 --- a/app/vendor/composer/composer/src/Composer/Package/Archiver/ZipArchiver.php +++ b/app/vendor/composer/composer/src/Composer/Package/Archiver/ZipArchiver.php @@ -51,8 +51,9 @@ public function archive($sources, $target, $format, array $excludes = array(), $ /** * ZipArchive::setExternalAttributesName is available from >= PHP 5.6 + * setExternalAttributesName() is only available with libzip 0.11.2 or above */ - if (PHP_VERSION_ID >= 50600) { + if (PHP_VERSION_ID >= 50600 && method_exists($zip, 'setExternalAttributesName')) { $perms = fileperms($filepath); /** diff --git a/app/vendor/composer/composer/src/Composer/Package/BasePackage.php b/app/vendor/composer/composer/src/Composer/Package/BasePackage.php index a7a075099..04a57f5bc 100644 --- a/app/vendor/composer/composer/src/Composer/Package/BasePackage.php +++ b/app/vendor/composer/composer/src/Composer/Package/BasePackage.php @@ -24,6 +24,7 @@ abstract class BasePackage implements PackageInterface { /** * @phpstan-var array + * @internal */ public static $supportedLinkTypes = array( 'require' => array('description' => 'requires', 'method' => Link::TYPE_REQUIRE), @@ -217,6 +218,10 @@ public function getFullPrettyVersion($truncate = true, $displayMode = PackageInt throw new \UnexpectedValueException('Display mode '.$displayMode.' is not supported'); } + if (null === $reference) { + return $this->getPrettyVersion(); + } + // if source reference is a sha1 hash -- truncate if ($truncate && \strlen($reference) === 40 && $this->getSourceType() !== 'svn') { return $this->getPrettyVersion() . ' ' . substr($reference, 0, 7); diff --git a/app/vendor/composer/composer/src/Composer/Package/CompletePackage.php b/app/vendor/composer/composer/src/Composer/Package/CompletePackage.php index e09158053..dc0b115c3 100644 --- a/app/vendor/composer/composer/src/Composer/Package/CompletePackage.php +++ b/app/vendor/composer/composer/src/Composer/Package/CompletePackage.php @@ -19,10 +19,10 @@ */ class CompletePackage extends Package implements CompletePackageInterface { - protected $repositories; + protected $repositories = array(); protected $license = array(); - protected $keywords; - protected $authors; + protected $keywords = array(); + protected $authors = array(); protected $description; protected $homepage; protected $scripts = array(); diff --git a/app/vendor/composer/composer/src/Composer/Package/Link.php b/app/vendor/composer/composer/src/Composer/Package/Link.php index 955eb8e97..af08705df 100644 --- a/app/vendor/composer/composer/src/Composer/Package/Link.php +++ b/app/vendor/composer/composer/src/Composer/Package/Link.php @@ -26,6 +26,12 @@ class Link const TYPE_PROVIDE = 'provides'; const TYPE_CONFLICT = 'conflicts'; const TYPE_REPLACE = 'replaces'; + + /** + * Special type + * @internal + */ + const TYPE_DOES_NOT_REQUIRE = 'does not require'; /** * TODO should be marked private once 5.3 is dropped * @private @@ -37,6 +43,7 @@ class Link * * @internal * @var string[] + * @phpstan-var array */ public static $TYPES = array( self::TYPE_REQUIRE, @@ -63,12 +70,12 @@ class Link /** * @var string - * @phpstan-var self::TYPE_* $description + * @phpstan-var string $description */ protected $description; /** - * @var string|null + * @var ?string */ protected $prettyConstraint; @@ -91,7 +98,7 @@ public function __construct( $this->source = strtolower($source); $this->target = strtolower($target); $this->constraint = $constraint; - $this->description = $description; + $this->description = self::TYPE_DEV_REQUIRE === $description ? 'requires (for development)' : $description; $this->prettyConstraint = $prettyConstraint; } @@ -154,6 +161,6 @@ public function __toString() */ public function getPrettyString(PackageInterface $sourcePackage) { - return $sourcePackage->getPrettyString().' '.$this->description.' '.$this->target.($this->constraint ? ' '.$this->constraint->getPrettyString() : ''); + return $sourcePackage->getPrettyString().' '.$this->description.' '.$this->target.' '.$this->constraint->getPrettyString(); } } diff --git a/app/vendor/composer/composer/src/Composer/Package/Loader/ArrayLoader.php b/app/vendor/composer/composer/src/Composer/Package/Loader/ArrayLoader.php index 1f3843f3e..4367b9a3a 100644 --- a/app/vendor/composer/composer/src/Composer/Package/Loader/ArrayLoader.php +++ b/app/vendor/composer/composer/src/Composer/Package/Loader/ArrayLoader.php @@ -45,9 +45,12 @@ public function __construct(VersionParser $parser = null, $loadOptions = false) /** * @template PackageClass of CompletePackageInterface - * @param array $config package data - * @param string $class FQCN to be instantiated - * @return CompletePackage|CompleteAliasPackage + * + * @param array $config package data + * @param string $class FQCN to be instantiated + * + * @return CompletePackage|CompleteAliasPackage|RootPackage|RootAliasPackage + * * @phpstan-param class-string $class */ public function load(array $config, $class = 'Composer\Package\CompletePackage') @@ -65,7 +68,7 @@ public function load(array $config, $class = 'Composer\Package\CompletePackage') $this->parseLinks( $package->getName(), $package->getPrettyVersion(), - $opts['description'], + $opts['method'], $config[$type] ) ); @@ -78,23 +81,16 @@ public function load(array $config, $class = 'Composer\Package\CompletePackage') } /** - * @template PackageClass of CompletePackageInterface * @param array $versions - * @param string $class FQCN to be instantiated * @return list - * @phpstan-param class-string $class */ - public function loadPackages(array $versions, $class = 'Composer\Package\CompletePackage') + public function loadPackages(array $versions) { - if ($class !== 'Composer\Package\CompletePackage') { - trigger_error('The $class arg is deprecated, please reach out to Composer maintainers ASAP if you still need this.', E_USER_DEPRECATED); - } - $packages = array(); $linkCache = array(); foreach ($versions as $version) { - $package = $this->createObject($version, $class); + $package = $this->createObject($version, 'Composer\Package\CompletePackage'); $this->configureCachedLinks($linkCache, $package, $version); $package = $this->configureObject($package, $version); @@ -137,14 +133,14 @@ private function createObject(array $config, $class) } /** - * @param CompletePackageInterface $package + * @param CompletePackage $package * @param array $config package data * @return RootPackage|RootAliasPackage|CompletePackage|CompleteAliasPackage */ private function configureObject(PackageInterface $package, array $config) { - if (!$package instanceof Package) { - throw new \LogicException('ArrayLoader expects instances of the Composer\Package\Package class to function correctly'); + if (!$package instanceof CompletePackage) { + throw new \LogicException('ArrayLoader expects instances of the Composer\Package\CompletePackage class to function correctly'); } $package->setType(isset($config['type']) ? strtolower($config['type']) : 'library'); @@ -302,15 +298,11 @@ private function configureObject(PackageInterface $package, array $config) if ($aliasNormalized = $this->getBranchAlias($config)) { $prettyAlias = preg_replace('{(\.9{7})+}', '.x', $aliasNormalized); - if ($package instanceof RootPackageInterface) { + if ($package instanceof RootPackage) { return new RootAliasPackage($package, $aliasNormalized, $prettyAlias); } - if ($package instanceof CompletePackageInterface) { - return new CompleteAliasPackage($package, $aliasNormalized, $prettyAlias); - } - - return new AliasPackage($package, $aliasNormalized, $prettyAlias); + return new CompleteAliasPackage($package, $aliasNormalized, $prettyAlias); } return $package; @@ -335,10 +327,10 @@ private function configureCachedLinks(&$linkCache, $package, array $config) foreach ($config[$type] as $prettyTarget => $constraint) { $target = strtolower($prettyTarget); if ($constraint === 'self.version') { - $links[$target] = $this->createLink($name, $prettyVersion, $opts['description'], $target, $constraint); + $links[$target] = $this->createLink($name, $prettyVersion, $opts['method'], $target, $constraint); } else { if (!isset($linkCache[$name][$type][$target][$constraint])) { - $linkCache[$name][$type][$target][$constraint] = array($target, $this->createLink($name, $prettyVersion, $opts['description'], $target, $constraint)); + $linkCache[$name][$type][$target][$constraint] = array($target, $this->createLink($name, $prettyVersion, $opts['method'], $target, $constraint)); } list($target, $link) = $linkCache[$name][$type][$target][$constraint]; diff --git a/app/vendor/composer/composer/src/Composer/Package/Loader/ValidatingArrayLoader.php b/app/vendor/composer/composer/src/Composer/Package/Loader/ValidatingArrayLoader.php index b2e0ad232..62fa84943 100644 --- a/app/vendor/composer/composer/src/Composer/Package/Loader/ValidatingArrayLoader.php +++ b/app/vendor/composer/composer/src/Composer/Package/Loader/ValidatingArrayLoader.php @@ -179,8 +179,8 @@ public function load(array $config, $class = 'Composer\Package\CompletePackage') unset($this->config['support']['email']); } - if (isset($this->config['support']['irc']) && !$this->filterUrl($this->config['support']['irc'], array('irc'))) { - $this->warnings[] = 'support.irc : invalid value ('.$this->config['support']['irc'].'), must be a irc:/// URL'; + if (isset($this->config['support']['irc']) && !$this->filterUrl($this->config['support']['irc'], array('irc', 'ircs'))) { + $this->warnings[] = 'support.irc : invalid value ('.$this->config['support']['irc'].'), must be a irc:/// or ircs:// URL'; unset($this->config['support']['irc']); } @@ -347,6 +347,13 @@ public function load(array $config, $class = 'Composer\Package\CompletePackage') $this->errors[] = 'extra.branch-alias : must be an array of versions => aliases'; } else { foreach ($this->config['extra']['branch-alias'] as $sourceBranch => $targetBranch) { + if (!is_string($targetBranch)) { + $this->warnings[] = 'extra.branch-alias.'.$sourceBranch.' : the target branch ('.json_encode($targetBranch).') must be a string, "'.gettype($targetBranch).'" received.'; + unset($this->config['extra']['branch-alias'][$sourceBranch]); + + continue; + } + // ensure it is an alias to a -dev package if ('-dev' !== substr($targetBranch, -4)) { $this->warnings[] = 'extra.branch-alias.'.$sourceBranch.' : the target branch ('.$targetBranch.') must end in -dev'; diff --git a/app/vendor/composer/composer/src/Composer/Package/Locker.php b/app/vendor/composer/composer/src/Composer/Package/Locker.php index 4bbbb1d4c..2ab1e2052 100644 --- a/app/vendor/composer/composer/src/Composer/Package/Locker.php +++ b/app/vendor/composer/composer/src/Composer/Package/Locker.php @@ -186,11 +186,7 @@ public function getLockedRepository($withDevReqs = false) if (isset($lockData['aliases'])) { foreach ($lockData['aliases'] as $alias) { if (isset($packageByName[$alias['package']])) { - if ($packageByName[$alias['package']] instanceof CompletePackageInterface) { - $aliasPkg = new CompleteAliasPackage($packageByName[$alias['package']], $alias['alias_normalized'], $alias['alias']); - } else { - $aliasPkg = new AliasPackage($packageByName[$alias['package']], $alias['alias_normalized'], $alias['alias']); - } + $aliasPkg = new CompleteAliasPackage($packageByName[$alias['package']], $alias['alias_normalized'], $alias['alias']); $aliasPkg->setRootPackageAlias(true); $packages->addPackage($aliasPkg); } diff --git a/app/vendor/composer/composer/src/Composer/Package/Package.php b/app/vendor/composer/composer/src/Composer/Package/Package.php index 300c5ef03..2b3ccb1aa 100644 --- a/app/vendor/composer/composer/src/Composer/Package/Package.php +++ b/app/vendor/composer/composer/src/Composer/Package/Package.php @@ -22,43 +22,68 @@ */ class Package extends BasePackage { + /** @var string */ protected $type; + /** @var ?string */ protected $targetDir; + /** @var 'source'|'dist'|null */ protected $installationSource; + /** @var ?string */ protected $sourceType; + /** @var ?string */ protected $sourceUrl; + /** @var ?string */ protected $sourceReference; + /** @var ?array */ protected $sourceMirrors; + /** @var ?string */ protected $distType; + /** @var ?string */ protected $distUrl; + /** @var ?string */ protected $distReference; + /** @var ?string */ protected $distSha1Checksum; + /** @var ?array */ protected $distMirrors; + /** @var string */ protected $version; + /** @var string */ protected $prettyVersion; + /** @var ?\DateTime */ protected $releaseDate; + /** @var mixed[] */ protected $extra = array(); + /** @var string[] */ protected $binaries = array(); + /** @var bool */ protected $dev; + /** @var string */ protected $stability; + /** @var ?string */ protected $notificationUrl; - /** @var Link[] */ + /** @var array */ protected $requires = array(); - /** @var Link[] */ + /** @var array */ protected $conflicts = array(); - /** @var Link[] */ + /** @var array */ protected $provides = array(); - /** @var Link[] */ + /** @var array */ protected $replaces = array(); - /** @var Link[] */ + /** @var array */ protected $devRequires = array(); + /** @var array */ protected $suggests = array(); + /** @var array{psr-0?: array, psr-4?: array, classmap?: list, files?: list} */ protected $autoload = array(); + /** @var array{psr-0?: array, psr-4?: array, classmap?: list, files?: list} */ protected $devAutoload = array(); + /** @var string[] */ protected $includePaths = array(); + /** @var bool */ protected $isDefaultBranch = false; - /** @var array */ + /** @var mixed[] */ protected $transportOptions = array(); /** @@ -392,7 +417,7 @@ public function getReleaseDate() /** * Set the required packages * - * @param Link[] $requires A set of package links + * @param array $requires A set of package links */ public function setRequires(array $requires) { @@ -410,7 +435,7 @@ public function getRequires() /** * Set the conflicting packages * - * @param Link[] $conflicts A set of package links + * @param array $conflicts A set of package links */ public function setConflicts(array $conflicts) { @@ -419,6 +444,7 @@ public function setConflicts(array $conflicts) /** * {@inheritDoc} + * @return array */ public function getConflicts() { @@ -428,7 +454,7 @@ public function getConflicts() /** * Set the provided virtual packages * - * @param Link[] $provides A set of package links + * @param array $provides A set of package links */ public function setProvides(array $provides) { @@ -437,6 +463,7 @@ public function setProvides(array $provides) /** * {@inheritDoc} + * @return array */ public function getProvides() { @@ -446,7 +473,7 @@ public function getProvides() /** * Set the packages this one replaces * - * @param Link[] $replaces A set of package links + * @param array $replaces A set of package links */ public function setReplaces(array $replaces) { @@ -455,6 +482,7 @@ public function setReplaces(array $replaces) /** * {@inheritDoc} + * @return array */ public function getReplaces() { @@ -464,7 +492,7 @@ public function getReplaces() /** * Set the recommended packages * - * @param Link[] $devRequires A set of package links + * @param array $devRequires A set of package links */ public function setDevRequires(array $devRequires) { @@ -482,7 +510,7 @@ public function getDevRequires() /** * Set the suggested packages * - * @param array $suggests A set of package names/comments + * @param array $suggests A set of package names/comments */ public function setSuggests(array $suggests) { @@ -594,7 +622,10 @@ public function setSourceDistReferences($reference) // only bitbucket, github and gitlab have auto generated dist URLs that easily allow replacing the reference in the dist URL // TODO generalize this a bit for self-managed/on-prem versions? Some kind of replace token in dist urls which allow this? - if (preg_match('{^https?://(?:(?:www\.)?bitbucket\.org|(api\.)?github\.com|(?:www\.)?gitlab\.com)/}i', $this->getDistUrl())) { + if ( + $this->getDistUrl() !== null + && preg_match('{^https?://(?:(?:www\.)?bitbucket\.org|(api\.)?github\.com|(?:www\.)?gitlab\.com)/}i', $this->getDistUrl()) + ) { $this->setDistReference($reference); $this->setDistUrl(preg_replace('{(?<=/|sha=)[a-f0-9]{40}(?=/|$)}i', $reference, $this->getDistUrl())); } elseif ($this->getDistReference()) { // update the dist reference if there was one, but if none was provided ignore it diff --git a/app/vendor/composer/composer/src/Composer/Package/PackageInterface.php b/app/vendor/composer/composer/src/Composer/Package/PackageInterface.php index 7f0fb1023..c3df0fd63 100644 --- a/app/vendor/composer/composer/src/Composer/Package/PackageInterface.php +++ b/app/vendor/composer/composer/src/Composer/Package/PackageInterface.php @@ -82,14 +82,14 @@ public function getType(); /** * Returns the package targetDir property * - * @return string|null The package targetDir + * @return ?string The package targetDir */ public function getTargetDir(); /** * Returns the package extra data * - * @return array The package extra data + * @return mixed[] The package extra data */ public function getExtra(); @@ -97,27 +97,29 @@ public function getExtra(); * Sets source from which this package was installed (source/dist). * * @param string $type source/dist + * @phpstan-param 'source'|'dist'|null $type */ public function setInstallationSource($type); /** * Returns source from which this package was installed (source/dist). * - * @return string source/dist + * @return ?string source/dist + * @phpstan-return 'source'|'dist'|null */ public function getInstallationSource(); /** * Returns the repository type of this package, e.g. git, svn * - * @return string The repository type + * @return ?string The repository type */ public function getSourceType(); /** * Returns the repository url of this package, e.g. git://github.com/naderman/composer.git * - * @return string The repository url + * @return ?string The repository url */ public function getSourceUrl(); @@ -131,19 +133,19 @@ public function getSourceUrls(); /** * Returns the repository reference of this package, e.g. master, 1.0.0 or a commit hash for git * - * @return string The repository reference + * @return ?string The repository reference */ public function getSourceReference(); /** * Returns the source mirrors of this package * - * @return array|null + * @return ?array */ public function getSourceMirrors(); /** - * @param array|null $mirrors + * @param ?array $mirrors * @return void */ public function setSourceMirrors($mirrors); @@ -151,14 +153,14 @@ public function setSourceMirrors($mirrors); /** * Returns the type of the distribution archive of this version, e.g. zip, tarball * - * @return string The repository type + * @return ?string The repository type */ public function getDistType(); /** * Returns the url of the distribution archive of this version * - * @return string + * @return ?string */ public function getDistUrl(); @@ -172,26 +174,26 @@ public function getDistUrls(); /** * Returns the reference of the distribution archive of this version, e.g. master, 1.0.0 or a commit hash for git * - * @return string + * @return ?string */ public function getDistReference(); /** * Returns the sha1 checksum for the distribution archive of this version * - * @return string + * @return ?string */ public function getDistSha1Checksum(); /** * Returns the dist mirrors of this package * - * @return array|null + * @return ?array */ public function getDistMirrors(); /** - * @param array|null $mirrors + * @param ?array $mirrors * @return void */ public function setDistMirrors($mirrors); @@ -226,7 +228,7 @@ public function getFullPrettyVersion($truncate = true, $displayMode = self::DISP /** * Returns the release date of the package * - * @return \DateTime + * @return ?\DateTime */ public function getReleaseDate(); @@ -241,7 +243,7 @@ public function getStability(); * Returns a set of links to packages which need to be installed before * this package can be installed * - * @return Link[] An array of package links defining required packages + * @return array An array of package links defining required packages */ public function getRequires(); @@ -273,7 +275,7 @@ public function getReplaces(); * Returns a set of links to packages which are required to develop * this package. These are installed if in dev mode. * - * @return Link[] An array of package links defining packages required for development + * @return array An array of package links defining packages required for development */ public function getDevRequires(); @@ -295,7 +297,7 @@ public function getSuggests(); * directories for autoloading using the type specified. * * @return array Mapping of autoloading rules - * @phpstan-return array{psr-0?: array, psr-4?: array, classmap?: list, files?: list} + * @phpstan-return array{psr-0?: array, psr-4?: array, classmap?: list, files?: list} */ public function getAutoload(); @@ -308,7 +310,7 @@ public function getAutoload(); * directories for autoloading using the type specified. * * @return array Mapping of dev autoloading rules - * @phpstan-return array{psr-0?: array, psr-4?: array, classmap?: list, files?: list} + * @phpstan-return array{psr-0?: array, psr-4?: array, classmap?: list, files?: list} */ public function getDevAutoload(); @@ -330,7 +332,7 @@ public function setRepository(RepositoryInterface $repository); /** * Returns a reference to the repository that owns the package * - * @return RepositoryInterface + * @return ?RepositoryInterface */ public function getRepository(); @@ -351,7 +353,7 @@ public function getUniqueName(); /** * Returns the package notification url * - * @return string + * @return ?string */ public function getNotificationUrl(); @@ -377,7 +379,7 @@ public function isDefaultBranch(); /** * Returns a list of options to download package dist files * - * @return array + * @return mixed[] */ public function getTransportOptions(); diff --git a/app/vendor/composer/composer/src/Composer/Package/RootAliasPackage.php b/app/vendor/composer/composer/src/Composer/Package/RootAliasPackage.php index 6a71ba740..78139eb02 100644 --- a/app/vendor/composer/composer/src/Composer/Package/RootAliasPackage.php +++ b/app/vendor/composer/composer/src/Composer/Package/RootAliasPackage.php @@ -17,23 +17,23 @@ */ class RootAliasPackage extends CompleteAliasPackage implements RootPackageInterface { - /** @var RootPackageInterface */ + /** @var RootPackage */ protected $aliasOf; /** * All descendants' constructors should call this parent constructor * - * @param RootPackageInterface $aliasOf The package this package is an alias of - * @param string $version The version the alias must report - * @param string $prettyVersion The alias's non-normalized version + * @param RootPackage $aliasOf The package this package is an alias of + * @param string $version The version the alias must report + * @param string $prettyVersion The alias's non-normalized version */ - public function __construct(RootPackageInterface $aliasOf, $version, $prettyVersion) + public function __construct(RootPackage $aliasOf, $version, $prettyVersion) { parent::__construct($aliasOf, $version, $prettyVersion); } /** - * @return RootPackageInterface + * @return RootPackage */ public function getAliasOf() { diff --git a/app/vendor/composer/composer/src/Composer/Package/Version/StabilityFilter.php b/app/vendor/composer/composer/src/Composer/Package/Version/StabilityFilter.php index d502da257..8eda2033b 100644 --- a/app/vendor/composer/composer/src/Composer/Package/Version/StabilityFilter.php +++ b/app/vendor/composer/composer/src/Composer/Package/Version/StabilityFilter.php @@ -30,7 +30,7 @@ class StabilityFilter * @param string $stability one of 'stable', 'RC', 'beta', 'alpha' or 'dev' * @return bool true if any package name is acceptable */ - public static function isPackageAcceptable(array $acceptableStabilities, array $stabilityFlags, $names, $stability) + public static function isPackageAcceptable(array $acceptableStabilities, array $stabilityFlags, array $names, $stability) { foreach ($names as $name) { // allow if package matches the package-specific stability flag diff --git a/app/vendor/composer/composer/src/Composer/Package/Version/VersionParser.php b/app/vendor/composer/composer/src/Composer/Package/Version/VersionParser.php index e2b70b959..df3e9feb2 100644 --- a/app/vendor/composer/composer/src/Composer/Package/Version/VersionParser.php +++ b/app/vendor/composer/composer/src/Composer/Package/Version/VersionParser.php @@ -51,7 +51,7 @@ public function parseNameVersionPairs(array $pairs) for ($i = 0, $count = count($pairs); $i < $count; $i++) { $pair = preg_replace('{^([^=: ]+)[=: ](.*)$}', '$1 $2', trim($pairs[$i])); - if (false === strpos($pair, ' ') && isset($pairs[$i + 1]) && false === strpos($pairs[$i + 1], '/') && !PlatformRepository::isPlatformPackage($pairs[$i + 1])) { + if (false === strpos($pair, ' ') && isset($pairs[$i + 1]) && false === strpos($pairs[$i + 1], '/') && !preg_match('{(?<=[a-z0-9_/-])\*|\*(?=[a-z0-9_/-])}i', $pairs[$i + 1]) && !PlatformRepository::isPlatformPackage($pairs[$i + 1])) { $pair .= ' '.$pairs[$i + 1]; $i++; } diff --git a/app/vendor/composer/composer/src/Composer/Platform/HhvmDetector.php b/app/vendor/composer/composer/src/Composer/Platform/HhvmDetector.php index a13559e0d..7bf1beb2c 100644 --- a/app/vendor/composer/composer/src/Composer/Platform/HhvmDetector.php +++ b/app/vendor/composer/composer/src/Composer/Platform/HhvmDetector.php @@ -18,11 +18,14 @@ class HhvmDetector { - private static $hhvmVersion; + /** @var string|false|null */ + private static $hhvmVersion = null; + /** @var ?ExecutableFinder */ private $executableFinder; + /** @var ?ProcessExecutor */ private $processExecutor; - public function __construct(ExecutableFinder $executableFinder = null, ProcessExecutor $processExecutor = null) + public function __construct(ExecutableFinder $executableFinder = null, ProcessExecutor $processExecutor = null) { $this->executableFinder = $executableFinder; $this->processExecutor = $processExecutor; diff --git a/app/vendor/composer/composer/src/Composer/Platform/Runtime.php b/app/vendor/composer/composer/src/Composer/Platform/Runtime.php index 1cb09e4b1..4e9caff57 100644 --- a/app/vendor/composer/composer/src/Composer/Platform/Runtime.php +++ b/app/vendor/composer/composer/src/Composer/Platform/Runtime.php @@ -25,7 +25,7 @@ public function hasConstant($constant, $class = null) } /** - * @param bool $constant + * @param string $constant * @param class-string $class * @return mixed */ diff --git a/app/vendor/composer/composer/src/Composer/Platform/Version.php b/app/vendor/composer/composer/src/Composer/Platform/Version.php index 61b3b5669..a55266c86 100644 --- a/app/vendor/composer/composer/src/Composer/Platform/Version.php +++ b/app/vendor/composer/composer/src/Composer/Platform/Version.php @@ -26,7 +26,7 @@ public static function parseOpenssl($opensslVersion, &$isFips) { $isFips = false; - if (!preg_match('/^(?[0-9.]+)(?[a-z]{0,2})?(?(?:-?(?:dev|pre|alpha|beta|rc|fips)[\d]*)*)?$/', $opensslVersion, $matches)) { + if (!preg_match('/^(?[0-9.]+)(?[a-z]{0,2})?(?(?:-?(?:dev|pre|alpha|beta|rc|fips)[\d]*)*)?(?-\w+)?$/', $opensslVersion, $matches)) { return null; } diff --git a/app/vendor/composer/composer/src/Composer/Plugin/PluginManager.php b/app/vendor/composer/composer/src/Composer/Plugin/PluginManager.php index cd85ac2d3..eb13aad0e 100644 --- a/app/vendor/composer/composer/src/Composer/Plugin/PluginManager.php +++ b/app/vendor/composer/composer/src/Composer/Plugin/PluginManager.php @@ -39,7 +39,7 @@ class PluginManager protected $composer; /** @var IOInterface */ protected $io; - /** @var Composer */ + /** @var ?Composer */ protected $globalComposer; /** @var VersionParser */ protected $versionParser; @@ -82,9 +82,7 @@ public function loadInstalledPlugins() $repo = $this->composer->getRepositoryManager()->getLocalRepository(); $globalRepo = $this->globalComposer ? $this->globalComposer->getRepositoryManager()->getLocalRepository() : null; - if ($repo) { - $this->loadRepository($repo, false); - } + $this->loadRepository($repo, false); if ($globalRepo) { $this->loadRepository($globalRepo, true); } @@ -259,6 +257,7 @@ public function deactivatePackage(PackageInterface $package) } if ($oldInstallerPlugin) { + /** @var \Composer\Installer\InstallerInterface $installer */ $installer = $this->registeredPlugins[$package->getName()]; unset($this->registeredPlugins[$package->getName()]); $this->composer->getInstallationManager()->removeInstaller($installer); @@ -469,7 +468,7 @@ protected function getCapabilityImplementationClassName(PluginInterface $plugin, array_key_exists($capability, $capabilities) && (empty($capabilities[$capability]) || !is_string($capabilities[$capability]) || !trim($capabilities[$capability])) ) { - throw new \UnexpectedValueException('Plugin '.get_class($plugin).' provided invalid capability class name(s), got '.var_export($capabilities[$capability], 1)); + throw new \UnexpectedValueException('Plugin '.get_class($plugin).' provided invalid capability class name(s), got '.var_export($capabilities[$capability], true)); } return null; diff --git a/app/vendor/composer/composer/src/Composer/Plugin/PostFileDownloadEvent.php b/app/vendor/composer/composer/src/Composer/Plugin/PostFileDownloadEvent.php index c30e00c89..7be34d728 100644 --- a/app/vendor/composer/composer/src/Composer/Plugin/PostFileDownloadEvent.php +++ b/app/vendor/composer/composer/src/Composer/Plugin/PostFileDownloadEvent.php @@ -59,6 +59,7 @@ class PostFileDownloadEvent extends Event */ public function __construct($name, $fileName, $checksum, $url, $type, $context = null) { + /** @phpstan-ignore-next-line */ if ($context === null && $type instanceof PackageInterface) { $context = $type; $type = 'package'; diff --git a/app/vendor/composer/composer/src/Composer/Plugin/PreFileDownloadEvent.php b/app/vendor/composer/composer/src/Composer/Plugin/PreFileDownloadEvent.php index e4921621e..1c07d5ca6 100644 --- a/app/vendor/composer/composer/src/Composer/Plugin/PreFileDownloadEvent.php +++ b/app/vendor/composer/composer/src/Composer/Plugin/PreFileDownloadEvent.php @@ -48,7 +48,7 @@ class PreFileDownloadEvent extends Event private $context; /** - * @var array + * @var mixed[] */ private $transportOptions = array(); diff --git a/app/vendor/composer/composer/src/Composer/Plugin/PrePoolCreateEvent.php b/app/vendor/composer/composer/src/Composer/Plugin/PrePoolCreateEvent.php index e5e46e708..baa4bc985 100644 --- a/app/vendor/composer/composer/src/Composer/Plugin/PrePoolCreateEvent.php +++ b/app/vendor/composer/composer/src/Composer/Plugin/PrePoolCreateEvent.php @@ -16,6 +16,7 @@ use Composer\Repository\RepositoryInterface; use Composer\DependencyResolver\Request; use Composer\Package\PackageInterface; +use Composer\Package\BasePackage; /** * The pre command run event. @@ -33,19 +34,23 @@ class PrePoolCreateEvent extends Event */ private $request; /** - * @var array + * @var int[] array of stability => BasePackage::STABILITY_* value + * @phpstan-var array */ private $acceptableStabilities; /** - * @var array + * @var int[] array of package name => BasePackage::STABILITY_* value + * @phpstan-var array */ private $stabilityFlags; /** - * @var array + * @var array[] of package => version => [alias, alias_normalized] + * @phpstan-var array> */ private $rootAliases; /** - * @var array + * @var string[] + * @phpstan-var array */ private $rootReferences; /** @@ -58,8 +63,17 @@ class PrePoolCreateEvent extends Event private $unacceptableFixedPackages; /** - * @param string $name The event name + * @param string $name The event name * @param RepositoryInterface[] $repositories + * @param int[] $acceptableStabilities array of stability => BasePackage::STABILITY_* value + * @param int[] $stabilityFlags array of package name => BasePackage::STABILITY_* value + * @param array[] $rootAliases array of package => version => [alias, alias_normalized] + * @param string[] $rootReferences + * + * @phpstan-param array $acceptableStabilities + * @phpstan-param array $stabilityFlags + * @phpstan-param array> $rootAliases + * @phpstan-param array $rootReferences */ public function __construct($name, array $repositories, Request $request, array $acceptableStabilities, array $stabilityFlags, array $rootAliases, array $rootReferences, array $packages, array $unacceptableFixedPackages) { @@ -92,7 +106,8 @@ public function getRequest() } /** - * @return array + * @return int[] array of stability => BasePackage::STABILITY_* value + * @phpstan-return array */ public function getAcceptableStabilities() { @@ -100,7 +115,8 @@ public function getAcceptableStabilities() } /** - * @return array + * @return int[] array of package name => BasePackage::STABILITY_* value + * @phpstan-return array */ public function getStabilityFlags() { @@ -117,7 +133,8 @@ public function getRootAliases() } /** - * @return array + * @return string[] + * @phpstan-return array */ public function getRootReferences() { diff --git a/app/vendor/composer/composer/src/Composer/Question/StrictConfirmationQuestion.php b/app/vendor/composer/composer/src/Composer/Question/StrictConfirmationQuestion.php index c64890b8d..19432201d 100644 --- a/app/vendor/composer/composer/src/Composer/Question/StrictConfirmationQuestion.php +++ b/app/vendor/composer/composer/src/Composer/Question/StrictConfirmationQuestion.php @@ -24,7 +24,9 @@ */ class StrictConfirmationQuestion extends Question { + /** @var string */ private $trueAnswerRegex; + /** @var string */ private $falseAnswerRegex; /** diff --git a/app/vendor/composer/composer/src/Composer/Repository/ArrayRepository.php b/app/vendor/composer/composer/src/Composer/Repository/ArrayRepository.php index 90cf938f4..8b44547a1 100644 --- a/app/vendor/composer/composer/src/Composer/Repository/ArrayRepository.php +++ b/app/vendor/composer/composer/src/Composer/Repository/ArrayRepository.php @@ -13,7 +13,9 @@ namespace Composer\Repository; use Composer\Package\AliasPackage; +use Composer\Package\BasePackage; use Composer\Package\CompleteAliasPackage; +use Composer\Package\CompletePackage; use Composer\Package\PackageInterface; use Composer\Package\CompletePackageInterface; use Composer\Package\Version\VersionParser; @@ -28,11 +30,11 @@ */ class ArrayRepository implements RepositoryInterface { - /** @var ?PackageInterface[] */ + /** @var ?array */ protected $packages = null; /** - * @var ?PackageInterface[] indexed by package unique name and used to cache hasPackage calls + * @var ?array indexed by package unique name and used to cache hasPackage calls */ protected $packageMap = null; @@ -232,13 +234,17 @@ public function getProviders($packageName) return $result; } + /** + * @phpstan-param PackageInterface&BasePackage $package + * @return AliasPackage|CompleteAliasPackage + */ protected function createAliasPackage(PackageInterface $package, $alias, $prettyAlias) { while ($package instanceof AliasPackage) { $package = $package->getAliasOf(); } - if ($package instanceof CompletePackageInterface) { + if ($package instanceof CompletePackage) { return new CompleteAliasPackage($package, $alias, $prettyAlias); } @@ -275,6 +281,10 @@ public function getPackages() $this->initialize(); } + if (null === $this->packages) { + throw new \LogicException('initialize failed to initialize the packages array'); + } + return $this->packages; } @@ -283,6 +293,7 @@ public function getPackages() * * @return int Number of packages */ + #[\ReturnTypeWillChange] public function count() { if (null === $this->packages) { diff --git a/app/vendor/composer/composer/src/Composer/Repository/ArtifactRepository.php b/app/vendor/composer/composer/src/Composer/Repository/ArtifactRepository.php index 0ea1ef71c..02b593a0b 100644 --- a/app/vendor/composer/composer/src/Composer/Repository/ArtifactRepository.php +++ b/app/vendor/composer/composer/src/Composer/Repository/ArtifactRepository.php @@ -27,8 +27,11 @@ class ArtifactRepository extends ArrayRepository implements ConfigurableReposito /** @var LoaderInterface */ protected $loader; + /** @var string */ protected $lookup; + /** @var mixed[] */ protected $repoConfig; + /** @var IOInterface */ private $io; public function __construct(array $repoConfig, IOInterface $io) diff --git a/app/vendor/composer/composer/src/Composer/Repository/ComposerRepository.php b/app/vendor/composer/composer/src/Composer/Repository/ComposerRepository.php index 3d510c570..75b3aabec 100644 --- a/app/vendor/composer/composer/src/Composer/Repository/ComposerRepository.php +++ b/app/vendor/composer/composer/src/Composer/Repository/ComposerRepository.php @@ -44,42 +44,72 @@ */ class ComposerRepository extends ArrayRepository implements ConfigurableRepositoryInterface { + /** + * @var mixed[] + * @phpstan-var array{url: string, options?: mixed[], type?: 'composer', allow_ssl_downgrade?: bool} + */ private $repoConfig; + /** @var mixed[] */ private $options; + /** @var string */ private $url; + /** @var string */ private $baseUrl; + /** @var IOInterface */ private $io; + /** @var HttpDownloader */ private $httpDownloader; + /** @var Loop */ private $loop; + /** @var Cache */ protected $cache; - protected $notifyUrl; - protected $searchUrl; - /** @var string|null a URL containing %package% which can be queried to get providers of a given name */ - protected $providersApiUrl; + /** @var ?string */ + protected $notifyUrl = null; + /** @var ?string */ + protected $searchUrl = null; + /** @var ?string a URL containing %package% which can be queried to get providers of a given name */ + protected $providersApiUrl = null; + /** @var bool */ protected $hasProviders = false; - protected $providersUrl; - protected $listUrl; + /** @var ?string */ + protected $providersUrl = null; + /** @var ?string */ + protected $listUrl = null; /** @var bool Indicates whether a comprehensive list of packages this repository might provide is expressed in the repository root. **/ protected $hasAvailablePackageList = false; - protected $availablePackages; - protected $availablePackagePatterns; - protected $lazyProvidersUrl; + /** @var ?array */ + protected $availablePackages = null; + /** @var ?array */ + protected $availablePackagePatterns = null; + /** @var ?string */ + protected $lazyProvidersUrl = null; + /** @var ?array */ protected $providerListing; + /** @var ArrayLoader */ protected $loader; + /** @var bool */ private $allowSslDowngrade = false; + /** @var ?EventDispatcher */ private $eventDispatcher; + /** @var ?array */ private $sourceMirrors; + /** @var ?array */ private $distMirrors; + /** @var bool */ private $degradedMode = false; + /** @var mixed[]|true */ private $rootData; - private $hasPartialPackages; - private $partialPackagesByName; + /** @var bool */ + private $hasPartialPackages = false; + /** @var ?array */ + private $partialPackagesByName = null; /** * TODO v3 should make this private once we can drop PHP 5.3 support * @private * @var array list of package names which are fresh and can be loaded from the cache directly in case loadPackage is called several times * useful for v2 metadata repositories with lazy providers + * @phpstan-var array */ public $freshMetadataUrls = array(); @@ -88,11 +118,13 @@ class ComposerRepository extends ArrayRepository implements ConfigurableReposito * @private * @var array list of package names which returned a 404 and should not be re-fetched in case loadPackage is called several times * useful for v2 metadata repositories with lazy providers + * @phpstan-var array */ public $packagesNotFoundCache = array(); /** * TODO v3 should make this private once we can drop PHP 5.3 support * @private + * @var VersionParser */ public $versionParser; @@ -566,22 +598,20 @@ private function whatProvides($name, array $acceptableStabilities = null, array } $packages = null; - if ($cacheKey) { - if (!$useLastModifiedCheck && $hash && $this->cache->sha256($cacheKey) === $hash) { - $packages = json_decode($this->cache->read($cacheKey), true); - $packagesSource = 'cached file ('.$cacheKey.' originating from '.Url::sanitize($url).')'; - } elseif ($useLastModifiedCheck) { - if ($contents = $this->cache->read($cacheKey)) { - $contents = json_decode($contents, true); - // we already loaded some packages from this file, so assume it is fresh and avoid fetching it again - if (isset($alreadyLoaded[$name])) { - $packages = $contents; - $packagesSource = 'cached file ('.$cacheKey.' originating from '.Url::sanitize($url).')'; - } elseif (isset($contents['last-modified'])) { - $response = $this->fetchFileIfLastModified($url, $cacheKey, $contents['last-modified']); - $packages = true === $response ? $contents : $response; - $packagesSource = true === $response ? 'cached file ('.$cacheKey.' originating from '.Url::sanitize($url).')' : 'downloaded file ('.Url::sanitize($url).')'; - } + if (!$useLastModifiedCheck && $hash && $this->cache->sha256($cacheKey) === $hash) { + $packages = json_decode($this->cache->read($cacheKey), true); + $packagesSource = 'cached file ('.$cacheKey.' originating from '.Url::sanitize($url).')'; + } elseif ($useLastModifiedCheck) { + if ($contents = $this->cache->read($cacheKey)) { + $contents = json_decode($contents, true); + // we already loaded some packages from this file, so assume it is fresh and avoid fetching it again + if (isset($alreadyLoaded[$name])) { + $packages = $contents; + $packagesSource = 'cached file ('.$cacheKey.' originating from '.Url::sanitize($url).')'; + } elseif (isset($contents['last-modified'])) { + $response = $this->fetchFileIfLastModified($url, $cacheKey, $contents['last-modified']); + $packages = true === $response ? $contents : $response; + $packagesSource = true === $response ? 'cached file ('.$cacheKey.' originating from '.Url::sanitize($url).')' : 'downloaded file ('.Url::sanitize($url).')'; } } } @@ -1148,6 +1178,14 @@ protected function fetchFile($filename, $cacheKey = null, $sha256 = null, $store throw $e; } + // try to detect offline state (if dns resolution fails it is pretty likely to keep failing) and avoid retrying in that case + if ($e instanceof TransportException && $e->getStatusCode() === null) { + $responseInfo = $e->getResponseInfo(); + if (isset($responseInfo['namelookup_time']) && $responseInfo['namelookup_time'] == 0) { + $retries = 0; + } + } + if ($retries) { usleep(100000); continue; @@ -1319,7 +1357,7 @@ private function asyncFetchFile($filename, $cacheKey, $lastModifiedTime = null) return $data; }; - $reject = function ($e) use (&$retries, $httpDownloader, $filename, $options, &$reject, $accept, $io, $url, &$degradedMode, $repo) { + $reject = function ($e) use (&$retries, $httpDownloader, $filename, $options, &$reject, $accept, $io, $url, &$degradedMode, $repo, $lastModifiedTime) { if ($e instanceof TransportException && $e->getStatusCode() === 404) { $repo->packagesNotFoundCache[$filename] = true; @@ -1331,6 +1369,14 @@ private function asyncFetchFile($filename, $cacheKey, $lastModifiedTime = null) $retries = 0; } + // try to detect offline state (if dns resolution fails it is pretty likely to keep failing) and avoid retrying in that case + if ($e instanceof TransportException && $e->getStatusCode() === null) { + $responseInfo = $e->getResponseInfo(); + if (isset($responseInfo['namelookup_time']) && $responseInfo['namelookup_time'] == 0) { + $retries = 0; + } + } + if (--$retries > 0) { usleep(100000); @@ -1342,6 +1388,11 @@ private function asyncFetchFile($filename, $cacheKey, $lastModifiedTime = null) } $degradedMode = true; + // if the file is in the cache, we fake a 304 Not Modified to allow the process to continue + if ($lastModifiedTime) { + return $accept(new Response(array('url' => $url), 304, array(), '')); + } + // special error code returned when network is being artificially disabled if ($e instanceof TransportException && $e->getStatusCode() === 499) { return $accept(new Response(array('url' => $url), 404, array(), '')); diff --git a/app/vendor/composer/composer/src/Composer/Repository/CompositeRepository.php b/app/vendor/composer/composer/src/Composer/Repository/CompositeRepository.php index 53d1fa9d9..8426364a5 100644 --- a/app/vendor/composer/composer/src/Composer/Repository/CompositeRepository.php +++ b/app/vendor/composer/composer/src/Composer/Repository/CompositeRepository.php @@ -23,13 +23,13 @@ class CompositeRepository implements RepositoryInterface { /** * List of repositories - * @var array + * @var RepositoryInterface[] */ private $repositories; /** * Constructor - * @param array $repositories + * @param RepositoryInterface[] $repositories */ public function __construct(array $repositories) { @@ -169,14 +169,16 @@ public function getProviders($packageName) public function removePackage(PackageInterface $package) { foreach ($this->repositories as $repository) { - /* @var $repository RepositoryInterface */ - $repository->removePackage($package); + if ($repository instanceof WritableRepositoryInterface) { + $repository->removePackage($package); + } } } /** * {@inheritdoc} */ + #[\ReturnTypeWillChange] public function count() { $total = 0; diff --git a/app/vendor/composer/composer/src/Composer/Repository/FilesystemRepository.php b/app/vendor/composer/composer/src/Composer/Repository/FilesystemRepository.php index 696b00541..debdb7a89 100644 --- a/app/vendor/composer/composer/src/Composer/Repository/FilesystemRepository.php +++ b/app/vendor/composer/composer/src/Composer/Repository/FilesystemRepository.php @@ -28,9 +28,14 @@ */ class FilesystemRepository extends WritableArrayRepository { + /** @var JsonFile */ protected $file; + /** @var bool */ private $dumpVersions; + /** @var ?RootPackageInterface */ private $rootPackage; + /** @var Filesystem */ + private $filesystem; /** * Initializes filesystem repository. @@ -39,12 +44,13 @@ class FilesystemRepository extends WritableArrayRepository * @param bool $dumpVersions * @param ?RootPackageInterface $rootPackage Must be provided if $dumpVersions is true */ - public function __construct(JsonFile $repositoryFile, $dumpVersions = false, RootPackageInterface $rootPackage = null) + public function __construct(JsonFile $repositoryFile, $dumpVersions = false, RootPackageInterface $rootPackage = null, Filesystem $filesystem = null) { parent::__construct(); $this->file = $repositoryFile; $this->dumpVersions = $dumpVersions; $this->rootPackage = $rootPackage; + $this->filesystem = $filesystem ?: new Filesystem; if ($dumpVersions && !$rootPackage) { throw new \InvalidArgumentException('Expected a root package instance if $dumpVersions is true'); } @@ -100,14 +106,24 @@ public function write($devMode, InstallationManager $installationManager) { $data = array('packages' => array(), 'dev' => $devMode, 'dev-package-names' => array()); $dumper = new ArrayDumper(); - $fs = new Filesystem(); - $repoDir = dirname($fs->normalizePath($this->file->getPath())); + + // make sure the directory is created so we can realpath it + // as realpath() does some additional normalizations with network paths that normalizePath does not + // and we need to find shortest path correctly + $repoDir = dirname($this->file->getPath()); + $this->filesystem->ensureDirectoryExists($repoDir); + + $repoDir = $this->filesystem->normalizePath(realpath($repoDir)); $installPaths = array(); foreach ($this->getCanonicalPackages() as $package) { $pkgArray = $dumper->dump($package); $path = $installationManager->getInstallPath($package); - $installPath = ('' !== $path && null !== $path) ? $fs->findShortestPath($repoDir, $fs->isAbsolutePath($path) ? $path : getcwd() . '/' . $path, true) : null; + $installPath = null; + if ('' !== $path && null !== $path) { + $normalizedPath = $this->filesystem->normalizePath($this->filesystem->isAbsolutePath($path) ? $path : getcwd() . '/' . $path); + $installPath = $this->filesystem->findShortestPath($repoDir, $normalizedPath, true); + } $installPaths[$package->getName()] = $installPath; $pkgArray['install-path'] = $installPath; @@ -130,9 +146,9 @@ public function write($devMode, InstallationManager $installationManager) if ($this->dumpVersions) { $versions = $this->generateInstalledVersions($installationManager, $installPaths, $devMode, $repoDir); - $fs->filePutContentsIfModified($repoDir.'/installed.php', 'dumpToPhpCode($versions) . ';'."\n"); + $this->filesystem->filePutContentsIfModified($repoDir.'/installed.php', 'dumpToPhpCode($versions) . ';'."\n"); $installedVersionsClass = file_get_contents(__DIR__.'/../InstalledVersions.php'); - $fs->filePutContentsIfModified($repoDir.'/InstalledVersions.php', $installedVersionsClass); + $this->filesystem->filePutContentsIfModified($repoDir.'/InstalledVersions.php', $installedVersionsClass); \Composer\InstalledVersions::reload($versions); } @@ -154,8 +170,7 @@ private function dumpToPhpCode(array $array = array(), $level = 0) $lines .= "array(),\n"; } } elseif ($key === 'install_path' && is_string($value)) { - $fs = new Filesystem(); - if ($fs->isAbsolutePath($value)) { + if ($this->filesystem->isAbsolutePath($value)) { $lines .= var_export($value, true) . ",\n"; } else { $lines .= "__DIR__ . " . var_export('/' . $value, true) . ",\n"; @@ -203,9 +218,8 @@ private function generateInstalledVersions(InstallationManager $installationMana } if ($package instanceof RootPackageInterface) { - $fs = new Filesystem(); - $to = getcwd(); - $installPath = $fs->findShortestPath($repoDir, $to, true); + $to = $this->filesystem->normalizePath(realpath(getcwd())); + $installPath = $this->filesystem->findShortestPath($repoDir, $to, true); } else { $installPath = $installPaths[$package->getName()]; } diff --git a/app/vendor/composer/composer/src/Composer/Repository/FilterRepository.php b/app/vendor/composer/composer/src/Composer/Repository/FilterRepository.php index 61b31e91a..8ce7be05f 100644 --- a/app/vendor/composer/composer/src/Composer/Repository/FilterRepository.php +++ b/app/vendor/composer/composer/src/Composer/Repository/FilterRepository.php @@ -22,9 +22,13 @@ */ class FilterRepository implements RepositoryInterface { - private $only = array(); - private $exclude = array(); + /** @var ?string */ + private $only = null; + /** @var ?string */ + private $exclude = null; + /** @var bool */ private $canonical = true; + /** @var RepositoryInterface */ private $repo; public function __construct(RepositoryInterface $repo, array $options) @@ -33,17 +37,17 @@ public function __construct(RepositoryInterface $repo, array $options) if (!is_array($options['only'])) { throw new \InvalidArgumentException('"only" key for repository '.$repo->getRepoName().' should be an array'); } - $this->only = '{^'.implode('|', array_map(function ($val) { + $this->only = '{^(?:'.implode('|', array_map(function ($val) { return BasePackage::packageNameToRegexp($val, '%s'); - }, $options['only'])) .'$}iD'; + }, $options['only'])) .')$}iD'; } if (isset($options['exclude'])) { if (!is_array($options['exclude'])) { throw new \InvalidArgumentException('"exclude" key for repository '.$repo->getRepoName().' should be an array'); } - $this->exclude = '{^'.implode('|', array_map(function ($val) { + $this->exclude = '{^(?:'.implode('|', array_map(function ($val) { return BasePackage::packageNameToRegexp($val, '%s'); - }, $options['exclude'])) .'$}iD'; + }, $options['exclude'])) .')$}iD'; } if ($this->exclude && $this->only) { throw new \InvalidArgumentException('Only one of "only" and "exclude" can be specified for repository '.$repo->getRepoName()); @@ -177,14 +181,7 @@ public function getProviders($packageName) /** * {@inheritdoc} */ - public function removePackage(PackageInterface $package) - { - return $this->repo->removePackage($package); - } - - /** - * {@inheritdoc} - */ + #[\ReturnTypeWillChange] public function count() { if ($this->repo->count() > 0) { diff --git a/app/vendor/composer/composer/src/Composer/Repository/InstalledRepository.php b/app/vendor/composer/composer/src/Composer/Repository/InstalledRepository.php index 7405a30bb..13c5fddbb 100644 --- a/app/vendor/composer/composer/src/Composer/Repository/InstalledRepository.php +++ b/app/vendor/composer/composer/src/Composer/Repository/InstalledRepository.php @@ -114,7 +114,7 @@ public function getDependents($needle, $constraint = null, $invert = false, $rec foreach ($package->getReplaces() as $link) { foreach ($needles as $needle) { if ($link->getSource() === $needle) { - if ($constraint === null || ($link->getConstraint()->matches($constraint) === !$invert)) { + if ($constraint === null || ($link->getConstraint()->matches($constraint) === true)) { // already displayed this node's dependencies, cutting short if (in_array($link->getTarget(), $packagesInTree)) { $results[] = array($package, $link, false); @@ -221,7 +221,7 @@ public function getDependents($needle, $constraint = null, $invert = false, $rec } $results[] = array($package, $link, false); - $results[] = array($rootPackage, new Link($rootPackage->getName(), $link->getTarget(), new MatchAllConstraint, 'does not require', 'but ' . $pkg->getPrettyVersion() . ' is installed'), false); + $results[] = array($rootPackage, new Link($rootPackage->getName(), $link->getTarget(), new MatchAllConstraint, Link::TYPE_DOES_NOT_REQUIRE, 'but ' . $pkg->getPrettyVersion() . ' is installed'), false); } else { // no root so let's just print whatever we found $results[] = array($package, $link, false); diff --git a/app/vendor/composer/composer/src/Composer/Repository/PackageRepository.php b/app/vendor/composer/composer/src/Composer/Repository/PackageRepository.php index de6d31d4d..c5576cf7e 100644 --- a/app/vendor/composer/composer/src/Composer/Repository/PackageRepository.php +++ b/app/vendor/composer/composer/src/Composer/Repository/PackageRepository.php @@ -22,6 +22,7 @@ */ class PackageRepository extends ArrayRepository { + /** @var mixed[] */ private $config; /** diff --git a/app/vendor/composer/composer/src/Composer/Repository/PathRepository.php b/app/vendor/composer/composer/src/Composer/Repository/PathRepository.php index c1fc632da..7232e0368 100644 --- a/app/vendor/composer/composer/src/Composer/Repository/PathRepository.php +++ b/app/vendor/composer/composer/src/Composer/Repository/PathRepository.php @@ -77,7 +77,8 @@ class PathRepository extends ArrayRepository implements ConfigurableRepositoryIn private $url; /** - * @var array + * @var mixed[] + * @phpstan-var array{url: string, options?: array{symlink?: bool, relative?: bool, versions?: array}} */ private $repoConfig; @@ -87,7 +88,7 @@ class PathRepository extends ArrayRepository implements ConfigurableRepositoryIn private $process; /** - * @var array + * @var array{symlink?: bool, relative?: bool, versions?: array} */ private $options; diff --git a/app/vendor/composer/composer/src/Composer/Repository/PearRepository.php b/app/vendor/composer/composer/src/Composer/Repository/PearRepository.php index 5b4ea969c..0998f302d 100644 --- a/app/vendor/composer/composer/src/Composer/Repository/PearRepository.php +++ b/app/vendor/composer/composer/src/Composer/Repository/PearRepository.php @@ -27,6 +27,6 @@ class PearRepository extends ArrayRepository { public function __construct() { - throw new \RuntimeException('The PEAR repository has been removed from Composer 2.0'); + throw new \InvalidArgumentException('The PEAR repository has been removed from Composer 2.x'); } } diff --git a/app/vendor/composer/composer/src/Composer/Repository/PlatformRepository.php b/app/vendor/composer/composer/src/Composer/Repository/PlatformRepository.php index 3b08b3e2c..5cd1ae27c 100644 --- a/app/vendor/composer/composer/src/Composer/Repository/PlatformRepository.php +++ b/app/vendor/composer/composer/src/Composer/Repository/PlatformRepository.php @@ -46,13 +46,15 @@ class PlatformRepository extends ArrayRepository /** * Defines overrides so that the platform can be mocked * - * Should be an array of package name => version number mappings + * Keyed by package name (lowercased) * - * @var array + * @var array */ private $overrides = array(); + /** @var Runtime */ private $runtime; + /** @var HhvmDetector */ private $hhvmDetector; public function __construct(array $packages = array(), array $overrides = array(), Runtime $runtime = null, HhvmDetector $hhvmDetector = null) @@ -566,7 +568,7 @@ private function addExtension($name, $prettyVersion) if ($name === 'uuid') { $ext->setReplaces(array( - new Link('ext-uuid', 'lib-uuid', new Constraint('=', $version), Link::TYPE_REPLACE, $ext->getPrettyVersion()), + 'lib-uuid' => new Link('ext-uuid', 'lib-uuid', new Constraint('=', $version), Link::TYPE_REPLACE, $ext->getPrettyVersion()), )); } diff --git a/app/vendor/composer/composer/src/Composer/Repository/RepositoryInterface.php b/app/vendor/composer/composer/src/Composer/Repository/RepositoryInterface.php index f5f1204d0..3b0760e0e 100644 --- a/app/vendor/composer/composer/src/Composer/Repository/RepositoryInterface.php +++ b/app/vendor/composer/composer/src/Composer/Repository/RepositoryInterface.php @@ -44,6 +44,7 @@ public function hasPackage(PackageInterface $package); * @param string|ConstraintInterface $constraint package version or version constraint to match against * * @return PackageInterface|null + * @phpstan-return (BasePackage&PackageInterface)|null */ public function findPackage($name, $constraint); @@ -54,6 +55,7 @@ public function findPackage($name, $constraint); * @param string|ConstraintInterface $constraint package version or version constraint to match against * * @return PackageInterface[] + * @phpstan-return array */ public function findPackages($name, $constraint = null); @@ -61,6 +63,7 @@ public function findPackages($name, $constraint = null); * Returns list of registered packages. * * @return PackageInterface[] + * @phpstan-return array */ public function getPackages(); @@ -75,7 +78,10 @@ public function getPackages(); * @param array $stabilityFlags an array of package name => BasePackage::STABILITY_* value * @param array> $alreadyLoaded an array of package name => package version => package * - * @return array{namesFound: string[], packages: PackageInterface[]} + * @return array + * + * @phpstan-param array $packageNameMap + * @phpstan-return array{namesFound: string[], packages: array} */ public function loadPackages(array $packageNameMap, array $acceptableStabilities, array $stabilityFlags, array $alreadyLoaded = array()); diff --git a/app/vendor/composer/composer/src/Composer/Repository/RepositoryManager.php b/app/vendor/composer/composer/src/Composer/Repository/RepositoryManager.php index 717fce4ee..12123ce7b 100644 --- a/app/vendor/composer/composer/src/Composer/Repository/RepositoryManager.php +++ b/app/vendor/composer/composer/src/Composer/Repository/RepositoryManager.php @@ -55,7 +55,7 @@ public function __construct(IOInterface $io, Config $config, HttpDownloader $htt } /** - * Searches for a package by it's name and version in managed repositories. + * Searches for a package by its name and version in managed repositories. * * @param string $name package name * @param string|\Composer\Semver\Constraint\ConstraintInterface $constraint package version or version constraint to match against diff --git a/app/vendor/composer/composer/src/Composer/Repository/RepositorySet.php b/app/vendor/composer/composer/src/Composer/Repository/RepositorySet.php index 66db56833..d87a334b3 100644 --- a/app/vendor/composer/composer/src/Composer/Repository/RepositorySet.php +++ b/app/vendor/composer/composer/src/Composer/Repository/RepositorySet.php @@ -21,6 +21,7 @@ use Composer\Package\BasePackage; use Composer\Package\AliasPackage; use Composer\Package\CompleteAliasPackage; +use Composer\Package\CompletePackage; use Composer\Package\CompletePackageInterface; use Composer\Semver\Constraint\ConstraintInterface; use Composer\Package\Version\StabilityFilter; @@ -56,16 +57,20 @@ class RepositorySet /** * @var int[] array of stability => BasePackage::STABILITY_* value - * @phpstan-var array + * @phpstan-var array */ private $acceptableStabilities; /** * @var int[] array of package name => BasePackage::STABILITY_* value - * @phpstan-var array + * @phpstan-var array */ private $stabilityFlags; + /** + * @var ConstraintInterface[] + * @phpstan-var array + */ private $rootRequires; /** @var bool */ @@ -80,11 +85,13 @@ class RepositorySet * * @param string $minimumStability * @param int[] $stabilityFlags an array of package name => BasePackage::STABILITY_* value - * @phpstan-param array $stabilityFlags + * @phpstan-param array $stabilityFlags * @param array[] $rootAliases * @phpstan-param list $rootAliases * @param string[] $rootReferences an array of package name => source reference * @phpstan-param array $rootReferences + * @param ConstraintInterface[] $rootRequires an array of package name => constraint from the root package + * @phpstan-param array $rootRequires */ public function __construct($minimumStability = 'stable', array $stabilityFlags = array(), array $rootAliases = array(), array $rootReferences = array(), array $rootRequires = array()) { @@ -111,6 +118,10 @@ public function allowInstalledRepositories($allow = true) $this->allowInstalledRepositories = $allow; } + /** + * @return ConstraintInterface[] an array of package name => constraint from the root package, platform requirements excluded + * @phpstan-return array + */ public function getRootRequires() { return $this->rootRequires; @@ -192,6 +203,12 @@ public function findPackages($name, ConstraintInterface $constraint = null, $fla return $result; } + /** + * @param string $packageName + * + * @return array[] an array with the provider name as key and value of array('name' => '...', 'description' => '...', 'type' => '...') + * @phpstan-return array + */ public function getProviders($packageName) { $providers = array(); @@ -204,6 +221,13 @@ public function getProviders($packageName) return $providers; } + /** + * Check for each given package name whether it would be accepted by this RepositorySet in the given $stability + * + * @param string[] $names + * @param string $stability one of 'stable', 'RC', 'beta', 'alpha' or 'dev' + * @return bool + */ public function isPackageAcceptable($names, $stability) { return StabilityFilter::isPackageAcceptable($this->acceptableStabilities, $this->stabilityFlags, $names, $stability); @@ -254,7 +278,7 @@ public function createPoolWithAllPackages() while ($package instanceof AliasPackage) { $package = $package->getAliasOf(); } - if ($package instanceof CompletePackageInterface) { + if ($package instanceof CompletePackage) { $aliasPackage = new CompleteAliasPackage($package, $alias['alias_normalized'], $alias['alias']); } else { $aliasPackage = new AliasPackage($package, $alias['alias_normalized'], $alias['alias']); diff --git a/app/vendor/composer/composer/src/Composer/Repository/Vcs/BitbucketDriver.php b/app/vendor/composer/composer/src/Composer/Repository/Vcs/BitbucketDriver.php index e1c45acde..8bd47a7a2 100644 --- a/app/vendor/composer/composer/src/Composer/Repository/Vcs/BitbucketDriver.php +++ b/app/vendor/composer/composer/src/Composer/Repository/Vcs/BitbucketDriver.php @@ -20,16 +20,27 @@ abstract class BitbucketDriver extends VcsDriver { + /** @var string */ protected $owner; + /** @var string */ protected $repository; - protected $hasIssues; + /** @var bool */ + protected $hasIssues = false; + /** @var ?string */ protected $rootIdentifier; + /** @var array Map of tag name to identifier */ protected $tags; + /** @var array Map of branch name to identifier */ protected $branches; + /** @var string */ protected $branchesUrl = ''; + /** @var string */ protected $tagsUrl = ''; + /** @var string */ protected $homeUrl = ''; + /** @var string */ protected $website = ''; + /** @var string */ protected $cloneHttpsUrl = ''; /** @@ -77,6 +88,7 @@ public function getUrl() * sets some parameters which are used in other methods * * @return bool + * @phpstan-impure */ protected function getRepoData() { @@ -86,7 +98,7 @@ protected function getRepoData() $this->repository, http_build_query( array('fields' => '-project,-owner'), - null, + '', '&' ) ); @@ -286,7 +298,7 @@ public function getTags() 'fields' => 'values.name,values.target.hash,next', 'sort' => '-target.date', ), - null, + '', '&' ) ); @@ -330,7 +342,7 @@ public function getBranches() 'fields' => 'values.name,values.target.hash,values.heads,next', 'sort' => '-target.date', ), - null, + '', '&' ) ); @@ -363,6 +375,8 @@ public function getBranches() * @param bool $fetchingRepoData * * @return Response The result + * + * @phpstan-impure */ protected function fetchWithOAuthCredentials($url, $fetchingRepoData = false) { @@ -396,6 +410,9 @@ protected function fetchWithOAuthCredentials($url, $fetchingRepoData = false) */ abstract protected function generateSshUrl(); + /** + * @phpstan-impure + */ protected function attemptCloneFallback() { try { diff --git a/app/vendor/composer/composer/src/Composer/Repository/Vcs/FossilDriver.php b/app/vendor/composer/composer/src/Composer/Repository/Vcs/FossilDriver.php index 8f73ffb5e..c4c468f40 100644 --- a/app/vendor/composer/composer/src/Composer/Repository/Vcs/FossilDriver.php +++ b/app/vendor/composer/composer/src/Composer/Repository/Vcs/FossilDriver.php @@ -23,10 +23,15 @@ */ class FossilDriver extends VcsDriver { + /** @var array Map of tag name to identifier */ protected $tags; + /** @var array Map of branch name to identifier */ protected $branches; - protected $rootIdentifier; - protected $repoFile; + /** @var ?string */ + protected $rootIdentifier = null; + /** @var ?string */ + protected $repoFile = null; + /** @var string */ protected $checkoutDir; /** diff --git a/app/vendor/composer/composer/src/Composer/Repository/Vcs/GitDriver.php b/app/vendor/composer/composer/src/Composer/Repository/Vcs/GitDriver.php index ea7803631..4fef3f702 100644 --- a/app/vendor/composer/composer/src/Composer/Repository/Vcs/GitDriver.php +++ b/app/vendor/composer/composer/src/Composer/Repository/Vcs/GitDriver.php @@ -25,9 +25,13 @@ */ class GitDriver extends VcsDriver { + /** @var array Map of tag name to identifier */ protected $tags; + /** @var array Map of branch name to identifier */ protected $branches; + /** @var string */ protected $rootIdentifier; + /** @var string */ protected $repoDir; /** diff --git a/app/vendor/composer/composer/src/Composer/Repository/Vcs/GitHubDriver.php b/app/vendor/composer/composer/src/Composer/Repository/Vcs/GitHubDriver.php index b312edeac..af0ef59da 100644 --- a/app/vendor/composer/composer/src/Composer/Repository/Vcs/GitHubDriver.php +++ b/app/vendor/composer/composer/src/Composer/Repository/Vcs/GitHubDriver.php @@ -25,15 +25,25 @@ */ class GitHubDriver extends VcsDriver { + /** @var string */ protected $owner; + /** @var string */ protected $repository; + /** @var array Map of tag name to identifier */ protected $tags; + /** @var array Map of branch name to identifier */ protected $branches; + /** @var string */ protected $rootIdentifier; + /** @var mixed[] */ protected $repoData; - protected $hasIssues; + /** @var bool */ + protected $hasIssues = false; + /** @var bool */ protected $isPrivate = false; + /** @var bool */ private $isArchived = false; + /** @var array|false|null */ private $fundingInfo; /** @@ -565,6 +575,10 @@ protected function setupGitDriver($url) protected function getNextPage(Response $response) { $header = $response->getHeader('link'); + + if (!$header) { + return; + } $links = explode(',', $header); foreach ($links as $link) { diff --git a/app/vendor/composer/composer/src/Composer/Repository/Vcs/GitLabDriver.php b/app/vendor/composer/composer/src/Composer/Repository/Vcs/GitLabDriver.php index 2bc0cf61c..8e9d9059d 100644 --- a/app/vendor/composer/composer/src/Composer/Repository/Vcs/GitLabDriver.php +++ b/app/vendor/composer/composer/src/Composer/Repository/Vcs/GitLabDriver.php @@ -29,28 +29,30 @@ */ class GitLabDriver extends VcsDriver { + /** + * @var string + * @phpstan-var 'https'|'http' + */ private $scheme; + /** @var string */ private $namespace; + /** @var string */ private $repository; /** - * @var array Project data returned by GitLab API + * @var mixed[] Project data returned by GitLab API */ private $project; /** - * @var array Keeps commits returned by GitLab API + * @var array Keeps commits returned by GitLab API */ private $commits = array(); - /** - * @var array List of tag => reference - */ + /** @var array Map of tag name to identifier */ private $tags; - /** - * @var array List of branch => reference - */ + /** @var array Map of branch name to identifier */ private $branches; /** diff --git a/app/vendor/composer/composer/src/Composer/Repository/Vcs/HgBitbucketDriver.php b/app/vendor/composer/composer/src/Composer/Repository/Vcs/HgBitbucketDriver.php index 42adcb918..71505cf52 100644 --- a/app/vendor/composer/composer/src/Composer/Repository/Vcs/HgBitbucketDriver.php +++ b/app/vendor/composer/composer/src/Composer/Repository/Vcs/HgBitbucketDriver.php @@ -31,12 +31,10 @@ public function getRootIdentifier() if (null === $this->rootIdentifier) { if (!$this->getRepoData()) { - // @phpstan-ignore-next-line if (!$this->fallbackDriver) { throw new \LogicException('A fallback driver should be setup if getRepoData returns false'); } - // @phpstan-ignore-next-line return $this->fallbackDriver->getRootIdentifier(); } diff --git a/app/vendor/composer/composer/src/Composer/Repository/Vcs/HgDriver.php b/app/vendor/composer/composer/src/Composer/Repository/Vcs/HgDriver.php index 9b6b68803..56e35ea30 100644 --- a/app/vendor/composer/composer/src/Composer/Repository/Vcs/HgDriver.php +++ b/app/vendor/composer/composer/src/Composer/Repository/Vcs/HgDriver.php @@ -24,9 +24,13 @@ */ class HgDriver extends VcsDriver { + /** @var array Map of tag name to identifier */ protected $tags; + /** @var array Map of branch name to identifier */ protected $branches; + /** @var string */ protected $rootIdentifier; + /** @var string */ protected $repoDir; /** diff --git a/app/vendor/composer/composer/src/Composer/Repository/Vcs/PerforceDriver.php b/app/vendor/composer/composer/src/Composer/Repository/Vcs/PerforceDriver.php index 861b67038..76249fd54 100644 --- a/app/vendor/composer/composer/src/Composer/Repository/Vcs/PerforceDriver.php +++ b/app/vendor/composer/composer/src/Composer/Repository/Vcs/PerforceDriver.php @@ -23,7 +23,9 @@ */ class PerforceDriver extends VcsDriver { + /** @var string */ protected $depot; + /** @var string */ protected $branch; /** @var ?Perforce */ protected $perforce = null; diff --git a/app/vendor/composer/composer/src/Composer/Repository/Vcs/SvnDriver.php b/app/vendor/composer/composer/src/Composer/Repository/Vcs/SvnDriver.php index ab3f95f16..9ea596115 100644 --- a/app/vendor/composer/composer/src/Composer/Repository/Vcs/SvnDriver.php +++ b/app/vendor/composer/composer/src/Composer/Repository/Vcs/SvnDriver.php @@ -28,15 +28,24 @@ */ class SvnDriver extends VcsDriver { + /** @var string */ protected $baseUrl; + /** @var array Map of tag name to identifier */ protected $tags; + /** @var array Map of branch name to identifier */ protected $branches; + /** @var ?string */ protected $rootIdentifier; + /** @var string|false */ protected $trunkPath = 'trunk'; + /** @var string */ protected $branchesPath = 'branches'; + /** @var string */ protected $tagsPath = 'tags'; + /** @var string */ protected $packagePath = ''; + /** @var bool */ protected $cacheCredentials = true; /** diff --git a/app/vendor/composer/composer/src/Composer/Repository/Vcs/VcsDriver.php b/app/vendor/composer/composer/src/Composer/Repository/Vcs/VcsDriver.php index 8927a0dcc..7e287e33c 100644 --- a/app/vendor/composer/composer/src/Composer/Repository/Vcs/VcsDriver.php +++ b/app/vendor/composer/composer/src/Composer/Repository/Vcs/VcsDriver.php @@ -33,7 +33,7 @@ abstract class VcsDriver implements VcsDriverInterface protected $url; /** @var string */ protected $originUrl; - /** @var array */ + /** @var array */ protected $repoConfig; /** @var IOInterface */ protected $io; @@ -43,7 +43,7 @@ abstract class VcsDriver implements VcsDriverInterface protected $process; /** @var HttpDownloader */ protected $httpDownloader; - /** @var array */ + /** @var array */ protected $infoCache = array(); /** @var ?Cache */ protected $cache; @@ -157,6 +157,7 @@ protected function getScheme() * @param string $url The URL of content * * @return Response + * @throws TransportException */ protected function getContents($url) { diff --git a/app/vendor/composer/composer/src/Composer/Repository/VcsRepository.php b/app/vendor/composer/composer/src/Composer/Repository/VcsRepository.php index 2456baaea..1b7c72949 100644 --- a/app/vendor/composer/composer/src/Composer/Repository/VcsRepository.php +++ b/app/vendor/composer/composer/src/Composer/Repository/VcsRepository.php @@ -32,25 +32,41 @@ */ class VcsRepository extends ArrayRepository implements ConfigurableRepositoryInterface { + /** @var string */ protected $url; + /** @var ?string */ protected $packageName; + /** @var bool */ protected $isVerbose; + /** @var bool */ protected $isVeryVerbose; + /** @var IOInterface */ protected $io; + /** @var Config */ protected $config; + /** @var VersionParser */ protected $versionParser; + /** @var string */ protected $type; + /** @var ?LoaderInterface */ protected $loader; + /** @var array */ protected $repoConfig; + /** @var HttpDownloader */ protected $httpDownloader; + /** @var ProcessExecutor */ protected $processExecutor; + /** @var bool */ protected $branchErrorOccurred = false; + /** @var array */ private $drivers; /** @var ?VcsDriverInterface */ private $driver; /** @var ?VersionCacheInterface */ private $versionCache; + /** @var string[] */ private $emptyReferences = array(); + /** @var array<'tags'|'branches', array> */ private $versionTransportExceptions = array(); public function __construct(array $repoConfig, IOInterface $io, Config $config, HttpDownloader $httpDownloader, EventDispatcher $dispatcher = null, ProcessExecutor $process = null, array $drivers = null, VersionCacheInterface $versionCache = null) @@ -266,7 +282,7 @@ protected function initialize() if ($e->getCode() === 404) { $this->emptyReferences[] = $identifier; } - if ($e->getCode() === 401 || $e->getCode() === 403) { + if (in_array($e->getCode(), array(401, 403, 429), true)) { throw $e; } } @@ -355,7 +371,7 @@ protected function initialize() if ($e->getCode() === 404) { $this->emptyReferences[] = $identifier; } - if ($e->getCode() === 401 || $e->getCode() === 403) { + if (in_array($e->getCode(), array(401, 403, 429), true)) { throw $e; } if ($isVeryVerbose) { diff --git a/app/vendor/composer/composer/src/Composer/SelfUpdate/Versions.php b/app/vendor/composer/composer/src/Composer/SelfUpdate/Versions.php index 45bc4272f..591c11253 100644 --- a/app/vendor/composer/composer/src/Composer/SelfUpdate/Versions.php +++ b/app/vendor/composer/composer/src/Composer/SelfUpdate/Versions.php @@ -20,11 +20,16 @@ */ class Versions { + /** @var string[] */ public static $channels = array('stable', 'preview', 'snapshot', '1', '2'); + /** @var HttpDownloader */ private $httpDownloader; + /** @var Config */ private $config; + /** @var string */ private $channel; + /** @var array> */ private $versionsData; public function __construct(Config $config, HttpDownloader $httpDownloader) diff --git a/app/vendor/composer/composer/src/Composer/Util/AuthHelper.php b/app/vendor/composer/composer/src/Composer/Util/AuthHelper.php index abbc76cf7..b8dc44407 100644 --- a/app/vendor/composer/composer/src/Composer/Util/AuthHelper.php +++ b/app/vendor/composer/composer/src/Composer/Util/AuthHelper.php @@ -21,8 +21,11 @@ */ class AuthHelper { + /** @var IOInterface */ protected $io; + /** @var Config */ protected $config; + /** @var array Map of origins to message displayed */ private $displayedOriginAuthentications = array(); public function __construct(IOInterface $io, Config $config) @@ -75,6 +78,7 @@ function ($value) { * @param string[] $headers * @return array|null containing retry (bool) and storeAuth (string|bool) keys, if retry is true the request should be * retried, if storeAuth is true then on a successful retry the authentication should be persisted to auth.json + * @phpstan-return ?array{retry: bool, storeAuth: string|bool} */ public function promptAuthIfNeeded($url, $origin, $statusCode, $reason = null, $headers = array()) { diff --git a/app/vendor/composer/composer/src/Composer/Util/Bitbucket.php b/app/vendor/composer/composer/src/Composer/Util/Bitbucket.php index 5970aa631..445dbed7e 100644 --- a/app/vendor/composer/composer/src/Composer/Util/Bitbucket.php +++ b/app/vendor/composer/composer/src/Composer/Util/Bitbucket.php @@ -151,7 +151,7 @@ public function authorizeOAuthInteractively($originUrl, $message = null) $this->io->writeError(sprintf('to create a consumer. It will be stored in "%s" for future use by Composer.', $this->config->getAuthConfigSource()->getName())); $this->io->writeError('Ensure you enter a "Callback URL" (http://example.com is fine) or it will not be possible to create an Access Token (this callback url will not be used by composer)'); - $consumerKey = trim($this->io->askAndHideAnswer('Consumer Key (hidden): ')); + $consumerKey = trim((string) $this->io->askAndHideAnswer('Consumer Key (hidden): ')); if (!$consumerKey) { $this->io->writeError('No consumer key given, aborting.'); @@ -160,7 +160,7 @@ public function authorizeOAuthInteractively($originUrl, $message = null) return false; } - $consumerSecret = trim($this->io->askAndHideAnswer('Consumer Secret (hidden): ')); + $consumerSecret = trim((string) $this->io->askAndHideAnswer('Consumer Secret (hidden): ')); if (!$consumerSecret) { $this->io->writeError('No consumer secret given, aborting.'); diff --git a/app/vendor/composer/composer/src/Composer/Util/ConfigValidator.php b/app/vendor/composer/composer/src/Composer/Util/ConfigValidator.php index dd2cbcb0d..a73b91651 100644 --- a/app/vendor/composer/composer/src/Composer/Util/ConfigValidator.php +++ b/app/vendor/composer/composer/src/Composer/Util/ConfigValidator.php @@ -30,6 +30,7 @@ class ConfigValidator { const CHECK_VERSION = 1; + /** @var IOInterface */ private $io; public function __construct(IOInterface $io) diff --git a/app/vendor/composer/composer/src/Composer/Util/ErrorHandler.php b/app/vendor/composer/composer/src/Composer/Util/ErrorHandler.php index 10f1c2472..8e96191f2 100644 --- a/app/vendor/composer/composer/src/Composer/Util/ErrorHandler.php +++ b/app/vendor/composer/composer/src/Composer/Util/ErrorHandler.php @@ -21,6 +21,7 @@ */ class ErrorHandler { + /** @var ?IOInterface */ private static $io; /** @@ -52,6 +53,15 @@ public static function handle($level, $message, $file, $line) } if (self::$io) { + // ignore symfony/* deprecation warnings + // TODO remove in 2.3 + if (preg_match('{^Return type of Symfony\\\\.*ReturnTypeWillChange}is', $message)) { + return true; + } + if (strpos(strtr($file, '\\', '/'), 'vendor/symfony/') !== false) { + return true; + } + self::$io->writeError('Deprecation Notice: '.$message.' in '.$file.':'.$line.''); if (self::$io->isVerbose()) { self::$io->writeError('Stack trace:'); diff --git a/app/vendor/composer/composer/src/Composer/Util/Filesystem.php b/app/vendor/composer/composer/src/Composer/Util/Filesystem.php index 2f5192096..5f99d8d30 100644 --- a/app/vendor/composer/composer/src/Composer/Util/Filesystem.php +++ b/app/vendor/composer/composer/src/Composer/Util/Filesystem.php @@ -514,7 +514,7 @@ public function isAbsolutePath($path) /** * Returns size of a file or directory specified by path. If a directory is - * given, it's size will be computed recursively. + * given, its size will be computed recursively. * * @param string $path Path to the file or directory * @throws \RuntimeException @@ -544,7 +544,13 @@ public function normalizePath($path) $parts = array(); $path = strtr($path, '\\', '/'); $prefix = ''; - $absolute = false; + $absolute = ''; + + // extract windows UNC paths e.g. \\foo\bar + if (strpos($path, '//') === 0 && \strlen($path) > 2) { + $absolute = '//'; + $path = substr($path, 2); + } // extract a prefix being a protocol://, protocol:, protocol://drive: or simply drive: if (preg_match('{^( [0-9a-z]{2,}+: (?: // (?: [a-z]: )? )? | [a-z]: )}ix', $path, $match)) { @@ -553,13 +559,13 @@ public function normalizePath($path) } if (strpos($path, '/') === 0) { - $absolute = true; + $absolute = '/'; $path = substr($path, 1); } $up = false; foreach (explode('/', $path) as $chunk) { - if ('..' === $chunk && ($absolute || $up)) { + if ('..' === $chunk && ($absolute !== '' || $up)) { array_pop($parts); $up = !(empty($parts) || '..' === end($parts)); } elseif ('.' !== $chunk && '' !== $chunk) { @@ -568,7 +574,7 @@ public function normalizePath($path) } } - return $prefix.($absolute ? '/' : '').implode('/', $parts); + return $prefix.((string) $absolute).implode('/', $parts); } /** diff --git a/app/vendor/composer/composer/src/Composer/Util/Git.php b/app/vendor/composer/composer/src/Composer/Util/Git.php index 67d42b7c2..8eab2c7c7 100644 --- a/app/vendor/composer/composer/src/Composer/Util/Git.php +++ b/app/vendor/composer/composer/src/Composer/Util/Git.php @@ -20,6 +20,7 @@ */ class Git { + /** @var string|false|null */ private static $version = false; /** @var IOInterface */ @@ -97,6 +98,7 @@ public function runCommand($commandCallable, $url, $cwd, $initialClone = false) $command = call_user_func($commandCallable, $url); $auth = null; + $credentials = array(); if ($bypassSshForGitHub || 0 !== $this->process->execute($command, $ignoredOutput, $cwd)) { $errorMsg = $this->process->getErrorOutput(); // private github repository without ssh key access, try https with auth @@ -120,6 +122,7 @@ public function runCommand($commandCallable, $url, $cwd, $initialClone = false) return; } + $credentials = array(rawurlencode($auth['username']), rawurlencode($auth['password'])); $errorMsg = $this->process->getErrorOutput(); } } elseif (preg_match('{^https://(bitbucket\.org)/(.*?)(?:\.git)?$}i', $url, $match)) { //bitbucket oauth @@ -154,6 +157,7 @@ public function runCommand($commandCallable, $url, $cwd, $initialClone = false) return; } + $credentials = array(rawurlencode($auth['username']), rawurlencode($auth['password'])); $errorMsg = $this->process->getErrorOutput(); } else { // Falling back to ssh $sshUrl = 'git@bitbucket.org:' . $match[2] . '.git'; @@ -195,6 +199,7 @@ public function runCommand($commandCallable, $url, $cwd, $initialClone = false) return; } + $credentials = array(rawurlencode($auth['username']), rawurlencode($auth['password'])); $errorMsg = $this->process->getErrorOutput(); } } elseif ($this->isAuthenticationFailure($url, $match)) { // private non-github/gitlab/bitbucket repo that failed to authenticate @@ -235,6 +240,7 @@ public function runCommand($commandCallable, $url, $cwd, $initialClone = false) return; } + $credentials = array(rawurlencode($auth['username']), rawurlencode($auth['password'])); $errorMsg = $this->process->getErrorOutput(); } } @@ -243,6 +249,10 @@ public function runCommand($commandCallable, $url, $cwd, $initialClone = false) $this->filesystem->removeDirectory($origCwd); } + if (count($credentials) > 0) { + $command = $this->maskCredentials($command, $credentials); + $errorMsg = $this->maskCredentials($errorMsg, $credentials); + } $this->throwException('Failed to execute ' . $command . "\n\n" . $errorMsg, $url); } } @@ -411,4 +421,23 @@ public static function getVersion(ProcessExecutor $process) return self::$version; } + + private function maskCredentials(string $error, array $credentials) + { + $maskedCredentials = array(); + + foreach ($credentials as $credential) { + if (in_array($credential, array('private-token', 'x-token-auth', 'oauth2', 'gitlab-ci-token', 'x-oauth-basic'))) { + $maskedCredentials[] = $credential; + } elseif (strlen($credential) > 6) { + $maskedCredentials[] = substr($credential, 0, 3) . '...' . substr($credential, -3); + } elseif (strlen($credential) > 3) { + $maskedCredentials[] = substr($credential, 0, 3) . '...'; + } else { + $maskedCredentials[] = 'XXX'; + } + } + + return str_replace($credentials, $maskedCredentials, $error); + } } diff --git a/app/vendor/composer/composer/src/Composer/Util/GitLab.php b/app/vendor/composer/composer/src/Composer/Util/GitLab.php index 1ff2fbb96..e5287991b 100644 --- a/app/vendor/composer/composer/src/Composer/Util/GitLab.php +++ b/app/vendor/composer/composer/src/Composer/Util/GitLab.php @@ -118,7 +118,7 @@ public function authorizeOAuthInteractively($scheme, $originUrl, $message = null } $this->io->writeError(sprintf('A token will be created and stored in "%s", your password will never be stored', $this->config->getAuthConfigSource()->getName())); - $this->io->writeError('To revoke access to this token you can visit '.$scheme.'://'.$originUrl.'/profile/applications'); + $this->io->writeError('To revoke access to this token you can visit '.$scheme.'://'.$originUrl.'/-/profile/personal_access_tokens'); $attemptCounter = 0; @@ -172,7 +172,7 @@ private function createToken($scheme, $originUrl) 'username' => $username, 'password' => $password, 'grant_type' => 'password', - ), null, '&'); + ), '', '&'); $options = array( 'retry-auth-failure' => false, 'http' => array( diff --git a/app/vendor/composer/composer/src/Composer/Util/Hg.php b/app/vendor/composer/composer/src/Composer/Util/Hg.php index fe0649dbb..b6321c17a 100644 --- a/app/vendor/composer/composer/src/Composer/Util/Hg.php +++ b/app/vendor/composer/composer/src/Composer/Util/Hg.php @@ -20,6 +20,7 @@ */ class Hg { + /** @var string|false|null */ private static $version = false; /** diff --git a/app/vendor/composer/composer/src/Composer/Util/Http/CurlDownloader.php b/app/vendor/composer/composer/src/Composer/Util/Http/CurlDownloader.php index f511f17d3..cb1f6daea 100644 --- a/app/vendor/composer/composer/src/Composer/Util/Http/CurlDownloader.php +++ b/app/vendor/composer/composer/src/Composer/Util/Http/CurlDownloader.php @@ -26,11 +26,16 @@ * @internal * @author Jordi Boggiano * @author Nicolas Grekas + * @phpstan-type Attributes array{retryAuthFailure: bool, redirects: int, storeAuth: bool} + * @phpstan-type Job array{url: string, origin: string, attributes: Attributes, options: mixed[], progress: mixed[], curlHandle: resource, filename: string|false, headerHandle: resource, bodyHandle: resource, resolve: callable, reject: callable} */ class CurlDownloader { + /** @var ?resource */ private $multiHandle; + /** @var ?resource */ private $shareHandle; + /** @var Job[] */ private $jobs = array(); /** @var IOInterface */ private $io; @@ -38,11 +43,15 @@ class CurlDownloader private $config; /** @var AuthHelper */ private $authHelper; + /** @var float */ private $selectTimeout = 5.0; + /** @var int */ private $maxRedirects = 20; /** @var ProxyManager */ private $proxyManager; + /** @var bool */ private $supportsSecureProxy; + /** @var array */ protected $multiErrors = array( CURLM_BAD_HANDLE => array('CURLM_BAD_HANDLE', 'The passed-in handle is not a valid CURLM handle.'), CURLM_BAD_EASY_HANDLE => array('CURLM_BAD_EASY_HANDLE', "An easy handle was not good/valid. It could mean that it isn't an easy handle at all, or possibly that the handle already is in used by this or another multi handle."), @@ -50,6 +59,7 @@ class CurlDownloader CURLM_INTERNAL_ERROR => array('CURLM_INTERNAL_ERROR', 'This can only be returned if libcurl bugs. Please report it to us!'), ); + /** @var mixed[] */ private static $options = array( 'http' => array( 'method' => CURLOPT_CUSTOMREQUEST, @@ -68,6 +78,7 @@ class CurlDownloader ), ); + /** @var array */ private static $timeInfo = array( 'total_time' => true, 'namelookup_time' => true, @@ -77,6 +88,10 @@ class CurlDownloader 'redirect_time' => true, ); + /** + * @param mixed[] $options + * @param bool $disableTls + */ public function __construct(IOInterface $io, Config $config, array $options = array(), $disableTls = false) { $this->io = $io; @@ -106,6 +121,13 @@ public function __construct(IOInterface $io, Config $config, array $options = ar } /** + * @param callable $resolve + * @param callable $reject + * @param string $origin + * @param string $url + * @param mixed[] $options + * @param ?string $copyTo + * * @return int internal job id */ public function download($resolve, $reject, $origin, $url, $options, $copyTo = null) @@ -120,6 +142,15 @@ public function download($resolve, $reject, $origin, $url, $options, $copyTo = n } /** + * @param callable $resolve + * @param callable $reject + * @param string $origin + * @param string $url + * @param mixed[] $options + * @param ?string $copyTo + * + * @param array{retryAuthFailure?: bool, redirects?: int, storeAuth?: bool} $attributes + * * @return int internal job id */ private function initDownload($resolve, $reject, $origin, $url, $options, $copyTo = null, array $attributes = array()) @@ -142,6 +173,7 @@ private function initDownload($resolve, $reject, $origin, $url, $options, $copyT if ($copyTo) { $errorMessage = ''; + // @phpstan-ignore-next-line set_error_handler(function ($code, $msg) use (&$errorMessage) { if ($errorMessage) { $errorMessage .= "\n"; @@ -160,7 +192,7 @@ private function initDownload($resolve, $reject, $origin, $url, $options, $copyT curl_setopt($curlHandle, CURLOPT_URL, $url); curl_setopt($curlHandle, CURLOPT_FOLLOWLOCATION, false); curl_setopt($curlHandle, CURLOPT_CONNECTTIMEOUT, 10); - curl_setopt($curlHandle, CURLOPT_TIMEOUT, 300); + curl_setopt($curlHandle, CURLOPT_TIMEOUT, max((int) ini_get("default_socket_timeout"), 300)); curl_setopt($curlHandle, CURLOPT_WRITEHEADER, $headerHandle); curl_setopt($curlHandle, CURLOPT_FILE, $bodyHandle); curl_setopt($curlHandle, CURLOPT_ENCODING, "gzip"); @@ -244,6 +276,10 @@ private function initDownload($resolve, $reject, $origin, $url, $options, $copyT return (int) $curlHandle; } + /** + * @param int $id + * @return void + */ public function abortRequest($id) { if (isset($this->jobs[$id], $this->jobs[$id]['handle'])) { @@ -263,6 +299,9 @@ public function abortRequest($id) } } + /** + * @return void + */ public function tick() { if (!$this->jobs) { @@ -302,6 +341,7 @@ public function tick() if (!$error && function_exists('curl_strerror')) { $error = curl_strerror($errno); } + $progress['error_code'] = $errno; throw new TransportException('curl error '.$errno.' while downloading '.Url::sanitize($progress['url']).': '.$error); } $statusCode = $progress['http_code']; @@ -408,6 +448,10 @@ public function tick() } } + /** + * @param Job $job + * @return string + */ private function handleRedirect(array $job, Response $response) { if ($locationHeader = $response->getHeader('location')) { @@ -439,6 +483,10 @@ private function handleRedirect(array $job, Response $response) throw new TransportException('The "'.$job['url'].'" file could not be downloaded, got redirect without Location ('.$response->getStatusMessage().')'); } + /** + * @param Job $job + * @return array{retry: bool, storeAuth: string|bool} + */ private function isAuthenticatedRetryNeeded(array $job, Response $response) { if (in_array($response->getStatusCode(), array(401, 403)) && $job['attributes']['retryAuthFailure']) { @@ -486,6 +534,14 @@ private function isAuthenticatedRetryNeeded(array $job, Response $response) return array('retry' => false, 'storeAuth' => false); } + /** + * @param Job $job + * @param string $url + * + * @param array{retryAuthFailure?: bool, redirects?: int, storeAuth?: bool} $attributes + * + * @return void + */ private function restartJob(array $job, $url, array $attributes = array()) { if ($job['filename']) { @@ -498,6 +554,11 @@ private function restartJob(array $job, $url, array $attributes = array()) $this->initDownload($job['resolve'], $job['reject'], $origin, $url, $job['options'], $job['filename'], $attributes); } + /** + * @param Job $job + * @param string $errorMessage + * @return TransportException + */ private function failResponse(array $job, Response $response, $errorMessage) { if ($job['filename']) { @@ -512,6 +573,10 @@ private function failResponse(array $job, Response $response, $errorMessage) return new TransportException('The "'.$job['url'].'" file could not be downloaded ('.$errorMessage.')' . $details, $response->getStatusCode()); } + /** + * @param Job $job + * @return void + */ private function rejectJob(array $job, \Exception $e) { if (is_resource($job['headerHandle'])) { @@ -526,6 +591,10 @@ private function rejectJob(array $job, \Exception $e) call_user_func($job['reject'], $e); } + /** + * @param int $code + * @return void + */ private function checkCurlResult($code) { if ($code != CURLM_OK && $code != CURLM_CALL_MULTI_PERFORM) { diff --git a/app/vendor/composer/composer/src/Composer/Util/Http/CurlResponse.php b/app/vendor/composer/composer/src/Composer/Util/Http/CurlResponse.php index 82f725266..495a73b85 100644 --- a/app/vendor/composer/composer/src/Composer/Util/Http/CurlResponse.php +++ b/app/vendor/composer/composer/src/Composer/Util/Http/CurlResponse.php @@ -12,10 +12,20 @@ namespace Composer\Util\Http; +/** + * @phpstan-type CurlInfo array{url: mixed, content_type: mixed, http_code: mixed, header_size: mixed, request_size: mixed, filetime: mixed, ssl_verify_result: mixed, redirect_count: mixed, total_time: mixed, namelookup_time: mixed, connect_time: mixed, pretransfer_time: mixed, size_upload: mixed, size_download: mixed, speed_download: mixed, speed_upload: mixed, download_content_length: mixed, upload_content_length: mixed, starttransfer_time: mixed, redirect_time: mixed, certinfo: mixed, primary_ip: mixed, primary_port: mixed, local_ip: mixed, local_port: mixed, redirect_url: mixed} + */ class CurlResponse extends Response { + /** + * @see https://www.php.net/curl_getinfo + * @var CurlInfo + */ private $curlInfo; + /** + * @param CurlInfo $curlInfo + */ public function __construct(array $request, $code, array $headers, $body, array $curlInfo) { parent::__construct($request, $code, $headers, $body); @@ -23,7 +33,7 @@ public function __construct(array $request, $code, array $headers, $body, array } /** - * @return array + * @return CurlInfo */ public function getCurlInfo() { diff --git a/app/vendor/composer/composer/src/Composer/Util/Http/RequestProxy.php b/app/vendor/composer/composer/src/Composer/Util/Http/RequestProxy.php index 67555c9b1..5a832706f 100644 --- a/app/vendor/composer/composer/src/Composer/Util/Http/RequestProxy.php +++ b/app/vendor/composer/composer/src/Composer/Util/Http/RequestProxy.php @@ -20,15 +20,19 @@ */ class RequestProxy { + /** @var mixed[] */ private $contextOptions; + /** @var bool */ private $isSecure; + /** @var string */ private $formattedUrl; + /** @var string */ private $url; /** - * @param string $url - * @param array $contextOptions - * @param string $formattedUrl + * @param string $url + * @param mixed[] $contextOptions + * @param string $formattedUrl */ public function __construct($url, array $contextOptions, $formattedUrl) { @@ -41,7 +45,7 @@ public function __construct($url, array $contextOptions, $formattedUrl) /** * Returns an array of context options * - * @return array + * @return mixed[] */ public function getContextOptions() { diff --git a/app/vendor/composer/composer/src/Composer/Util/Http/Response.php b/app/vendor/composer/composer/src/Composer/Util/Http/Response.php index 29dd934d5..5f3cf73e5 100644 --- a/app/vendor/composer/composer/src/Composer/Util/Http/Response.php +++ b/app/vendor/composer/composer/src/Composer/Util/Http/Response.php @@ -13,14 +13,28 @@ namespace Composer\Util\Http; use Composer\Json\JsonFile; +use Composer\Util\HttpDownloader; +/** + * @phpstan-import-type Request from HttpDownloader + */ class Response { + /** @var Request */ private $request; + /** @var int */ private $code; + /** @var string[] */ private $headers; + /** @var ?string */ private $body; + /** + * @param Request $request + * @param int $code + * @param string[] $headers + * @param ?string $body + */ public function __construct(array $request, $code, array $headers, $body) { if (!isset($request['url'])) { @@ -32,6 +46,9 @@ public function __construct(array $request, $code, array $headers, $body) $this->body = $body; } + /** + * @return int + */ public function getStatusCode() { return $this->code; @@ -54,33 +71,51 @@ public function getStatusMessage() return $value; } + /** + * @return string[] + */ public function getHeaders() { return $this->headers; } + /** + * @param string $name + * @return ?string + */ public function getHeader($name) { return self::findHeaderValue($this->headers, $name); } + /** + * @return ?string + */ public function getBody() { return $this->body; } + /** + * @return mixed + */ public function decodeJson() { return JsonFile::parseJson($this->body, $this->request['url']); } + /** + * @return void + * @phpstan-impure + */ public function collect() { + /** @phpstan-ignore-next-line */ $this->request = $this->code = $this->headers = $this->body = null; } /** - * @param array $headers array of returned headers like from getLastHeaders() + * @param string[] $headers array of returned headers like from getLastHeaders() * @param string $name header name (case insensitive) * @return string|null */ diff --git a/app/vendor/composer/composer/src/Composer/Util/HttpDownloader.php b/app/vendor/composer/composer/src/Composer/Util/HttpDownloader.php index 4610a29b2..1706dab9f 100644 --- a/app/vendor/composer/composer/src/Composer/Util/HttpDownloader.php +++ b/app/vendor/composer/composer/src/Composer/Util/HttpDownloader.php @@ -16,14 +16,18 @@ use Composer\IO\IOInterface; use Composer\Downloader\TransportException; use Composer\Util\Http\Response; +use Composer\Util\Http\CurlDownloader; use Composer\Composer; use Composer\Package\Version\VersionParser; use Composer\Semver\Constraint\Constraint; use Composer\Exception\IrrecoverableDownloadException; use React\Promise\Promise; +use React\Promise\PromiseInterface; /** * @author Jordi Boggiano + * @phpstan-type Request array{url: string, options?: mixed[], copyTo?: ?string} + * @phpstan-type Job array{id: int, status: int, request: Request, sync: bool, origin: string, resolve?: callable, reject?: callable, curl_id?: int, response?: Response, exception?: TransportException} */ class HttpDownloader { @@ -33,22 +37,33 @@ class HttpDownloader const STATUS_FAILED = 4; const STATUS_ABORTED = 5; + /** @var IOInterface */ private $io; + /** @var Config */ private $config; + /** @var array */ private $jobs = array(); + /** @var mixed[] */ private $options = array(); + /** @var int */ private $runningJobs = 0; + /** @var int */ private $maxJobs = 12; + /** @var ?CurlDownloader */ private $curl; + /** @var ?RemoteFilesystem */ private $rfs; + /** @var int */ private $idGen = 0; + /** @var bool */ private $disabled; + /** @var bool */ private $allowAsync = false; /** * @param IOInterface $io The IO instance * @param Config $config The config - * @param array $options The options + * @param mixed[] $options The options * @param bool $disableTls */ public function __construct(IOInterface $io, Config $config, array $options = array(), $disableTls = false) @@ -68,7 +83,7 @@ public function __construct(IOInterface $io, Config $config, array $options = ar $this->config = $config; if (self::isCurlEnabled()) { - $this->curl = new Http\CurlDownloader($io, $config, $options, $disableTls); + $this->curl = new CurlDownloader($io, $config, $options, $disableTls); } $this->rfs = new RemoteFilesystem($io, $config, $options, $disableTls); @@ -82,14 +97,14 @@ public function __construct(IOInterface $io, Config $config, array $options = ar * Download a file synchronously * * @param string $url URL to download - * @param array $options Stream context options e.g. https://www.php.net/manual/en/context.http.php + * @param mixed[] $options Stream context options e.g. https://www.php.net/manual/en/context.http.php * although not all options are supported when using the default curl downloader * @throws TransportException * @return Response */ public function get($url, $options = array()) { - list($job) = $this->addJob(array('url' => $url, 'options' => $options, 'copyTo' => false), true); + list($job) = $this->addJob(array('url' => $url, 'options' => $options, 'copyTo' => null), true); $this->wait($job['id']); $response = $this->getResponse($job['id']); @@ -106,7 +121,7 @@ public function get($url, $options = array()) $this->curl = null; - list($job) = $this->addJob(array('url' => $url, 'options' => $options, 'copyTo' => false), true); + list($job) = $this->addJob(array('url' => $url, 'options' => $options, 'copyTo' => null), true); $this->wait($job['id']); $response = $this->getResponse($job['id']); @@ -119,14 +134,14 @@ public function get($url, $options = array()) * Create an async download operation * * @param string $url URL to download - * @param array $options Stream context options e.g. https://www.php.net/manual/en/context.http.php + * @param mixed[] $options Stream context options e.g. https://www.php.net/manual/en/context.http.php * although not all options are supported when using the default curl downloader * @throws TransportException - * @return Promise + * @return PromiseInterface */ public function add($url, $options = array()) { - list(, $promise) = $this->addJob(array('url' => $url, 'options' => $options, 'copyTo' => false)); + list(, $promise) = $this->addJob(array('url' => $url, 'options' => $options, 'copyTo' => null)); return $promise; } @@ -136,7 +151,7 @@ public function add($url, $options = array()) * * @param string $url URL to download * @param string $to Path to copy to - * @param array $options Stream context options e.g. https://www.php.net/manual/en/context.http.php + * @param mixed[] $options Stream context options e.g. https://www.php.net/manual/en/context.http.php * although not all options are supported when using the default curl downloader * @throws TransportException * @return Response @@ -154,10 +169,10 @@ public function copy($url, $to, $options = array()) * * @param string $url URL to download * @param string $to Path to copy to - * @param array $options Stream context options e.g. https://www.php.net/manual/en/context.http.php + * @param mixed[] $options Stream context options e.g. https://www.php.net/manual/en/context.http.php * although not all options are supported when using the default curl downloader * @throws TransportException - * @return Promise + * @return PromiseInterface */ public function addCopy($url, $to, $options = array()) { @@ -169,7 +184,7 @@ public function addCopy($url, $to, $options = array()) /** * Retrieve the options set in the constructor * - * @return array Options + * @return mixed[] Options */ public function getOptions() { @@ -179,6 +194,7 @@ public function getOptions() /** * Merges new options * + * @param mixed[] $options * @return void */ public function setOptions(array $options) @@ -186,10 +202,17 @@ public function setOptions(array $options) $this->options = array_replace_recursive($this->options, $options); } + /** + * @param Request $request + * @param bool $sync + * + * @return array{Job, PromiseInterface} + */ private function addJob($request, $sync = false) { $request['options'] = array_replace_recursive($this->options, $request['options']); + /** @var Job */ $job = array( 'id' => $this->idGen++, 'status' => self::STATUS_QUEUED, @@ -283,6 +306,10 @@ private function addJob($request, $sync = false) return array($job, $promise); } + /** + * @param int $id + * @return void + */ private function startJob($id) { $job = &$this->jobs[$id]; @@ -325,6 +352,7 @@ private function startJob($id) /** * @private + * @return void */ public function markJobDone() { @@ -335,6 +363,8 @@ public function markJobDone() * Wait for current async download jobs to complete * * @param int|null $index For internal use only, the job id + * + * @return void */ public function wait($index = null) { @@ -345,6 +375,8 @@ public function wait($index = null) /** * @internal + * + * @return void */ public function enableAsync() { @@ -387,6 +419,10 @@ public function countActiveJobs($index = null) return $active; } + /** + * @param int $index Job id + * @return Response + */ private function getResponse($index) { if (!isset($this->jobs[$index])) { @@ -410,6 +446,10 @@ private function getResponse($index) /** * @internal + * + * @param string $url + * @param array{warning?: string, info?: string, warning-versions?: string, info-versions?: string} $data + * @return void */ public static function outputWarnings(IOInterface $io, $url, $data) { @@ -433,11 +473,13 @@ public static function outputWarnings(IOInterface $io, $url, $data) /** * @internal + * + * @return ?string[] */ public static function getExceptionHints(\Exception $e) { if (!$e instanceof TransportException) { - return; + return null; } if ( @@ -460,8 +502,14 @@ public static function getExceptionHints(\Exception $e) 'The following exception probably indicates you are offline or have misconfigured DNS resolver(s)', ); } + + return null; } + /** + * @param Job $job + * @return bool + */ private function canUseCurl(array $job) { if (!$this->curl) { @@ -481,6 +529,7 @@ private function canUseCurl(array $job) /** * @internal + * @return bool */ public static function isCurlEnabled() { diff --git a/app/vendor/composer/composer/src/Composer/Util/IniHelper.php b/app/vendor/composer/composer/src/Composer/Util/IniHelper.php index d655419fc..8076f82ed 100644 --- a/app/vendor/composer/composer/src/Composer/Util/IniHelper.php +++ b/app/vendor/composer/composer/src/Composer/Util/IniHelper.php @@ -29,7 +29,7 @@ class IniHelper * The equivalent of calling php_ini_loaded_file then php_ini_scanned_files. * The loaded ini location is the first entry and may be empty. * - * @return array + * @return string[] */ public static function getAll() { diff --git a/app/vendor/composer/composer/src/Composer/Util/Loop.php b/app/vendor/composer/composer/src/Composer/Util/Loop.php index 00130a472..b103011a4 100644 --- a/app/vendor/composer/composer/src/Composer/Util/Loop.php +++ b/app/vendor/composer/composer/src/Composer/Util/Loop.php @@ -12,8 +12,9 @@ namespace Composer\Util; -use React\Promise\Promise; +use React\Promise\CancellablePromiseInterface; use Symfony\Component\Console\Helper\ProgressBar; +use React\Promise\PromiseInterface; /** * @author Jordi Boggiano @@ -24,7 +25,7 @@ class Loop private $httpDownloader; /** @var ProcessExecutor|null */ private $processExecutor; - /** @var Promise[][] */ + /** @var PromiseInterface[][] */ private $currentPromises = array(); /** @var int */ private $waitIndex = 0; @@ -56,6 +57,11 @@ public function getProcessExecutor() return $this->processExecutor; } + /** + * @param PromiseInterface[] $promises + * @param ?ProgressBar $progress + * @return void + */ public function wait(array $promises, ProgressBar $progress = null) { /** @var \Exception|null */ @@ -113,11 +119,16 @@ function ($e) use (&$uncaught) { } } + /** + * @return void + */ public function abortJobs() { foreach ($this->currentPromises as $promiseGroup) { foreach ($promiseGroup as $promise) { - $promise->cancel(); + if ($promise instanceof CancellablePromiseInterface) { + $promise->cancel(); + } } } } diff --git a/app/vendor/composer/composer/src/Composer/Util/NoProxyPattern.php b/app/vendor/composer/composer/src/Composer/Util/NoProxyPattern.php index c391a7535..21f7c4fca 100644 --- a/app/vendor/composer/composer/src/Composer/Util/NoProxyPattern.php +++ b/app/vendor/composer/composer/src/Composer/Util/NoProxyPattern.php @@ -39,7 +39,7 @@ class NoProxyPattern */ public function __construct($pattern) { - $this->hostNames = preg_split('{[\s,]+}', $pattern, null, PREG_SPLIT_NO_EMPTY); + $this->hostNames = preg_split('{[\s,]+}', $pattern, -1, PREG_SPLIT_NO_EMPTY); $this->noproxy = empty($this->hostNames) || '*' === $this->hostNames[0]; } @@ -264,8 +264,8 @@ private function ipGetAddr($host) /** * Returns the binary network mask mapped to IPv6 * - * @param string $prefix CIDR prefix-length - * @param int $size Byte size of in_addr + * @param int $prefix CIDR prefix-length + * @param int $size Byte size of in_addr * * @return string */ @@ -274,7 +274,7 @@ private function ipGetMask($prefix, $size) $mask = ''; if ($ones = floor($prefix / 8)) { - $mask = str_repeat(chr(255), $ones); + $mask = str_repeat(chr(255), (int) $ones); } if ($remainder = $prefix % 8) { @@ -291,7 +291,7 @@ private function ipGetMask($prefix, $size) * * @param string $rangeIp IP in_addr * @param int $size Byte size of in_addr - * @param string $prefix CIDR prefix-length + * @param int $prefix CIDR prefix-length * * @return string[] network in_addr, binary mask */ @@ -420,6 +420,8 @@ private function splitHostPort($hostName) * @param string $int * @param int $min * @param int $max + * + * @return bool */ private function validateInt($int, $min, $max) { diff --git a/app/vendor/composer/composer/src/Composer/Util/Perforce.php b/app/vendor/composer/composer/src/Composer/Util/Perforce.php index 1187b06c3..ea2b1152c 100644 --- a/app/vendor/composer/composer/src/Composer/Util/Perforce.php +++ b/app/vendor/composer/composer/src/Composer/Util/Perforce.php @@ -160,7 +160,7 @@ public function setStream($stream) public function isStream() { - return (strcmp($this->p4DepotType, 'stream') === 0); + return is_string($this->p4DepotType) && (strcmp($this->p4DepotType, 'stream') === 0); } public function getStream() @@ -204,13 +204,11 @@ public function setUser($user) public function queryP4User() { $this->getUser(); - if (strlen($this->p4User) > 0) { + if (strlen((string) $this->p4User) > 0) { return; } $this->p4User = $this->getP4variable('P4USER'); - // https://github.com/phpstan/phpstan/issues/5129 - // @phpstan-ignore-next-line - if (strlen($this->p4User) > 0) { + if (strlen((string) $this->p4User) > 0) { return; } $this->p4User = $this->io->ask('Enter P4 User:'); @@ -264,7 +262,7 @@ public function queryP4Password() return $this->p4Password; } $password = $this->getP4variable('P4PASSWD'); - if (strlen($password) <= 0) { + if (strlen((string) $password) <= 0) { $password = $this->io->askAndHideAnswer('Enter password for Perforce user ' . $this->getUser() . ': '); } $this->p4Password = $password; diff --git a/app/vendor/composer/composer/src/Composer/Util/Platform.php b/app/vendor/composer/composer/src/Composer/Util/Platform.php index 75b0b06eb..8f8ed2682 100644 --- a/app/vendor/composer/composer/src/Composer/Util/Platform.php +++ b/app/vendor/composer/composer/src/Composer/Util/Platform.php @@ -108,7 +108,12 @@ public static function isWindowsSubsystemForLinux() return self::$isWindowsSubsystemForLinux = false; } - if (is_readable('/proc/version') && false !== stripos(file_get_contents('/proc/version'), 'microsoft')) { + if ( + !ini_get('open_basedir') + && is_readable('/proc/version') + && false !== stripos(Silencer::call('file_get_contents', '/proc/version'), 'microsoft') + && !file_exists('/.dockerenv') // docker running inside WSL should not be seen as WSL + ) { return self::$isWindowsSubsystemForLinux = true; } } @@ -142,6 +147,10 @@ public static function strlen($str) return \strlen($str); } + /** + * @param ?resource $fd Open file descriptor or null to default to STDOUT + * @return bool + */ public static function isTty($fd = null) { if ($fd === null) { @@ -170,6 +179,9 @@ public static function isTty($fd = null) return $stat ? 0020000 === ($stat['mode'] & 0170000) : false; } + /** + * @return void + */ public static function workaroundFilesystemIssues() { if (self::isVirtualBoxGuest()) { diff --git a/app/vendor/composer/composer/src/Composer/Util/ProcessExecutor.php b/app/vendor/composer/composer/src/Composer/Util/ProcessExecutor.php index 7d7e6546e..665b0e7b3 100644 --- a/app/vendor/composer/composer/src/Composer/Util/ProcessExecutor.php +++ b/app/vendor/composer/composer/src/Composer/Util/ProcessExecutor.php @@ -31,19 +31,27 @@ class ProcessExecutor const STATUS_FAILED = 4; const STATUS_ABORTED = 5; + /** @var int */ protected static $timeout = 300; - protected $captureOutput; - protected $errorOutput; + /** @var bool */ + protected $captureOutput = false; + /** @var string */ + protected $errorOutput = ''; + /** @var ?IOInterface */ protected $io; /** * @phpstan-var array> */ private $jobs = array(); + /** @var int */ private $runningJobs = 0; + /** @var int */ private $maxJobs = 10; + /** @var int */ private $idGen = 0; + /** @var bool */ private $allowAsync = false; public function __construct(IOInterface $io = null) @@ -54,11 +62,11 @@ public function __construct(IOInterface $io = null) /** * runs a process on the commandline * - * @param string $command the command to execute - * @param mixed $output the output will be written into this var if passed by ref - * if a callable is passed it will be used as output handler - * @param string $cwd the working directory - * @return int statuscode + * @param string $command the command to execute + * @param mixed $output the output will be written into this var if passed by ref + * if a callable is passed it will be used as output handler + * @param ?string $cwd the working directory + * @return int statuscode */ public function execute($command, &$output = null, $cwd = null) { @@ -72,9 +80,9 @@ public function execute($command, &$output = null, $cwd = null) /** * runs a process on the commandline in TTY mode * - * @param string $command the command to execute - * @param string $cwd the working directory - * @return int statuscode + * @param string $command the command to execute + * @param ?string $cwd the working directory + * @return int statuscode */ public function executeTty($command, $cwd = null) { @@ -85,6 +93,13 @@ public function executeTty($command, $cwd = null) return $this->doExecute($command, $cwd, false); } + /** + * @param string $command + * @param ?string $cwd + * @param bool $tty + * @param mixed $output + * @return int + */ private function doExecute($command, $cwd, $tty, &$output = null) { if ($this->io && $this->io->isDebug()) { @@ -111,12 +126,13 @@ private function doExecute($command, $cwd, $tty, &$output = null) } $this->captureOutput = func_num_args() > 3; - $this->errorOutput = null; + $this->errorOutput = ''; // TODO in v3, commands should be passed in as arrays of cmd + args if (method_exists('Symfony\Component\Process\Process', 'fromShellCommandline')) { $process = Process::fromShellCommandline($command, $cwd, null, null, static::getTimeout()); } else { + /** @phpstan-ignore-next-line */ $process = new Process($command, $cwd, null, null, static::getTimeout()); } if (!Platform::isWindows() && $tty) { @@ -215,6 +231,10 @@ public function executeAsync($command, $cwd = null) return $promise; } + /** + * @param int $id + * @return void + */ private function startJob($id) { $job = &$this->jobs[$id]; @@ -283,6 +303,10 @@ private function startJob($id) } } + /** + * @param ?int $index job id + * @return void + */ public function wait($index = null) { while (true) { @@ -296,6 +320,8 @@ public function wait($index = null) /** * @internal + * + * @return void */ public function enableAsync() { @@ -305,7 +331,8 @@ public function enableAsync() /** * @internal * - * @return int number of active (queued or started) jobs + * @param ?int $index job id + * @return int number of active (queued or started) jobs */ public function countActiveJobs($index = null) { @@ -342,6 +369,8 @@ public function countActiveJobs($index = null) /** * @private + * + * @return void */ public function markJobDone() { @@ -349,13 +378,14 @@ public function markJobDone() } /** + * @param ?string $output * @return string[] */ public function splitLines($output) { - $output = trim($output); + $output = trim((string) $output); - return ((string) $output === '') ? array() : preg_split('{\r?\n}', $output); + return $output === '' ? array() : preg_split('{\r?\n}', $output); } /** @@ -368,6 +398,14 @@ public function getErrorOutput() return $this->errorOutput; } + /** + * @private + * + * @param Process::ERR|Process::OUT $type + * @param string $buffer + * + * @return void + */ public function outputHandler($type, $buffer) { if ($this->captureOutput) { @@ -396,7 +434,8 @@ public static function getTimeout() } /** - * @param int $timeout the timeout in seconds + * @param int $timeout the timeout in seconds + * @return void */ public static function setTimeout($timeout) { @@ -406,7 +445,7 @@ public static function setTimeout($timeout) /** * Escapes a string to be used as a shell argument. * - * @param string $argument The argument that will be escaped + * @param ?string $argument The argument that will be escaped * * @return string The escaped argument */ @@ -416,50 +455,36 @@ public static function escape($argument) } /** - * Copy of ProcessUtils::escapeArgument() that is deprecated in Symfony 3.3 and removed in Symfony 4. + * Copy of Symfony's Process::escapeArgument() which is private * - * @param string $argument + * @param ?string $argument * * @return string */ private static function escapeArgument($argument) { - //Fix for PHP bug #43784 escapeshellarg removes % from given string - //Fix for PHP bug #49446 escapeshellarg doesn't work on Windows - //@see https://bugs.php.net/bug.php?id=43784 - //@see https://bugs.php.net/bug.php?id=49446 - if ('\\' === DIRECTORY_SEPARATOR) { - if ((string) $argument === '') { - return escapeshellarg($argument); - } - - $escapedArgument = ''; - $quote = false; - foreach (preg_split('/(")/', $argument, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE) as $part) { - if ('"' === $part) { - $escapedArgument .= '\\"'; - } elseif (self::isSurroundedBy($part, '%')) { - // Avoid environment variable expansion - $escapedArgument .= '^%"'.substr($part, 1, -1).'"^%'; - } else { - // escape trailing backslash - if ('\\' === substr($part, -1)) { - $part .= '\\'; - } - $quote = true; - $escapedArgument .= $part; - } - } - if ($quote) { - $escapedArgument = '"'.$escapedArgument.'"'; - } - - return $escapedArgument; + if ('' === $argument || null === $argument) { + return '""'; + } + if ('\\' !== \DIRECTORY_SEPARATOR) { + return "'".str_replace("'", "'\\''", $argument)."'"; + } + if (false !== strpos($argument, "\0")) { + $argument = str_replace("\0", '?', $argument); } + if (!preg_match('/[\/()%!^"<>&|\s]/', $argument)) { + return $argument; + } + $argument = preg_replace('/(\\\\+)$/', '$1$1', $argument); - return "'".str_replace("'", "'\\''", $argument)."'"; + return '"'.str_replace(array('"', '^', '%', '!', "\n"), array('""', '"^^"', '"^%"', '"^!"', '!LF!'), $argument).'"'; } + /** + * @param string $arg + * @param string $char + * @return bool + */ private static function isSurroundedBy($arg, $char) { return 2 < strlen($arg) && $char === $arg[0] && $char === $arg[strlen($arg) - 1]; diff --git a/app/vendor/composer/composer/src/Composer/Util/RemoteFilesystem.php b/app/vendor/composer/composer/src/Composer/Util/RemoteFilesystem.php index 8b16bb456..56ec5cadd 100644 --- a/app/vendor/composer/composer/src/Composer/Util/RemoteFilesystem.php +++ b/app/vendor/composer/composer/src/Composer/Util/RemoteFilesystem.php @@ -28,25 +28,45 @@ */ class RemoteFilesystem { + /** @var IOInterface */ private $io; + /** @var Config */ private $config; + /** @var string */ private $scheme; + /** @var int */ private $bytesMax; + /** @var string */ private $originUrl; + /** @var string */ private $fileUrl; + /** @var ?string */ private $fileName; - private $retry; + /** @var bool */ + private $retry = false; + /** @var bool */ private $progress; + /** @var ?int */ private $lastProgress; + /** @var mixed[] */ private $options = array(); + /** @var array */ private $peerCertificateMap = array(); + /** @var bool */ private $disableTls = false; + /** @var string[] */ private $lastHeaders; - private $storeAuth; + /** @var bool */ + private $storeAuth = false; + /** @var AuthHelper */ private $authHelper; + /** @var bool */ private $degradedMode = false; + /** @var int */ private $redirects; + /** @var int */ private $maxRedirects = 20; + /** @var ProxyManager */ private $proxyManager; /** @@ -54,7 +74,7 @@ class RemoteFilesystem * * @param IOInterface $io The IO instance * @param Config $config The config - * @param array $options The options + * @param mixed[] $options The options * @param bool $disableTls * @param AuthHelper $authHelper */ @@ -80,11 +100,11 @@ public function __construct(IOInterface $io, Config $config, array $options = ar /** * Copy the remote file in local. * - * @param string $originUrl The origin URL - * @param string $fileUrl The file URL - * @param string $fileName the local filename - * @param bool $progress Display the progression - * @param array $options Additional context options + * @param string $originUrl The origin URL + * @param string $fileUrl The file URL + * @param string $fileName the local filename + * @param bool $progress Display the progression + * @param mixed[] $options Additional context options * * @return bool true */ @@ -96,10 +116,10 @@ public function copy($originUrl, $fileUrl, $fileName, $progress = true, $options /** * Get the content. * - * @param string $originUrl The origin URL - * @param string $fileUrl The file URL - * @param bool $progress Display the progression - * @param array $options Additional context options + * @param string $originUrl The origin URL + * @param string $fileUrl The file URL + * @param bool $progress Display the progression + * @param mixed[] $options Additional context options * * @return bool|string The content */ @@ -111,7 +131,7 @@ public function getContents($originUrl, $fileUrl, $progress = true, $options = a /** * Retrieve the options set in the constructor * - * @return array Options + * @return mixed[] Options */ public function getOptions() { @@ -121,7 +141,8 @@ public function getOptions() /** * Merges new options * - * @param array $options + * @param mixed[] $options + * @return void */ public function setOptions(array $options) { @@ -141,7 +162,7 @@ public function isTlsDisabled() /** * Returns the headers of the last request * - * @return array + * @return string[] */ public function getLastHeaders() { @@ -149,7 +170,7 @@ public function getLastHeaders() } /** - * @param array $headers array of returned headers like from getLastHeaders() + * @param string[] $headers array of returned headers like from getLastHeaders() * @return int|null */ public static function findStatusCode(array $headers) @@ -167,7 +188,7 @@ public static function findStatusCode(array $headers) } /** - * @param array $headers array of returned headers like from getLastHeaders() + * @param string[] $headers array of returned headers like from getLastHeaders() * @return string|null */ public function findStatusMessage(array $headers) @@ -187,11 +208,11 @@ public function findStatusMessage(array $headers) /** * Get file content or copy action. * - * @param string $originUrl The origin URL - * @param string $fileUrl The file URL - * @param array $additionalOptions context options - * @param string $fileName the local filename - * @param bool $progress Display the progression + * @param string $originUrl The origin URL + * @param string $fileUrl The file URL + * @param mixed[] $additionalOptions context options + * @param string $fileName the local filename + * @param bool $progress Display the progression * * @throws TransportException|\Exception * @throws TransportException When the file could not be downloaded @@ -260,7 +281,7 @@ protected function get($originUrl, $fileUrl, $additionalOptions = array(), $file unset($origFileUrl, $proxy, $usingProxy); // Check for secure HTTP, but allow insecure Packagist calls to $hashed providers as file integrity is verified with sha256 - if ((!preg_match('{^http://(repo\.)?packagist\.org/p/}', $fileUrl) || (false === strpos($fileUrl, '$') && false === strpos($fileUrl, '%24'))) && empty($degradedPackagist) && $this->config) { + if ((!preg_match('{^http://(repo\.)?packagist\.org/p/}', $fileUrl) || (false === strpos($fileUrl, '$') && false === strpos($fileUrl, '%24'))) && empty($degradedPackagist)) { $this->config->prohibitUrlByConfig($fileUrl, $this->io); } @@ -375,7 +396,7 @@ protected function get($originUrl, $fileUrl, $additionalOptions = array(), $file // check for gitlab 404 when downloading archives if ($statusCode === 404 - && $this->config && in_array($originUrl, $this->config->get('gitlab-domains'), true) + && in_array($originUrl, $this->config->get('gitlab-domains'), true) && false !== strpos($fileUrl, 'archive.zip') ) { $result = false; @@ -493,7 +514,7 @@ protected function get($originUrl, $fileUrl, $additionalOptions = array(), $file $result = $this->get($this->originUrl, $this->fileUrl, $additionalOptions, $this->fileName, $this->progress); - if ($this->storeAuth && $this->config) { + if ($this->storeAuth) { $this->authHelper->storeAuth($this->originUrl, $this->storeAuth); $this->storeAuth = false; } @@ -596,7 +617,7 @@ protected function callbackGet($notificationCode, $severity, $message, $messageC case STREAM_NOTIFY_PROGRESS: if ($this->bytesMax > 0 && $this->progress) { - $progression = min(100, round($bytesTransferred / $this->bytesMax * 100)); + $progression = min(100, (int) round($bytesTransferred / $this->bytesMax * 100)); if ((0 === $progression % 5) && 100 !== $progression && $progression !== $this->lastProgress) { $this->lastProgress = $progression; @@ -741,6 +762,8 @@ private function handleRedirect(array $http_response_header, array $additionalOp * Fetch certificate common name and fingerprint for validation of SAN. * * @todo Remove when PHP 5.6 is minimum supported version. + * + * @return ?array{cn: string, fp: string} */ private function getCertificateCnAndFp($url, $options) { @@ -761,7 +784,7 @@ private function getCertificateCnAndFp($url, $options) // Ideally this would just use stream_socket_client() to avoid sending a // HTTP request but that does not capture the certificate. if (false === $handle = @fopen($url, 'rb', false, $context)) { - return; + return null; } // Close non authenticated connection without reading any content. @@ -780,6 +803,8 @@ private function getCertificateCnAndFp($url, $options) ); } } + + return null; } private function getUrlAuthority($url) diff --git a/app/vendor/composer/composer/src/Composer/Util/Silencer.php b/app/vendor/composer/composer/src/Composer/Util/Silencer.php index dcb362b52..361ef41f6 100644 --- a/app/vendor/composer/composer/src/Composer/Util/Silencer.php +++ b/app/vendor/composer/composer/src/Composer/Util/Silencer.php @@ -44,6 +44,8 @@ public static function suppress($mask = null) /** * Restores a single state. + * + * @return void */ public static function restore() { diff --git a/app/vendor/composer/composer/src/Composer/Util/StreamContextFactory.php b/app/vendor/composer/composer/src/Composer/Util/StreamContextFactory.php index 3542d55ed..9cab3b2fe 100644 --- a/app/vendor/composer/composer/src/Composer/Util/StreamContextFactory.php +++ b/app/vendor/composer/composer/src/Composer/Util/StreamContextFactory.php @@ -31,9 +31,9 @@ final class StreamContextFactory * Creates a context supporting HTTP proxies * * @param string $url URL the context is to be used for - * @phpstan-param array{http?: array{follow_location?: int, max_redirects?: int, header?: string|array}} $defaultOptions - * @param array $defaultOptions Options to merge with the default - * @param array $defaultParams Parameters to specify on the context + * @phpstan-param array{http?: array{follow_location?: int, max_redirects?: int, header?: string|array}} $defaultOptions + * @param mixed[] $defaultOptions Options to merge with the default + * @param mixed[] $defaultParams Parameters to specify on the context * @throws \RuntimeException if https proxy required and OpenSSL uninstalled * @return resource Default context */ @@ -57,9 +57,9 @@ public static function getContext($url, array $defaultOptions = array(), array $ } /** - * @param string $url - * @param array $options - * @param bool $forCurl When true, will not add proxy values as these are handled separately + * @param string $url + * @param mixed[] $options + * @param bool $forCurl When true, will not add proxy values as these are handled separately * @phpstan-return array{http: array{header: string[], proxy?: string, request_fulluri: bool}, ssl: array} * @return array formatted as a stream context array */ @@ -130,9 +130,9 @@ function_exists('php_uname') ? php_uname('r') : 'Unknown', } /** - * @param array $options + * @param mixed[] $options * - * @return array + * @return mixed[] */ public static function getTlsDefaults(array $options, LoggerInterface $logger = null) { @@ -239,8 +239,8 @@ public static function getTlsDefaults(array $options, LoggerInterface $logger = * This method fixes the array by moving the content-type header to the end * * @link https://bugs.php.net/bug.php?id=61548 - * @param string|array $header - * @return array + * @param string|string[] $header + * @return string[] */ private static function fixHttpHeaderField($header) { diff --git a/app/vendor/composer/composer/src/Composer/Util/Svn.php b/app/vendor/composer/composer/src/Composer/Util/Svn.php index 2f7d070ab..0bc489de6 100644 --- a/app/vendor/composer/composer/src/Composer/Util/Svn.php +++ b/app/vendor/composer/composer/src/Composer/Util/Svn.php @@ -24,7 +24,7 @@ class Svn const MAX_QTY_AUTH_TRIES = 5; /** - * @var array + * @var ?array{username: string, password: string} */ protected $credentials; @@ -82,6 +82,9 @@ public function __construct($url, IOInterface $io, Config $config, ProcessExecut $this->process = $process ?: new ProcessExecutor($io); } + /** + * @return void + */ public static function cleanEnv() { // clean up env for OSX, see https://github.com/composer/composer/issues/2146#issuecomment-35478940 @@ -127,6 +130,15 @@ public function executeLocal($command, $path, $cwd = null, $verbose = false) return $this->executeWithAuthRetry($command, $cwd, '', $path, $verbose); } + /** + * @param string $svnCommand + * @param string $cwd + * @param string $url + * @param string $path + * @param bool $verbose + * + * @return ?string + */ private function executeWithAuthRetry($svnCommand, $cwd, $url, $path, $verbose) { // Regenerate the command at each try, to use the newly user-provided credentials @@ -136,10 +148,10 @@ private function executeWithAuthRetry($svnCommand, $cwd, $url, $path, $verbose) $io = $this->io; $handler = function ($type, $buffer) use (&$output, $io, $verbose) { if ($type !== 'out') { - return; + return null; } if (strpos($buffer, 'Redirecting to URL ') === 0) { - return; + return null; } $output .= $buffer; if ($verbose) { @@ -178,7 +190,8 @@ private function executeWithAuthRetry($svnCommand, $cwd, $url, $path, $verbose) } /** - * @param bool $cacheCredentials + * @param bool $cacheCredentials + * @return void */ public function setCacheCredentials($cacheCredentials) { diff --git a/app/vendor/composer/composer/src/Composer/Util/SyncHelper.php b/app/vendor/composer/composer/src/Composer/Util/SyncHelper.php index a970028a9..9e8c5d710 100644 --- a/app/vendor/composer/composer/src/Composer/Util/SyncHelper.php +++ b/app/vendor/composer/composer/src/Composer/Util/SyncHelper.php @@ -28,6 +28,8 @@ class SyncHelper * @param string $path the installation path for the package * @param PackageInterface $package the package to install * @param PackageInterface|null $prevPackage the previous package if this is an update and not an initial installation + * + * @return void */ public static function downloadAndInstallPackageSync(Loop $loop, DownloaderInterface $downloader, $path, PackageInterface $package, PackageInterface $prevPackage = null) { @@ -39,7 +41,7 @@ public static function downloadAndInstallPackageSync(Loop $loop, DownloaderInter self::await($loop, $downloader->prepare($type, $package, $path, $prevPackage)); if ($type === 'update') { - self::await($loop, $downloader->update($package, $path, $prevPackage)); + self::await($loop, $downloader->update($package, $prevPackage, $path)); } else { self::await($loop, $downloader->install($package, $path)); } @@ -56,6 +58,8 @@ public static function downloadAndInstallPackageSync(Loop $loop, DownloaderInter * * @param Loop $loop Loop instance which you can get from $composer->getLoop() * @param PromiseInterface|null $promise + * + * @return void */ public static function await(Loop $loop, PromiseInterface $promise = null) { diff --git a/app/vendor/composer/composer/src/Composer/Util/TlsHelper.php b/app/vendor/composer/composer/src/Composer/Util/TlsHelper.php index 6fa70f0cc..01166d7b3 100644 --- a/app/vendor/composer/composer/src/Composer/Util/TlsHelper.php +++ b/app/vendor/composer/composer/src/Composer/Util/TlsHelper.php @@ -57,7 +57,7 @@ public static function checkCertificateHost($certificate, $hostname, &$cn = null * * @param mixed $certificate X.509 certificate * - * @return array|null + * @return array{cn: string, san: string[]}|null */ public static function getCertificateNames($certificate) { @@ -130,6 +130,9 @@ public static function getCertificateNames($certificate) * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * @param string $certificate + * @return string */ public static function getCertificateFingerprint($certificate) { diff --git a/app/vendor/composer/composer/src/Composer/Util/Url.php b/app/vendor/composer/composer/src/Composer/Util/Url.php index 26cf80f9b..7a281c924 100644 --- a/app/vendor/composer/composer/src/Composer/Util/Url.php +++ b/app/vendor/composer/composer/src/Composer/Util/Url.php @@ -103,6 +103,10 @@ public static function getOrigin(Config $config, $url) return $origin; } + /** + * @param string $url + * @return string + */ public static function sanitize($url) { // GitHub repository rename result in redirect locations containing the access_token as GET parameter @@ -110,8 +114,8 @@ public static function sanitize($url) $url = preg_replace('{([&?]access_token=)[^&]+}', '$1***', $url); $url = preg_replace_callback('{^(?P[a-z0-9]+://)?(?P[^:/\s@]+):(?P[^@\s/]+)@}i', function ($m) { - // if the username looks like a long (12char+) hex string, or a modern github token (e.g. gp1_xxx) we obfuscate that - if (preg_match('{^([a-f0-9]{12,}|g[a-z]\d_[a-zA-Z0-9_]+)$}', $m['user'])) { + // if the username looks like a long (12char+) hex string, or a modern github token (e.g. ghp_xxx) we obfuscate that + if (preg_match('{^([a-f0-9]{12,}|gh[a-z]_[a-zA-Z0-9_]+)$}', $m['user'])) { return $m['prefix'].'***:***@'; } diff --git a/app/vendor/composer/composer/src/bootstrap.php b/app/vendor/composer/composer/src/bootstrap.php index a3832ce1d..9b33ec1b0 100644 --- a/app/vendor/composer/composer/src/bootstrap.php +++ b/app/vendor/composer/composer/src/bootstrap.php @@ -10,9 +10,13 @@ * file that was distributed with this source code. */ +/** + * @param string $file + * @return ?\Composer\Autoload\ClassLoader + */ function includeIfExists($file) { - return file_exists($file) ? include $file : false; + return file_exists($file) ? include $file : null; } if ((!$loader = includeIfExists(__DIR__.'/../vendor/autoload.php')) && (!$loader = includeIfExists(__DIR__.'/../../../autoload.php'))) { diff --git a/app/vendor/composer/installed.json b/app/vendor/composer/installed.json index a19225315..085677a9c 100644 --- a/app/vendor/composer/installed.json +++ b/app/vendor/composer/installed.json @@ -48,17 +48,17 @@ }, { "name": "cakephp/bake", - "version": "2.5.1", - "version_normalized": "2.5.1.0", + "version": "2.5.2", + "version_normalized": "2.5.2.0", "source": { "type": "git", "url": "https://github.com/cakephp/bake.git", - "reference": "5cec940065af0846dd58b6dcfd6cb4f8d321ccce" + "reference": "bfb856afcfbc70c5cf5341669c3036a45ca15d94" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cakephp/bake/zipball/5cec940065af0846dd58b6dcfd6cb4f8d321ccce", - "reference": "5cec940065af0846dd58b6dcfd6cb4f8d321ccce", + "url": "https://api.github.com/repos/cakephp/bake/zipball/bfb856afcfbc70c5cf5341669c3036a45ca15d94", + "reference": "bfb856afcfbc70c5cf5341669c3036a45ca15d94", "shasum": "" }, "require": { @@ -73,7 +73,7 @@ "cakephp/plugin-installer": "^1.3", "phpunit/phpunit": "~8.5.0" }, - "time": "2021-04-30T13:52:48+00:00", + "time": "2021-07-26T14:56:18+00:00", "type": "cakephp-plugin", "installation-source": "dist", "autoload": { @@ -107,17 +107,17 @@ }, { "name": "cakephp/cakephp", - "version": "4.2.7", - "version_normalized": "4.2.7.0", + "version": "4.2.9", + "version_normalized": "4.2.9.0", "source": { "type": "git", "url": "https://github.com/cakephp/cakephp.git", - "reference": "bd2d476e0b14b21c6103eca789667a016ec14458" + "reference": "6cb068fd328219d79a02ef6df439b73459071368" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cakephp/cakephp/zipball/bd2d476e0b14b21c6103eca789667a016ec14458", - "reference": "bd2d476e0b14b21c6103eca789667a016ec14458", + "url": "https://api.github.com/repos/cakephp/cakephp/zipball/6cb068fd328219d79a02ef6df439b73459071368", + "reference": "6cb068fd328219d79a02ef6df439b73459071368", "shasum": "" }, "require": { @@ -165,7 +165,7 @@ "lib-ICU": "The intl PHP library, to use Text::transliterate() or Text::slug()", "paragonie/csp-builder": "CSP builder, to use the CSP Middleware" }, - "time": "2021-06-16T21:23:42+00:00", + "time": "2021-09-11T00:24:13+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -330,17 +330,17 @@ }, { "name": "cakephp/debug_kit", - "version": "4.4.3", - "version_normalized": "4.4.3.0", + "version": "4.4.4", + "version_normalized": "4.4.4.0", "source": { "type": "git", "url": "https://github.com/cakephp/debug_kit.git", - "reference": "d8a5552096b09a1cdf192b454ec06dc0157a3515" + "reference": "10d7d9ba36945844211f1d8763e59618917e1784" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cakephp/debug_kit/zipball/d8a5552096b09a1cdf192b454ec06dc0157a3515", - "reference": "d8a5552096b09a1cdf192b454ec06dc0157a3515", + "url": "https://api.github.com/repos/cakephp/debug_kit/zipball/10d7d9ba36945844211f1d8763e59618917e1784", + "reference": "10d7d9ba36945844211f1d8763e59618917e1784", "shasum": "" }, "require": { @@ -358,7 +358,7 @@ "suggest": { "ext-pdo_sqlite": "DebugKit needs to store panel data in a database. SQLite is simple and easy to use." }, - "time": "2021-05-09T01:21:26+00:00", + "time": "2021-09-12T20:06:14+00:00", "type": "cakephp-plugin", "installation-source": "dist", "autoload": { @@ -514,17 +514,17 @@ }, { "name": "cakephp/twig-view", - "version": "1.2.0", - "version_normalized": "1.2.0.0", + "version": "1.3.0", + "version_normalized": "1.3.0.0", "source": { "type": "git", "url": "https://github.com/cakephp/twig-view.git", - "reference": "668dd6aee43dd616b1e83cb9ba166f094c10fbce" + "reference": "14df50360b809a171d0688020fbdfe513763f89b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cakephp/twig-view/zipball/668dd6aee43dd616b1e83cb9ba166f094c10fbce", - "reference": "668dd6aee43dd616b1e83cb9ba166f094c10fbce", + "url": "https://api.github.com/repos/cakephp/twig-view/zipball/14df50360b809a171d0688020fbdfe513763f89b", + "reference": "14df50360b809a171d0688020fbdfe513763f89b", "shasum": "" }, "require": { @@ -545,7 +545,7 @@ "mikey179/vfsstream": "^1.6", "phpunit/phpunit": "^8.5 || ^9.3" }, - "time": "2020-12-13T19:57:31+00:00", + "time": "2021-09-17T14:07:52+00:00", "type": "cakephp-plugin", "installation-source": "dist", "autoload": { @@ -580,17 +580,17 @@ }, { "name": "composer/ca-bundle", - "version": "1.2.10", - "version_normalized": "1.2.10.0", + "version": "1.2.11", + "version_normalized": "1.2.11.0", "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", - "reference": "9fdb22c2e97a614657716178093cd1da90a64aa8" + "reference": "0b072d51c5a9c6f3412f7ea3ab043d6603cb2582" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/9fdb22c2e97a614657716178093cd1da90a64aa8", - "reference": "9fdb22c2e97a614657716178093cd1da90a64aa8", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/0b072d51c5a9c6f3412f7ea3ab043d6603cb2582", + "reference": "0b072d51c5a9c6f3412f7ea3ab043d6603cb2582", "shasum": "" }, "require": { @@ -602,9 +602,9 @@ "phpstan/phpstan": "^0.12.55", "psr/log": "^1.0", "symfony/phpunit-bridge": "^4.2 || ^5", - "symfony/process": "^2.5 || ^3.0 || ^4.0 || ^5.0" + "symfony/process": "^2.5 || ^3.0 || ^4.0 || ^5.0 || ^6.0" }, - "time": "2021-06-07T13:58:28+00:00", + "time": "2021-09-25T20:32:43+00:00", "type": "library", "extra": { "branch-alias": { @@ -639,7 +639,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/ca-bundle/issues", - "source": "https://github.com/composer/ca-bundle/tree/1.2.10" + "source": "https://github.com/composer/ca-bundle/tree/1.2.11" }, "funding": [ { @@ -659,17 +659,17 @@ }, { "name": "composer/composer", - "version": "2.1.3", - "version_normalized": "2.1.3.0", + "version": "2.1.9", + "version_normalized": "2.1.9.0", "source": { "type": "git", "url": "https://github.com/composer/composer.git", - "reference": "fc5c4573aafce3a018eb7f1f8f91cea423970f2e" + "reference": "e558c88f28d102d497adec4852802c0dc14c7077" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/composer/zipball/fc5c4573aafce3a018eb7f1f8f91cea423970f2e", - "reference": "fc5c4573aafce3a018eb7f1f8f91cea423970f2e", + "url": "https://api.github.com/repos/composer/composer/zipball/e558c88f28d102d497adec4852802c0dc14c7077", + "reference": "e558c88f28d102d497adec4852802c0dc14c7077", "shasum": "" }, "require": { @@ -678,7 +678,7 @@ "composer/semver": "^3.0", "composer/spdx-licenses": "^1.2", "composer/xdebug-handler": "^2.0", - "justinrainbow/json-schema": "^5.2.10", + "justinrainbow/json-schema": "^5.2.11", "php": "^5.3.2 || ^7.0 || ^8.0", "psr/log": "^1.0", "react/promise": "^1.2 || ^2.7", @@ -698,7 +698,7 @@ "ext-zip": "Enabling the zip extension allows you to unzip archives", "ext-zlib": "Allow gzip compression of HTTP requests" }, - "time": "2021-06-09T14:31:20+00:00", + "time": "2021-10-05T07:47:38+00:00", "bin": [ "bin/composer" ], @@ -738,9 +738,9 @@ "package" ], "support": { - "irc": "irc://irc.freenode.org/composer", + "irc": "ircs://irc.libera.chat:6697/composer", "issues": "https://github.com/composer/composer/issues", - "source": "https://github.com/composer/composer/tree/2.1.3" + "source": "https://github.com/composer/composer/tree/2.1.9" }, "funding": [ { @@ -830,6 +830,82 @@ ], "install-path": "./metadata-minifier" }, + { + "name": "composer/package-versions-deprecated", + "version": "1.11.99.4", + "version_normalized": "1.11.99.4", + "source": { + "type": "git", + "url": "https://github.com/composer/package-versions-deprecated.git", + "reference": "b174585d1fe49ceed21928a945138948cb394600" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/package-versions-deprecated/zipball/b174585d1fe49ceed21928a945138948cb394600", + "reference": "b174585d1fe49ceed21928a945138948cb394600", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.1.0 || ^2.0", + "php": "^7 || ^8" + }, + "replace": { + "ocramius/package-versions": "1.11.99" + }, + "require-dev": { + "composer/composer": "^1.9.3 || ^2.0@dev", + "ext-zip": "^1.13", + "phpunit/phpunit": "^6.5 || ^7" + }, + "time": "2021-09-13T08:41:34+00:00", + "type": "composer-plugin", + "extra": { + "class": "PackageVersions\\Installer", + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "PackageVersions\\": "src/PackageVersions" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be" + } + ], + "description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)", + "support": { + "issues": "https://github.com/composer/package-versions-deprecated/issues", + "source": "https://github.com/composer/package-versions-deprecated/tree/1.11.99.4" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "install-path": "./package-versions-deprecated" + }, { "name": "composer/semver", "version": "3.2.5", @@ -998,28 +1074,28 @@ }, { "name": "composer/xdebug-handler", - "version": "2.0.1", - "version_normalized": "2.0.1.0", + "version": "2.0.2", + "version_normalized": "2.0.2.0", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "964adcdd3a28bf9ed5d9ac6450064e0d71ed7496" + "reference": "84674dd3a7575ba617f5a76d7e9e29a7d3891339" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/964adcdd3a28bf9ed5d9ac6450064e0d71ed7496", - "reference": "964adcdd3a28bf9ed5d9ac6450064e0d71ed7496", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/84674dd3a7575ba617f5a76d7e9e29a7d3891339", + "reference": "84674dd3a7575ba617f5a76d7e9e29a7d3891339", "shasum": "" }, "require": { "php": "^5.3.2 || ^7.0 || ^8.0", - "psr/log": "^1.0" + "psr/log": "^1 || ^2 || ^3" }, "require-dev": { "phpstan/phpstan": "^0.12.55", "symfony/phpunit-bridge": "^4.2 || ^5" }, - "time": "2021-05-05T19:37:51+00:00", + "time": "2021-07-31T17:03:58+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -1045,7 +1121,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/xdebug-handler/issues", - "source": "https://github.com/composer/xdebug-handler/tree/2.0.1" + "source": "https://github.com/composer/xdebug-handler/tree/2.0.2" }, "funding": [ { @@ -1136,6 +1212,363 @@ }, "install-path": "../dealerdirect/phpcodesniffer-composer-installer" }, + { + "name": "doctrine/cache", + "version": "2.1.1", + "version_normalized": "2.1.1.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/cache.git", + "reference": "331b4d5dbaeab3827976273e9356b3b453c300ce" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/cache/zipball/331b4d5dbaeab3827976273e9356b3b453c300ce", + "reference": "331b4d5dbaeab3827976273e9356b3b453c300ce", + "shasum": "" + }, + "require": { + "php": "~7.1 || ^8.0" + }, + "conflict": { + "doctrine/common": ">2.2,<2.4" + }, + "require-dev": { + "alcaeus/mongo-php-adapter": "^1.1", + "cache/integration-tests": "dev-master", + "doctrine/coding-standard": "^8.0", + "mongodb/mongodb": "^1.1", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0", + "predis/predis": "~1.0", + "psr/cache": "^1.0 || ^2.0 || ^3.0", + "symfony/cache": "^4.4 || ^5.2 || ^6.0@dev", + "symfony/var-exporter": "^4.4 || ^5.2 || ^6.0@dev" + }, + "suggest": { + "alcaeus/mongo-php-adapter": "Required to use legacy MongoDB driver" + }, + "time": "2021-07-17T14:49:29+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Doctrine\\Common\\Cache\\": "lib/Doctrine/Common/Cache" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "PHP Doctrine Cache library is a popular cache implementation that supports many different drivers such as redis, memcache, apc, mongodb and others.", + "homepage": "https://www.doctrine-project.org/projects/cache.html", + "keywords": [ + "abstraction", + "apcu", + "cache", + "caching", + "couchdb", + "memcached", + "php", + "redis", + "xcache" + ], + "support": { + "issues": "https://github.com/doctrine/cache/issues", + "source": "https://github.com/doctrine/cache/tree/2.1.1" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fcache", + "type": "tidelift" + } + ], + "install-path": "../doctrine/cache" + }, + { + "name": "doctrine/dbal", + "version": "3.1.3", + "version_normalized": "3.1.3.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/dbal.git", + "reference": "96b0053775a544b4a6ab47654dac0621be8b4cf8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/dbal/zipball/96b0053775a544b4a6ab47654dac0621be8b4cf8", + "reference": "96b0053775a544b4a6ab47654dac0621be8b4cf8", + "shasum": "" + }, + "require": { + "composer/package-versions-deprecated": "^1.11.99", + "doctrine/cache": "^1.0|^2.0", + "doctrine/deprecations": "^0.5.3", + "doctrine/event-manager": "^1.0", + "php": "^7.3 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "9.0.0", + "jetbrains/phpstorm-stubs": "2021.1", + "phpstan/phpstan": "0.12.99", + "phpstan/phpstan-strict-rules": "^0.12.11", + "phpunit/phpunit": "9.5.10", + "psalm/plugin-phpunit": "0.16.1", + "squizlabs/php_codesniffer": "3.6.0", + "symfony/cache": "^5.2|^6.0", + "symfony/console": "^2.0.5|^3.0|^4.0|^5.0|^6.0", + "vimeo/psalm": "4.10.0" + }, + "suggest": { + "symfony/console": "For helpful console commands such as SQL execution and import of files." + }, + "time": "2021-10-02T16:15:05+00:00", + "bin": [ + "bin/doctrine-dbal" + ], + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Doctrine\\DBAL\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + } + ], + "description": "Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection and management.", + "homepage": "https://www.doctrine-project.org/projects/dbal.html", + "keywords": [ + "abstraction", + "database", + "db2", + "dbal", + "mariadb", + "mssql", + "mysql", + "oci8", + "oracle", + "pdo", + "pgsql", + "postgresql", + "queryobject", + "sasql", + "sql", + "sqlite", + "sqlserver", + "sqlsrv" + ], + "support": { + "issues": "https://github.com/doctrine/dbal/issues", + "source": "https://github.com/doctrine/dbal/tree/3.1.3" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fdbal", + "type": "tidelift" + } + ], + "install-path": "../doctrine/dbal" + }, + { + "name": "doctrine/deprecations", + "version": "v0.5.3", + "version_normalized": "0.5.3.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/deprecations.git", + "reference": "9504165960a1f83cc1480e2be1dd0a0478561314" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/deprecations/zipball/9504165960a1f83cc1480e2be1dd0a0478561314", + "reference": "9504165960a1f83cc1480e2be1dd0a0478561314", + "shasum": "" + }, + "require": { + "php": "^7.1|^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^6.0|^7.0|^8.0", + "phpunit/phpunit": "^7.0|^8.0|^9.0", + "psr/log": "^1.0" + }, + "suggest": { + "psr/log": "Allows logging deprecations via PSR-3 logger implementation" + }, + "time": "2021-03-21T12:59:47+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.", + "homepage": "https://www.doctrine-project.org/", + "support": { + "issues": "https://github.com/doctrine/deprecations/issues", + "source": "https://github.com/doctrine/deprecations/tree/v0.5.3" + }, + "install-path": "../doctrine/deprecations" + }, + { + "name": "doctrine/event-manager", + "version": "1.1.1", + "version_normalized": "1.1.1.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/event-manager.git", + "reference": "41370af6a30faa9dc0368c4a6814d596e81aba7f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/event-manager/zipball/41370af6a30faa9dc0368c4a6814d596e81aba7f", + "reference": "41370af6a30faa9dc0368c4a6814d596e81aba7f", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "conflict": { + "doctrine/common": "<2.9@dev" + }, + "require-dev": { + "doctrine/coding-standard": "^6.0", + "phpunit/phpunit": "^7.0" + }, + "time": "2020-05-29T18:28:51+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Doctrine\\Common\\": "lib/Doctrine/Common" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + }, + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com" + } + ], + "description": "The Doctrine Event Manager is a simple PHP event system that was built to be used with the various Doctrine projects.", + "homepage": "https://www.doctrine-project.org/projects/event-manager.html", + "keywords": [ + "event", + "event dispatcher", + "event manager", + "event system", + "events" + ], + "support": { + "issues": "https://github.com/doctrine/event-manager/issues", + "source": "https://github.com/doctrine/event-manager/tree/1.1.x" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fevent-manager", + "type": "tidelift" + } + ], + "install-path": "../doctrine/event-manager" + }, { "name": "doctrine/instantiator", "version": "1.4.0", @@ -1394,17 +1827,17 @@ }, { "name": "justinrainbow/json-schema", - "version": "5.2.10", - "version_normalized": "5.2.10.0", + "version": "5.2.11", + "version_normalized": "5.2.11.0", "source": { "type": "git", "url": "https://github.com/justinrainbow/json-schema.git", - "reference": "2ba9c8c862ecd5510ed16c6340aa9f6eadb4f31b" + "reference": "2ab6744b7296ded80f8cc4f9509abbff393399aa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/2ba9c8c862ecd5510ed16c6340aa9f6eadb4f31b", - "reference": "2ba9c8c862ecd5510ed16c6340aa9f6eadb4f31b", + "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/2ab6744b7296ded80f8cc4f9509abbff393399aa", + "reference": "2ab6744b7296ded80f8cc4f9509abbff393399aa", "shasum": "" }, "require": { @@ -1415,7 +1848,7 @@ "json-schema/json-schema-test-suite": "1.2.0", "phpunit/phpunit": "^4.8.35" }, - "time": "2020-05-27T16:41:55+00:00", + "time": "2021-07-22T09:24:00+00:00", "bin": [ "bin/validate-json" ], @@ -1461,41 +1894,38 @@ ], "support": { "issues": "https://github.com/justinrainbow/json-schema/issues", - "source": "https://github.com/justinrainbow/json-schema/tree/5.2.10" + "source": "https://github.com/justinrainbow/json-schema/tree/5.2.11" }, "install-path": "../justinrainbow/json-schema" }, { "name": "laminas/laminas-diactoros", - "version": "2.6.0", - "version_normalized": "2.6.0.0", + "version": "2.8.0", + "version_normalized": "2.8.0.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-diactoros.git", - "reference": "7d2034110ae18afe05050b796a3ee4b3fe177876" + "reference": "0c26ef1d95b6d7e6e3943a243ba3dc0797227199" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-diactoros/zipball/7d2034110ae18afe05050b796a3ee4b3fe177876", - "reference": "7d2034110ae18afe05050b796a3ee4b3fe177876", + "url": "https://api.github.com/repos/laminas/laminas-diactoros/zipball/0c26ef1d95b6d7e6e3943a243ba3dc0797227199", + "reference": "0c26ef1d95b6d7e6e3943a243ba3dc0797227199", "shasum": "" }, "require": { - "laminas/laminas-zendframework-bridge": "^1.0", - "php": "^7.3 || ~8.0.0", + "php": "^7.3 || ~8.0.0 || ~8.1.0", "psr/http-factory": "^1.0", "psr/http-message": "^1.0" }, "conflict": { - "phpspec/prophecy": "<1.9.0" + "phpspec/prophecy": "<1.9.0", + "zendframework/zend-diactoros": "*" }, "provide": { "psr/http-factory-implementation": "1.0", "psr/http-message-implementation": "1.0" }, - "replace": { - "zendframework/zend-diactoros": "^2.2.1" - }, "require-dev": { "ext-curl": "*", "ext-dom": "*", @@ -1509,7 +1939,7 @@ "psalm/plugin-phpunit": "^0.14.0", "vimeo/psalm": "^4.3" }, - "time": "2021-05-18T14:41:54+00:00", + "time": "2021-09-22T03:54:36+00:00", "type": "library", "extra": { "laminas": { @@ -1572,22 +2002,22 @@ }, { "name": "laminas/laminas-httphandlerrunner", - "version": "1.4.0", - "version_normalized": "1.4.0.0", + "version": "1.5.0", + "version_normalized": "1.5.0.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-httphandlerrunner.git", - "reference": "6a2dd33e4166469ade07ad1283b45924383b224b" + "reference": "5f94e55d93f756e8ad07b9049aeb3d6d84582d0e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-httphandlerrunner/zipball/6a2dd33e4166469ade07ad1283b45924383b224b", - "reference": "6a2dd33e4166469ade07ad1283b45924383b224b", + "url": "https://api.github.com/repos/laminas/laminas-httphandlerrunner/zipball/5f94e55d93f756e8ad07b9049aeb3d6d84582d0e", + "reference": "5f94e55d93f756e8ad07b9049aeb3d6d84582d0e", "shasum": "" }, "require": { "laminas/laminas-zendframework-bridge": "^1.0", - "php": "^7.3 || ~8.0.0", + "php": "^7.3 || ~8.0.0 || ~8.1.0", "psr/http-message": "^1.0", "psr/http-message-implementation": "^1.0", "psr/http-server-handler": "^1.0" @@ -1597,12 +2027,12 @@ }, "require-dev": { "laminas/laminas-coding-standard": "~1.0.0", - "laminas/laminas-diactoros": "^2.1.1", - "phpunit/phpunit": "^9.3", - "psalm/plugin-phpunit": "^0.15.1", - "vimeo/psalm": "^4.6" + "laminas/laminas-diactoros": "^2.8.0", + "phpunit/phpunit": "^9.5.9", + "psalm/plugin-phpunit": "^0.16.1", + "vimeo/psalm": "^4.10.0" }, - "time": "2021-04-08T13:52:56+00:00", + "time": "2021-09-22T09:17:54+00:00", "type": "library", "extra": { "laminas": { @@ -1646,29 +2076,29 @@ }, { "name": "laminas/laminas-zendframework-bridge", - "version": "1.3.0", - "version_normalized": "1.3.0.0", + "version": "1.4.0", + "version_normalized": "1.4.0.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-zendframework-bridge.git", - "reference": "13af2502d9bb6f7d33be2de4b51fb68c6cdb476e" + "reference": "bf180a382393e7db5c1e8d0f2ec0c4af9c724baf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-zendframework-bridge/zipball/13af2502d9bb6f7d33be2de4b51fb68c6cdb476e", - "reference": "13af2502d9bb6f7d33be2de4b51fb68c6cdb476e", + "url": "https://api.github.com/repos/laminas/laminas-zendframework-bridge/zipball/bf180a382393e7db5c1e8d0f2ec0c4af9c724baf", + "reference": "bf180a382393e7db5c1e8d0f2ec0c4af9c724baf", "shasum": "" }, "require": { - "php": "^7.3 || ^8.0" + "php": "^7.3 || ~8.0.0 || ~8.1.0" }, "require-dev": { - "phpunit/phpunit": "^5.7 || ^6.5 || ^7.5 || ^8.1 || ^9.3", + "phpunit/phpunit": "^9.3", "psalm/plugin-phpunit": "^0.15.1", "squizlabs/php_codesniffer": "^3.5", "vimeo/psalm": "^4.6" }, - "time": "2021-06-24T12:49:22+00:00", + "time": "2021-09-03T17:53:30+00:00", "type": "library", "extra": { "laminas": { @@ -1984,17 +2414,17 @@ }, { "name": "nikic/php-parser", - "version": "v4.11.0", - "version_normalized": "4.11.0.0", + "version": "v4.13.0", + "version_normalized": "4.13.0.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "fe14cf3672a149364fb66dfe11bf6549af899f94" + "reference": "50953a2691a922aa1769461637869a0a2faa3f53" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/fe14cf3672a149364fb66dfe11bf6549af899f94", - "reference": "fe14cf3672a149364fb66dfe11bf6549af899f94", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/50953a2691a922aa1769461637869a0a2faa3f53", + "reference": "50953a2691a922aa1769461637869a0a2faa3f53", "shasum": "" }, "require": { @@ -2005,7 +2435,7 @@ "ircmaxell/php-yacc": "^0.0.7", "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" }, - "time": "2021-07-03T13:36:55+00:00", + "time": "2021-09-20T12:20:58+00:00", "bin": [ "bin/php-parse" ], @@ -2037,23 +2467,23 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.11.0" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.13.0" }, "install-path": "../nikic/php-parser" }, { "name": "phar-io/manifest", - "version": "2.0.1", - "version_normalized": "2.0.1.0", + "version": "2.0.3", + "version_normalized": "2.0.3.0", "source": { "type": "git", "url": "https://github.com/phar-io/manifest.git", - "reference": "85265efd3af7ba3ca4b2a2c34dbfc5788dd29133" + "reference": "97803eca37d319dfa7826cc2437fc020857acb53" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/85265efd3af7ba3ca4b2a2c34dbfc5788dd29133", - "reference": "85265efd3af7ba3ca4b2a2c34dbfc5788dd29133", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", + "reference": "97803eca37d319dfa7826cc2437fc020857acb53", "shasum": "" }, "require": { @@ -2063,7 +2493,7 @@ "phar-io/version": "^3.0.1", "php": "^7.2 || ^8.0" }, - "time": "2020-06-27T14:33:11+00:00", + "time": "2021-07-20T11:28:43+00:00", "type": "library", "extra": { "branch-alias": { @@ -2100,7 +2530,7 @@ "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", "support": { "issues": "https://github.com/phar-io/manifest/issues", - "source": "https://github.com/phar-io/manifest/tree/master" + "source": "https://github.com/phar-io/manifest/tree/2.0.3" }, "install-path": "../phar-io/manifest" }, @@ -2275,17 +2705,17 @@ }, { "name": "phpdocumentor/type-resolver", - "version": "1.4.0", - "version_normalized": "1.4.0.0", + "version": "1.5.1", + "version_normalized": "1.5.1.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0" + "reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0", - "reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/a12f7e301eb7258bb68acd89d4aefa05c2906cae", + "reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae", "shasum": "" }, "require": { @@ -2293,9 +2723,10 @@ "phpdocumentor/reflection-common": "^2.0" }, "require-dev": { - "ext-tokenizer": "*" + "ext-tokenizer": "*", + "psalm/phar": "^4.8" }, - "time": "2020-09-17T18:55:26+00:00", + "time": "2021-10-02T14:08:47+00:00", "type": "library", "extra": { "branch-alias": { @@ -2321,41 +2752,41 @@ "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", "support": { "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.4.0" + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.5.1" }, "install-path": "../phpdocumentor/type-resolver" }, { "name": "phpspec/prophecy", - "version": "1.13.0", - "version_normalized": "1.13.0.0", + "version": "1.14.0", + "version_normalized": "1.14.0.0", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "be1996ed8adc35c3fd795488a653f4b518be70ea" + "reference": "d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/be1996ed8adc35c3fd795488a653f4b518be70ea", - "reference": "be1996ed8adc35c3fd795488a653f4b518be70ea", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e", + "reference": "d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e", "shasum": "" }, "require": { "doctrine/instantiator": "^1.2", - "php": "^7.2 || ~8.0, <8.1", + "php": "^7.2 || ~8.0, <8.2", "phpdocumentor/reflection-docblock": "^5.2", "sebastian/comparator": "^3.0 || ^4.0", "sebastian/recursion-context": "^3.0 || ^4.0" }, "require-dev": { - "phpspec/phpspec": "^6.0", + "phpspec/phpspec": "^6.0 || ^7.0", "phpunit/phpunit": "^8.0 || ^9.0" }, - "time": "2021-03-17T13:42:18+00:00", + "time": "2021-09-10T09:02:12+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "1.11.x-dev" + "dev-master": "1.x-dev" } }, "installation-source": "dist", @@ -2391,7 +2822,7 @@ ], "support": { "issues": "https://github.com/phpspec/prophecy/issues", - "source": "https://github.com/phpspec/prophecy/tree/1.13.0" + "source": "https://github.com/phpspec/prophecy/tree/1.14.0" }, "install-path": "../phpspec/prophecy" }, @@ -2453,24 +2884,24 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.2.6", - "version_normalized": "9.2.6.0", + "version": "9.2.7", + "version_normalized": "9.2.7.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "f6293e1b30a2354e8428e004689671b83871edde" + "reference": "d4c798ed8d51506800b441f7a13ecb0f76f12218" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/f6293e1b30a2354e8428e004689671b83871edde", - "reference": "f6293e1b30a2354e8428e004689671b83871edde", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/d4c798ed8d51506800b441f7a13ecb0f76f12218", + "reference": "d4c798ed8d51506800b441f7a13ecb0f76f12218", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.10.2", + "nikic/php-parser": "^4.12.0", "php": ">=7.3", "phpunit/php-file-iterator": "^3.0.3", "phpunit/php-text-template": "^2.0.2", @@ -2488,7 +2919,7 @@ "ext-pcov": "*", "ext-xdebug": "*" }, - "time": "2021-03-28T07:26:59+00:00", + "time": "2021-09-17T05:39:03+00:00", "type": "library", "extra": { "branch-alias": { @@ -2521,7 +2952,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.6" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.7" }, "funding": [ { @@ -2786,17 +3217,17 @@ }, { "name": "phpunit/phpunit", - "version": "9.5.6", - "version_normalized": "9.5.6.0", + "version": "9.5.10", + "version_normalized": "9.5.10.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "fb9b8333f14e3dce976a60ef6a7e05c7c7ed8bfb" + "reference": "c814a05837f2edb0d1471d6e3f4ab3501ca3899a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/fb9b8333f14e3dce976a60ef6a7e05c7c7ed8bfb", - "reference": "fb9b8333f14e3dce976a60ef6a7e05c7c7ed8bfb", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c814a05837f2edb0d1471d6e3f4ab3501ca3899a", + "reference": "c814a05837f2edb0d1471d6e3f4ab3501ca3899a", "shasum": "" }, "require": { @@ -2808,11 +3239,11 @@ "ext-xml": "*", "ext-xmlwriter": "*", "myclabs/deep-copy": "^1.10.1", - "phar-io/manifest": "^2.0.1", + "phar-io/manifest": "^2.0.3", "phar-io/version": "^3.0.2", "php": ">=7.3", "phpspec/prophecy": "^1.12.1", - "phpunit/php-code-coverage": "^9.2.3", + "phpunit/php-code-coverage": "^9.2.7", "phpunit/php-file-iterator": "^3.0.5", "phpunit/php-invoker": "^3.1.1", "phpunit/php-text-template": "^2.0.3", @@ -2837,7 +3268,7 @@ "ext-soap": "*", "ext-xdebug": "*" }, - "time": "2021-06-23T05:14:38+00:00", + "time": "2021-09-25T07:38:51+00:00", "bin": [ "phpunit" ], @@ -2876,7 +3307,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.6" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.10" }, "funding": [ { @@ -3339,17 +3770,17 @@ }, { "name": "psy/psysh", - "version": "v0.10.8", - "version_normalized": "0.10.8.0", + "version": "v0.10.9", + "version_normalized": "0.10.9.0", "source": { "type": "git", "url": "https://github.com/bobthecow/psysh.git", - "reference": "e4573f47750dd6c92dca5aee543fa77513cbd8d3" + "reference": "01281336c4ae557fe4a994544f30d3a1bc204375" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bobthecow/psysh/zipball/e4573f47750dd6c92dca5aee543fa77513cbd8d3", - "reference": "e4573f47750dd6c92dca5aee543fa77513cbd8d3", + "url": "https://api.github.com/repos/bobthecow/psysh/zipball/01281336c4ae557fe4a994544f30d3a1bc204375", + "reference": "01281336c4ae557fe4a994544f30d3a1bc204375", "shasum": "" }, "require": { @@ -3371,7 +3802,7 @@ "ext-readline": "Enables support for arrow-key history navigation, and showing and manipulating command history.", "hoa/console": "A pure PHP readline implementation. You'll want this if your PHP install doesn't already support readline or libedit." }, - "time": "2021-04-10T16:23:39+00:00", + "time": "2021-10-10T13:37:39+00:00", "bin": [ "bin/psysh" ], @@ -3411,7 +3842,7 @@ ], "support": { "issues": "https://github.com/bobthecow/psysh/issues", - "source": "https://github.com/bobthecow/psysh/tree/v0.10.8" + "source": "https://github.com/bobthecow/psysh/tree/v0.10.9" }, "install-path": "../psy/psysh" }, @@ -3470,17 +3901,17 @@ }, { "name": "robmorgan/phinx", - "version": "0.12.7", - "version_normalized": "0.12.7.0", + "version": "0.12.8", + "version_normalized": "0.12.8.0", "source": { "type": "git", "url": "https://github.com/cakephp/phinx.git", - "reference": "bdd8f337fcdf24c20d0b708664a85ca9b8d5dbe2" + "reference": "d2ed1b452cc90f4cae4ea6b5976b94fb9e5ed2a2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cakephp/phinx/zipball/bdd8f337fcdf24c20d0b708664a85ca9b8d5dbe2", - "reference": "bdd8f337fcdf24c20d0b708664a85ca9b8d5dbe2", + "url": "https://api.github.com/repos/cakephp/phinx/zipball/d2ed1b452cc90f4cae4ea6b5976b94fb9e5ed2a2", + "reference": "d2ed1b452cc90f4cae4ea6b5976b94fb9e5ed2a2", "shasum": "" }, "require": { @@ -3491,7 +3922,7 @@ "symfony/console": "^3.4|^4.0|^5.0" }, "require-dev": { - "cakephp/cakephp-codesniffer": "^3.0", + "cakephp/cakephp-codesniffer": "^4.0", "ext-json": "*", "ext-pdo": "*", "phpunit/phpunit": "^8.5|^9.3", @@ -3503,7 +3934,7 @@ "ext-pdo": "PDO extension is needed", "symfony/yaml": "Install if using YAML configuration format" }, - "time": "2021-04-16T14:27:37+00:00", + "time": "2021-07-28T15:31:39+00:00", "bin": [ "bin/phinx" ], @@ -3553,7 +3984,7 @@ ], "support": { "issues": "https://github.com/cakephp/phinx/issues", - "source": "https://github.com/cakephp/phinx/tree/0.12.7" + "source": "https://github.com/cakephp/phinx/tree/0.12.8" }, "install-path": "../robmorgan/phinx" }, @@ -4637,23 +5068,23 @@ }, { "name": "seld/phar-utils", - "version": "1.1.1", - "version_normalized": "1.1.1.0", + "version": "1.1.2", + "version_normalized": "1.1.2.0", "source": { "type": "git", "url": "https://github.com/Seldaek/phar-utils.git", - "reference": "8674b1d84ffb47cc59a101f5d5a3b61e87d23796" + "reference": "749042a2315705d2dfbbc59234dd9ceb22bf3ff0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/phar-utils/zipball/8674b1d84ffb47cc59a101f5d5a3b61e87d23796", - "reference": "8674b1d84ffb47cc59a101f5d5a3b61e87d23796", + "url": "https://api.github.com/repos/Seldaek/phar-utils/zipball/749042a2315705d2dfbbc59234dd9ceb22bf3ff0", + "reference": "749042a2315705d2dfbbc59234dd9ceb22bf3ff0", "shasum": "" }, "require": { "php": ">=5.3" }, - "time": "2020-07-07T18:42:57+00:00", + "time": "2021-08-19T21:01:38+00:00", "type": "library", "extra": { "branch-alias": { @@ -4682,7 +5113,7 @@ ], "support": { "issues": "https://github.com/Seldaek/phar-utils/issues", - "source": "https://github.com/Seldaek/phar-utils/tree/master" + "source": "https://github.com/Seldaek/phar-utils/tree/1.1.2" }, "install-path": "../seld/phar-utils" }, @@ -4811,17 +5242,17 @@ }, { "name": "symfony/config", - "version": "v5.3.3", - "version_normalized": "5.3.3.0", + "version": "v5.3.4", + "version_normalized": "5.3.4.0", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "a69e0c55528b47df88d3c4067ddedf32d485d662" + "reference": "4268f3059c904c61636275182707f81645517a37" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/a69e0c55528b47df88d3c4067ddedf32d485d662", - "reference": "a69e0c55528b47df88d3c4067ddedf32d485d662", + "url": "https://api.github.com/repos/symfony/config/zipball/4268f3059c904c61636275182707f81645517a37", + "reference": "4268f3059c904c61636275182707f81645517a37", "shasum": "" }, "require": { @@ -4829,7 +5260,7 @@ "symfony/deprecation-contracts": "^2.1", "symfony/filesystem": "^4.4|^5.0", "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-php80": "^1.15", + "symfony/polyfill-php80": "^1.16", "symfony/polyfill-php81": "^1.22" }, "conflict": { @@ -4845,7 +5276,7 @@ "suggest": { "symfony/yaml": "To use the yaml reference dumper" }, - "time": "2021-06-24T08:13:00+00:00", + "time": "2021-07-21T12:40:44+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -4873,7 +5304,7 @@ "description": "Helps you find, load, combine, autofill and validate configuration values of any kind", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/config/tree/v5.3.3" + "source": "https://github.com/symfony/config/tree/v5.3.4" }, "funding": [ { @@ -4893,17 +5324,17 @@ }, { "name": "symfony/console", - "version": "v5.3.2", - "version_normalized": "5.3.2.0", + "version": "v5.3.7", + "version_normalized": "5.3.7.0", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "649730483885ff2ca99ca0560ef0e5f6b03f2ac1" + "reference": "8b1008344647462ae6ec57559da166c2bfa5e16a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/649730483885ff2ca99ca0560ef0e5f6b03f2ac1", - "reference": "649730483885ff2ca99ca0560ef0e5f6b03f2ac1", + "url": "https://api.github.com/repos/symfony/console/zipball/8b1008344647462ae6ec57559da166c2bfa5e16a", + "reference": "8b1008344647462ae6ec57559da166c2bfa5e16a", "shasum": "" }, "require": { @@ -4911,11 +5342,12 @@ "symfony/deprecation-contracts": "^2.1", "symfony/polyfill-mbstring": "~1.0", "symfony/polyfill-php73": "^1.8", - "symfony/polyfill-php80": "^1.15", + "symfony/polyfill-php80": "^1.16", "symfony/service-contracts": "^1.1|^2", "symfony/string": "^5.1" }, "conflict": { + "psr/log": ">=3", "symfony/dependency-injection": "<4.4", "symfony/dotenv": "<5.1", "symfony/event-dispatcher": "<4.4", @@ -4923,10 +5355,10 @@ "symfony/process": "<4.4" }, "provide": { - "psr/log-implementation": "1.0" + "psr/log-implementation": "1.0|2.0" }, "require-dev": { - "psr/log": "~1.0", + "psr/log": "^1|^2", "symfony/config": "^4.4|^5.0", "symfony/dependency-injection": "^4.4|^5.0", "symfony/event-dispatcher": "^4.4|^5.0", @@ -4940,7 +5372,7 @@ "symfony/lock": "", "symfony/process": "" }, - "time": "2021-06-12T09:42:48+00:00", + "time": "2021-08-25T20:02:16+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -4974,7 +5406,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.3.2" + "source": "https://github.com/symfony/console/tree/v5.3.7" }, "funding": [ { @@ -5064,24 +5496,25 @@ }, { "name": "symfony/filesystem", - "version": "v5.3.3", - "version_normalized": "5.3.3.0", + "version": "v5.3.4", + "version_normalized": "5.3.4.0", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "19b71c8f313b411172dd5f470fd61f24466d79a9" + "reference": "343f4fe324383ca46792cae728a3b6e2f708fb32" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/19b71c8f313b411172dd5f470fd61f24466d79a9", - "reference": "19b71c8f313b411172dd5f470fd61f24466d79a9", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/343f4fe324383ca46792cae728a3b6e2f708fb32", + "reference": "343f4fe324383ca46792cae728a3b6e2f708fb32", "shasum": "" }, "require": { "php": ">=7.2.5", - "symfony/polyfill-ctype": "~1.8" + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-php80": "^1.16" }, - "time": "2021-06-30T07:27:52+00:00", + "time": "2021-07-21T12:40:44+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -5109,7 +5542,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v5.3.3" + "source": "https://github.com/symfony/filesystem/tree/v5.3.4" }, "funding": [ { @@ -5129,23 +5562,24 @@ }, { "name": "symfony/finder", - "version": "v5.3.0", - "version_normalized": "5.3.0.0", + "version": "v5.3.7", + "version_normalized": "5.3.7.0", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "0ae3f047bed4edff6fd35b26a9a6bfdc92c953c6" + "reference": "a10000ada1e600d109a6c7632e9ac42e8bf2fb93" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/0ae3f047bed4edff6fd35b26a9a6bfdc92c953c6", - "reference": "0ae3f047bed4edff6fd35b26a9a6bfdc92c953c6", + "url": "https://api.github.com/repos/symfony/finder/zipball/a10000ada1e600d109a6c7632e9ac42e8bf2fb93", + "reference": "a10000ada1e600d109a6c7632e9ac42e8bf2fb93", "shasum": "" }, "require": { - "php": ">=7.2.5" + "php": ">=7.2.5", + "symfony/polyfill-php80": "^1.16" }, - "time": "2021-05-26T12:52:38+00:00", + "time": "2021-08-04T21:20:46+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -5173,7 +5607,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v5.3.0" + "source": "https://github.com/symfony/finder/tree/v5.3.7" }, "funding": [ { @@ -5275,17 +5709,17 @@ }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.23.0", - "version_normalized": "1.23.0.0", + "version": "v1.23.1", + "version_normalized": "1.23.1.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "24b72c6baa32c746a4d0840147c9715e42bb68ab" + "reference": "16880ba9c5ebe3642d1995ab866db29270b36535" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/24b72c6baa32c746a4d0840147c9715e42bb68ab", - "reference": "24b72c6baa32c746a4d0840147c9715e42bb68ab", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/16880ba9c5ebe3642d1995ab866db29270b36535", + "reference": "16880ba9c5ebe3642d1995ab866db29270b36535", "shasum": "" }, "require": { @@ -5294,7 +5728,7 @@ "suggest": { "ext-intl": "For best performance" }, - "time": "2021-05-27T09:17:38+00:00", + "time": "2021-05-27T12:26:48+00:00", "type": "library", "extra": { "branch-alias": { @@ -5339,7 +5773,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.23.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.23.1" }, "funding": [ { @@ -5446,17 +5880,17 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.23.0", - "version_normalized": "1.23.0.0", + "version": "v1.23.1", + "version_normalized": "1.23.1.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "2df51500adbaebdc4c38dea4c89a2e131c45c8a1" + "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/2df51500adbaebdc4c38dea4c89a2e131c45c8a1", - "reference": "2df51500adbaebdc4c38dea4c89a2e131c45c8a1", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9174a3d80210dca8daa7f31fec659150bbeabfc6", + "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6", "shasum": "" }, "require": { @@ -5465,7 +5899,7 @@ "suggest": { "ext-mbstring": "For best performance" }, - "time": "2021-05-27T09:27:20+00:00", + "time": "2021-05-27T12:26:48+00:00", "type": "library", "extra": { "branch-alias": { @@ -5509,7 +5943,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.23.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.23.1" }, "funding": [ { @@ -5611,23 +6045,23 @@ }, { "name": "symfony/polyfill-php80", - "version": "v1.23.0", - "version_normalized": "1.23.0.0", + "version": "v1.23.1", + "version_normalized": "1.23.1.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "eca0bf41ed421bed1b57c4958bab16aa86b757d0" + "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/eca0bf41ed421bed1b57c4958bab16aa86b757d0", - "reference": "eca0bf41ed421bed1b57c4958bab16aa86b757d0", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/1100343ed1a92e3a38f9ae122fc0eb21602547be", + "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be", "shasum": "" }, "require": { "php": ">=7.1" }, - "time": "2021-02-19T12:13:01+00:00", + "time": "2021-07-28T13:41:28+00:00", "type": "library", "extra": { "branch-alias": { @@ -5677,7 +6111,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.23.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.23.1" }, "funding": [ { @@ -5779,24 +6213,24 @@ }, { "name": "symfony/process", - "version": "v5.3.2", - "version_normalized": "5.3.2.0", + "version": "v5.3.7", + "version_normalized": "5.3.7.0", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "714b47f9196de61a196d86c4bad5f09201b307df" + "reference": "38f26c7d6ed535217ea393e05634cb0b244a1967" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/714b47f9196de61a196d86c4bad5f09201b307df", - "reference": "714b47f9196de61a196d86c4bad5f09201b307df", + "url": "https://api.github.com/repos/symfony/process/zipball/38f26c7d6ed535217ea393e05634cb0b244a1967", + "reference": "38f26c7d6ed535217ea393e05634cb0b244a1967", "shasum": "" }, "require": { "php": ">=7.2.5", - "symfony/polyfill-php80": "^1.15" + "symfony/polyfill-php80": "^1.16" }, - "time": "2021-06-12T10:15:01+00:00", + "time": "2021-08-04T21:20:46+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -5824,7 +6258,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v5.3.2" + "source": "https://github.com/symfony/process/tree/v5.3.7" }, "funding": [ { @@ -5926,17 +6360,17 @@ }, { "name": "symfony/string", - "version": "v5.3.3", - "version_normalized": "5.3.3.0", + "version": "v5.3.7", + "version_normalized": "5.3.7.0", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "bd53358e3eccec6a670b5f33ab680d8dbe1d4ae1" + "reference": "8d224396e28d30f81969f083a58763b8b9ceb0a5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/bd53358e3eccec6a670b5f33ab680d8dbe1d4ae1", - "reference": "bd53358e3eccec6a670b5f33ab680d8dbe1d4ae1", + "url": "https://api.github.com/repos/symfony/string/zipball/8d224396e28d30f81969f083a58763b8b9ceb0a5", + "reference": "8d224396e28d30f81969f083a58763b8b9ceb0a5", "shasum": "" }, "require": { @@ -5953,7 +6387,7 @@ "symfony/translation-contracts": "^1.1|^2", "symfony/var-exporter": "^4.4|^5.0" }, - "time": "2021-06-27T11:44:38+00:00", + "time": "2021-08-26T08:00:08+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -5992,7 +6426,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.3.3" + "source": "https://github.com/symfony/string/tree/v5.3.7" }, "funding": [ { @@ -6012,23 +6446,23 @@ }, { "name": "symfony/var-dumper", - "version": "v5.3.3", - "version_normalized": "5.3.3.0", + "version": "v5.3.8", + "version_normalized": "5.3.8.0", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "46aa709affb9ad3355bd7a810f9662d71025c384" + "reference": "eaaea4098be1c90c8285543e1356a09c8aa5c8da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/46aa709affb9ad3355bd7a810f9662d71025c384", - "reference": "46aa709affb9ad3355bd7a810f9662d71025c384", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/eaaea4098be1c90c8285543e1356a09c8aa5c8da", + "reference": "eaaea4098be1c90c8285543e1356a09c8aa5c8da", "shasum": "" }, "require": { "php": ">=7.2.5", "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php80": "^1.15" + "symfony/polyfill-php80": "^1.16" }, "conflict": { "phpunit/phpunit": "<5.4.3", @@ -6045,7 +6479,7 @@ "ext-intl": "To show region name in time zone dump", "symfony/console": "To use the ServerDumpCommand and/or the bin/var-dump-server script" }, - "time": "2021-06-24T08:13:00+00:00", + "time": "2021-09-24T15:59:58+00:00", "bin": [ "Resources/bin/var-dump-server" ], @@ -6083,7 +6517,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v5.3.3" + "source": "https://github.com/symfony/var-dumper/tree/v5.3.8" }, "funding": [ { @@ -6103,17 +6537,17 @@ }, { "name": "theseer/tokenizer", - "version": "1.2.0", - "version_normalized": "1.2.0.0", + "version": "1.2.1", + "version_normalized": "1.2.1.0", "source": { "type": "git", "url": "https://github.com/theseer/tokenizer.git", - "reference": "75a63c33a8577608444246075ea0af0d052e452a" + "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/75a63c33a8577608444246075ea0af0d052e452a", - "reference": "75a63c33a8577608444246075ea0af0d052e452a", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", + "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", "shasum": "" }, "require": { @@ -6122,7 +6556,7 @@ "ext-xmlwriter": "*", "php": "^7.2 || ^8.0" }, - "time": "2020-07-12T23:59:07+00:00", + "time": "2021-07-28T10:34:58+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -6144,7 +6578,7 @@ "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", "support": { "issues": "https://github.com/theseer/tokenizer/issues", - "source": "https://github.com/theseer/tokenizer/tree/master" + "source": "https://github.com/theseer/tokenizer/tree/1.2.1" }, "funding": [ { @@ -6156,17 +6590,17 @@ }, { "name": "twig/markdown-extra", - "version": "v3.3.1", - "version_normalized": "3.3.1.0", + "version": "v3.3.3", + "version_normalized": "3.3.3.0", "source": { "type": "git", "url": "https://github.com/twigphp/markdown-extra.git", - "reference": "a9fe276dbb7f837c3f4ecc6dad89bcccb9fc8bc9" + "reference": "725a4ef89d93bb80fc63c67cf261bf7512649290" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/markdown-extra/zipball/a9fe276dbb7f837c3f4ecc6dad89bcccb9fc8bc9", - "reference": "a9fe276dbb7f837c3f4ecc6dad89bcccb9fc8bc9", + "url": "https://api.github.com/repos/twigphp/markdown-extra/zipball/725a4ef89d93bb80fc63c67cf261bf7512649290", + "reference": "725a4ef89d93bb80fc63c67cf261bf7512649290", "shasum": "" }, "require": { @@ -6178,9 +6612,9 @@ "league/commonmark": "^1.0", "league/html-to-markdown": "^4.8|^5.0", "michelf/php-markdown": "^1.8", - "symfony/phpunit-bridge": "^4.4.9|^5.0.9" + "symfony/phpunit-bridge": "^4.4.9|^5.0.9|^6.0" }, - "time": "2021-04-01T12:19:25+00:00", + "time": "2021-07-07T07:08:18+00:00", "type": "library", "extra": { "branch-alias": { @@ -6216,7 +6650,7 @@ "twig" ], "support": { - "source": "https://github.com/twigphp/markdown-extra/tree/v3.3.1" + "source": "https://github.com/twigphp/markdown-extra/tree/v3.3.3" }, "funding": [ { @@ -6232,17 +6666,17 @@ }, { "name": "twig/twig", - "version": "v3.3.2", - "version_normalized": "3.3.2.0", + "version": "v3.3.3", + "version_normalized": "3.3.3.0", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "21578f00e83d4a82ecfa3d50752b609f13de6790" + "reference": "a27fa056df8a6384316288ca8b0fa3a35fdeb569" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/21578f00e83d4a82ecfa3d50752b609f13de6790", - "reference": "21578f00e83d4a82ecfa3d50752b609f13de6790", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/a27fa056df8a6384316288ca8b0fa3a35fdeb569", + "reference": "a27fa056df8a6384316288ca8b0fa3a35fdeb569", "shasum": "" }, "require": { @@ -6252,9 +6686,9 @@ }, "require-dev": { "psr/container": "^1.0", - "symfony/phpunit-bridge": "^4.4.9|^5.0.9" + "symfony/phpunit-bridge": "^4.4.9|^5.0.9|^6.0" }, - "time": "2021-05-16T12:14:13+00:00", + "time": "2021-09-17T08:44:23+00:00", "type": "library", "extra": { "branch-alias": { @@ -6295,7 +6729,7 @@ ], "support": { "issues": "https://github.com/twigphp/Twig/issues", - "source": "https://github.com/twigphp/Twig/tree/v3.3.2" + "source": "https://github.com/twigphp/Twig/tree/v3.3.3" }, "funding": [ { diff --git a/app/vendor/composer/installed.php b/app/vendor/composer/installed.php index f649afc15..1ec202038 100644 --- a/app/vendor/composer/installed.php +++ b/app/vendor/composer/installed.php @@ -1,995 +1,1064 @@ - array( - 'pretty_version' => '4.2.2', - 'version' => '4.2.2.0', - 'type' => 'project', - 'install_path' => __DIR__ . '/../../', - 'aliases' => array(), - 'reference' => NULL, - 'name' => 'cakephp/app', - 'dev' => true, - ), - 'versions' => array( - 'brick/varexporter' => array( - 'pretty_version' => '0.3.5', - 'version' => '0.3.5.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../brick/varexporter', - 'aliases' => array(), - 'reference' => '05241f28dfcba2b51b11e2d750e296316ebbe518', - 'dev_requirement' => true, - ), - 'cakephp/app' => array( - 'pretty_version' => '4.2.2', - 'version' => '4.2.2.0', - 'type' => 'project', - 'install_path' => __DIR__ . '/../../', - 'aliases' => array(), - 'reference' => NULL, - 'dev_requirement' => false, - ), - 'cakephp/bake' => array( - 'pretty_version' => '2.5.1', - 'version' => '2.5.1.0', - 'type' => 'cakephp-plugin', - 'install_path' => __DIR__ . '/../cakephp/bake', - 'aliases' => array(), - 'reference' => '5cec940065af0846dd58b6dcfd6cb4f8d321ccce', - 'dev_requirement' => true, - ), - 'cakephp/cache' => array( - 'dev_requirement' => false, - 'replaced' => array( - 0 => '4.2.7', - ), - ), - 'cakephp/cakephp' => array( - 'pretty_version' => '4.2.7', - 'version' => '4.2.7.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../cakephp/cakephp', - 'aliases' => array(), - 'reference' => 'bd2d476e0b14b21c6103eca789667a016ec14458', - 'dev_requirement' => false, - ), - 'cakephp/cakephp-codesniffer' => array( - 'pretty_version' => '4.2.4', - 'version' => '4.2.4.0', - 'type' => 'phpcodesniffer-standard', - 'install_path' => __DIR__ . '/../cakephp/cakephp-codesniffer', - 'aliases' => array(), - 'reference' => 'c5bb1faeebf09cd4a3604bdb0c84f7bc92dc5475', - 'dev_requirement' => true, - ), - 'cakephp/chronos' => array( - 'pretty_version' => '2.2.0', - 'version' => '2.2.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../cakephp/chronos', - 'aliases' => array(), - 'reference' => '556e14da67307ffc2e68beeb7df0694dc8d1207d', - 'dev_requirement' => false, - ), - 'cakephp/collection' => array( - 'dev_requirement' => false, - 'replaced' => array( - 0 => '4.2.7', - ), - ), - 'cakephp/console' => array( - 'dev_requirement' => false, - 'replaced' => array( - 0 => '4.2.7', - ), - ), - 'cakephp/core' => array( - 'dev_requirement' => false, - 'replaced' => array( - 0 => '4.2.7', - ), - ), - 'cakephp/database' => array( - 'dev_requirement' => false, - 'replaced' => array( - 0 => '4.2.7', - ), - ), - 'cakephp/datasource' => array( - 'dev_requirement' => false, - 'replaced' => array( - 0 => '4.2.7', - ), - ), - 'cakephp/debug_kit' => array( - 'pretty_version' => '4.4.3', - 'version' => '4.4.3.0', - 'type' => 'cakephp-plugin', - 'install_path' => __DIR__ . '/../cakephp/debug_kit', - 'aliases' => array(), - 'reference' => 'd8a5552096b09a1cdf192b454ec06dc0157a3515', - 'dev_requirement' => true, - ), - 'cakephp/event' => array( - 'dev_requirement' => false, - 'replaced' => array( - 0 => '4.2.7', - ), - ), - 'cakephp/filesystem' => array( - 'dev_requirement' => false, - 'replaced' => array( - 0 => '4.2.7', - ), - ), - 'cakephp/form' => array( - 'dev_requirement' => false, - 'replaced' => array( - 0 => '4.2.7', - ), - ), - 'cakephp/http' => array( - 'dev_requirement' => false, - 'replaced' => array( - 0 => '4.2.7', - ), - ), - 'cakephp/i18n' => array( - 'dev_requirement' => false, - 'replaced' => array( - 0 => '4.2.7', - ), - ), - 'cakephp/log' => array( - 'dev_requirement' => false, - 'replaced' => array( - 0 => '4.2.7', - ), - ), - 'cakephp/migrations' => array( - 'pretty_version' => '3.1.0', - 'version' => '3.1.0.0', - 'type' => 'cakephp-plugin', - 'install_path' => __DIR__ . '/../cakephp/migrations', - 'aliases' => array(), - 'reference' => 'd22737c31243db89774abfe6a077d254c0eae75a', - 'dev_requirement' => false, - ), - 'cakephp/orm' => array( - 'dev_requirement' => false, - 'replaced' => array( - 0 => '4.2.7', - ), - ), - 'cakephp/plugin-installer' => array( - 'pretty_version' => '1.3.1', - 'version' => '1.3.1.0', - 'type' => 'composer-plugin', - 'install_path' => __DIR__ . '/../cakephp/plugin-installer', - 'aliases' => array(), - 'reference' => 'e27027aa2d3d8ab64452c6817629558685a064cb', - 'dev_requirement' => false, - ), - 'cakephp/twig-view' => array( - 'pretty_version' => '1.2.0', - 'version' => '1.2.0.0', - 'type' => 'cakephp-plugin', - 'install_path' => __DIR__ . '/../cakephp/twig-view', - 'aliases' => array(), - 'reference' => '668dd6aee43dd616b1e83cb9ba166f094c10fbce', - 'dev_requirement' => true, - ), - 'cakephp/utility' => array( - 'dev_requirement' => false, - 'replaced' => array( - 0 => '4.2.7', - ), - ), - 'cakephp/validation' => array( - 'dev_requirement' => false, - 'replaced' => array( - 0 => '4.2.7', - ), - ), - 'composer/ca-bundle' => array( - 'pretty_version' => '1.2.10', - 'version' => '1.2.10.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/./ca-bundle', - 'aliases' => array(), - 'reference' => '9fdb22c2e97a614657716178093cd1da90a64aa8', - 'dev_requirement' => false, - ), - 'composer/composer' => array( - 'pretty_version' => '2.1.3', - 'version' => '2.1.3.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/./composer', - 'aliases' => array(), - 'reference' => 'fc5c4573aafce3a018eb7f1f8f91cea423970f2e', - 'dev_requirement' => true, - ), - 'composer/metadata-minifier' => array( - 'pretty_version' => '1.0.0', - 'version' => '1.0.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/./metadata-minifier', - 'aliases' => array(), - 'reference' => 'c549d23829536f0d0e984aaabbf02af91f443207', - 'dev_requirement' => true, - ), - 'composer/semver' => array( - 'pretty_version' => '3.2.5', - 'version' => '3.2.5.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/./semver', - 'aliases' => array(), - 'reference' => '31f3ea725711245195f62e54ffa402d8ef2fdba9', - 'dev_requirement' => true, - ), - 'composer/spdx-licenses' => array( - 'pretty_version' => '1.5.5', - 'version' => '1.5.5.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/./spdx-licenses', - 'aliases' => array(), - 'reference' => 'de30328a7af8680efdc03e396aad24befd513200', - 'dev_requirement' => true, - ), - 'composer/xdebug-handler' => array( - 'pretty_version' => '2.0.1', - 'version' => '2.0.1.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/./xdebug-handler', - 'aliases' => array(), - 'reference' => '964adcdd3a28bf9ed5d9ac6450064e0d71ed7496', - 'dev_requirement' => true, - ), - 'dealerdirect/phpcodesniffer-composer-installer' => array( - 'pretty_version' => 'v0.7.1', - 'version' => '0.7.1.0', - 'type' => 'composer-plugin', - 'install_path' => __DIR__ . '/../dealerdirect/phpcodesniffer-composer-installer', - 'aliases' => array(), - 'reference' => 'fe390591e0241955f22eb9ba327d137e501c771c', - 'dev_requirement' => true, - ), - 'doctrine/instantiator' => array( - 'pretty_version' => '1.4.0', - 'version' => '1.4.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../doctrine/instantiator', - 'aliases' => array(), - 'reference' => 'd56bf6102915de5702778fe20f2de3b2fe570b5b', - 'dev_requirement' => true, - ), - 'jasny/twig-extensions' => array( - 'pretty_version' => 'v1.3.0', - 'version' => '1.3.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../jasny/twig-extensions', - 'aliases' => array(), - 'reference' => 'a694eb02f6fc14ff8e2fceb8b80882c0c926102b', - 'dev_requirement' => true, - ), - 'jdorn/sql-formatter' => array( - 'pretty_version' => 'v1.2.17', - 'version' => '1.2.17.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../jdorn/sql-formatter', - 'aliases' => array(), - 'reference' => '64990d96e0959dff8e059dfcdc1af130728d92bc', - 'dev_requirement' => true, - ), - 'josegonzalez/dotenv' => array( - 'pretty_version' => '3.2.0', - 'version' => '3.2.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../josegonzalez/dotenv', - 'aliases' => array(), - 'reference' => 'f19174d9d7213a6c20e8e5e268aa7dd042d821ca', - 'dev_requirement' => true, - ), - 'justinrainbow/json-schema' => array( - 'pretty_version' => '5.2.10', - 'version' => '5.2.10.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../justinrainbow/json-schema', - 'aliases' => array(), - 'reference' => '2ba9c8c862ecd5510ed16c6340aa9f6eadb4f31b', - 'dev_requirement' => true, - ), - 'laminas/laminas-diactoros' => array( - 'pretty_version' => '2.6.0', - 'version' => '2.6.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../laminas/laminas-diactoros', - 'aliases' => array(), - 'reference' => '7d2034110ae18afe05050b796a3ee4b3fe177876', - 'dev_requirement' => false, - ), - 'laminas/laminas-httphandlerrunner' => array( - 'pretty_version' => '1.4.0', - 'version' => '1.4.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../laminas/laminas-httphandlerrunner', - 'aliases' => array(), - 'reference' => '6a2dd33e4166469ade07ad1283b45924383b224b', - 'dev_requirement' => false, - ), - 'laminas/laminas-zendframework-bridge' => array( - 'pretty_version' => '1.3.0', - 'version' => '1.3.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../laminas/laminas-zendframework-bridge', - 'aliases' => array(), - 'reference' => '13af2502d9bb6f7d33be2de4b51fb68c6cdb476e', - 'dev_requirement' => false, - ), - 'league/container' => array( - 'pretty_version' => '3.4.1', - 'version' => '3.4.1.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../league/container', - 'aliases' => array(), - 'reference' => '84ecbc2dbecc31bd23faf759a0e329ee49abddbd', - 'dev_requirement' => false, - ), - 'm1/env' => array( - 'pretty_version' => '2.2.0', - 'version' => '2.2.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../m1/env', - 'aliases' => array(), - 'reference' => '5c296e3e13450a207e12b343f3af1d7ab569f6f3', - 'dev_requirement' => true, - ), - 'mobiledetect/mobiledetectlib' => array( - 'pretty_version' => '2.8.37', - 'version' => '2.8.37.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../mobiledetect/mobiledetectlib', - 'aliases' => array(), - 'reference' => '9841e3c46f5bd0739b53aed8ac677fa712943df7', - 'dev_requirement' => false, - ), - 'myclabs/deep-copy' => array( - 'pretty_version' => '1.10.2', - 'version' => '1.10.2.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../myclabs/deep-copy', - 'aliases' => array(), - 'reference' => '776f831124e9c62e1a2c601ecc52e776d8bb7220', - 'dev_requirement' => true, - 'replaced' => array( - 0 => '1.10.2', - ), - ), - 'nikic/php-parser' => array( - 'pretty_version' => 'v4.11.0', - 'version' => '4.11.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../nikic/php-parser', - 'aliases' => array(), - 'reference' => 'fe14cf3672a149364fb66dfe11bf6549af899f94', - 'dev_requirement' => true, - ), - 'orno/di' => array( - 'dev_requirement' => false, - 'replaced' => array( - 0 => '~2.0', - ), - ), - 'phar-io/manifest' => array( - 'pretty_version' => '2.0.1', - 'version' => '2.0.1.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../phar-io/manifest', - 'aliases' => array(), - 'reference' => '85265efd3af7ba3ca4b2a2c34dbfc5788dd29133', - 'dev_requirement' => true, - ), - 'phar-io/version' => array( - 'pretty_version' => '3.1.0', - 'version' => '3.1.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../phar-io/version', - 'aliases' => array(), - 'reference' => 'bae7c545bef187884426f042434e561ab1ddb182', - 'dev_requirement' => true, - ), - 'phpdocumentor/reflection-common' => array( - 'pretty_version' => '2.2.0', - 'version' => '2.2.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../phpdocumentor/reflection-common', - 'aliases' => array(), - 'reference' => '1d01c49d4ed62f25aa84a747ad35d5a16924662b', - 'dev_requirement' => true, - ), - 'phpdocumentor/reflection-docblock' => array( - 'pretty_version' => '5.2.2', - 'version' => '5.2.2.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../phpdocumentor/reflection-docblock', - 'aliases' => array(), - 'reference' => '069a785b2141f5bcf49f3e353548dc1cce6df556', - 'dev_requirement' => true, - ), - 'phpdocumentor/type-resolver' => array( - 'pretty_version' => '1.4.0', - 'version' => '1.4.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../phpdocumentor/type-resolver', - 'aliases' => array(), - 'reference' => '6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0', - 'dev_requirement' => true, - ), - 'phpspec/prophecy' => array( - 'pretty_version' => '1.13.0', - 'version' => '1.13.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../phpspec/prophecy', - 'aliases' => array(), - 'reference' => 'be1996ed8adc35c3fd795488a653f4b518be70ea', - 'dev_requirement' => true, - ), - 'phpstan/phpdoc-parser' => array( - 'pretty_version' => '0.4.9', - 'version' => '0.4.9.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../phpstan/phpdoc-parser', - 'aliases' => array(), - 'reference' => '98a088b17966bdf6ee25c8a4b634df313d8aa531', - 'dev_requirement' => true, - ), - 'phpunit/php-code-coverage' => array( - 'pretty_version' => '9.2.6', - 'version' => '9.2.6.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../phpunit/php-code-coverage', - 'aliases' => array(), - 'reference' => 'f6293e1b30a2354e8428e004689671b83871edde', - 'dev_requirement' => true, - ), - 'phpunit/php-file-iterator' => array( - 'pretty_version' => '3.0.5', - 'version' => '3.0.5.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../phpunit/php-file-iterator', - 'aliases' => array(), - 'reference' => 'aa4be8575f26070b100fccb67faabb28f21f66f8', - 'dev_requirement' => true, - ), - 'phpunit/php-invoker' => array( - 'pretty_version' => '3.1.1', - 'version' => '3.1.1.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../phpunit/php-invoker', - 'aliases' => array(), - 'reference' => '5a10147d0aaf65b58940a0b72f71c9ac0423cc67', - 'dev_requirement' => true, - ), - 'phpunit/php-text-template' => array( - 'pretty_version' => '2.0.4', - 'version' => '2.0.4.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../phpunit/php-text-template', - 'aliases' => array(), - 'reference' => '5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28', - 'dev_requirement' => true, - ), - 'phpunit/php-timer' => array( - 'pretty_version' => '5.0.3', - 'version' => '5.0.3.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../phpunit/php-timer', - 'aliases' => array(), - 'reference' => '5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2', - 'dev_requirement' => true, - ), - 'phpunit/phpunit' => array( - 'pretty_version' => '9.5.6', - 'version' => '9.5.6.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../phpunit/phpunit', - 'aliases' => array(), - 'reference' => 'fb9b8333f14e3dce976a60ef6a7e05c7c7ed8bfb', - 'dev_requirement' => true, - ), - 'psr/container' => array( - 'pretty_version' => '1.1.1', - 'version' => '1.1.1.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../psr/container', - 'aliases' => array(), - 'reference' => '8622567409010282b7aeebe4bb841fe98b58dcaf', - 'dev_requirement' => false, - ), - 'psr/container-implementation' => array( - 'dev_requirement' => false, - 'provided' => array( - 0 => '^1.0', - ), - ), - 'psr/http-client' => array( - 'pretty_version' => '1.0.1', - 'version' => '1.0.1.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../psr/http-client', - 'aliases' => array(), - 'reference' => '2dfb5f6c5eff0e91e20e913f8c5452ed95b86621', - 'dev_requirement' => false, - ), - 'psr/http-factory' => array( - 'pretty_version' => '1.0.1', - 'version' => '1.0.1.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../psr/http-factory', - 'aliases' => array(), - 'reference' => '12ac7fcd07e5b077433f5f2bee95b3a771bf61be', - 'dev_requirement' => false, - ), - 'psr/http-factory-implementation' => array( - 'dev_requirement' => false, - 'provided' => array( - 0 => '1.0', - ), - ), - 'psr/http-message' => array( - 'pretty_version' => '1.0.1', - 'version' => '1.0.1.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../psr/http-message', - 'aliases' => array(), - 'reference' => 'f6561bf28d520154e4b0ec72be95418abe6d9363', - 'dev_requirement' => false, - ), - 'psr/http-message-implementation' => array( - 'dev_requirement' => false, - 'provided' => array( - 0 => '1.0', - ), - ), - 'psr/http-server-handler' => array( - 'pretty_version' => '1.0.1', - 'version' => '1.0.1.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../psr/http-server-handler', - 'aliases' => array(), - 'reference' => 'aff2f80e33b7f026ec96bb42f63242dc50ffcae7', - 'dev_requirement' => false, - ), - 'psr/http-server-middleware' => array( - 'pretty_version' => '1.0.1', - 'version' => '1.0.1.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../psr/http-server-middleware', - 'aliases' => array(), - 'reference' => '2296f45510945530b9dceb8bcedb5cb84d40c5f5', - 'dev_requirement' => false, - ), - 'psr/log' => array( - 'pretty_version' => '1.1.4', - 'version' => '1.1.4.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../psr/log', - 'aliases' => array(), - 'reference' => 'd49695b909c3b7628b6289db5479a1c204601f11', - 'dev_requirement' => false, - ), - 'psr/log-implementation' => array( - 'dev_requirement' => false, - 'provided' => array( - 0 => '1.0', - ), - ), - 'psr/simple-cache' => array( - 'pretty_version' => '1.0.1', - 'version' => '1.0.1.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../psr/simple-cache', - 'aliases' => array(), - 'reference' => '408d5eafb83c57f6365a3ca330ff23aa4a5fa39b', - 'dev_requirement' => false, - ), - 'psy/psysh' => array( - 'pretty_version' => 'v0.10.8', - 'version' => '0.10.8.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../psy/psysh', - 'aliases' => array(), - 'reference' => 'e4573f47750dd6c92dca5aee543fa77513cbd8d3', - 'dev_requirement' => true, - ), - 'react/promise' => array( - 'pretty_version' => 'v2.8.0', - 'version' => '2.8.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../react/promise', - 'aliases' => array(), - 'reference' => 'f3cff96a19736714524ca0dd1d4130de73dbbbc4', - 'dev_requirement' => true, - ), - 'robmorgan/phinx' => array( - 'pretty_version' => '0.12.7', - 'version' => '0.12.7.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../robmorgan/phinx', - 'aliases' => array(), - 'reference' => 'bdd8f337fcdf24c20d0b708664a85ca9b8d5dbe2', - 'dev_requirement' => false, - ), - 'sebastian/cli-parser' => array( - 'pretty_version' => '1.0.1', - 'version' => '1.0.1.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../sebastian/cli-parser', - 'aliases' => array(), - 'reference' => '442e7c7e687e42adc03470c7b668bc4b2402c0b2', - 'dev_requirement' => true, - ), - 'sebastian/code-unit' => array( - 'pretty_version' => '1.0.8', - 'version' => '1.0.8.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../sebastian/code-unit', - 'aliases' => array(), - 'reference' => '1fc9f64c0927627ef78ba436c9b17d967e68e120', - 'dev_requirement' => true, - ), - 'sebastian/code-unit-reverse-lookup' => array( - 'pretty_version' => '2.0.3', - 'version' => '2.0.3.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../sebastian/code-unit-reverse-lookup', - 'aliases' => array(), - 'reference' => 'ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5', - 'dev_requirement' => true, - ), - 'sebastian/comparator' => array( - 'pretty_version' => '4.0.6', - 'version' => '4.0.6.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../sebastian/comparator', - 'aliases' => array(), - 'reference' => '55f4261989e546dc112258c7a75935a81a7ce382', - 'dev_requirement' => true, - ), - 'sebastian/complexity' => array( - 'pretty_version' => '2.0.2', - 'version' => '2.0.2.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../sebastian/complexity', - 'aliases' => array(), - 'reference' => '739b35e53379900cc9ac327b2147867b8b6efd88', - 'dev_requirement' => true, - ), - 'sebastian/diff' => array( - 'pretty_version' => '4.0.4', - 'version' => '4.0.4.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../sebastian/diff', - 'aliases' => array(), - 'reference' => '3461e3fccc7cfdfc2720be910d3bd73c69be590d', - 'dev_requirement' => true, - ), - 'sebastian/environment' => array( - 'pretty_version' => '5.1.3', - 'version' => '5.1.3.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../sebastian/environment', - 'aliases' => array(), - 'reference' => '388b6ced16caa751030f6a69e588299fa09200ac', - 'dev_requirement' => true, - ), - 'sebastian/exporter' => array( - 'pretty_version' => '4.0.3', - 'version' => '4.0.3.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../sebastian/exporter', - 'aliases' => array(), - 'reference' => 'd89cc98761b8cb5a1a235a6b703ae50d34080e65', - 'dev_requirement' => true, - ), - 'sebastian/global-state' => array( - 'pretty_version' => '5.0.3', - 'version' => '5.0.3.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../sebastian/global-state', - 'aliases' => array(), - 'reference' => '23bd5951f7ff26f12d4e3242864df3e08dec4e49', - 'dev_requirement' => true, - ), - 'sebastian/lines-of-code' => array( - 'pretty_version' => '1.0.3', - 'version' => '1.0.3.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../sebastian/lines-of-code', - 'aliases' => array(), - 'reference' => 'c1c2e997aa3146983ed888ad08b15470a2e22ecc', - 'dev_requirement' => true, - ), - 'sebastian/object-enumerator' => array( - 'pretty_version' => '4.0.4', - 'version' => '4.0.4.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../sebastian/object-enumerator', - 'aliases' => array(), - 'reference' => '5c9eeac41b290a3712d88851518825ad78f45c71', - 'dev_requirement' => true, - ), - 'sebastian/object-reflector' => array( - 'pretty_version' => '2.0.4', - 'version' => '2.0.4.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../sebastian/object-reflector', - 'aliases' => array(), - 'reference' => 'b4f479ebdbf63ac605d183ece17d8d7fe49c15c7', - 'dev_requirement' => true, - ), - 'sebastian/recursion-context' => array( - 'pretty_version' => '4.0.4', - 'version' => '4.0.4.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../sebastian/recursion-context', - 'aliases' => array(), - 'reference' => 'cd9d8cf3c5804de4341c283ed787f099f5506172', - 'dev_requirement' => true, - ), - 'sebastian/resource-operations' => array( - 'pretty_version' => '3.0.3', - 'version' => '3.0.3.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../sebastian/resource-operations', - 'aliases' => array(), - 'reference' => '0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8', - 'dev_requirement' => true, - ), - 'sebastian/type' => array( - 'pretty_version' => '2.3.4', - 'version' => '2.3.4.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../sebastian/type', - 'aliases' => array(), - 'reference' => 'b8cd8a1c753c90bc1a0f5372170e3e489136f914', - 'dev_requirement' => true, - ), - 'sebastian/version' => array( - 'pretty_version' => '3.0.2', - 'version' => '3.0.2.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../sebastian/version', - 'aliases' => array(), - 'reference' => 'c6c1022351a901512170118436c764e473f6de8c', - 'dev_requirement' => true, - ), - 'seld/jsonlint' => array( - 'pretty_version' => '1.8.3', - 'version' => '1.8.3.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../seld/jsonlint', - 'aliases' => array(), - 'reference' => '9ad6ce79c342fbd44df10ea95511a1b24dee5b57', - 'dev_requirement' => true, - ), - 'seld/phar-utils' => array( - 'pretty_version' => '1.1.1', - 'version' => '1.1.1.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../seld/phar-utils', - 'aliases' => array(), - 'reference' => '8674b1d84ffb47cc59a101f5d5a3b61e87d23796', - 'dev_requirement' => true, - ), - 'slevomat/coding-standard' => array( - 'pretty_version' => '6.4.1', - 'version' => '6.4.1.0', - 'type' => 'phpcodesniffer-standard', - 'install_path' => __DIR__ . '/../slevomat/coding-standard', - 'aliases' => array(), - 'reference' => '696dcca217d0c9da2c40d02731526c1e25b65346', - 'dev_requirement' => true, - ), - 'squizlabs/php_codesniffer' => array( - 'pretty_version' => '3.5.8', - 'version' => '3.5.8.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../squizlabs/php_codesniffer', - 'aliases' => array(), - 'reference' => '9d583721a7157ee997f235f327de038e7ea6dac4', - 'dev_requirement' => true, - ), - 'symfony/config' => array( - 'pretty_version' => 'v5.3.3', - 'version' => '5.3.3.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/config', - 'aliases' => array(), - 'reference' => 'a69e0c55528b47df88d3c4067ddedf32d485d662', - 'dev_requirement' => false, - ), - 'symfony/console' => array( - 'pretty_version' => 'v5.3.2', - 'version' => '5.3.2.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/console', - 'aliases' => array(), - 'reference' => '649730483885ff2ca99ca0560ef0e5f6b03f2ac1', - 'dev_requirement' => false, - ), - 'symfony/deprecation-contracts' => array( - 'pretty_version' => 'v2.4.0', - 'version' => '2.4.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/deprecation-contracts', - 'aliases' => array(), - 'reference' => '5f38c8804a9e97d23e0c8d63341088cd8a22d627', - 'dev_requirement' => false, - ), - 'symfony/filesystem' => array( - 'pretty_version' => 'v5.3.3', - 'version' => '5.3.3.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/filesystem', - 'aliases' => array(), - 'reference' => '19b71c8f313b411172dd5f470fd61f24466d79a9', - 'dev_requirement' => false, - ), - 'symfony/finder' => array( - 'pretty_version' => 'v5.3.0', - 'version' => '5.3.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/finder', - 'aliases' => array(), - 'reference' => '0ae3f047bed4edff6fd35b26a9a6bfdc92c953c6', - 'dev_requirement' => true, - ), - 'symfony/polyfill-ctype' => array( - 'pretty_version' => 'v1.23.0', - 'version' => '1.23.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/polyfill-ctype', - 'aliases' => array(), - 'reference' => '46cd95797e9df938fdd2b03693b5fca5e64b01ce', - 'dev_requirement' => false, - ), - 'symfony/polyfill-intl-grapheme' => array( - 'pretty_version' => 'v1.23.0', - 'version' => '1.23.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/polyfill-intl-grapheme', - 'aliases' => array(), - 'reference' => '24b72c6baa32c746a4d0840147c9715e42bb68ab', - 'dev_requirement' => false, - ), - 'symfony/polyfill-intl-normalizer' => array( - 'pretty_version' => 'v1.23.0', - 'version' => '1.23.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/polyfill-intl-normalizer', - 'aliases' => array(), - 'reference' => '8590a5f561694770bdcd3f9b5c69dde6945028e8', - 'dev_requirement' => false, - ), - 'symfony/polyfill-mbstring' => array( - 'pretty_version' => 'v1.23.0', - 'version' => '1.23.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/polyfill-mbstring', - 'aliases' => array(), - 'reference' => '2df51500adbaebdc4c38dea4c89a2e131c45c8a1', - 'dev_requirement' => false, - ), - 'symfony/polyfill-php73' => array( - 'pretty_version' => 'v1.23.0', - 'version' => '1.23.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/polyfill-php73', - 'aliases' => array(), - 'reference' => 'fba8933c384d6476ab14fb7b8526e5287ca7e010', - 'dev_requirement' => false, - ), - 'symfony/polyfill-php80' => array( - 'pretty_version' => 'v1.23.0', - 'version' => '1.23.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/polyfill-php80', - 'aliases' => array(), - 'reference' => 'eca0bf41ed421bed1b57c4958bab16aa86b757d0', - 'dev_requirement' => false, - ), - 'symfony/polyfill-php81' => array( - 'pretty_version' => 'v1.23.0', - 'version' => '1.23.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/polyfill-php81', - 'aliases' => array(), - 'reference' => 'e66119f3de95efc359483f810c4c3e6436279436', - 'dev_requirement' => false, - ), - 'symfony/process' => array( - 'pretty_version' => 'v5.3.2', - 'version' => '5.3.2.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/process', - 'aliases' => array(), - 'reference' => '714b47f9196de61a196d86c4bad5f09201b307df', - 'dev_requirement' => true, - ), - 'symfony/service-contracts' => array( - 'pretty_version' => 'v2.4.0', - 'version' => '2.4.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/service-contracts', - 'aliases' => array(), - 'reference' => 'f040a30e04b57fbcc9c6cbcf4dbaa96bd318b9bb', - 'dev_requirement' => false, - ), - 'symfony/string' => array( - 'pretty_version' => 'v5.3.3', - 'version' => '5.3.3.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/string', - 'aliases' => array(), - 'reference' => 'bd53358e3eccec6a670b5f33ab680d8dbe1d4ae1', - 'dev_requirement' => false, - ), - 'symfony/var-dumper' => array( - 'pretty_version' => 'v5.3.3', - 'version' => '5.3.3.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/var-dumper', - 'aliases' => array(), - 'reference' => '46aa709affb9ad3355bd7a810f9662d71025c384', - 'dev_requirement' => true, - ), - 'theseer/tokenizer' => array( - 'pretty_version' => '1.2.0', - 'version' => '1.2.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../theseer/tokenizer', - 'aliases' => array(), - 'reference' => '75a63c33a8577608444246075ea0af0d052e452a', - 'dev_requirement' => true, - ), - 'twig/markdown-extra' => array( - 'pretty_version' => 'v3.3.1', - 'version' => '3.3.1.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../twig/markdown-extra', - 'aliases' => array(), - 'reference' => 'a9fe276dbb7f837c3f4ecc6dad89bcccb9fc8bc9', - 'dev_requirement' => true, - ), - 'twig/twig' => array( - 'pretty_version' => 'v3.3.2', - 'version' => '3.3.2.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../twig/twig', - 'aliases' => array(), - 'reference' => '21578f00e83d4a82ecfa3d50752b609f13de6790', - 'dev_requirement' => true, - ), - 'webmozart/assert' => array( - 'pretty_version' => '1.10.0', - 'version' => '1.10.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../webmozart/assert', - 'aliases' => array(), - 'reference' => '6964c76c7804814a842473e0c8fd15bab0f18e25', - 'dev_requirement' => true, - ), - 'zendframework/zend-diactoros' => array( - 'dev_requirement' => false, - 'replaced' => array( - 0 => '^2.2.1', - ), - ), - 'zendframework/zend-httphandlerrunner' => array( - 'dev_requirement' => false, - 'replaced' => array( - 0 => '^1.1.0', - ), - ), + + array ( + 'pretty_version' => 'dev-develop', + 'version' => 'dev-develop', + 'aliases' => + array ( ), + 'reference' => 'e9e35cc04f182202ee69f7923f435979daf95502', + 'name' => 'cakephp/app', + ), + 'versions' => + array ( + 'brick/varexporter' => + array ( + 'pretty_version' => '0.3.5', + 'version' => '0.3.5.0', + 'aliases' => + array ( + ), + 'reference' => '05241f28dfcba2b51b11e2d750e296316ebbe518', + ), + 'cakephp/app' => + array ( + 'pretty_version' => 'dev-develop', + 'version' => 'dev-develop', + 'aliases' => + array ( + ), + 'reference' => 'e9e35cc04f182202ee69f7923f435979daf95502', + ), + 'cakephp/bake' => + array ( + 'pretty_version' => '2.5.2', + 'version' => '2.5.2.0', + 'aliases' => + array ( + ), + 'reference' => 'bfb856afcfbc70c5cf5341669c3036a45ca15d94', + ), + 'cakephp/cache' => + array ( + 'replaced' => + array ( + 0 => '4.2.9', + ), + ), + 'cakephp/cakephp' => + array ( + 'pretty_version' => '4.2.9', + 'version' => '4.2.9.0', + 'aliases' => + array ( + ), + 'reference' => '6cb068fd328219d79a02ef6df439b73459071368', + ), + 'cakephp/cakephp-codesniffer' => + array ( + 'pretty_version' => '4.2.4', + 'version' => '4.2.4.0', + 'aliases' => + array ( + ), + 'reference' => 'c5bb1faeebf09cd4a3604bdb0c84f7bc92dc5475', + ), + 'cakephp/chronos' => + array ( + 'pretty_version' => '2.2.0', + 'version' => '2.2.0.0', + 'aliases' => + array ( + ), + 'reference' => '556e14da67307ffc2e68beeb7df0694dc8d1207d', + ), + 'cakephp/collection' => + array ( + 'replaced' => + array ( + 0 => '4.2.9', + ), + ), + 'cakephp/console' => + array ( + 'replaced' => + array ( + 0 => '4.2.9', + ), + ), + 'cakephp/core' => + array ( + 'replaced' => + array ( + 0 => '4.2.9', + ), + ), + 'cakephp/database' => + array ( + 'replaced' => + array ( + 0 => '4.2.9', + ), + ), + 'cakephp/datasource' => + array ( + 'replaced' => + array ( + 0 => '4.2.9', + ), + ), + 'cakephp/debug_kit' => + array ( + 'pretty_version' => '4.4.4', + 'version' => '4.4.4.0', + 'aliases' => + array ( + ), + 'reference' => '10d7d9ba36945844211f1d8763e59618917e1784', + ), + 'cakephp/event' => + array ( + 'replaced' => + array ( + 0 => '4.2.9', + ), + ), + 'cakephp/filesystem' => + array ( + 'replaced' => + array ( + 0 => '4.2.9', + ), + ), + 'cakephp/form' => + array ( + 'replaced' => + array ( + 0 => '4.2.9', + ), + ), + 'cakephp/http' => + array ( + 'replaced' => + array ( + 0 => '4.2.9', + ), + ), + 'cakephp/i18n' => + array ( + 'replaced' => + array ( + 0 => '4.2.9', + ), + ), + 'cakephp/log' => + array ( + 'replaced' => + array ( + 0 => '4.2.9', + ), + ), + 'cakephp/migrations' => + array ( + 'pretty_version' => '3.1.0', + 'version' => '3.1.0.0', + 'aliases' => + array ( + ), + 'reference' => 'd22737c31243db89774abfe6a077d254c0eae75a', + ), + 'cakephp/orm' => + array ( + 'replaced' => + array ( + 0 => '4.2.9', + ), + ), + 'cakephp/plugin-installer' => + array ( + 'pretty_version' => '1.3.1', + 'version' => '1.3.1.0', + 'aliases' => + array ( + ), + 'reference' => 'e27027aa2d3d8ab64452c6817629558685a064cb', + ), + 'cakephp/twig-view' => + array ( + 'pretty_version' => '1.3.0', + 'version' => '1.3.0.0', + 'aliases' => + array ( + ), + 'reference' => '14df50360b809a171d0688020fbdfe513763f89b', + ), + 'cakephp/utility' => + array ( + 'replaced' => + array ( + 0 => '4.2.9', + ), + ), + 'cakephp/validation' => + array ( + 'replaced' => + array ( + 0 => '4.2.9', + ), + ), + 'composer/ca-bundle' => + array ( + 'pretty_version' => '1.2.11', + 'version' => '1.2.11.0', + 'aliases' => + array ( + ), + 'reference' => '0b072d51c5a9c6f3412f7ea3ab043d6603cb2582', + ), + 'composer/composer' => + array ( + 'pretty_version' => '2.1.9', + 'version' => '2.1.9.0', + 'aliases' => + array ( + ), + 'reference' => 'e558c88f28d102d497adec4852802c0dc14c7077', + ), + 'composer/metadata-minifier' => + array ( + 'pretty_version' => '1.0.0', + 'version' => '1.0.0.0', + 'aliases' => + array ( + ), + 'reference' => 'c549d23829536f0d0e984aaabbf02af91f443207', + ), + 'composer/package-versions-deprecated' => + array ( + 'pretty_version' => '1.11.99.4', + 'version' => '1.11.99.4', + 'aliases' => + array ( + ), + 'reference' => 'b174585d1fe49ceed21928a945138948cb394600', + ), + 'composer/semver' => + array ( + 'pretty_version' => '3.2.5', + 'version' => '3.2.5.0', + 'aliases' => + array ( + ), + 'reference' => '31f3ea725711245195f62e54ffa402d8ef2fdba9', + ), + 'composer/spdx-licenses' => + array ( + 'pretty_version' => '1.5.5', + 'version' => '1.5.5.0', + 'aliases' => + array ( + ), + 'reference' => 'de30328a7af8680efdc03e396aad24befd513200', + ), + 'composer/xdebug-handler' => + array ( + 'pretty_version' => '2.0.2', + 'version' => '2.0.2.0', + 'aliases' => + array ( + ), + 'reference' => '84674dd3a7575ba617f5a76d7e9e29a7d3891339', + ), + 'dealerdirect/phpcodesniffer-composer-installer' => + array ( + 'pretty_version' => 'v0.7.1', + 'version' => '0.7.1.0', + 'aliases' => + array ( + ), + 'reference' => 'fe390591e0241955f22eb9ba327d137e501c771c', + ), + 'doctrine/cache' => + array ( + 'pretty_version' => '2.1.1', + 'version' => '2.1.1.0', + 'aliases' => + array ( + ), + 'reference' => '331b4d5dbaeab3827976273e9356b3b453c300ce', + ), + 'doctrine/dbal' => + array ( + 'pretty_version' => '3.1.3', + 'version' => '3.1.3.0', + 'aliases' => + array ( + ), + 'reference' => '96b0053775a544b4a6ab47654dac0621be8b4cf8', + ), + 'doctrine/deprecations' => + array ( + 'pretty_version' => 'v0.5.3', + 'version' => '0.5.3.0', + 'aliases' => + array ( + ), + 'reference' => '9504165960a1f83cc1480e2be1dd0a0478561314', + ), + 'doctrine/event-manager' => + array ( + 'pretty_version' => '1.1.1', + 'version' => '1.1.1.0', + 'aliases' => + array ( + ), + 'reference' => '41370af6a30faa9dc0368c4a6814d596e81aba7f', + ), + 'doctrine/instantiator' => + array ( + 'pretty_version' => '1.4.0', + 'version' => '1.4.0.0', + 'aliases' => + array ( + ), + 'reference' => 'd56bf6102915de5702778fe20f2de3b2fe570b5b', + ), + 'jasny/twig-extensions' => + array ( + 'pretty_version' => 'v1.3.0', + 'version' => '1.3.0.0', + 'aliases' => + array ( + ), + 'reference' => 'a694eb02f6fc14ff8e2fceb8b80882c0c926102b', + ), + 'jdorn/sql-formatter' => + array ( + 'pretty_version' => 'v1.2.17', + 'version' => '1.2.17.0', + 'aliases' => + array ( + ), + 'reference' => '64990d96e0959dff8e059dfcdc1af130728d92bc', + ), + 'josegonzalez/dotenv' => + array ( + 'pretty_version' => '3.2.0', + 'version' => '3.2.0.0', + 'aliases' => + array ( + ), + 'reference' => 'f19174d9d7213a6c20e8e5e268aa7dd042d821ca', + ), + 'justinrainbow/json-schema' => + array ( + 'pretty_version' => '5.2.11', + 'version' => '5.2.11.0', + 'aliases' => + array ( + ), + 'reference' => '2ab6744b7296ded80f8cc4f9509abbff393399aa', + ), + 'laminas/laminas-diactoros' => + array ( + 'pretty_version' => '2.8.0', + 'version' => '2.8.0.0', + 'aliases' => + array ( + ), + 'reference' => '0c26ef1d95b6d7e6e3943a243ba3dc0797227199', + ), + 'laminas/laminas-httphandlerrunner' => + array ( + 'pretty_version' => '1.5.0', + 'version' => '1.5.0.0', + 'aliases' => + array ( + ), + 'reference' => '5f94e55d93f756e8ad07b9049aeb3d6d84582d0e', + ), + 'laminas/laminas-zendframework-bridge' => + array ( + 'pretty_version' => '1.4.0', + 'version' => '1.4.0.0', + 'aliases' => + array ( + ), + 'reference' => 'bf180a382393e7db5c1e8d0f2ec0c4af9c724baf', + ), + 'league/container' => + array ( + 'pretty_version' => '3.4.1', + 'version' => '3.4.1.0', + 'aliases' => + array ( + ), + 'reference' => '84ecbc2dbecc31bd23faf759a0e329ee49abddbd', + ), + 'm1/env' => + array ( + 'pretty_version' => '2.2.0', + 'version' => '2.2.0.0', + 'aliases' => + array ( + ), + 'reference' => '5c296e3e13450a207e12b343f3af1d7ab569f6f3', + ), + 'mobiledetect/mobiledetectlib' => + array ( + 'pretty_version' => '2.8.37', + 'version' => '2.8.37.0', + 'aliases' => + array ( + ), + 'reference' => '9841e3c46f5bd0739b53aed8ac677fa712943df7', + ), + 'myclabs/deep-copy' => + array ( + 'pretty_version' => '1.10.2', + 'version' => '1.10.2.0', + 'aliases' => + array ( + ), + 'reference' => '776f831124e9c62e1a2c601ecc52e776d8bb7220', + 'replaced' => + array ( + 0 => '1.10.2', + ), + ), + 'nikic/php-parser' => + array ( + 'pretty_version' => 'v4.13.0', + 'version' => '4.13.0.0', + 'aliases' => + array ( + ), + 'reference' => '50953a2691a922aa1769461637869a0a2faa3f53', + ), + 'ocramius/package-versions' => + array ( + 'replaced' => + array ( + 0 => '1.11.99', + ), + ), + 'orno/di' => + array ( + 'replaced' => + array ( + 0 => '~2.0', + ), + ), + 'phar-io/manifest' => + array ( + 'pretty_version' => '2.0.3', + 'version' => '2.0.3.0', + 'aliases' => + array ( + ), + 'reference' => '97803eca37d319dfa7826cc2437fc020857acb53', + ), + 'phar-io/version' => + array ( + 'pretty_version' => '3.1.0', + 'version' => '3.1.0.0', + 'aliases' => + array ( + ), + 'reference' => 'bae7c545bef187884426f042434e561ab1ddb182', + ), + 'phpdocumentor/reflection-common' => + array ( + 'pretty_version' => '2.2.0', + 'version' => '2.2.0.0', + 'aliases' => + array ( + ), + 'reference' => '1d01c49d4ed62f25aa84a747ad35d5a16924662b', + ), + 'phpdocumentor/reflection-docblock' => + array ( + 'pretty_version' => '5.2.2', + 'version' => '5.2.2.0', + 'aliases' => + array ( + ), + 'reference' => '069a785b2141f5bcf49f3e353548dc1cce6df556', + ), + 'phpdocumentor/type-resolver' => + array ( + 'pretty_version' => '1.5.1', + 'version' => '1.5.1.0', + 'aliases' => + array ( + ), + 'reference' => 'a12f7e301eb7258bb68acd89d4aefa05c2906cae', + ), + 'phpspec/prophecy' => + array ( + 'pretty_version' => '1.14.0', + 'version' => '1.14.0.0', + 'aliases' => + array ( + ), + 'reference' => 'd86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e', + ), + 'phpstan/phpdoc-parser' => + array ( + 'pretty_version' => '0.4.9', + 'version' => '0.4.9.0', + 'aliases' => + array ( + ), + 'reference' => '98a088b17966bdf6ee25c8a4b634df313d8aa531', + ), + 'phpunit/php-code-coverage' => + array ( + 'pretty_version' => '9.2.7', + 'version' => '9.2.7.0', + 'aliases' => + array ( + ), + 'reference' => 'd4c798ed8d51506800b441f7a13ecb0f76f12218', + ), + 'phpunit/php-file-iterator' => + array ( + 'pretty_version' => '3.0.5', + 'version' => '3.0.5.0', + 'aliases' => + array ( + ), + 'reference' => 'aa4be8575f26070b100fccb67faabb28f21f66f8', + ), + 'phpunit/php-invoker' => + array ( + 'pretty_version' => '3.1.1', + 'version' => '3.1.1.0', + 'aliases' => + array ( + ), + 'reference' => '5a10147d0aaf65b58940a0b72f71c9ac0423cc67', + ), + 'phpunit/php-text-template' => + array ( + 'pretty_version' => '2.0.4', + 'version' => '2.0.4.0', + 'aliases' => + array ( + ), + 'reference' => '5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28', + ), + 'phpunit/php-timer' => + array ( + 'pretty_version' => '5.0.3', + 'version' => '5.0.3.0', + 'aliases' => + array ( + ), + 'reference' => '5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2', + ), + 'phpunit/phpunit' => + array ( + 'pretty_version' => '9.5.10', + 'version' => '9.5.10.0', + 'aliases' => + array ( + ), + 'reference' => 'c814a05837f2edb0d1471d6e3f4ab3501ca3899a', + ), + 'psr/container' => + array ( + 'pretty_version' => '1.1.1', + 'version' => '1.1.1.0', + 'aliases' => + array ( + ), + 'reference' => '8622567409010282b7aeebe4bb841fe98b58dcaf', + ), + 'psr/container-implementation' => + array ( + 'provided' => + array ( + 0 => '^1.0', + ), + ), + 'psr/http-client' => + array ( + 'pretty_version' => '1.0.1', + 'version' => '1.0.1.0', + 'aliases' => + array ( + ), + 'reference' => '2dfb5f6c5eff0e91e20e913f8c5452ed95b86621', + ), + 'psr/http-factory' => + array ( + 'pretty_version' => '1.0.1', + 'version' => '1.0.1.0', + 'aliases' => + array ( + ), + 'reference' => '12ac7fcd07e5b077433f5f2bee95b3a771bf61be', + ), + 'psr/http-factory-implementation' => + array ( + 'provided' => + array ( + 0 => '1.0', + ), + ), + 'psr/http-message' => + array ( + 'pretty_version' => '1.0.1', + 'version' => '1.0.1.0', + 'aliases' => + array ( + ), + 'reference' => 'f6561bf28d520154e4b0ec72be95418abe6d9363', + ), + 'psr/http-message-implementation' => + array ( + 'provided' => + array ( + 0 => '1.0', + ), + ), + 'psr/http-server-handler' => + array ( + 'pretty_version' => '1.0.1', + 'version' => '1.0.1.0', + 'aliases' => + array ( + ), + 'reference' => 'aff2f80e33b7f026ec96bb42f63242dc50ffcae7', + ), + 'psr/http-server-middleware' => + array ( + 'pretty_version' => '1.0.1', + 'version' => '1.0.1.0', + 'aliases' => + array ( + ), + 'reference' => '2296f45510945530b9dceb8bcedb5cb84d40c5f5', + ), + 'psr/log' => + array ( + 'pretty_version' => '1.1.4', + 'version' => '1.1.4.0', + 'aliases' => + array ( + ), + 'reference' => 'd49695b909c3b7628b6289db5479a1c204601f11', + ), + 'psr/log-implementation' => + array ( + 'provided' => + array ( + 0 => '1.0|2.0', + ), + ), + 'psr/simple-cache' => + array ( + 'pretty_version' => '1.0.1', + 'version' => '1.0.1.0', + 'aliases' => + array ( + ), + 'reference' => '408d5eafb83c57f6365a3ca330ff23aa4a5fa39b', + ), + 'psy/psysh' => + array ( + 'pretty_version' => 'v0.10.9', + 'version' => '0.10.9.0', + 'aliases' => + array ( + ), + 'reference' => '01281336c4ae557fe4a994544f30d3a1bc204375', + ), + 'react/promise' => + array ( + 'pretty_version' => 'v2.8.0', + 'version' => '2.8.0.0', + 'aliases' => + array ( + ), + 'reference' => 'f3cff96a19736714524ca0dd1d4130de73dbbbc4', + ), + 'robmorgan/phinx' => + array ( + 'pretty_version' => '0.12.8', + 'version' => '0.12.8.0', + 'aliases' => + array ( + ), + 'reference' => 'd2ed1b452cc90f4cae4ea6b5976b94fb9e5ed2a2', + ), + 'sebastian/cli-parser' => + array ( + 'pretty_version' => '1.0.1', + 'version' => '1.0.1.0', + 'aliases' => + array ( + ), + 'reference' => '442e7c7e687e42adc03470c7b668bc4b2402c0b2', + ), + 'sebastian/code-unit' => + array ( + 'pretty_version' => '1.0.8', + 'version' => '1.0.8.0', + 'aliases' => + array ( + ), + 'reference' => '1fc9f64c0927627ef78ba436c9b17d967e68e120', + ), + 'sebastian/code-unit-reverse-lookup' => + array ( + 'pretty_version' => '2.0.3', + 'version' => '2.0.3.0', + 'aliases' => + array ( + ), + 'reference' => 'ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5', + ), + 'sebastian/comparator' => + array ( + 'pretty_version' => '4.0.6', + 'version' => '4.0.6.0', + 'aliases' => + array ( + ), + 'reference' => '55f4261989e546dc112258c7a75935a81a7ce382', + ), + 'sebastian/complexity' => + array ( + 'pretty_version' => '2.0.2', + 'version' => '2.0.2.0', + 'aliases' => + array ( + ), + 'reference' => '739b35e53379900cc9ac327b2147867b8b6efd88', + ), + 'sebastian/diff' => + array ( + 'pretty_version' => '4.0.4', + 'version' => '4.0.4.0', + 'aliases' => + array ( + ), + 'reference' => '3461e3fccc7cfdfc2720be910d3bd73c69be590d', + ), + 'sebastian/environment' => + array ( + 'pretty_version' => '5.1.3', + 'version' => '5.1.3.0', + 'aliases' => + array ( + ), + 'reference' => '388b6ced16caa751030f6a69e588299fa09200ac', + ), + 'sebastian/exporter' => + array ( + 'pretty_version' => '4.0.3', + 'version' => '4.0.3.0', + 'aliases' => + array ( + ), + 'reference' => 'd89cc98761b8cb5a1a235a6b703ae50d34080e65', + ), + 'sebastian/global-state' => + array ( + 'pretty_version' => '5.0.3', + 'version' => '5.0.3.0', + 'aliases' => + array ( + ), + 'reference' => '23bd5951f7ff26f12d4e3242864df3e08dec4e49', + ), + 'sebastian/lines-of-code' => + array ( + 'pretty_version' => '1.0.3', + 'version' => '1.0.3.0', + 'aliases' => + array ( + ), + 'reference' => 'c1c2e997aa3146983ed888ad08b15470a2e22ecc', + ), + 'sebastian/object-enumerator' => + array ( + 'pretty_version' => '4.0.4', + 'version' => '4.0.4.0', + 'aliases' => + array ( + ), + 'reference' => '5c9eeac41b290a3712d88851518825ad78f45c71', + ), + 'sebastian/object-reflector' => + array ( + 'pretty_version' => '2.0.4', + 'version' => '2.0.4.0', + 'aliases' => + array ( + ), + 'reference' => 'b4f479ebdbf63ac605d183ece17d8d7fe49c15c7', + ), + 'sebastian/recursion-context' => + array ( + 'pretty_version' => '4.0.4', + 'version' => '4.0.4.0', + 'aliases' => + array ( + ), + 'reference' => 'cd9d8cf3c5804de4341c283ed787f099f5506172', + ), + 'sebastian/resource-operations' => + array ( + 'pretty_version' => '3.0.3', + 'version' => '3.0.3.0', + 'aliases' => + array ( + ), + 'reference' => '0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8', + ), + 'sebastian/type' => + array ( + 'pretty_version' => '2.3.4', + 'version' => '2.3.4.0', + 'aliases' => + array ( + ), + 'reference' => 'b8cd8a1c753c90bc1a0f5372170e3e489136f914', + ), + 'sebastian/version' => + array ( + 'pretty_version' => '3.0.2', + 'version' => '3.0.2.0', + 'aliases' => + array ( + ), + 'reference' => 'c6c1022351a901512170118436c764e473f6de8c', + ), + 'seld/jsonlint' => + array ( + 'pretty_version' => '1.8.3', + 'version' => '1.8.3.0', + 'aliases' => + array ( + ), + 'reference' => '9ad6ce79c342fbd44df10ea95511a1b24dee5b57', + ), + 'seld/phar-utils' => + array ( + 'pretty_version' => '1.1.2', + 'version' => '1.1.2.0', + 'aliases' => + array ( + ), + 'reference' => '749042a2315705d2dfbbc59234dd9ceb22bf3ff0', + ), + 'slevomat/coding-standard' => + array ( + 'pretty_version' => '6.4.1', + 'version' => '6.4.1.0', + 'aliases' => + array ( + ), + 'reference' => '696dcca217d0c9da2c40d02731526c1e25b65346', + ), + 'squizlabs/php_codesniffer' => + array ( + 'pretty_version' => '3.5.8', + 'version' => '3.5.8.0', + 'aliases' => + array ( + ), + 'reference' => '9d583721a7157ee997f235f327de038e7ea6dac4', + ), + 'symfony/config' => + array ( + 'pretty_version' => 'v5.3.4', + 'version' => '5.3.4.0', + 'aliases' => + array ( + ), + 'reference' => '4268f3059c904c61636275182707f81645517a37', + ), + 'symfony/console' => + array ( + 'pretty_version' => 'v5.3.7', + 'version' => '5.3.7.0', + 'aliases' => + array ( + ), + 'reference' => '8b1008344647462ae6ec57559da166c2bfa5e16a', + ), + 'symfony/deprecation-contracts' => + array ( + 'pretty_version' => 'v2.4.0', + 'version' => '2.4.0.0', + 'aliases' => + array ( + ), + 'reference' => '5f38c8804a9e97d23e0c8d63341088cd8a22d627', + ), + 'symfony/filesystem' => + array ( + 'pretty_version' => 'v5.3.4', + 'version' => '5.3.4.0', + 'aliases' => + array ( + ), + 'reference' => '343f4fe324383ca46792cae728a3b6e2f708fb32', + ), + 'symfony/finder' => + array ( + 'pretty_version' => 'v5.3.7', + 'version' => '5.3.7.0', + 'aliases' => + array ( + ), + 'reference' => 'a10000ada1e600d109a6c7632e9ac42e8bf2fb93', + ), + 'symfony/polyfill-ctype' => + array ( + 'pretty_version' => 'v1.23.0', + 'version' => '1.23.0.0', + 'aliases' => + array ( + ), + 'reference' => '46cd95797e9df938fdd2b03693b5fca5e64b01ce', + ), + 'symfony/polyfill-intl-grapheme' => + array ( + 'pretty_version' => 'v1.23.1', + 'version' => '1.23.1.0', + 'aliases' => + array ( + ), + 'reference' => '16880ba9c5ebe3642d1995ab866db29270b36535', + ), + 'symfony/polyfill-intl-normalizer' => + array ( + 'pretty_version' => 'v1.23.0', + 'version' => '1.23.0.0', + 'aliases' => + array ( + ), + 'reference' => '8590a5f561694770bdcd3f9b5c69dde6945028e8', + ), + 'symfony/polyfill-mbstring' => + array ( + 'pretty_version' => 'v1.23.1', + 'version' => '1.23.1.0', + 'aliases' => + array ( + ), + 'reference' => '9174a3d80210dca8daa7f31fec659150bbeabfc6', + ), + 'symfony/polyfill-php73' => + array ( + 'pretty_version' => 'v1.23.0', + 'version' => '1.23.0.0', + 'aliases' => + array ( + ), + 'reference' => 'fba8933c384d6476ab14fb7b8526e5287ca7e010', + ), + 'symfony/polyfill-php80' => + array ( + 'pretty_version' => 'v1.23.1', + 'version' => '1.23.1.0', + 'aliases' => + array ( + ), + 'reference' => '1100343ed1a92e3a38f9ae122fc0eb21602547be', + ), + 'symfony/polyfill-php81' => + array ( + 'pretty_version' => 'v1.23.0', + 'version' => '1.23.0.0', + 'aliases' => + array ( + ), + 'reference' => 'e66119f3de95efc359483f810c4c3e6436279436', + ), + 'symfony/process' => + array ( + 'pretty_version' => 'v5.3.7', + 'version' => '5.3.7.0', + 'aliases' => + array ( + ), + 'reference' => '38f26c7d6ed535217ea393e05634cb0b244a1967', + ), + 'symfony/service-contracts' => + array ( + 'pretty_version' => 'v2.4.0', + 'version' => '2.4.0.0', + 'aliases' => + array ( + ), + 'reference' => 'f040a30e04b57fbcc9c6cbcf4dbaa96bd318b9bb', + ), + 'symfony/string' => + array ( + 'pretty_version' => 'v5.3.7', + 'version' => '5.3.7.0', + 'aliases' => + array ( + ), + 'reference' => '8d224396e28d30f81969f083a58763b8b9ceb0a5', + ), + 'symfony/var-dumper' => + array ( + 'pretty_version' => 'v5.3.8', + 'version' => '5.3.8.0', + 'aliases' => + array ( + ), + 'reference' => 'eaaea4098be1c90c8285543e1356a09c8aa5c8da', + ), + 'theseer/tokenizer' => + array ( + 'pretty_version' => '1.2.1', + 'version' => '1.2.1.0', + 'aliases' => + array ( + ), + 'reference' => '34a41e998c2183e22995f158c581e7b5e755ab9e', + ), + 'twig/markdown-extra' => + array ( + 'pretty_version' => 'v3.3.3', + 'version' => '3.3.3.0', + 'aliases' => + array ( + ), + 'reference' => '725a4ef89d93bb80fc63c67cf261bf7512649290', + ), + 'twig/twig' => + array ( + 'pretty_version' => 'v3.3.3', + 'version' => '3.3.3.0', + 'aliases' => + array ( + ), + 'reference' => 'a27fa056df8a6384316288ca8b0fa3a35fdeb569', + ), + 'webmozart/assert' => + array ( + 'pretty_version' => '1.10.0', + 'version' => '1.10.0.0', + 'aliases' => + array ( + ), + 'reference' => '6964c76c7804814a842473e0c8fd15bab0f18e25', + ), + 'zendframework/zend-httphandlerrunner' => + array ( + 'replaced' => + array ( + 0 => '^1.1.0', + ), + ), + ), ); diff --git a/app/vendor/composer/package-versions-deprecated/CHANGELOG.md b/app/vendor/composer/package-versions-deprecated/CHANGELOG.md new file mode 100644 index 000000000..a838c56ad --- /dev/null +++ b/app/vendor/composer/package-versions-deprecated/CHANGELOG.md @@ -0,0 +1,120 @@ +# CHANGELOG + +## 1.1.3 - 2017-09-06 + +This release fixes a bug that caused PackageVersions to prevent +the `composer remove` and `composer update` commands to fail when +this package is removed. + +In addition to that, mutation testing has been added to the suite, +ensuring that the package is accurately and extensively tested. + +Total issues resolved: **3** + +- [40: Mutation testing, PHP 7.1 testing](https://github.com/Ocramius/PackageVersions/pull/40) thanks to @Ocramius +- [41: Removing this package on install results in file access error](https://github.com/Ocramius/PackageVersions/issues/41) thanks to @Xerkus +- [46: #41 Avoid issues when the package is scheduled for removal](https://github.com/Ocramius/PackageVersions/pull/46) thanks to @Jean85 + +## 1.1.2 - 2016-12-30 + +This release fixes a bug that caused PackageVersions to be enabled +even when it was part of a globally installed package. + +Total issues resolved: **3** + +- [35: remove all temp directories](https://github.com/Ocramius/PackageVersions/pull/35) +- [38: Interferes with other projects when installed globally](https://github.com/Ocramius/PackageVersions/issues/38) +- [39: Ignore the global plugin when updating local projects](https://github.com/Ocramius/PackageVersions/pull/39) + +## 1.1.1 - 2016-07-25 + +This release removes the [`"files"`](https://getcomposer.org/doc/04-schema.md#files) directive from +[`composer.json`](https://github.com/Ocramius/PackageVersions/commit/86f2636f7c5e7b56fa035fa3826d5fcf80b6dc72), +as it is no longer needed for `composer install --classmap-authoritative`. +Also, that directive was causing issues with HHVM installations, since +PackageVersions is not compatible with it. + +Total issues resolved: **1** + +- [34: Fatal error during travis build after update to 1.1.0](https://github.com/Ocramius/PackageVersions/issues/34) + +## 1.1.0 - 2016-07-22 + +This release introduces support for running `composer install --classmap-authoritative` +and `composer install --no-scripts`. Please note that performance +while using these modes may be degraded, but the package will +still work. + +Additionally, the package was tuned to prevent the plugin from +running twice at installation. + +Total issues resolved: **10** + +- [18: Fails when using composer install --no-scripts](https://github.com/Ocramius/PackageVersions/issues/18) +- [20: CS (spacing)](https://github.com/Ocramius/PackageVersions/pull/20) +- [22: Document the way the require-dev section is treated](https://github.com/Ocramius/PackageVersions/issues/22) +- [23: Underline that composer.lock is used as source of information](https://github.com/Ocramius/PackageVersions/pull/23) +- [27: Fix incompatibility with --classmap-authoritative](https://github.com/Ocramius/PackageVersions/pull/27) +- [29: mention optimize-autoloader composer.json config option in README](https://github.com/Ocramius/PackageVersions/pull/29) +- [30: The version class is generated twice during composer update](https://github.com/Ocramius/PackageVersions/issues/30) +- [31: Remove double registration of the event listeners](https://github.com/Ocramius/PackageVersions/pull/31) +- [32: Update the usage of mock APIs to use the new API](https://github.com/Ocramius/PackageVersions/pull/32) +- [33: Fix for #18 - support running with --no-scripts flag](https://github.com/Ocramius/PackageVersions/pull/33) + +## 1.0.4 - 2016-04-23 + +This release includes a fix/workaround for composer/composer#5237, +which causes `ocramius/package-versions` to sometimes generate a +`Versions` class with malformed name (something like +`Versions_composer_tmp0`) when running `composer require `. + +Total issues resolved: **2** + +- [16: Workaround for composer/composer#5237 - class parsing](https://github.com/Ocramius/PackageVersions/pull/16) +- [17: Weird Class name being generated](https://github.com/Ocramius/PackageVersions/issues/17) + +## 1.0.3 - 2016-02-26 + +This release fixes an issue related to concurrent autoloader +re-generation caused by multiple composer plugins being installed. +The issue was solved by removing autoloader re-generation from this +package, but it may still affect other packages. + +It is now recommended that you run `composer dump-autoload --optimize` +after installation when using this particular package. +Please note that `composer (install|update) -o` is not sufficient +to avoid autoload overhead when using this particular package. + +Total issues resolved: **1** + +- [15: Remove autoload re-dump optimization](https://github.com/Ocramius/PackageVersions/pull/15) + +## 1.0.2 - 2016-02-24 + +This release fixes issues related to installing the component without +any dev dependencies or with packages that don't have a source or dist +reference, which is usual with packages defined directly in the +`composer.json`. + +Total issues resolved: **3** + +- [11: fix composer install --no-dev PHP7](https://github.com/Ocramius/PackageVersions/pull/11) +- [12: Packages don't always have a source/reference](https://github.com/Ocramius/PackageVersions/issues/12) +- [13: Fix #12 - support dist and missing package version references](https://github.com/Ocramius/PackageVersions/pull/13) + +## 1.0.1 - 2016-02-01 + +This release fixes an issue related with composer updates to +already installed versions. +Using `composer require` within a package that already used +`ocramius/package-versions` caused the installation to be unable +to write the `PackageVersions\Versions` class to a file. + +Total issues resolved: **6** + +- [2: remove unused use statement](https://github.com/Ocramius/PackageVersions/pull/2) +- [3: Remove useless files from dist package](https://github.com/Ocramius/PackageVersions/pull/3) +- [5: failed to open stream: phar error: write operations disabled by the php.ini setting phar.readonly](https://github.com/Ocramius/PackageVersions/issues/5) +- [6: Fix/#5 use composer vendor dir](https://github.com/Ocramius/PackageVersions/pull/6) +- [7: Hotfix - #5 generate package versions also when in phar context](https://github.com/Ocramius/PackageVersions/pull/7) +- [8: Versions class should be ignored by VCS, as it is an install-time artifact](https://github.com/Ocramius/PackageVersions/pull/8) diff --git a/app/vendor/composer/package-versions-deprecated/CONTRIBUTING.md b/app/vendor/composer/package-versions-deprecated/CONTRIBUTING.md new file mode 100644 index 000000000..718061758 --- /dev/null +++ b/app/vendor/composer/package-versions-deprecated/CONTRIBUTING.md @@ -0,0 +1,39 @@ +--- +title: Contributing +--- + +# Contributing + + * Coding standard for the project is [PSR-2](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md) + * The project will follow strict [object calisthenics](http://www.slideshare.net/guilhermeblanco/object-calisthenics-applied-to-php) + * Any contribution must provide tests for additional introduced conditions + * Any un-confirmed issue needs a failing test case before being accepted + * Pull requests must be sent from a new hotfix/feature branch, not from `master`. + +## Installation + +To install the project and run the tests, you need to clone it first: + +```sh +$ git clone git://github.com/Ocramius/PackageVersions.git +``` + +You will then need to run a composer installation: + +```sh +$ cd PackageVersions +$ curl -s https://getcomposer.org/installer | php +$ php composer.phar update +``` + +## Testing + +The PHPUnit version to be used is the one installed as a dev- dependency via composer: + +```sh +$ ./vendor/bin/phpunit +``` + +Accepted coverage for new contributions is 80%. Any contribution not satisfying this requirement +won't be merged. + diff --git a/app/vendor/composer/package-versions-deprecated/LICENSE b/app/vendor/composer/package-versions-deprecated/LICENSE new file mode 100644 index 000000000..a90b0792c --- /dev/null +++ b/app/vendor/composer/package-versions-deprecated/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2016 Marco Pivetta + +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/app/vendor/composer/package-versions-deprecated/README.md b/app/vendor/composer/package-versions-deprecated/README.md new file mode 100644 index 000000000..7fe2097d4 --- /dev/null +++ b/app/vendor/composer/package-versions-deprecated/README.md @@ -0,0 +1,5 @@ +# Package Versions + +**`composer/package-versions-deprecated` is a fully-compatible fork of [`ocramius/package-versions`](https://github.com/Ocramius/PackageVersions)** which provides compatibility with Composer 1 and 2 on PHP 7+. It replaces ocramius/package-versions so if you have a dependency requiring it and you want to use Composer v2 but can not upgrade to PHP 7.4 just yet, you can require this package instead. + +If you have a direct dependency on ocramius/package-versions, we recommend instead that once you migrated to Composer 2 you also migrate to use the `Composer\InstalledVersions` class which offers the functionality present here out of the box. diff --git a/app/vendor/composer/package-versions-deprecated/SECURITY.md b/app/vendor/composer/package-versions-deprecated/SECURITY.md new file mode 100644 index 000000000..da9c516dd --- /dev/null +++ b/app/vendor/composer/package-versions-deprecated/SECURITY.md @@ -0,0 +1,5 @@ +## Security contact information + +To report a security vulnerability, please use the +[Tidelift security contact](https://tidelift.com/security). +Tidelift will coordinate the fix and disclosure. diff --git a/app/vendor/composer/package-versions-deprecated/composer.json b/app/vendor/composer/package-versions-deprecated/composer.json new file mode 100644 index 000000000..d5a40daac --- /dev/null +++ b/app/vendor/composer/package-versions-deprecated/composer.json @@ -0,0 +1,48 @@ +{ + "name": "composer/package-versions-deprecated", + "description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)", + "type": "composer-plugin", + "license": "MIT", + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be" + } + ], + "require": { + "php": "^7 || ^8", + "composer-plugin-api": "^1.1.0 || ^2.0" + }, + "replace": { + "ocramius/package-versions": "1.11.99" + }, + "require-dev": { + "phpunit/phpunit": "^6.5 || ^7", + "composer/composer": "^1.9.3 || ^2.0@dev", + "ext-zip": "^1.13" + }, + "autoload": { + "psr-4": { + "PackageVersions\\": "src/PackageVersions" + } + }, + "autoload-dev": { + "psr-4": { + "PackageVersionsTest\\": "test/PackageVersionsTest" + } + }, + "extra": { + "class": "PackageVersions\\Installer", + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "scripts": { + "post-update-cmd": "PackageVersions\\Installer::dumpVersionsClass", + "post-install-cmd": "PackageVersions\\Installer::dumpVersionsClass" + } +} diff --git a/app/vendor/composer/package-versions-deprecated/composer.lock b/app/vendor/composer/package-versions-deprecated/composer.lock new file mode 100644 index 000000000..b711f6b13 --- /dev/null +++ b/app/vendor/composer/package-versions-deprecated/composer.lock @@ -0,0 +1,2603 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "6bfe0a7d7a51c4bdf14a2d7ea1d22d11", + "packages": [], + "packages-dev": [ + { + "name": "composer/ca-bundle", + "version": "1.2.7", + "source": { + "type": "git", + "url": "https://github.com/composer/ca-bundle.git", + "reference": "95c63ab2117a72f48f5a55da9740a3273d45b7fd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/95c63ab2117a72f48f5a55da9740a3273d45b7fd", + "reference": "95c63ab2117a72f48f5a55da9740a3273d45b7fd", + "shasum": "" + }, + "require": { + "ext-openssl": "*", + "ext-pcre": "*", + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || 6.5 - 8", + "psr/log": "^1.0", + "symfony/process": "^2.5 || ^3.0 || ^4.0 || ^5.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\CaBundle\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "Lets you find a path to the system CA bundle, and includes a fallback to the Mozilla CA bundle.", + "keywords": [ + "cabundle", + "cacert", + "certificate", + "ssl", + "tls" + ], + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2020-04-08T08:27:21+00:00" + }, + { + "name": "composer/composer", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/composer/composer.git", + "reference": "a8c105da344dd84ebd5d11be7943a45b09dc076f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/composer/zipball/a8c105da344dd84ebd5d11be7943a45b09dc076f", + "reference": "a8c105da344dd84ebd5d11be7943a45b09dc076f", + "shasum": "" + }, + "require": { + "composer/ca-bundle": "^1.0", + "composer/semver": "^1.0", + "composer/spdx-licenses": "^1.2", + "composer/xdebug-handler": "^1.1", + "justinrainbow/json-schema": "^3.0 || ^4.0 || ^5.0", + "php": "^5.3.2 || ^7.0", + "psr/log": "^1.0", + "seld/jsonlint": "^1.4", + "seld/phar-utils": "^1.0", + "symfony/console": "^2.7 || ^3.0 || ^4.0 || ^5.0", + "symfony/filesystem": "^2.7 || ^3.0 || ^4.0 || ^5.0", + "symfony/finder": "^2.7 || ^3.0 || ^4.0 || ^5.0", + "symfony/process": "^2.7 || ^3.0 || ^4.0 || ^5.0" + }, + "conflict": { + "symfony/console": "2.8.38" + }, + "require-dev": { + "phpspec/prophecy": "^1.10", + "symfony/phpunit-bridge": "^3.4" + }, + "suggest": { + "ext-openssl": "Enabling the openssl extension allows you to access https URLs for repositories and packages", + "ext-zip": "Enabling the zip extension allows you to unzip archives", + "ext-zlib": "Allow gzip compression of HTTP requests" + }, + "bin": [ + "bin/composer" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.10-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\": "src/Composer" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "Composer helps you declare, manage and install dependencies of PHP projects. It ensures you have the right stack everywhere.", + "homepage": "https://getcomposer.org/", + "keywords": [ + "autoload", + "dependency", + "package" + ], + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/composer/issues", + "source": "https://github.com/composer/composer/tree/master" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2020-03-29T14:59:26+00:00" + }, + { + "name": "composer/semver", + "version": "1.5.1", + "source": { + "type": "git", + "url": "https://github.com/composer/semver.git", + "reference": "c6bea70230ef4dd483e6bbcab6005f682ed3a8de" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/semver/zipball/c6bea70230ef4dd483e6bbcab6005f682ed3a8de", + "reference": "c6bea70230ef4dd483e6bbcab6005f682ed3a8de", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.5 || ^5.0.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Semver\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + }, + { + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" + } + ], + "description": "Semver library that offers utilities, version constraint parsing and validation.", + "keywords": [ + "semantic", + "semver", + "validation", + "versioning" + ], + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/semver/issues", + "source": "https://github.com/composer/semver/tree/1.5.1" + }, + "time": "2020-01-13T12:06:48+00:00" + }, + { + "name": "composer/spdx-licenses", + "version": "1.5.3", + "source": { + "type": "git", + "url": "https://github.com/composer/spdx-licenses.git", + "reference": "0c3e51e1880ca149682332770e25977c70cf9dae" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/0c3e51e1880ca149682332770e25977c70cf9dae", + "reference": "0c3e51e1880ca149682332770e25977c70cf9dae", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || 6.5 - 7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Spdx\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + }, + { + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" + } + ], + "description": "SPDX licenses list and validation library.", + "keywords": [ + "license", + "spdx", + "validator" + ], + "time": "2020-02-14T07:44:31+00:00" + }, + { + "name": "composer/xdebug-handler", + "version": "1.4.1", + "source": { + "type": "git", + "url": "https://github.com/composer/xdebug-handler.git", + "reference": "1ab9842d69e64fb3a01be6b656501032d1b78cb7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/1ab9842d69e64fb3a01be6b656501032d1b78cb7", + "reference": "1ab9842d69e64fb3a01be6b656501032d1b78cb7", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0 || ^8.0", + "psr/log": "^1.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || 6.5 - 8" + }, + "type": "library", + "autoload": { + "psr-4": { + "Composer\\XdebugHandler\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "John Stevenson", + "email": "john-stevenson@blueyonder.co.uk" + } + ], + "description": "Restarts a process without Xdebug.", + "keywords": [ + "Xdebug", + "performance" + ], + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/xdebug-handler/issues", + "source": "https://github.com/composer/xdebug-handler/tree/master" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + } + ], + "time": "2020-03-01T12:26:26+00:00" + }, + { + "name": "doctrine/instantiator", + "version": "1.3.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "ae466f726242e637cebdd526a7d991b9433bacf1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/ae466f726242e637cebdd526a7d991b9433bacf1", + "reference": "ae466f726242e637cebdd526a7d991b9433bacf1", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "require-dev": { + "doctrine/coding-standard": "^6.0", + "ext-pdo": "*", + "ext-phar": "*", + "phpbench/phpbench": "^0.13", + "phpstan/phpstan-phpunit": "^0.11", + "phpstan/phpstan-shim": "^0.11", + "phpunit/phpunit": "^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "http://ocramius.github.com/" + } + ], + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://www.doctrine-project.org/projects/instantiator.html", + "keywords": [ + "constructor", + "instantiate" + ], + "support": { + "issues": "https://github.com/doctrine/instantiator/issues", + "source": "https://github.com/doctrine/instantiator/tree/master" + }, + "time": "2019-10-21T16:45:58+00:00" + }, + { + "name": "justinrainbow/json-schema", + "version": "5.2.9", + "source": { + "type": "git", + "url": "https://github.com/justinrainbow/json-schema.git", + "reference": "44c6787311242a979fa15c704327c20e7221a0e4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/44c6787311242a979fa15c704327c20e7221a0e4", + "reference": "44c6787311242a979fa15c704327c20e7221a0e4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "~2.2.20||~2.15.1", + "json-schema/json-schema-test-suite": "1.2.0", + "phpunit/phpunit": "^4.8.35" + }, + "bin": [ + "bin/validate-json" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "JsonSchema\\": "src/JsonSchema/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bruno Prieto Reis", + "email": "bruno.p.reis@gmail.com" + }, + { + "name": "Justin Rainbow", + "email": "justin.rainbow@gmail.com" + }, + { + "name": "Igor Wiedler", + "email": "igor@wiedler.ch" + }, + { + "name": "Robert Schönthal", + "email": "seroscho@googlemail.com" + } + ], + "description": "A library to validate a json schema.", + "homepage": "https://github.com/justinrainbow/json-schema", + "keywords": [ + "json", + "schema" + ], + "support": { + "issues": "https://github.com/justinrainbow/json-schema/issues", + "source": "https://github.com/justinrainbow/json-schema/tree/5.2.9" + }, + "time": "2019-09-25T14:49:45+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.9.5", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "b2c28789e80a97badd14145fda39b545d83ca3ef" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/b2c28789e80a97badd14145fda39b545d83ca3ef", + "reference": "b2c28789e80a97badd14145fda39b545d83ca3ef", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "replace": { + "myclabs/deep-copy": "self.version" + }, + "require-dev": { + "doctrine/collections": "^1.0", + "doctrine/common": "^2.6", + "phpunit/phpunit": "^7.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + }, + "files": [ + "src/DeepCopy/deep_copy.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "support": { + "issues": "https://github.com/myclabs/DeepCopy/issues", + "source": "https://github.com/myclabs/DeepCopy/tree/1.9.5" + }, + "time": "2020-01-17T21:11:47+00:00" + }, + { + "name": "phar-io/manifest", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", + "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-phar": "*", + "phar-io/version": "^2.0", + "php": "^5.6 || ^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "time": "2018-07-08T19:23:20+00:00" + }, + { + "name": "phar-io/version", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/45a2ec53a73c70ce41d55cedef9063630abaf1b6", + "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Library for handling version information and constraints", + "time": "2018-07-08T19:19:57+00:00" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "63a995caa1ca9e5590304cd845c15ad6d482a62a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/63a995caa1ca9e5590304cd845c15ad6d482a62a", + "reference": "63a995caa1ca9e5590304cd845c15ad6d482a62a", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "require-dev": { + "phpunit/phpunit": "~6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "homepage": "http://www.phpdoc.org", + "time": "2018-08-07T13:53:10+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "5.1.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "cd72d394ca794d3466a3b2fc09d5a6c1dc86b47e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/cd72d394ca794d3466a3b2fc09d5a6c1dc86b47e", + "reference": "cd72d394ca794d3466a3b2fc09d5a6c1dc86b47e", + "shasum": "" + }, + "require": { + "ext-filter": "^7.1", + "php": "^7.2", + "phpdocumentor/reflection-common": "^2.0", + "phpdocumentor/type-resolver": "^1.0", + "webmozart/assert": "^1" + }, + "require-dev": { + "doctrine/instantiator": "^1", + "mockery/mockery": "^1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + }, + { + "name": "Jaap van Otterdijk", + "email": "account@ijaap.nl" + } + ], + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "time": "2020-02-22T12:28:44+00:00" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "7462d5f123dfc080dfdf26897032a6513644fc95" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/7462d5f123dfc080dfdf26897032a6513644fc95", + "reference": "7462d5f123dfc080dfdf26897032a6513644fc95", + "shasum": "" + }, + "require": { + "php": "^7.2", + "phpdocumentor/reflection-common": "^2.0" + }, + "require-dev": { + "ext-tokenizer": "^7.2", + "mockery/mockery": "~1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", + "support": { + "issues": "https://github.com/phpDocumentor/TypeResolver/issues", + "source": "https://github.com/phpDocumentor/TypeResolver/tree/master" + }, + "time": "2020-02-18T18:59:58+00:00" + }, + { + "name": "phpspec/prophecy", + "version": "v1.10.3", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "451c3cd1418cf640de218914901e51b064abb093" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/451c3cd1418cf640de218914901e51b064abb093", + "reference": "451c3cd1418cf640de218914901e51b064abb093", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^5.3|^7.0", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0|^5.0", + "sebastian/comparator": "^1.2.3|^2.0|^3.0|^4.0", + "sebastian/recursion-context": "^1.0|^2.0|^3.0|^4.0" + }, + "require-dev": { + "phpspec/phpspec": "^2.5 || ^3.2", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.10.x-dev" + } + }, + "autoload": { + "psr-4": { + "Prophecy\\": "src/Prophecy" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + }, + { + "name": "Marcello Duarte", + "email": "marcello.duarte@gmail.com" + } + ], + "description": "Highly opinionated mocking framework for PHP 5.3+", + "homepage": "https://github.com/phpspec/prophecy", + "keywords": [ + "Double", + "Dummy", + "fake", + "mock", + "spy", + "stub" + ], + "support": { + "issues": "https://github.com/phpspec/prophecy/issues", + "source": "https://github.com/phpspec/prophecy/tree/v1.10.3" + }, + "time": "2020-03-05T15:02:03+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "6.1.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "807e6013b00af69b6c5d9ceb4282d0393dbb9d8d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/807e6013b00af69b6c5d9ceb4282d0393dbb9d8d", + "reference": "807e6013b00af69b6c5d9ceb4282d0393dbb9d8d", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-xmlwriter": "*", + "php": "^7.1", + "phpunit/php-file-iterator": "^2.0", + "phpunit/php-text-template": "^1.2.1", + "phpunit/php-token-stream": "^3.0", + "sebastian/code-unit-reverse-lookup": "^1.0.1", + "sebastian/environment": "^3.1 || ^4.0", + "sebastian/version": "^2.0.1", + "theseer/tokenizer": "^1.1" + }, + "require-dev": { + "phpunit/phpunit": "^7.0" + }, + "suggest": { + "ext-xdebug": "^2.6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "6.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "time": "2018-10-31T16:06:48+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "050bedf145a257b1ff02746c31894800e5122946" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/050bedf145a257b1ff02746c31894800e5122946", + "reference": "050bedf145a257b1ff02746c31894800e5122946", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "require-dev": { + "phpunit/phpunit": "^7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "time": "2018-09-13T20:33:42+00:00" + }, + { + "name": "phpunit/php-text-template", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "time": "2015-06-21T13:50:34+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "2.1.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "1038454804406b0b5f5f520358e78c1c2f71501e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/1038454804406b0b5f5f520358e78c1c2f71501e", + "reference": "1038454804406b0b5f5f520358e78c1c2f71501e", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "require-dev": { + "phpunit/phpunit": "^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "time": "2019-06-07T04:22:29+00:00" + }, + { + "name": "phpunit/php-token-stream", + "version": "3.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-token-stream.git", + "reference": "995192df77f63a59e47f025390d2d1fdf8f425ff" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/995192df77f63a59e47f025390d2d1fdf8f425ff", + "reference": "995192df77f63a59e47f025390d2d1fdf8f425ff", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": "^7.1" + }, + "require-dev": { + "phpunit/phpunit": "^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Wrapper around PHP's tokenizer extension.", + "homepage": "https://github.com/sebastianbergmann/php-token-stream/", + "keywords": [ + "tokenizer" + ], + "time": "2019-09-17T06:23:10+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "7.5.20", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "9467db479d1b0487c99733bb1e7944d32deded2c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/9467db479d1b0487c99733bb1e7944d32deded2c", + "reference": "9467db479d1b0487c99733bb1e7944d32deded2c", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.1", + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "myclabs/deep-copy": "^1.7", + "phar-io/manifest": "^1.0.2", + "phar-io/version": "^2.0", + "php": "^7.1", + "phpspec/prophecy": "^1.7", + "phpunit/php-code-coverage": "^6.0.7", + "phpunit/php-file-iterator": "^2.0.1", + "phpunit/php-text-template": "^1.2.1", + "phpunit/php-timer": "^2.1", + "sebastian/comparator": "^3.0", + "sebastian/diff": "^3.0", + "sebastian/environment": "^4.0", + "sebastian/exporter": "^3.1", + "sebastian/global-state": "^2.0", + "sebastian/object-enumerator": "^3.0.3", + "sebastian/resource-operations": "^2.0", + "sebastian/version": "^2.0.1" + }, + "conflict": { + "phpunit/phpunit-mock-objects": "*" + }, + "require-dev": { + "ext-pdo": "*" + }, + "suggest": { + "ext-soap": "*", + "ext-xdebug": "*", + "phpunit/php-invoker": "^2.0" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "7.5-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "time": "2020-01-08T08:45:45+00:00" + }, + { + "name": "psr/container", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "time": "2017-02-14T16:28:37+00:00" + }, + { + "name": "psr/log", + "version": "1.1.3", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc", + "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2020-03-23T09:12:05+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7 || ^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "time": "2017-03-04T06:30:41+00:00" + }, + { + "name": "sebastian/comparator", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "5de4fc177adf9bce8df98d8d141a7559d7ccf6da" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/5de4fc177adf9bce8df98d8d141a7559d7ccf6da", + "reference": "5de4fc177adf9bce8df98d8d141a7559d7ccf6da", + "shasum": "" + }, + "require": { + "php": "^7.1", + "sebastian/diff": "^3.0", + "sebastian/exporter": "^3.1" + }, + "require-dev": { + "phpunit/phpunit": "^7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "https://github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "time": "2018-07-12T15:12:46+00:00" + }, + { + "name": "sebastian/diff", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "720fcc7e9b5cf384ea68d9d930d480907a0c1a29" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/720fcc7e9b5cf384ea68d9d930d480907a0c1a29", + "reference": "720fcc7e9b5cf384ea68d9d930d480907a0c1a29", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "require-dev": { + "phpunit/phpunit": "^7.5 || ^8.0", + "symfony/process": "^2 || ^3.3 || ^4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff", + "udiff", + "unidiff", + "unified diff" + ], + "time": "2019-02-04T06:01:07+00:00" + }, + { + "name": "sebastian/environment", + "version": "4.2.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "464c90d7bdf5ad4e8a6aea15c091fec0603d4368" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/464c90d7bdf5ad4e8a6aea15c091fec0603d4368", + "reference": "464c90d7bdf5ad4e8a6aea15c091fec0603d4368", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "require-dev": { + "phpunit/phpunit": "^7.5" + }, + "suggest": { + "ext-posix": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.2-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "time": "2019-11-20T08:46:58+00:00" + }, + { + "name": "sebastian/exporter", + "version": "3.1.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "68609e1261d215ea5b21b7987539cbfbe156ec3e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/68609e1261d215ea5b21b7987539cbfbe156ec3e", + "reference": "68609e1261d215ea5b21b7987539cbfbe156ec3e", + "shasum": "" + }, + "require": { + "php": "^7.0", + "sebastian/recursion-context": "^3.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "http://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "time": "2019-09-14T09:02:43+00:00" + }, + { + "name": "sebastian/global-state", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", + "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "suggest": { + "ext-uopz": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "time": "2017-04-27T15:39:26+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/7cfd9e65d11ffb5af41198476395774d4c8a84c5", + "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5", + "shasum": "" + }, + "require": { + "php": "^7.0", + "sebastian/object-reflector": "^1.1.1", + "sebastian/recursion-context": "^3.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "time": "2017-08-03T12:35:26+00:00" + }, + { + "name": "sebastian/object-reflector", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "773f97c67f28de00d397be301821b06708fca0be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/773f97c67f28de00d397be301821b06708fca0be", + "reference": "773f97c67f28de00d397be301821b06708fca0be", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "time": "2017-03-29T09:07:27+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", + "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "time": "2017-03-03T06:23:57+00:00" + }, + { + "name": "sebastian/resource-operations", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "4d7a795d35b889bf80a0cc04e08d77cedfa917a9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/4d7a795d35b889bf80a0cc04e08d77cedfa917a9", + "reference": "4d7a795d35b889bf80a0cc04e08d77cedfa917a9", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "time": "2018-10-04T04:07:39+00:00" + }, + { + "name": "sebastian/version", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "time": "2016-10-03T07:35:21+00:00" + }, + { + "name": "seld/jsonlint", + "version": "1.7.2", + "source": { + "type": "git", + "url": "https://github.com/Seldaek/jsonlint.git", + "reference": "e2e5d290e4d2a4f0eb449f510071392e00e10d19" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/e2e5d290e4d2a4f0eb449f510071392e00e10d19", + "reference": "e2e5d290e4d2a4f0eb449f510071392e00e10d19", + "shasum": "" + }, + "require": { + "php": "^5.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + }, + "bin": [ + "bin/jsonlint" + ], + "type": "library", + "autoload": { + "psr-4": { + "Seld\\JsonLint\\": "src/Seld/JsonLint/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "JSON Linter", + "keywords": [ + "json", + "linter", + "parser", + "validator" + ], + "support": { + "issues": "https://github.com/Seldaek/jsonlint/issues", + "source": "https://github.com/Seldaek/jsonlint/tree/1.7.2" + }, + "time": "2019-10-24T14:27:39+00:00" + }, + { + "name": "seld/phar-utils", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/Seldaek/phar-utils.git", + "reference": "8800503d56b9867d43d9c303b9cbcc26016e82f0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Seldaek/phar-utils/zipball/8800503d56b9867d43d9c303b9cbcc26016e82f0", + "reference": "8800503d56b9867d43d9c303b9cbcc26016e82f0", + "shasum": "" + }, + "require": { + "php": ">=5.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Seld\\PharUtils\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be" + } + ], + "description": "PHAR file format utilities, for when PHP phars you up", + "keywords": [ + "phar" + ], + "support": { + "issues": "https://github.com/Seldaek/phar-utils/issues", + "source": "https://github.com/Seldaek/phar-utils/tree/1.1.0" + }, + "time": "2020-02-14T15:25:33+00:00" + }, + { + "name": "symfony/console", + "version": "v5.0.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "5fa1caadc8cdaa17bcfb25219f3b53fe294a9935" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/5fa1caadc8cdaa17bcfb25219f3b53fe294a9935", + "reference": "5fa1caadc8cdaa17bcfb25219f3b53fe294a9935", + "shasum": "" + }, + "require": { + "php": "^7.2.5", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php73": "^1.8", + "symfony/service-contracts": "^1.1|^2" + }, + "conflict": { + "symfony/dependency-injection": "<4.4", + "symfony/event-dispatcher": "<4.4", + "symfony/lock": "<4.4", + "symfony/process": "<4.4" + }, + "provide": { + "psr/log-implementation": "1.0" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "^4.4|^5.0", + "symfony/dependency-injection": "^4.4|^5.0", + "symfony/event-dispatcher": "^4.4|^5.0", + "symfony/lock": "^4.4|^5.0", + "symfony/process": "^4.4|^5.0", + "symfony/var-dumper": "^4.4|^5.0" + }, + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/lock": "", + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Console Component", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/console/tree/v5.0.7" + }, + "time": "2020-03-30T11:42:42+00:00" + }, + { + "name": "symfony/filesystem", + "version": "v5.0.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "ca3b87dd09fff9b771731637f5379965fbfab420" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/ca3b87dd09fff9b771731637f5379965fbfab420", + "reference": "ca3b87dd09fff9b771731637f5379965fbfab420", + "shasum": "" + }, + "require": { + "php": "^7.2.5", + "symfony/polyfill-ctype": "~1.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Filesystem Component", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/filesystem/tree/v5.0.7" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-03-27T16:56:45+00:00" + }, + { + "name": "symfony/finder", + "version": "v5.0.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "600a52c29afc0d1caa74acbec8d3095ca7e9910d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/600a52c29afc0d1caa74acbec8d3095ca7e9910d", + "reference": "600a52c29afc0d1caa74acbec8d3095ca7e9910d", + "shasum": "" + }, + "require": { + "php": "^7.2.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Finder Component", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/finder/tree/5.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-03-27T16:56:45+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.15.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "4719fa9c18b0464d399f1a63bf624b42b6fa8d14" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/4719fa9c18b0464d399f1a63bf624b42b6fa8d14", + "reference": "4719fa9c18b0464d399f1a63bf624b42b6fa8d14", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.15-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.15.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-02-27T09:26:54+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.15.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "81ffd3a9c6d707be22e3012b827de1c9775fc5ac" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/81ffd3a9c6d707be22e3012b827de1c9775fc5ac", + "reference": "81ffd3a9c6d707be22e3012b827de1c9775fc5ac", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.15-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.15.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-03-09T19:04:49+00:00" + }, + { + "name": "symfony/polyfill-php73", + "version": "v1.15.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php73.git", + "reference": "0f27e9f464ea3da33cbe7ca3bdf4eb66def9d0f7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/0f27e9f464ea3da33cbe7ca3bdf4eb66def9d0f7", + "reference": "0f27e9f464ea3da33cbe7ca3bdf4eb66def9d0f7", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.15-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php73\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php73/tree/v1.15.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-02-27T09:26:54+00:00" + }, + { + "name": "symfony/process", + "version": "v5.0.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "c5ca4a0fc16a0c888067d43fbcfe1f8a53d8e70e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/c5ca4a0fc16a0c888067d43fbcfe1f8a53d8e70e", + "reference": "c5ca4a0fc16a0c888067d43fbcfe1f8a53d8e70e", + "shasum": "" + }, + "require": { + "php": "^7.2.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Process\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Process Component", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/process/tree/v5.0.7" + }, + "time": "2020-03-27T16:56:45+00:00" + }, + { + "name": "symfony/service-contracts", + "version": "v2.0.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/service-contracts.git", + "reference": "144c5e51266b281231e947b51223ba14acf1a749" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/144c5e51266b281231e947b51223ba14acf1a749", + "reference": "144c5e51266b281231e947b51223ba14acf1a749", + "shasum": "" + }, + "require": { + "php": "^7.2.5", + "psr/container": "^1.0" + }, + "suggest": { + "symfony/service-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Service\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to writing services", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/service-contracts/tree/v2.0.1" + }, + "time": "2019-11-18T17:27:11+00:00" + }, + { + "name": "theseer/tokenizer", + "version": "1.1.3", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "11336f6f84e16a720dae9d8e6ed5019efa85a0f9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/11336f6f84e16a720dae9d8e6ed5019efa85a0f9", + "reference": "11336f6f84e16a720dae9d8e6ed5019efa85a0f9", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + } + ], + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "time": "2019-06-13T22:48:21+00:00" + }, + { + "name": "webmozart/assert", + "version": "1.8.0", + "source": { + "type": "git", + "url": "https://github.com/webmozart/assert.git", + "reference": "ab2cb0b3b559010b75981b1bdce728da3ee90ad6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/assert/zipball/ab2cb0b3b559010b75981b1bdce728da3ee90ad6", + "reference": "ab2cb0b3b559010b75981b1bdce728da3ee90ad6", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0", + "symfony/polyfill-ctype": "^1.8" + }, + "conflict": { + "vimeo/psalm": "<3.9.1" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.36 || ^7.5.13" + }, + "type": "library", + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "support": { + "issues": "https://github.com/webmozart/assert/issues", + "source": "https://github.com/webmozart/assert/tree/master" + }, + "time": "2020-04-18T12:12:48+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": { + "composer/composer": 20 + }, + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": "^7", + "composer-plugin-api": "^1.1.0 || ^2.0" + }, + "platform-dev": { + "ext-zip": "^1.13" + }, + "plugin-api-version": "1.1.0" +} diff --git a/app/vendor/composer/package-versions-deprecated/src/PackageVersions/FallbackVersions.php b/app/vendor/composer/package-versions-deprecated/src/PackageVersions/FallbackVersions.php new file mode 100644 index 000000000..18e5fe64f --- /dev/null +++ b/app/vendor/composer/package-versions-deprecated/src/PackageVersions/FallbackVersions.php @@ -0,0 +1,128 @@ + + */ + private static function getVersions(array $packageData): Generator + { + foreach ($packageData as $package) { + yield $package['name'] => $package['version'] . '@' . ( + $package['source']['reference'] ?? $package['dist']['reference'] ?? '' + ); + } + + yield self::ROOT_PACKAGE_NAME => self::ROOT_PACKAGE_NAME; + } +} diff --git a/app/vendor/composer/package-versions-deprecated/src/PackageVersions/Installer.php b/app/vendor/composer/package-versions-deprecated/src/PackageVersions/Installer.php new file mode 100644 index 000000000..05bdac9a7 --- /dev/null +++ b/app/vendor/composer/package-versions-deprecated/src/PackageVersions/Installer.php @@ -0,0 +1,290 @@ + + * @internal + */ + const VERSIONS = %s; + + private function __construct() + { + } + + /** + * @psalm-pure + * + * @psalm-suppress ImpureMethodCall we know that {@see InstalledVersions} interaction does not + * cause any side effects here. + */ + public static function rootPackageName() : string + { + if (!self::composer2ApiUsable()) { + return self::ROOT_PACKAGE_NAME; + } + + return InstalledVersions::getRootPackage()['name']; + } + + /** + * @throws OutOfBoundsException If a version cannot be located. + * + * @psalm-param key-of $packageName + * @psalm-pure + * + * @psalm-suppress ImpureMethodCall we know that {@see InstalledVersions} interaction does not + * cause any side effects here. + */ + public static function getVersion(string $packageName): string + { + if (self::composer2ApiUsable()) { + return InstalledVersions::getPrettyVersion($packageName) + . '@' . InstalledVersions::getReference($packageName); + } + + if (isset(self::VERSIONS[$packageName])) { + return self::VERSIONS[$packageName]; + } + + throw new OutOfBoundsException( + 'Required package "' . $packageName . '" is not installed: check your ./vendor/composer/installed.json and/or ./composer.lock files' + ); + } + + private static function composer2ApiUsable(): bool + { + if (!class_exists(InstalledVersions::class, false)) { + return false; + } + + if (method_exists(InstalledVersions::class, 'getAllRawData')) { + $rawData = InstalledVersions::getAllRawData(); + if (count($rawData) === 1 && count($rawData[0]) === 0) { + return false; + } + } else { + $rawData = InstalledVersions::getRawData(); + if ($rawData === null || $rawData === []) { + return false; + } + } + + return true; + } +} + +PHP; + + public function activate(Composer $composer, IOInterface $io) + { + // Nothing to do here, as all features are provided through event listeners + } + + public function deactivate(Composer $composer, IOInterface $io) + { + // Nothing to do here, as all features are provided through event listeners + } + + public function uninstall(Composer $composer, IOInterface $io) + { + // Nothing to do here, as all features are provided through event listeners + } + + /** + * {@inheritDoc} + */ + public static function getSubscribedEvents(): array + { + return [ScriptEvents::POST_AUTOLOAD_DUMP => 'dumpVersionsClass']; + } + + /** + * @throws RuntimeException + */ + public static function dumpVersionsClass(Event $composerEvent) + { + $composer = $composerEvent->getComposer(); + $rootPackage = $composer->getPackage(); + $versions = iterator_to_array(self::getVersions($composer->getLocker(), $rootPackage)); + + if (! array_key_exists('composer/package-versions-deprecated', $versions)) { + //plugin must be globally installed - we only want to generate versions for projects which specifically + //require composer/package-versions-deprecated + return; + } + + $versionClass = self::generateVersionsClass($rootPackage->getName(), $versions); + + self::writeVersionClassToFile($versionClass, $composer, $composerEvent->getIO()); + } + + /** + * @param string[] $versions + */ + private static function generateVersionsClass(string $rootPackageName, array $versions): string + { + return sprintf( + self::$generatedClassTemplate, + 'fin' . 'al ' . 'cla' . 'ss ' . 'Versions', // note: workaround for regex-based code parsers :-( + $rootPackageName, + var_export($versions, true) + ); + } + + /** + * @throws RuntimeException + */ + private static function writeVersionClassToFile(string $versionClassSource, Composer $composer, IOInterface $io) + { + $installPath = self::locateRootPackageInstallPath($composer->getConfig(), $composer->getPackage()) + . '/src/PackageVersions/Versions.php'; + + $installDir = dirname($installPath); + if (! file_exists($installDir)) { + $io->write('composer/package-versions-deprecated: Package not found (probably scheduled for removal); generation of version class skipped.'); + + return; + } + + if (! is_writable($installDir)) { + $io->write( + sprintf( + 'composer/package-versions-deprecated: %s is not writable; generation of version class skipped.', + $installDir + ) + ); + + return; + } + + $io->write('composer/package-versions-deprecated: Generating version class...'); + + $installPathTmp = $installPath . '_' . uniqid('tmp', true); + file_put_contents($installPathTmp, $versionClassSource); + chmod($installPathTmp, 0664); + rename($installPathTmp, $installPath); + + $io->write('composer/package-versions-deprecated: ...done generating version class'); + } + + /** + * @throws RuntimeException + */ + private static function locateRootPackageInstallPath( + Config $composerConfig, + RootPackageInterface $rootPackage + ): string { + if (self::getRootPackageAlias($rootPackage)->getName() === 'composer/package-versions-deprecated') { + return dirname($composerConfig->get('vendor-dir')); + } + + return $composerConfig->get('vendor-dir') . '/composer/package-versions-deprecated'; + } + + private static function getRootPackageAlias(RootPackageInterface $rootPackage): PackageInterface + { + $package = $rootPackage; + + while ($package instanceof AliasPackage) { + $package = $package->getAliasOf(); + } + + return $package; + } + + /** + * @return Generator&string[] + * + * @psalm-return Generator + */ + private static function getVersions(Locker $locker, RootPackageInterface $rootPackage): Generator + { + $lockData = $locker->getLockData(); + + $lockData['packages-dev'] = $lockData['packages-dev'] ?? []; + + $packages = $lockData['packages']; + if (getenv('COMPOSER_DEV_MODE') !== '0') { + $packages = array_merge($packages, $lockData['packages-dev']); + } + foreach ($packages as $package) { + yield $package['name'] => $package['version'] . '@' . ( + $package['source']['reference'] ?? $package['dist']['reference'] ?? '' + ); + } + + foreach ($rootPackage->getReplaces() as $replace) { + $version = $replace->getPrettyConstraint(); + if ($version === 'self.version') { + $version = $rootPackage->getPrettyVersion(); + } + + yield $replace->getTarget() => $version . '@' . $rootPackage->getSourceReference(); + } + + yield $rootPackage->getName() => $rootPackage->getPrettyVersion() . '@' . $rootPackage->getSourceReference(); + } +} diff --git a/app/vendor/composer/package-versions-deprecated/src/PackageVersions/Versions.php b/app/vendor/composer/package-versions-deprecated/src/PackageVersions/Versions.php new file mode 100644 index 000000000..ae46ff1f1 --- /dev/null +++ b/app/vendor/composer/package-versions-deprecated/src/PackageVersions/Versions.php @@ -0,0 +1,201 @@ + + * @internal + */ + const VERSIONS = array ( + 'cakephp/cakephp' => '4.2.9@6cb068fd328219d79a02ef6df439b73459071368', + 'cakephp/chronos' => '2.2.0@556e14da67307ffc2e68beeb7df0694dc8d1207d', + 'cakephp/migrations' => '3.1.0@d22737c31243db89774abfe6a077d254c0eae75a', + 'cakephp/plugin-installer' => '1.3.1@e27027aa2d3d8ab64452c6817629558685a064cb', + 'composer/ca-bundle' => '1.2.11@0b072d51c5a9c6f3412f7ea3ab043d6603cb2582', + 'composer/package-versions-deprecated' => '1.11.99.4@b174585d1fe49ceed21928a945138948cb394600', + 'doctrine/cache' => '2.1.1@331b4d5dbaeab3827976273e9356b3b453c300ce', + 'doctrine/dbal' => '3.1.3@96b0053775a544b4a6ab47654dac0621be8b4cf8', + 'doctrine/deprecations' => 'v0.5.3@9504165960a1f83cc1480e2be1dd0a0478561314', + 'doctrine/event-manager' => '1.1.1@41370af6a30faa9dc0368c4a6814d596e81aba7f', + 'laminas/laminas-diactoros' => '2.8.0@0c26ef1d95b6d7e6e3943a243ba3dc0797227199', + 'laminas/laminas-httphandlerrunner' => '1.5.0@5f94e55d93f756e8ad07b9049aeb3d6d84582d0e', + 'laminas/laminas-zendframework-bridge' => '1.4.0@bf180a382393e7db5c1e8d0f2ec0c4af9c724baf', + 'league/container' => '3.4.1@84ecbc2dbecc31bd23faf759a0e329ee49abddbd', + 'mobiledetect/mobiledetectlib' => '2.8.37@9841e3c46f5bd0739b53aed8ac677fa712943df7', + 'psr/container' => '1.1.1@8622567409010282b7aeebe4bb841fe98b58dcaf', + 'psr/http-client' => '1.0.1@2dfb5f6c5eff0e91e20e913f8c5452ed95b86621', + 'psr/http-factory' => '1.0.1@12ac7fcd07e5b077433f5f2bee95b3a771bf61be', + 'psr/http-message' => '1.0.1@f6561bf28d520154e4b0ec72be95418abe6d9363', + 'psr/http-server-handler' => '1.0.1@aff2f80e33b7f026ec96bb42f63242dc50ffcae7', + 'psr/http-server-middleware' => '1.0.1@2296f45510945530b9dceb8bcedb5cb84d40c5f5', + 'psr/log' => '1.1.4@d49695b909c3b7628b6289db5479a1c204601f11', + 'psr/simple-cache' => '1.0.1@408d5eafb83c57f6365a3ca330ff23aa4a5fa39b', + 'robmorgan/phinx' => '0.12.8@d2ed1b452cc90f4cae4ea6b5976b94fb9e5ed2a2', + 'symfony/config' => 'v5.3.4@4268f3059c904c61636275182707f81645517a37', + 'symfony/console' => 'v5.3.7@8b1008344647462ae6ec57559da166c2bfa5e16a', + 'symfony/deprecation-contracts' => 'v2.4.0@5f38c8804a9e97d23e0c8d63341088cd8a22d627', + 'symfony/filesystem' => 'v5.3.4@343f4fe324383ca46792cae728a3b6e2f708fb32', + 'symfony/polyfill-ctype' => 'v1.23.0@46cd95797e9df938fdd2b03693b5fca5e64b01ce', + 'symfony/polyfill-intl-grapheme' => 'v1.23.1@16880ba9c5ebe3642d1995ab866db29270b36535', + 'symfony/polyfill-intl-normalizer' => 'v1.23.0@8590a5f561694770bdcd3f9b5c69dde6945028e8', + 'symfony/polyfill-mbstring' => 'v1.23.1@9174a3d80210dca8daa7f31fec659150bbeabfc6', + 'symfony/polyfill-php73' => 'v1.23.0@fba8933c384d6476ab14fb7b8526e5287ca7e010', + 'symfony/polyfill-php80' => 'v1.23.1@1100343ed1a92e3a38f9ae122fc0eb21602547be', + 'symfony/polyfill-php81' => 'v1.23.0@e66119f3de95efc359483f810c4c3e6436279436', + 'symfony/service-contracts' => 'v2.4.0@f040a30e04b57fbcc9c6cbcf4dbaa96bd318b9bb', + 'symfony/string' => 'v5.3.7@8d224396e28d30f81969f083a58763b8b9ceb0a5', + 'brick/varexporter' => '0.3.5@05241f28dfcba2b51b11e2d750e296316ebbe518', + 'cakephp/bake' => '2.5.2@bfb856afcfbc70c5cf5341669c3036a45ca15d94', + 'cakephp/cakephp-codesniffer' => '4.2.4@c5bb1faeebf09cd4a3604bdb0c84f7bc92dc5475', + 'cakephp/debug_kit' => '4.4.4@10d7d9ba36945844211f1d8763e59618917e1784', + 'cakephp/twig-view' => '1.3.0@14df50360b809a171d0688020fbdfe513763f89b', + 'composer/composer' => '2.1.9@e558c88f28d102d497adec4852802c0dc14c7077', + 'composer/metadata-minifier' => '1.0.0@c549d23829536f0d0e984aaabbf02af91f443207', + 'composer/semver' => '3.2.5@31f3ea725711245195f62e54ffa402d8ef2fdba9', + 'composer/spdx-licenses' => '1.5.5@de30328a7af8680efdc03e396aad24befd513200', + 'composer/xdebug-handler' => '2.0.2@84674dd3a7575ba617f5a76d7e9e29a7d3891339', + 'dealerdirect/phpcodesniffer-composer-installer' => 'v0.7.1@fe390591e0241955f22eb9ba327d137e501c771c', + 'doctrine/instantiator' => '1.4.0@d56bf6102915de5702778fe20f2de3b2fe570b5b', + 'jasny/twig-extensions' => 'v1.3.0@a694eb02f6fc14ff8e2fceb8b80882c0c926102b', + 'jdorn/sql-formatter' => 'v1.2.17@64990d96e0959dff8e059dfcdc1af130728d92bc', + 'josegonzalez/dotenv' => '3.2.0@f19174d9d7213a6c20e8e5e268aa7dd042d821ca', + 'justinrainbow/json-schema' => '5.2.11@2ab6744b7296ded80f8cc4f9509abbff393399aa', + 'm1/env' => '2.2.0@5c296e3e13450a207e12b343f3af1d7ab569f6f3', + 'myclabs/deep-copy' => '1.10.2@776f831124e9c62e1a2c601ecc52e776d8bb7220', + 'nikic/php-parser' => 'v4.13.0@50953a2691a922aa1769461637869a0a2faa3f53', + 'phar-io/manifest' => '2.0.3@97803eca37d319dfa7826cc2437fc020857acb53', + 'phar-io/version' => '3.1.0@bae7c545bef187884426f042434e561ab1ddb182', + 'phpdocumentor/reflection-common' => '2.2.0@1d01c49d4ed62f25aa84a747ad35d5a16924662b', + 'phpdocumentor/reflection-docblock' => '5.2.2@069a785b2141f5bcf49f3e353548dc1cce6df556', + 'phpdocumentor/type-resolver' => '1.5.1@a12f7e301eb7258bb68acd89d4aefa05c2906cae', + 'phpspec/prophecy' => '1.14.0@d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e', + 'phpstan/phpdoc-parser' => '0.4.9@98a088b17966bdf6ee25c8a4b634df313d8aa531', + 'phpunit/php-code-coverage' => '9.2.7@d4c798ed8d51506800b441f7a13ecb0f76f12218', + 'phpunit/php-file-iterator' => '3.0.5@aa4be8575f26070b100fccb67faabb28f21f66f8', + 'phpunit/php-invoker' => '3.1.1@5a10147d0aaf65b58940a0b72f71c9ac0423cc67', + 'phpunit/php-text-template' => '2.0.4@5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28', + 'phpunit/php-timer' => '5.0.3@5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2', + 'phpunit/phpunit' => '9.5.10@c814a05837f2edb0d1471d6e3f4ab3501ca3899a', + 'psy/psysh' => 'v0.10.9@01281336c4ae557fe4a994544f30d3a1bc204375', + 'react/promise' => 'v2.8.0@f3cff96a19736714524ca0dd1d4130de73dbbbc4', + 'sebastian/cli-parser' => '1.0.1@442e7c7e687e42adc03470c7b668bc4b2402c0b2', + 'sebastian/code-unit' => '1.0.8@1fc9f64c0927627ef78ba436c9b17d967e68e120', + 'sebastian/code-unit-reverse-lookup' => '2.0.3@ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5', + 'sebastian/comparator' => '4.0.6@55f4261989e546dc112258c7a75935a81a7ce382', + 'sebastian/complexity' => '2.0.2@739b35e53379900cc9ac327b2147867b8b6efd88', + 'sebastian/diff' => '4.0.4@3461e3fccc7cfdfc2720be910d3bd73c69be590d', + 'sebastian/environment' => '5.1.3@388b6ced16caa751030f6a69e588299fa09200ac', + 'sebastian/exporter' => '4.0.3@d89cc98761b8cb5a1a235a6b703ae50d34080e65', + 'sebastian/global-state' => '5.0.3@23bd5951f7ff26f12d4e3242864df3e08dec4e49', + 'sebastian/lines-of-code' => '1.0.3@c1c2e997aa3146983ed888ad08b15470a2e22ecc', + 'sebastian/object-enumerator' => '4.0.4@5c9eeac41b290a3712d88851518825ad78f45c71', + 'sebastian/object-reflector' => '2.0.4@b4f479ebdbf63ac605d183ece17d8d7fe49c15c7', + 'sebastian/recursion-context' => '4.0.4@cd9d8cf3c5804de4341c283ed787f099f5506172', + 'sebastian/resource-operations' => '3.0.3@0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8', + 'sebastian/type' => '2.3.4@b8cd8a1c753c90bc1a0f5372170e3e489136f914', + 'sebastian/version' => '3.0.2@c6c1022351a901512170118436c764e473f6de8c', + 'seld/jsonlint' => '1.8.3@9ad6ce79c342fbd44df10ea95511a1b24dee5b57', + 'seld/phar-utils' => '1.1.2@749042a2315705d2dfbbc59234dd9ceb22bf3ff0', + 'slevomat/coding-standard' => '6.4.1@696dcca217d0c9da2c40d02731526c1e25b65346', + 'squizlabs/php_codesniffer' => '3.5.8@9d583721a7157ee997f235f327de038e7ea6dac4', + 'symfony/finder' => 'v5.3.7@a10000ada1e600d109a6c7632e9ac42e8bf2fb93', + 'symfony/process' => 'v5.3.7@38f26c7d6ed535217ea393e05634cb0b244a1967', + 'symfony/var-dumper' => 'v5.3.8@eaaea4098be1c90c8285543e1356a09c8aa5c8da', + 'theseer/tokenizer' => '1.2.1@34a41e998c2183e22995f158c581e7b5e755ab9e', + 'twig/markdown-extra' => 'v3.3.3@725a4ef89d93bb80fc63c67cf261bf7512649290', + 'twig/twig' => 'v3.3.3@a27fa056df8a6384316288ca8b0fa3a35fdeb569', + 'webmozart/assert' => '1.10.0@6964c76c7804814a842473e0c8fd15bab0f18e25', + 'cakephp/app' => 'dev-develop@e9e35cc04f182202ee69f7923f435979daf95502', +); + + private function __construct() + { + } + + /** + * @psalm-pure + * + * @psalm-suppress ImpureMethodCall we know that {@see InstalledVersions} interaction does not + * cause any side effects here. + */ + public static function rootPackageName() : string + { + if (!self::composer2ApiUsable()) { + return self::ROOT_PACKAGE_NAME; + } + + return InstalledVersions::getRootPackage()['name']; + } + + /** + * @throws OutOfBoundsException If a version cannot be located. + * + * @psalm-param key-of $packageName + * @psalm-pure + * + * @psalm-suppress ImpureMethodCall we know that {@see InstalledVersions} interaction does not + * cause any side effects here. + */ + public static function getVersion(string $packageName): string + { + if (self::composer2ApiUsable()) { + return InstalledVersions::getPrettyVersion($packageName) + . '@' . InstalledVersions::getReference($packageName); + } + + if (isset(self::VERSIONS[$packageName])) { + return self::VERSIONS[$packageName]; + } + + throw new OutOfBoundsException( + 'Required package "' . $packageName . '" is not installed: check your ./vendor/composer/installed.json and/or ./composer.lock files' + ); + } + + private static function composer2ApiUsable(): bool + { + if (!class_exists(InstalledVersions::class, false)) { + return false; + } + + if (method_exists(InstalledVersions::class, 'getAllRawData')) { + $rawData = InstalledVersions::getAllRawData(); + if (count($rawData) === 1 && count($rawData[0]) === 0) { + return false; + } + } else { + $rawData = InstalledVersions::getRawData(); + if ($rawData === null || $rawData === []) { + return false; + } + } + + return true; + } +} diff --git a/app/vendor/composer/xdebug-handler/CHANGELOG.md b/app/vendor/composer/xdebug-handler/CHANGELOG.md index e9fcd4fbb..d7d46f9c5 100644 --- a/app/vendor/composer/xdebug-handler/CHANGELOG.md +++ b/app/vendor/composer/xdebug-handler/CHANGELOG.md @@ -1,5 +1,10 @@ ## [Unreleased] +## [2.0.2] - 2021-07-31 + * Added: support for `xdebug_info('mode')` in Xdebug 3.1. + * Added: support for Psr\Log versions 2 and 3. + * Fixed: remove ini directives from non-cli HOST/PATH sections. + ## [2.0.1] - 2021-05-05 * Fixed: don't restart if the cwd is a UNC path and cmd.exe will be invoked. @@ -21,7 +26,7 @@ * Fixed: use `proc_open` when available for correct FD forwarding to the restarted process. ## [1.4.4] - 2020-10-24 - * Fix: exception if 'pcntl_signal' is disabled. + * Fixed: exception if 'pcntl_signal' is disabled. ## [1.4.3] - 2020-08-19 * Fixed: restore SIGINT to default handler in restarted process if no other handler exists. @@ -86,7 +91,8 @@ * Break: the following class was renamed: - `Composer\XdebugHandler` -> `Composer\XdebugHandler\XdebugHandler` -[Unreleased]: https://github.com/composer/xdebug-handler/compare/2.0.1...HEAD +[Unreleased]: https://github.com/composer/xdebug-handler/compare/2.0.2...HEAD +[2.0.2]: https://github.com/composer/xdebug-handler/compare/2.0.1...2.0.2 [2.0.1]: https://github.com/composer/xdebug-handler/compare/2.0.0...2.0.1 [2.0.0]: https://github.com/composer/xdebug-handler/compare/1.4.6...2.0.0 [1.4.6]: https://github.com/composer/xdebug-handler/compare/1.4.5...1.4.6 diff --git a/app/vendor/composer/xdebug-handler/composer.json b/app/vendor/composer/xdebug-handler/composer.json index 6757395d5..75cb1f745 100644 --- a/app/vendor/composer/xdebug-handler/composer.json +++ b/app/vendor/composer/xdebug-handler/composer.json @@ -19,7 +19,7 @@ }, "require": { "php": "^5.3.2 || ^7.0 || ^8.0", - "psr/log": "^1.0" + "psr/log": "^1 || ^2 || ^3" }, "require-dev": { "symfony/phpunit-bridge": "^4.2 || ^5", diff --git a/app/vendor/composer/xdebug-handler/src/XdebugHandler.php b/app/vendor/composer/xdebug-handler/src/XdebugHandler.php index e6f32a721..cd1a73837 100644 --- a/app/vendor/composer/xdebug-handler/src/XdebugHandler.php +++ b/app/vendor/composer/xdebug-handler/src/XdebugHandler.php @@ -66,7 +66,11 @@ public function __construct($envPrefix) if (extension_loaded('xdebug')) { $this->loaded = phpversion('xdebug') ?: 'unknown'; - if (false !== ($mode = ini_get('xdebug.mode'))) { + if (version_compare($this->loaded, '3.1', '>=')) { + /** @phpstan-ignore-next-line */ + $modes = xdebug_info('mode'); + $this->mode = empty($modes) ? 'off' : implode(',', $modes); + } elseif (false !== ($mode = ini_get('xdebug.mode'))) { $this->mode = getenv('XDEBUG_MODE') ?: ($mode ?: 'off'); if (preg_match('/^,+$/', str_replace(' ', '', $this->mode))) { $this->mode = 'off'; @@ -377,7 +381,8 @@ private function writeTmpIni(array $iniFiles, $tmpDir, &$error) } $content = ''; - $regex = '/^\s*(zend_extension\s*=.*xdebug.*)$/mi'; + $sectionRegex = '/^\s*\[(?:PATH|HOST)\s*=/mi'; + $xdebugRegex = '/^\s*(zend_extension\s*=.*xdebug.*)$/mi'; foreach ($iniFiles as $file) { // Check for inaccessible ini files @@ -385,7 +390,11 @@ private function writeTmpIni(array $iniFiles, $tmpDir, &$error) $error = 'Unable to read ini: '.$file; return false; } - $content .= preg_replace($regex, ';$1', $data).PHP_EOL; + // Check and remove directives after HOST and PATH sections + if (preg_match($sectionRegex, $data, $matches, PREG_OFFSET_CAPTURE)) { + $data = substr($data, 0, $matches[0][1]); + } + $content .= preg_replace($xdebugRegex, ';$1', $data).PHP_EOL; } // Merge loaded settings into our ini content, if it is valid diff --git a/app/vendor/doctrine/cache/LICENSE b/app/vendor/doctrine/cache/LICENSE new file mode 100644 index 000000000..8c38cc1bc --- /dev/null +++ b/app/vendor/doctrine/cache/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2006-2015 Doctrine Project + +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/app/vendor/doctrine/cache/README.md b/app/vendor/doctrine/cache/README.md new file mode 100644 index 000000000..a13196d15 --- /dev/null +++ b/app/vendor/doctrine/cache/README.md @@ -0,0 +1,13 @@ +# Doctrine Cache + +[![Build Status](https://github.com/doctrine/cache/workflows/Continuous%20Integration/badge.svg)](https://github.com/doctrine/cache/actions) +[![Code Coverage](https://codecov.io/gh/doctrine/cache/branch/1.10.x/graph/badge.svg)](https://codecov.io/gh/doctrine/cache/branch/1.10.x) + +[![Latest Stable Version](https://img.shields.io/packagist/v/doctrine/cache.svg?style=flat-square)](https://packagist.org/packages/doctrine/cache) +[![Total Downloads](https://img.shields.io/packagist/dt/doctrine/cache.svg?style=flat-square)](https://packagist.org/packages/doctrine/cache) + +Cache component extracted from the Doctrine Common project. [Documentation](https://www.doctrine-project.org/projects/doctrine-cache/en/current/index.html) + +This library is deprecated and will no longer receive bug fixes from the +Doctrine Project. Please use a different cache library, preferably PSR-6 or +PSR-16 instead. diff --git a/app/vendor/doctrine/cache/UPGRADE-1.11.md b/app/vendor/doctrine/cache/UPGRADE-1.11.md new file mode 100644 index 000000000..a33be2302 --- /dev/null +++ b/app/vendor/doctrine/cache/UPGRADE-1.11.md @@ -0,0 +1,15 @@ +# Upgrade to 1.11 + +doctrine/cache will no longer be maintained and all cache implementations have +been marked as deprecated. These implementations will be removed in 2.0, which +will only contain interfaces to provide a lightweight package for backward +compatibility. + +There are two new classes to use in the `Doctrine\Common\Cache\Psr6` namespace: +* The `CacheAdapter` class allows using any Doctrine Cache as PSR-6 cache. This + is useful to provide a forward compatibility layer in libraries that accept + Doctrine cache implementations and switch to PSR-6. +* The `DoctrineProvider` class allows using any PSR-6 cache as Doctrine cache. + This implementation is designed for libraries that leak the cache and want to + switch to allowing PSR-6 implementations. This class is design to be used + during the transition phase of sunsetting doctrine/cache support. diff --git a/app/vendor/doctrine/cache/UPGRADE-1.4.md b/app/vendor/doctrine/cache/UPGRADE-1.4.md new file mode 100644 index 000000000..e1f8a503e --- /dev/null +++ b/app/vendor/doctrine/cache/UPGRADE-1.4.md @@ -0,0 +1,16 @@ +# Upgrade to 1.4 + +## Minor BC Break: `Doctrine\Common\Cache\FileCache#$extension` is now `private`. + +If you need to override the value of `Doctrine\Common\Cache\FileCache#$extension`, then use the +second parameter of `Doctrine\Common\Cache\FileCache#__construct()` instead of overriding +the property in your own implementation. + +## Minor BC Break: file based caches paths changed + +`Doctrine\Common\Cache\FileCache`, `Doctrine\Common\Cache\PhpFileCache` and +`Doctrine\Common\Cache\FilesystemCache` are using a different cache paths structure. + +If you rely on warmed up caches for deployments, consider that caches generated +with `doctrine/cache` `<1.4` are not compatible with the new directory structure, +and will be ignored. diff --git a/app/vendor/doctrine/cache/composer.json b/app/vendor/doctrine/cache/composer.json new file mode 100644 index 000000000..ddad5f4fd --- /dev/null +++ b/app/vendor/doctrine/cache/composer.json @@ -0,0 +1,51 @@ +{ + "name": "doctrine/cache", + "type": "library", + "description": "PHP Doctrine Cache library is a popular cache implementation that supports many different drivers such as redis, memcache, apc, mongodb and others.", + "keywords": [ + "php", + "cache", + "caching", + "abstraction", + "redis", + "memcached", + "couchdb", + "xcache", + "apcu" + ], + "homepage": "https://www.doctrine-project.org/projects/cache.html", + "license": "MIT", + "authors": [ + {"name": "Guilherme Blanco", "email": "guilhermeblanco@gmail.com"}, + {"name": "Roman Borschel", "email": "roman@code-factory.org"}, + {"name": "Benjamin Eberlei", "email": "kontakt@beberlei.de"}, + {"name": "Jonathan Wage", "email": "jonwage@gmail.com"}, + {"name": "Johannes Schmitt", "email": "schmittjoh@gmail.com"} + ], + "require": { + "php": "~7.1 || ^8.0" + }, + "require-dev": { + "alcaeus/mongo-php-adapter": "^1.1", + "mongodb/mongodb": "^1.1", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0", + "predis/predis": "~1.0", + "doctrine/coding-standard": "^8.0", + "psr/cache": "^1.0 || ^2.0 || ^3.0", + "cache/integration-tests": "dev-master", + "symfony/cache": "^4.4 || ^5.2 || ^6.0@dev", + "symfony/var-exporter": "^4.4 || ^5.2 || ^6.0@dev" + }, + "suggest": { + "alcaeus/mongo-php-adapter": "Required to use legacy MongoDB driver" + }, + "conflict": { + "doctrine/common": ">2.2,<2.4" + }, + "autoload": { + "psr-4": { "Doctrine\\Common\\Cache\\": "lib/Doctrine/Common/Cache" } + }, + "autoload-dev": { + "psr-4": { "Doctrine\\Tests\\": "tests/Doctrine/Tests" } + } +} diff --git a/app/vendor/doctrine/cache/lib/Doctrine/Common/Cache/Cache.php b/app/vendor/doctrine/cache/lib/Doctrine/Common/Cache/Cache.php new file mode 100644 index 000000000..4cfab6c0f --- /dev/null +++ b/app/vendor/doctrine/cache/lib/Doctrine/Common/Cache/Cache.php @@ -0,0 +1,90 @@ +hits + * Number of keys that have been requested and found present. + * + * - misses + * Number of items that have been requested and not found. + * + * - uptime + * Time that the server is running. + * + * - memory_usage + * Memory used by this server to store items. + * + * - memory_available + * Memory allowed to use for storage. + * + * @return mixed[]|null An associative array with server's statistics if available, NULL otherwise. + */ + public function getStats(); +} diff --git a/app/vendor/doctrine/cache/lib/Doctrine/Common/Cache/CacheProvider.php b/app/vendor/doctrine/cache/lib/Doctrine/Common/Cache/CacheProvider.php new file mode 100644 index 000000000..180482a7b --- /dev/null +++ b/app/vendor/doctrine/cache/lib/Doctrine/Common/Cache/CacheProvider.php @@ -0,0 +1,325 @@ +namespace = (string) $namespace; + $this->namespaceVersion = null; + } + + /** + * Retrieves the namespace that prefixes all cache ids. + * + * @return string + */ + public function getNamespace() + { + return $this->namespace; + } + + /** + * {@inheritdoc} + */ + public function fetch($id) + { + return $this->doFetch($this->getNamespacedId($id)); + } + + /** + * {@inheritdoc} + */ + public function fetchMultiple(array $keys) + { + if (empty($keys)) { + return []; + } + + // note: the array_combine() is in place to keep an association between our $keys and the $namespacedKeys + $namespacedKeys = array_combine($keys, array_map([$this, 'getNamespacedId'], $keys)); + $items = $this->doFetchMultiple($namespacedKeys); + $foundItems = []; + + // no internal array function supports this sort of mapping: needs to be iterative + // this filters and combines keys in one pass + foreach ($namespacedKeys as $requestedKey => $namespacedKey) { + if (! isset($items[$namespacedKey]) && ! array_key_exists($namespacedKey, $items)) { + continue; + } + + $foundItems[$requestedKey] = $items[$namespacedKey]; + } + + return $foundItems; + } + + /** + * {@inheritdoc} + */ + public function saveMultiple(array $keysAndValues, $lifetime = 0) + { + $namespacedKeysAndValues = []; + foreach ($keysAndValues as $key => $value) { + $namespacedKeysAndValues[$this->getNamespacedId($key)] = $value; + } + + return $this->doSaveMultiple($namespacedKeysAndValues, $lifetime); + } + + /** + * {@inheritdoc} + */ + public function contains($id) + { + return $this->doContains($this->getNamespacedId($id)); + } + + /** + * {@inheritdoc} + */ + public function save($id, $data, $lifeTime = 0) + { + return $this->doSave($this->getNamespacedId($id), $data, $lifeTime); + } + + /** + * {@inheritdoc} + */ + public function deleteMultiple(array $keys) + { + return $this->doDeleteMultiple(array_map([$this, 'getNamespacedId'], $keys)); + } + + /** + * {@inheritdoc} + */ + public function delete($id) + { + return $this->doDelete($this->getNamespacedId($id)); + } + + /** + * {@inheritdoc} + */ + public function getStats() + { + return $this->doGetStats(); + } + + /** + * {@inheritDoc} + */ + public function flushAll() + { + return $this->doFlush(); + } + + /** + * {@inheritDoc} + */ + public function deleteAll() + { + $namespaceCacheKey = $this->getNamespaceCacheKey(); + $namespaceVersion = $this->getNamespaceVersion() + 1; + + if ($this->doSave($namespaceCacheKey, $namespaceVersion)) { + $this->namespaceVersion = $namespaceVersion; + + return true; + } + + return false; + } + + /** + * Prefixes the passed id with the configured namespace value. + * + * @param string $id The id to namespace. + * + * @return string The namespaced id. + */ + private function getNamespacedId(string $id): string + { + $namespaceVersion = $this->getNamespaceVersion(); + + return sprintf('%s[%s][%s]', $this->namespace, $id, $namespaceVersion); + } + + /** + * Returns the namespace cache key. + */ + private function getNamespaceCacheKey(): string + { + return sprintf(self::DOCTRINE_NAMESPACE_CACHEKEY, $this->namespace); + } + + /** + * Returns the namespace version. + */ + private function getNamespaceVersion(): int + { + if ($this->namespaceVersion !== null) { + return $this->namespaceVersion; + } + + $namespaceCacheKey = $this->getNamespaceCacheKey(); + $this->namespaceVersion = (int) $this->doFetch($namespaceCacheKey) ?: 1; + + return $this->namespaceVersion; + } + + /** + * Default implementation of doFetchMultiple. Each driver that supports multi-get should owerwrite it. + * + * @param string[] $keys Array of keys to retrieve from cache + * + * @return mixed[] Array of values retrieved for the given keys. + */ + protected function doFetchMultiple(array $keys) + { + $returnValues = []; + + foreach ($keys as $key) { + $item = $this->doFetch($key); + if ($item === false && ! $this->doContains($key)) { + continue; + } + + $returnValues[$key] = $item; + } + + return $returnValues; + } + + /** + * Fetches an entry from the cache. + * + * @param string $id The id of the cache entry to fetch. + * + * @return mixed|false The cached data or FALSE, if no cache entry exists for the given id. + */ + abstract protected function doFetch($id); + + /** + * Tests if an entry exists in the cache. + * + * @param string $id The cache id of the entry to check for. + * + * @return bool TRUE if a cache entry exists for the given cache id, FALSE otherwise. + */ + abstract protected function doContains($id); + + /** + * Default implementation of doSaveMultiple. Each driver that supports multi-put should override it. + * + * @param mixed[] $keysAndValues Array of keys and values to save in cache + * @param int $lifetime The lifetime. If != 0, sets a specific lifetime for these + * cache entries (0 => infinite lifeTime). + * + * @return bool TRUE if the operation was successful, FALSE if it wasn't. + */ + protected function doSaveMultiple(array $keysAndValues, $lifetime = 0) + { + $success = true; + + foreach ($keysAndValues as $key => $value) { + if ($this->doSave($key, $value, $lifetime)) { + continue; + } + + $success = false; + } + + return $success; + } + + /** + * Puts data into the cache. + * + * @param string $id The cache id. + * @param string $data The cache entry/data. + * @param int $lifeTime The lifetime. If != 0, sets a specific lifetime for this + * cache entry (0 => infinite lifeTime). + * + * @return bool TRUE if the entry was successfully stored in the cache, FALSE otherwise. + */ + abstract protected function doSave($id, $data, $lifeTime = 0); + + /** + * Default implementation of doDeleteMultiple. Each driver that supports multi-delete should override it. + * + * @param string[] $keys Array of keys to delete from cache + * + * @return bool TRUE if the operation was successful, FALSE if it wasn't + */ + protected function doDeleteMultiple(array $keys) + { + $success = true; + + foreach ($keys as $key) { + if ($this->doDelete($key)) { + continue; + } + + $success = false; + } + + return $success; + } + + /** + * Deletes a cache entry. + * + * @param string $id The cache id. + * + * @return bool TRUE if the cache entry was successfully deleted, FALSE otherwise. + */ + abstract protected function doDelete($id); + + /** + * Flushes all cache entries. + * + * @return bool TRUE if the cache entries were successfully flushed, FALSE otherwise. + */ + abstract protected function doFlush(); + + /** + * Retrieves cached information from the data store. + * + * @return mixed[]|null An associative array with server's statistics if available, NULL otherwise. + */ + abstract protected function doGetStats(); +} diff --git a/app/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ClearableCache.php b/app/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ClearableCache.php new file mode 100644 index 000000000..b94618e46 --- /dev/null +++ b/app/vendor/doctrine/cache/lib/Doctrine/Common/Cache/ClearableCache.php @@ -0,0 +1,21 @@ + infinite lifeTime). + * + * @return bool TRUE if the operation was successful, FALSE if it wasn't. + */ + public function saveMultiple(array $keysAndValues, $lifetime = 0); +} diff --git a/app/vendor/doctrine/cache/lib/Doctrine/Common/Cache/Psr6/CacheAdapter.php b/app/vendor/doctrine/cache/lib/Doctrine/Common/Cache/Psr6/CacheAdapter.php new file mode 100644 index 000000000..d3693b7c6 --- /dev/null +++ b/app/vendor/doctrine/cache/lib/Doctrine/Common/Cache/Psr6/CacheAdapter.php @@ -0,0 +1,340 @@ + */ + private $deferredItems = []; + + public static function wrap(Cache $cache): CacheItemPoolInterface + { + if ($cache instanceof DoctrineProvider && ! $cache->getNamespace()) { + return $cache->getPool(); + } + + if ($cache instanceof SymfonyDoctrineProvider && ! $cache->getNamespace()) { + $getPool = function () { + // phpcs:ignore Squiz.Scope.StaticThisUsage.Found + return $this->pool; + }; + + return $getPool->bindTo($cache, SymfonyDoctrineProvider::class)(); + } + + return new self($cache); + } + + private function __construct(Cache $cache) + { + $this->cache = $cache; + } + + /** @internal */ + public function getCache(): Cache + { + return $this->cache; + } + + /** + * {@inheritDoc} + */ + public function getItem($key): CacheItemInterface + { + assert(self::validKey($key)); + + if (isset($this->deferredItems[$key])) { + $this->commit(); + } + + $value = $this->cache->fetch($key); + + if (PHP_VERSION_ID >= 80000) { + if ($value !== false) { + return new TypedCacheItem($key, $value, true); + } + + return new TypedCacheItem($key, null, false); + } + + if ($value !== false) { + return new CacheItem($key, $value, true); + } + + return new CacheItem($key, null, false); + } + + /** + * {@inheritDoc} + */ + public function getItems(array $keys = []): array + { + if ($this->deferredItems) { + $this->commit(); + } + + assert(self::validKeys($keys)); + + $values = $this->doFetchMultiple($keys); + $items = []; + + if (PHP_VERSION_ID >= 80000) { + foreach ($keys as $key) { + if (array_key_exists($key, $values)) { + $items[$key] = new TypedCacheItem($key, $values[$key], true); + } else { + $items[$key] = new TypedCacheItem($key, null, false); + } + } + + return $items; + } + + foreach ($keys as $key) { + if (array_key_exists($key, $values)) { + $items[$key] = new CacheItem($key, $values[$key], true); + } else { + $items[$key] = new CacheItem($key, null, false); + } + } + + return $items; + } + + /** + * {@inheritDoc} + */ + public function hasItem($key): bool + { + assert(self::validKey($key)); + + if (isset($this->deferredItems[$key])) { + $this->commit(); + } + + return $this->cache->contains($key); + } + + public function clear(): bool + { + $this->deferredItems = []; + + if (! $this->cache instanceof ClearableCache) { + return false; + } + + return $this->cache->deleteAll(); + } + + /** + * {@inheritDoc} + */ + public function deleteItem($key): bool + { + assert(self::validKey($key)); + unset($this->deferredItems[$key]); + + return $this->cache->delete($key); + } + + /** + * {@inheritDoc} + */ + public function deleteItems(array $keys): bool + { + foreach ($keys as $key) { + assert(self::validKey($key)); + unset($this->deferredItems[$key]); + } + + return $this->doDeleteMultiple($keys); + } + + public function save(CacheItemInterface $item): bool + { + return $this->saveDeferred($item) && $this->commit(); + } + + public function saveDeferred(CacheItemInterface $item): bool + { + if (! $item instanceof CacheItem && ! $item instanceof TypedCacheItem) { + return false; + } + + $this->deferredItems[$item->getKey()] = $item; + + return true; + } + + public function commit(): bool + { + if (! $this->deferredItems) { + return true; + } + + $now = microtime(true); + $itemsCount = 0; + $byLifetime = []; + $expiredKeys = []; + + foreach ($this->deferredItems as $key => $item) { + $lifetime = ($item->getExpiry() ?? $now) - $now; + + if ($lifetime < 0) { + $expiredKeys[] = $key; + + continue; + } + + ++$itemsCount; + $byLifetime[(int) $lifetime][$key] = $item->get(); + } + + $this->deferredItems = []; + + switch (count($expiredKeys)) { + case 0: + break; + case 1: + $this->cache->delete(current($expiredKeys)); + break; + default: + $this->doDeleteMultiple($expiredKeys); + break; + } + + if ($itemsCount === 1) { + return $this->cache->save($key, $item->get(), (int) $lifetime); + } + + $success = true; + foreach ($byLifetime as $lifetime => $values) { + $success = $this->doSaveMultiple($values, $lifetime) && $success; + } + + return $success; + } + + public function __destruct() + { + $this->commit(); + } + + /** + * @param mixed $key + */ + private static function validKey($key): bool + { + if (! is_string($key)) { + throw new InvalidArgument(sprintf('Cache key must be string, "%s" given.', is_object($key) ? get_class($key) : gettype($key))); + } + + if ($key === '') { + throw new InvalidArgument('Cache key length must be greater than zero.'); + } + + if (strpbrk($key, self::RESERVED_CHARACTERS) !== false) { + throw new InvalidArgument(sprintf('Cache key "%s" contains reserved characters "%s".', $key, self::RESERVED_CHARACTERS)); + } + + return true; + } + + /** + * @param mixed[] $keys + */ + private static function validKeys(array $keys): bool + { + foreach ($keys as $key) { + self::validKey($key); + } + + return true; + } + + /** + * @param mixed[] $keys + */ + private function doDeleteMultiple(array $keys): bool + { + if ($this->cache instanceof MultiDeleteCache) { + return $this->cache->deleteMultiple($keys); + } + + $success = true; + foreach ($keys as $key) { + $success = $this->cache->delete($key) && $success; + } + + return $success; + } + + /** + * @param mixed[] $keys + * + * @return mixed[] + */ + private function doFetchMultiple(array $keys): array + { + if ($this->cache instanceof MultiGetCache) { + return $this->cache->fetchMultiple($keys); + } + + $values = []; + foreach ($keys as $key) { + $value = $this->cache->fetch($key); + if (! $value) { + continue; + } + + $values[$key] = $value; + } + + return $values; + } + + /** + * @param mixed[] $keysAndValues + */ + private function doSaveMultiple(array $keysAndValues, int $lifetime = 0): bool + { + if ($this->cache instanceof MultiPutCache) { + return $this->cache->saveMultiple($keysAndValues, $lifetime); + } + + $success = true; + foreach ($keysAndValues as $key => $value) { + $success = $this->cache->save($key, $value, $lifetime) && $success; + } + + return $success; + } +} diff --git a/app/vendor/doctrine/cache/lib/Doctrine/Common/Cache/Psr6/CacheItem.php b/app/vendor/doctrine/cache/lib/Doctrine/Common/Cache/Psr6/CacheItem.php new file mode 100644 index 000000000..0b6f0a28d --- /dev/null +++ b/app/vendor/doctrine/cache/lib/Doctrine/Common/Cache/Psr6/CacheItem.php @@ -0,0 +1,118 @@ +key = $key; + $this->value = $data; + $this->isHit = $isHit; + } + + public function getKey(): string + { + return $this->key; + } + + /** + * {@inheritDoc} + * + * @return mixed + */ + public function get() + { + return $this->value; + } + + public function isHit(): bool + { + return $this->isHit; + } + + /** + * {@inheritDoc} + */ + public function set($value): self + { + $this->value = $value; + + return $this; + } + + /** + * {@inheritDoc} + */ + public function expiresAt($expiration): self + { + if ($expiration === null) { + $this->expiry = null; + } elseif ($expiration instanceof DateTimeInterface) { + $this->expiry = (float) $expiration->format('U.u'); + } else { + throw new TypeError(sprintf( + 'Expected $expiration to be an instance of DateTimeInterface or null, got %s', + is_object($expiration) ? get_class($expiration) : gettype($expiration) + )); + } + + return $this; + } + + /** + * {@inheritDoc} + */ + public function expiresAfter($time): self + { + if ($time === null) { + $this->expiry = null; + } elseif ($time instanceof DateInterval) { + $this->expiry = microtime(true) + DateTime::createFromFormat('U', 0)->add($time)->format('U.u'); + } elseif (is_int($time)) { + $this->expiry = $time + microtime(true); + } else { + throw new TypeError(sprintf( + 'Expected $time to be either an integer, an instance of DateInterval or null, got %s', + is_object($time) ? get_class($time) : gettype($time) + )); + } + + return $this; + } + + /** + * @internal + */ + public function getExpiry(): ?float + { + return $this->expiry; + } +} diff --git a/app/vendor/doctrine/cache/lib/Doctrine/Common/Cache/Psr6/DoctrineProvider.php b/app/vendor/doctrine/cache/lib/Doctrine/Common/Cache/Psr6/DoctrineProvider.php new file mode 100644 index 000000000..c15497e55 --- /dev/null +++ b/app/vendor/doctrine/cache/lib/Doctrine/Common/Cache/Psr6/DoctrineProvider.php @@ -0,0 +1,125 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Doctrine\Common\Cache\Psr6; + +use Doctrine\Common\Cache\Cache; +use Doctrine\Common\Cache\CacheProvider; +use Psr\Cache\CacheItemPoolInterface; +use Symfony\Component\Cache\Adapter\DoctrineAdapter as SymfonyDoctrineAdapter; + +use function rawurlencode; + +/** + * This class was copied from the Symfony Framework, see the original copyright + * notice above. The code is distributed subject to the license terms in + * https://github.com/symfony/symfony/blob/ff0cf61278982539c49e467db9ab13cbd342f76d/LICENSE + */ +final class DoctrineProvider extends CacheProvider +{ + /** @var CacheItemPoolInterface */ + private $pool; + + public static function wrap(CacheItemPoolInterface $pool): Cache + { + if ($pool instanceof CacheAdapter) { + return $pool->getCache(); + } + + if ($pool instanceof SymfonyDoctrineAdapter) { + $getCache = function () { + // phpcs:ignore Squiz.Scope.StaticThisUsage.Found + return $this->provider; + }; + + return $getCache->bindTo($pool, SymfonyDoctrineAdapter::class)(); + } + + return new self($pool); + } + + private function __construct(CacheItemPoolInterface $pool) + { + $this->pool = $pool; + } + + /** @internal */ + public function getPool(): CacheItemPoolInterface + { + return $this->pool; + } + + /** + * {@inheritdoc} + */ + protected function doFetch($id) + { + $item = $this->pool->getItem(rawurlencode($id)); + + return $item->isHit() ? $item->get() : false; + } + + /** + * {@inheritdoc} + * + * @return bool + */ + protected function doContains($id) + { + return $this->pool->hasItem(rawurlencode($id)); + } + + /** + * {@inheritdoc} + * + * @return bool + */ + protected function doSave($id, $data, $lifeTime = 0) + { + $item = $this->pool->getItem(rawurlencode($id)); + + if (0 < $lifeTime) { + $item->expiresAfter($lifeTime); + } + + return $this->pool->save($item->set($data)); + } + + /** + * {@inheritdoc} + * + * @return bool + */ + protected function doDelete($id) + { + return $this->pool->deleteItem(rawurlencode($id)); + } + + /** + * {@inheritdoc} + * + * @return bool + */ + protected function doFlush() + { + return $this->pool->clear(); + } + + /** + * {@inheritdoc} + * + * @return array|null + */ + protected function doGetStats() + { + return null; + } +} diff --git a/app/vendor/doctrine/cache/lib/Doctrine/Common/Cache/Psr6/InvalidArgument.php b/app/vendor/doctrine/cache/lib/Doctrine/Common/Cache/Psr6/InvalidArgument.php new file mode 100644 index 000000000..196f1bca9 --- /dev/null +++ b/app/vendor/doctrine/cache/lib/Doctrine/Common/Cache/Psr6/InvalidArgument.php @@ -0,0 +1,13 @@ +key; + } + + public function get(): mixed + { + return $this->value; + } + + public function isHit(): bool + { + return $this->isHit; + } + + public function set(mixed $value): static + { + $this->value = $value; + + return $this; + } + + /** + * {@inheritDoc} + */ + public function expiresAt($expiration): static + { + if ($expiration === null) { + $this->expiry = null; + } elseif ($expiration instanceof DateTimeInterface) { + $this->expiry = (float) $expiration->format('U.u'); + } else { + throw new TypeError(sprintf( + 'Expected $expiration to be an instance of DateTimeInterface or null, got %s', + get_debug_type($expiration) + )); + } + + return $this; + } + + /** + * {@inheritDoc} + */ + public function expiresAfter($time): static + { + if ($time === null) { + $this->expiry = null; + } elseif ($time instanceof DateInterval) { + $this->expiry = microtime(true) + DateTime::createFromFormat('U', 0)->add($time)->format('U.u'); + } elseif (is_int($time)) { + $this->expiry = $time + microtime(true); + } else { + throw new TypeError(sprintf( + 'Expected $time to be either an integer, an instance of DateInterval or null, got %s', + get_debug_type($time) + )); + } + + return $this; + } + + /** + * @internal + */ + public function getExpiry(): ?float + { + return $this->expiry; + } +} diff --git a/app/vendor/doctrine/dbal/CONTRIBUTING.md b/app/vendor/doctrine/dbal/CONTRIBUTING.md new file mode 100644 index 000000000..c2555ebbd --- /dev/null +++ b/app/vendor/doctrine/dbal/CONTRIBUTING.md @@ -0,0 +1,4 @@ +Doctrine has [general contributing guidelines][contributor workflow], make +sure you follow them. + +[contributor workflow]: https://www.doctrine-project.org/contribute/index.html diff --git a/app/vendor/doctrine/dbal/LICENSE b/app/vendor/doctrine/dbal/LICENSE new file mode 100644 index 000000000..e8fdec4af --- /dev/null +++ b/app/vendor/doctrine/dbal/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2006-2018 Doctrine Project + +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/app/vendor/doctrine/dbal/README.md b/app/vendor/doctrine/dbal/README.md new file mode 100644 index 000000000..43caa5a53 --- /dev/null +++ b/app/vendor/doctrine/dbal/README.md @@ -0,0 +1,42 @@ +# Doctrine DBAL + +| [4.0-dev][4.0] | [3.1][3.1] | [2.13][2.13] | +|:----------------:|:----------:|:----------:| +| [![GitHub Actions][GA 4.0 image]][GA 4.0] | [![GitHub Actions][GA 3.1 image]][GA 3.1] | [![GitHub Actions][GA 2.13 image]][GA 2.13] | +| [![AppVeyor][AppVeyor 4.0 image]][AppVeyor 4.0] | [![AppVeyor][AppVeyor 3.1 image]][AppVeyor 3.1] | [![AppVeyor][AppVeyor 2.13 image]][AppVeyor 2.13] | +| [![Code Coverage][Coverage image]][CodeCov 4.0] | [![Code Coverage][Coverage 3.1 image]][CodeCov 3.1] | [![Code Coverage][Coverage 2.13 image]][CodeCov 2.13] | +| N/A | [![Code Coverage][TypeCov 3.1 image]][TypeCov 3.1] | N/A | + +Powerful database abstraction layer with many features for database schema introspection, schema management and PDO abstraction. + +## More resources: + +* [Website](http://www.doctrine-project.org/projects/dbal.html) +* [Documentation](http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/) +* [Issue Tracker](https://github.com/doctrine/dbal/issues) + + [Coverage image]: https://codecov.io/gh/doctrine/dbal/branch/4.0.x/graph/badge.svg + [4.0]: https://github.com/doctrine/dbal/tree/4.0.x + [CodeCov 4.0]: https://codecov.io/gh/doctrine/dbal/branch/4.0.x + [AppVeyor 4.0]: https://ci.appveyor.com/project/doctrine/dbal/branch/4.0.x + [AppVeyor 4.0 image]: https://ci.appveyor.com/api/projects/status/i88kitq8qpbm0vie/branch/4.0.x?svg=true + [GA 4.0]: https://github.com/doctrine/dbal/actions?query=workflow%3A%22Continuous+Integration%22+branch%3A4.0.x + [GA 4.0 image]: https://github.com/doctrine/dbal/workflows/Continuous%20Integration/badge.svg + + [Coverage 3.1 image]: https://codecov.io/gh/doctrine/dbal/branch/3.1.x/graph/badge.svg + [3.1]: https://github.com/doctrine/dbal/tree/3.1.x + [CodeCov 3.1]: https://codecov.io/gh/doctrine/dbal/branch/3.1.x + [AppVeyor 3.1]: https://ci.appveyor.com/project/doctrine/dbal/branch/3.1.x + [AppVeyor 3.1 image]: https://ci.appveyor.com/api/projects/status/i88kitq8qpbm0vie/branch/3.1.x?svg=true + [GA 3.1]: https://github.com/doctrine/dbal/actions?query=workflow%3A%22Continuous+Integration%22+branch%3A3.1.x + [GA 3.1 image]: https://github.com/doctrine/dbal/workflows/Continuous%20Integration/badge.svg?branch=3.1.x + + [Coverage 2.13 image]: https://codecov.io/gh/doctrine/dbal/branch/2.13.x/graph/badge.svg + [2.13]: https://github.com/doctrine/dbal/tree/2.13.x + [CodeCov 2.13]: https://codecov.io/gh/doctrine/dbal/branch/2.13.x + [AppVeyor 2.13]: https://ci.appveyor.com/project/doctrine/dbal/branch/2.13.x + [AppVeyor 2.13 image]: https://ci.appveyor.com/api/projects/status/i88kitq8qpbm0vie/branch/2.13.x?svg=true + [GA 2.13]: https://github.com/doctrine/dbal/actions?query=workflow%3A%22Continuous+Integration%22+branch%3A2.13.x + [GA 2.13 image]: https://github.com/doctrine/dbal/workflows/Continuous%20Integration/badge.svg?branch=2.13.x + [TypeCov 3.1]: https://shepherd.dev/github/doctrine/dbal + [TypeCov 3.1 image]: https://shepherd.dev/github/doctrine/dbal/coverage.svg diff --git a/app/vendor/doctrine/dbal/bin/doctrine-dbal b/app/vendor/doctrine/dbal/bin/doctrine-dbal new file mode 100755 index 000000000..0531527dd --- /dev/null +++ b/app/vendor/doctrine/dbal/bin/doctrine-dbal @@ -0,0 +1,4 @@ +#!/usr/bin/env php +data = $data; + if (count($data) === 0) { + return; + } + + $this->columnCount = count($data[0]); + } + + /** + * {@inheritdoc} + */ + public function fetchNumeric() + { + $row = $this->fetch(); + + if ($row === false) { + return false; + } + + return array_values($row); + } + + /** + * {@inheritdoc} + */ + public function fetchAssociative() + { + return $this->fetch(); + } + + /** + * {@inheritdoc} + */ + public function fetchOne() + { + $row = $this->fetch(); + + if ($row === false) { + return false; + } + + return reset($row); + } + + /** + * {@inheritdoc} + */ + public function fetchAllNumeric(): array + { + return FetchUtils::fetchAllNumeric($this); + } + + /** + * {@inheritdoc} + */ + public function fetchAllAssociative(): array + { + return FetchUtils::fetchAllAssociative($this); + } + + /** + * {@inheritdoc} + */ + public function fetchFirstColumn(): array + { + return FetchUtils::fetchFirstColumn($this); + } + + public function rowCount(): int + { + return count($this->data); + } + + public function columnCount(): int + { + return $this->columnCount; + } + + public function free(): void + { + $this->data = []; + } + + /** + * @return mixed|false + */ + private function fetch() + { + if (! isset($this->data[$this->num])) { + return false; + } + + return $this->data[$this->num++]; + } +} diff --git a/app/vendor/doctrine/dbal/src/Cache/CacheException.php b/app/vendor/doctrine/dbal/src/Cache/CacheException.php new file mode 100644 index 000000000..3db115bdf --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Cache/CacheException.php @@ -0,0 +1,27 @@ +>|null */ + private $data; + + /** + * @param string $cacheKey + * @param string $realKey + * @param int $lifetime + */ + public function __construct(Result $result, Cache $cache, $cacheKey, $realKey, $lifetime) + { + $this->result = $result; + $this->cache = $cache; + $this->cacheKey = $cacheKey; + $this->realKey = $realKey; + $this->lifetime = $lifetime; + } + + /** + * {@inheritdoc} + */ + public function fetchNumeric() + { + $row = $this->fetch(); + + if ($row === false) { + return false; + } + + return array_values($row); + } + + /** + * {@inheritdoc} + */ + public function fetchAssociative() + { + return $this->fetch(); + } + + /** + * {@inheritdoc} + */ + public function fetchOne() + { + return FetchUtils::fetchOne($this); + } + + /** + * {@inheritdoc} + */ + public function fetchAllNumeric(): array + { + return array_map('array_values', $this->fetchAllAssociative()); + } + + /** + * {@inheritdoc} + */ + public function fetchAllAssociative(): array + { + $data = $this->result->fetchAllAssociative(); + + $this->store($data); + + return $data; + } + + /** + * {@inheritdoc} + */ + public function fetchFirstColumn(): array + { + return FetchUtils::fetchFirstColumn($this); + } + + public function rowCount(): int + { + return $this->result->rowCount(); + } + + public function columnCount(): int + { + return $this->result->columnCount(); + } + + public function free(): void + { + $this->data = null; + } + + /** + * @return array|false + * + * @throws Exception + */ + private function fetch() + { + if ($this->data === null) { + $this->data = []; + } + + $row = $this->result->fetchAssociative(); + + if ($row !== false) { + $this->data[] = $row; + + return $row; + } + + $this->saveToCache(); + + return false; + } + + /** + * @param array> $data + */ + private function store(array $data): void + { + $this->data = $data; + + $this->saveToCache(); + } + + private function saveToCache(): void + { + if ($this->data === null) { + return; + } + + $data = $this->cache->fetch($this->cacheKey); + + if ($data === false) { + $data = []; + } + + $data[$this->realKey] = $this->data; + + $this->cache->save($this->cacheKey, $data, $this->lifetime); + } +} diff --git a/app/vendor/doctrine/dbal/src/Cache/QueryCacheProfile.php b/app/vendor/doctrine/dbal/src/Cache/QueryCacheProfile.php new file mode 100644 index 000000000..44f5868cf --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Cache/QueryCacheProfile.php @@ -0,0 +1,123 @@ +lifetime = $lifetime; + $this->cacheKey = $cacheKey; + $this->resultCacheDriver = $resultCache; + } + + /** + * @return Cache|null + */ + public function getResultCacheDriver() + { + return $this->resultCacheDriver; + } + + /** + * @return int + */ + public function getLifetime() + { + return $this->lifetime; + } + + /** + * @return string + * + * @throws CacheException + */ + public function getCacheKey() + { + if ($this->cacheKey === null) { + throw CacheException::noCacheKey(); + } + + return $this->cacheKey; + } + + /** + * Generates the real cache key from query, params, types and connection parameters. + * + * @param string $sql + * @param list|array $params + * @param array|array $types + * @param array $connectionParams + * + * @return string[] + */ + public function generateCacheKeys($sql, $params, $types, array $connectionParams = []) + { + $realCacheKey = 'query=' . $sql . + '¶ms=' . serialize($params) . + '&types=' . serialize($types) . + '&connectionParams=' . hash('sha256', serialize($connectionParams)); + + // should the key be automatically generated using the inputs or is the cache key set? + if ($this->cacheKey === null) { + $cacheKey = sha1($realCacheKey); + } else { + $cacheKey = $this->cacheKey; + } + + return [$cacheKey, $realCacheKey]; + } + + /** + * @return QueryCacheProfile + */ + public function setResultCacheDriver(Cache $cache) + { + return new QueryCacheProfile($this->lifetime, $this->cacheKey, $cache); + } + + /** + * @param string|null $cacheKey + * + * @return QueryCacheProfile + */ + public function setCacheKey($cacheKey) + { + return new QueryCacheProfile($this->lifetime, $cacheKey, $this->resultCacheDriver); + } + + /** + * @param int $lifetime + * + * @return QueryCacheProfile + */ + public function setLifetime($lifetime) + { + return new QueryCacheProfile($lifetime, $this->cacheKey, $this->resultCacheDriver); + } +} diff --git a/app/vendor/doctrine/dbal/src/ColumnCase.php b/app/vendor/doctrine/dbal/src/ColumnCase.php new file mode 100644 index 000000000..cb0dd409b --- /dev/null +++ b/app/vendor/doctrine/dbal/src/ColumnCase.php @@ -0,0 +1,28 @@ +sqlLogger = $logger; + } + + /** + * Gets the SQL logger that is used. + */ + public function getSQLLogger(): ?SQLLogger + { + return $this->sqlLogger; + } + + /** + * Gets the cache driver implementation that is used for query result caching. + */ + public function getResultCacheImpl(): ?Cache + { + return $this->resultCacheImpl; + } + + /** + * Sets the cache driver implementation that is used for query result caching. + */ + public function setResultCacheImpl(Cache $cacheImpl): void + { + $this->resultCacheImpl = $cacheImpl; + } + + /** + * Sets the callable to use to filter schema assets. + */ + public function setSchemaAssetsFilter(?callable $callable = null): void + { + $this->schemaAssetsFilter = $callable; + } + + /** + * Returns the callable to use to filter schema assets. + */ + public function getSchemaAssetsFilter(): ?callable + { + return $this->schemaAssetsFilter; + } + + /** + * Sets the default auto-commit mode for connections. + * + * If a connection is in auto-commit mode, then all its SQL statements will be executed and committed as individual + * transactions. Otherwise, its SQL statements are grouped into transactions that are terminated by a call to either + * the method commit or the method rollback. By default, new connections are in auto-commit mode. + * + * @see getAutoCommit + * + * @param bool $autoCommit True to enable auto-commit mode; false to disable it + */ + public function setAutoCommit(bool $autoCommit): void + { + $this->autoCommit = $autoCommit; + } + + /** + * Returns the default auto-commit mode for connections. + * + * @see setAutoCommit + * + * @return bool True if auto-commit mode is enabled by default for connections, false otherwise. + */ + public function getAutoCommit(): bool + { + return $this->autoCommit; + } + + /** + * @param Middleware[] $middlewares + * + * @return $this + */ + public function setMiddlewares(array $middlewares): self + { + $this->middlewares = $middlewares; + + return $this; + } + + /** + * @return Middleware[] + */ + public function getMiddlewares(): array + { + return $this->middlewares; + } +} diff --git a/app/vendor/doctrine/dbal/src/Connection.php b/app/vendor/doctrine/dbal/src/Connection.php new file mode 100644 index 000000000..466484234 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Connection.php @@ -0,0 +1,1821 @@ + + * @phpstan-var array + * @psalm-var Params + */ + private $params; + + /** + * The database platform object used by the connection or NULL before it's initialized. + * + * @var AbstractPlatform|null + */ + private $platform; + + /** @var ExceptionConverter|null */ + private $exceptionConverter; + + /** @var Parser|null */ + private $parser; + + /** + * The schema manager. + * + * @deprecated Use {@link createSchemaManager()} instead. + * + * @var AbstractSchemaManager|null + */ + protected $_schemaManager; + + /** + * The used DBAL driver. + * + * @var Driver + */ + protected $_driver; + + /** + * Flag that indicates whether the current transaction is marked for rollback only. + * + * @var bool + */ + private $isRollbackOnly = false; + + /** + * Initializes a new instance of the Connection class. + * + * @internal The connection can be only instantiated by the driver manager. + * + * @param array $params The connection parameters. + * @param Driver $driver The driver to use. + * @param Configuration|null $config The configuration, optional. + * @param EventManager|null $eventManager The event manager, optional. + * @psalm-param Params $params + * @phpstan-param array $params + * + * @throws Exception + */ + public function __construct( + array $params, + Driver $driver, + ?Configuration $config = null, + ?EventManager $eventManager = null + ) { + $this->_driver = $driver; + $this->params = $params; + + if (isset($params['platform'])) { + if (! $params['platform'] instanceof Platforms\AbstractPlatform) { + throw Exception::invalidPlatformType($params['platform']); + } + + $this->platform = $params['platform']; + } + + // Create default config and event manager if none given + if ($config === null) { + $config = new Configuration(); + } + + if ($eventManager === null) { + $eventManager = new EventManager(); + } + + $this->_config = $config; + $this->_eventManager = $eventManager; + + $this->_expr = $this->createExpressionBuilder(); + + $this->autoCommit = $config->getAutoCommit(); + } + + /** + * Gets the parameters used during instantiation. + * + * @internal + * + * @return array + * @psalm-return Params + * @phpstan-return array + */ + public function getParams() + { + return $this->params; + } + + /** + * Gets the name of the currently selected database. + * + * @return string|null The name of the database or NULL if a database is not selected. + * The platforms which don't support the concept of a database (e.g. embedded databases) + * must always return a string as an indicator of an implicitly selected database. + * + * @throws Exception + */ + public function getDatabase() + { + $platform = $this->getDatabasePlatform(); + $query = $platform->getDummySelectSQL($platform->getCurrentDatabaseExpression()); + $database = $this->fetchOne($query); + + assert(is_string($database) || $database === null); + + return $database; + } + + /** + * Gets the DBAL driver instance. + * + * @return Driver + */ + public function getDriver() + { + return $this->_driver; + } + + /** + * Gets the Configuration used by the Connection. + * + * @return Configuration + */ + public function getConfiguration() + { + return $this->_config; + } + + /** + * Gets the EventManager used by the Connection. + * + * @return EventManager + */ + public function getEventManager() + { + return $this->_eventManager; + } + + /** + * Gets the DatabasePlatform for the connection. + * + * @return AbstractPlatform + * + * @throws Exception + */ + public function getDatabasePlatform() + { + if ($this->platform === null) { + $this->platform = $this->detectDatabasePlatform(); + $this->platform->setEventManager($this->_eventManager); + } + + return $this->platform; + } + + /** + * Creates an expression builder for the connection. + */ + public function createExpressionBuilder(): ExpressionBuilder + { + return new ExpressionBuilder($this); + } + + /** + * Gets the ExpressionBuilder for the connection. + * + * @deprecated Use {@link createExpressionBuilder()} instead. + * + * @return ExpressionBuilder + */ + public function getExpressionBuilder() + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4515', + 'Connection::getExpressionBuilder() is deprecated,' + . ' use Connection::createExpressionBuilder() instead.' + ); + + return $this->_expr; + } + + /** + * Establishes the connection with the database. + * + * @return bool TRUE if the connection was successfully established, FALSE if + * the connection is already open. + * + * @throws Exception + */ + public function connect() + { + if ($this->_conn !== null) { + return false; + } + + try { + $this->_conn = $this->_driver->connect($this->params); + } catch (Driver\Exception $e) { + throw $this->convertException($e); + } + + if ($this->autoCommit === false) { + $this->beginTransaction(); + } + + if ($this->_eventManager->hasListeners(Events::postConnect)) { + $eventArgs = new Event\ConnectionEventArgs($this); + $this->_eventManager->dispatchEvent(Events::postConnect, $eventArgs); + } + + return true; + } + + /** + * Detects and sets the database platform. + * + * Evaluates custom platform class and version in order to set the correct platform. + * + * @throws Exception If an invalid platform was specified for this connection. + */ + private function detectDatabasePlatform(): AbstractPlatform + { + $version = $this->getDatabasePlatformVersion(); + + if ($version !== null) { + assert($this->_driver instanceof VersionAwarePlatformDriver); + + return $this->_driver->createDatabasePlatformForVersion($version); + } + + return $this->_driver->getDatabasePlatform(); + } + + /** + * Returns the version of the related platform if applicable. + * + * Returns null if either the driver is not capable to create version + * specific platform instances, no explicit server version was specified + * or the underlying driver connection cannot determine the platform + * version without having to query it (performance reasons). + * + * @return string|null + * + * @throws Throwable + */ + private function getDatabasePlatformVersion() + { + // Driver does not support version specific platforms. + if (! $this->_driver instanceof VersionAwarePlatformDriver) { + return null; + } + + // Explicit platform version requested (supersedes auto-detection). + if (isset($this->params['serverVersion'])) { + return $this->params['serverVersion']; + } + + // If not connected, we need to connect now to determine the platform version. + if ($this->_conn === null) { + try { + $this->connect(); + } catch (Exception $originalException) { + if (! isset($this->params['dbname'])) { + throw $originalException; + } + + // The database to connect to might not yet exist. + // Retry detection without database name connection parameter. + $params = $this->params; + + unset($this->params['dbname']); + + try { + $this->connect(); + } catch (Exception $fallbackException) { + // Either the platform does not support database-less connections + // or something else went wrong. + throw $originalException; + } finally { + $this->params = $params; + } + + $serverVersion = $this->getServerVersion(); + + // Close "temporary" connection to allow connecting to the real database again. + $this->close(); + + return $serverVersion; + } + } + + return $this->getServerVersion(); + } + + /** + * Returns the database server version if the underlying driver supports it. + * + * @return string|null + * + * @throws Exception + */ + private function getServerVersion() + { + $connection = $this->getWrappedConnection(); + + // Automatic platform version detection. + if ($connection instanceof ServerInfoAwareConnection) { + try { + return $connection->getServerVersion(); + } catch (Driver\Exception $e) { + throw $this->convertException($e); + } + } + + // Unable to detect platform version. + return null; + } + + /** + * Returns the current auto-commit mode for this connection. + * + * @see setAutoCommit + * + * @return bool True if auto-commit mode is currently enabled for this connection, false otherwise. + */ + public function isAutoCommit() + { + return $this->autoCommit === true; + } + + /** + * Sets auto-commit mode for this connection. + * + * If a connection is in auto-commit mode, then all its SQL statements will be executed and committed as individual + * transactions. Otherwise, its SQL statements are grouped into transactions that are terminated by a call to either + * the method commit or the method rollback. By default, new connections are in auto-commit mode. + * + * NOTE: If this method is called during a transaction and the auto-commit mode is changed, the transaction is + * committed. If this method is called and the auto-commit mode is not changed, the call is a no-op. + * + * @see isAutoCommit + * + * @param bool $autoCommit True to enable auto-commit mode; false to disable it. + * + * @return void + */ + public function setAutoCommit($autoCommit) + { + $autoCommit = (bool) $autoCommit; + + // Mode not changed, no-op. + if ($autoCommit === $this->autoCommit) { + return; + } + + $this->autoCommit = $autoCommit; + + // Commit all currently active transactions if any when switching auto-commit mode. + if ($this->_conn === null || $this->transactionNestingLevel === 0) { + return; + } + + $this->commitAll(); + } + + /** + * Prepares and executes an SQL query and returns the first row of the result + * as an associative array. + * + * @param string $query SQL query + * @param list|array $params Query parameters + * @param array|array $types Parameter types + * + * @return array|false False is returned if no rows are found. + * + * @throws Exception + */ + public function fetchAssociative(string $query, array $params = [], array $types = []) + { + try { + return $this->executeQuery($query, $params, $types)->fetchAssociative(); + } catch (Driver\Exception $e) { + throw $this->convertExceptionDuringQuery($e, $query, $params, $types); + } + } + + /** + * Prepares and executes an SQL query and returns the first row of the result + * as a numerically indexed array. + * + * @param string $query SQL query + * @param list|array $params Query parameters + * @param array|array $types Parameter types + * + * @return list< mixed>|false False is returned if no rows are found. + * + * @throws Exception + */ + public function fetchNumeric(string $query, array $params = [], array $types = []) + { + try { + return $this->executeQuery($query, $params, $types)->fetchNumeric(); + } catch (Driver\Exception $e) { + throw $this->convertExceptionDuringQuery($e, $query, $params, $types); + } + } + + /** + * Prepares and executes an SQL query and returns the value of a single column + * of the first row of the result. + * + * @param string $query SQL query + * @param list|array $params Query parameters + * @param array|array $types Parameter types + * + * @return mixed|false False is returned if no rows are found. + * + * @throws Exception + */ + public function fetchOne(string $query, array $params = [], array $types = []) + { + try { + return $this->executeQuery($query, $params, $types)->fetchOne(); + } catch (Driver\Exception $e) { + throw $this->convertExceptionDuringQuery($e, $query, $params, $types); + } + } + + /** + * Whether an actual connection to the database is established. + * + * @return bool + */ + public function isConnected() + { + return $this->_conn !== null; + } + + /** + * Checks whether a transaction is currently active. + * + * @return bool TRUE if a transaction is currently active, FALSE otherwise. + */ + public function isTransactionActive() + { + return $this->transactionNestingLevel > 0; + } + + /** + * Adds condition based on the criteria to the query components + * + * @param array $criteria Map of key columns to their values + * @param string[] $columns Column names + * @param mixed[] $values Column values + * @param string[] $conditions Key conditions + * + * @throws Exception + */ + private function addCriteriaCondition( + array $criteria, + array &$columns, + array &$values, + array &$conditions + ): void { + $platform = $this->getDatabasePlatform(); + + foreach ($criteria as $columnName => $value) { + if ($value === null) { + $conditions[] = $platform->getIsNullExpression($columnName); + continue; + } + + $columns[] = $columnName; + $values[] = $value; + $conditions[] = $columnName . ' = ?'; + } + } + + /** + * Executes an SQL DELETE statement on a table. + * + * Table expression and columns are not escaped and are not safe for user-input. + * + * @param string $table Table name + * @param array $criteria Deletion criteria + * @param array|array $types Parameter types + * + * @return int The number of affected rows. + * + * @throws Exception + */ + public function delete($table, array $criteria, array $types = []) + { + if (count($criteria) === 0) { + throw InvalidArgumentException::fromEmptyCriteria(); + } + + $columns = $values = $conditions = []; + + $this->addCriteriaCondition($criteria, $columns, $values, $conditions); + + return $this->executeStatement( + 'DELETE FROM ' . $table . ' WHERE ' . implode(' AND ', $conditions), + $values, + is_string(key($types)) ? $this->extractTypeValues($columns, $types) : $types + ); + } + + /** + * Closes the connection. + * + * @return void + */ + public function close() + { + $this->_conn = null; + $this->transactionNestingLevel = 0; + } + + /** + * Sets the transaction isolation level. + * + * @param int $level The level to set. + * + * @return int + * + * @throws Exception + */ + public function setTransactionIsolation($level) + { + $this->transactionIsolationLevel = $level; + + return $this->executeStatement($this->getDatabasePlatform()->getSetTransactionIsolationSQL($level)); + } + + /** + * Gets the currently active transaction isolation level. + * + * @return int The current transaction isolation level. + * + * @throws Exception + */ + public function getTransactionIsolation() + { + if ($this->transactionIsolationLevel === null) { + $this->transactionIsolationLevel = $this->getDatabasePlatform()->getDefaultTransactionIsolationLevel(); + } + + return $this->transactionIsolationLevel; + } + + /** + * Executes an SQL UPDATE statement on a table. + * + * Table expression and columns are not escaped and are not safe for user-input. + * + * @param string $table Table name + * @param array $data Column-value pairs + * @param array $criteria Update criteria + * @param array|array $types Parameter types + * + * @return int The number of affected rows. + * + * @throws Exception + */ + public function update($table, array $data, array $criteria, array $types = []) + { + $columns = $values = $conditions = $set = []; + + foreach ($data as $columnName => $value) { + $columns[] = $columnName; + $values[] = $value; + $set[] = $columnName . ' = ?'; + } + + $this->addCriteriaCondition($criteria, $columns, $values, $conditions); + + if (is_string(key($types))) { + $types = $this->extractTypeValues($columns, $types); + } + + $sql = 'UPDATE ' . $table . ' SET ' . implode(', ', $set) + . ' WHERE ' . implode(' AND ', $conditions); + + return $this->executeStatement($sql, $values, $types); + } + + /** + * Inserts a table row with specified data. + * + * Table expression and columns are not escaped and are not safe for user-input. + * + * @param string $table Table name + * @param array $data Column-value pairs + * @param array|array $types Parameter types + * + * @return int The number of affected rows. + * + * @throws Exception + */ + public function insert($table, array $data, array $types = []) + { + if (count($data) === 0) { + return $this->executeStatement('INSERT INTO ' . $table . ' () VALUES ()'); + } + + $columns = []; + $values = []; + $set = []; + + foreach ($data as $columnName => $value) { + $columns[] = $columnName; + $values[] = $value; + $set[] = '?'; + } + + return $this->executeStatement( + 'INSERT INTO ' . $table . ' (' . implode(', ', $columns) . ')' . + ' VALUES (' . implode(', ', $set) . ')', + $values, + is_string(key($types)) ? $this->extractTypeValues($columns, $types) : $types + ); + } + + /** + * Extract ordered type list from an ordered column list and type map. + * + * @param array $columnList + * @param array|array $types + * + * @return array|array + */ + private function extractTypeValues(array $columnList, array $types) + { + $typeValues = []; + + foreach ($columnList as $columnName) { + $typeValues[] = $types[$columnName] ?? ParameterType::STRING; + } + + return $typeValues; + } + + /** + * Quotes a string so it can be safely used as a table or column name, even if + * it is a reserved name. + * + * Delimiting style depends on the underlying database platform that is being used. + * + * NOTE: Just because you CAN use quoted identifiers does not mean + * you SHOULD use them. In general, they end up causing way more + * problems than they solve. + * + * @param string $str The name to be quoted. + * + * @return string The quoted name. + */ + public function quoteIdentifier($str) + { + return $this->getDatabasePlatform()->quoteIdentifier($str); + } + + /** + * @param mixed $value + * @param int|string|Type|null $type + * + * @return mixed + */ + public function quote($value, $type = ParameterType::STRING) + { + $connection = $this->getWrappedConnection(); + + [$value, $bindingType] = $this->getBindingInfo($value, $type); + + return $connection->quote($value, $bindingType); + } + + /** + * Prepares and executes an SQL query and returns the result as an array of numeric arrays. + * + * @param string $query SQL query + * @param list|array $params Query parameters + * @param array|array $types Parameter types + * + * @return list> + * + * @throws Exception + */ + public function fetchAllNumeric(string $query, array $params = [], array $types = []): array + { + try { + return $this->executeQuery($query, $params, $types)->fetchAllNumeric(); + } catch (Driver\Exception $e) { + throw $this->convertExceptionDuringQuery($e, $query, $params, $types); + } + } + + /** + * Prepares and executes an SQL query and returns the result as an array of associative arrays. + * + * @param string $query SQL query + * @param list|array $params Query parameters + * @param array|array $types Parameter types + * + * @return list> + * + * @throws Exception + */ + public function fetchAllAssociative(string $query, array $params = [], array $types = []): array + { + try { + return $this->executeQuery($query, $params, $types)->fetchAllAssociative(); + } catch (Driver\Exception $e) { + throw $this->convertExceptionDuringQuery($e, $query, $params, $types); + } + } + + /** + * Prepares and executes an SQL query and returns the result as an associative array with the keys + * mapped to the first column and the values mapped to the second column. + * + * @param string $query SQL query + * @param list|array $params Query parameters + * @param array|array $types Parameter types + * + * @return array + * + * @throws Exception + */ + public function fetchAllKeyValue(string $query, array $params = [], array $types = []): array + { + return $this->executeQuery($query, $params, $types)->fetchAllKeyValue(); + } + + /** + * Prepares and executes an SQL query and returns the result as an associative array with the keys mapped + * to the first column and the values being an associative array representing the rest of the columns + * and their values. + * + * @param string $query SQL query + * @param list|array $params Query parameters + * @param array|array $types Parameter types + * + * @return array> + * + * @throws Exception + */ + public function fetchAllAssociativeIndexed(string $query, array $params = [], array $types = []): array + { + return $this->executeQuery($query, $params, $types)->fetchAllAssociativeIndexed(); + } + + /** + * Prepares and executes an SQL query and returns the result as an array of the first column values. + * + * @param string $query SQL query + * @param list|array $params Query parameters + * @param array|array $types Parameter types + * + * @return list + * + * @throws Exception + */ + public function fetchFirstColumn(string $query, array $params = [], array $types = []): array + { + try { + return $this->executeQuery($query, $params, $types)->fetchFirstColumn(); + } catch (Driver\Exception $e) { + throw $this->convertExceptionDuringQuery($e, $query, $params, $types); + } + } + + /** + * Prepares and executes an SQL query and returns the result as an iterator over rows represented as numeric arrays. + * + * @param string $query SQL query + * @param list|array $params Query parameters + * @param array|array $types Parameter types + * + * @return Traversable> + * + * @throws Exception + */ + public function iterateNumeric(string $query, array $params = [], array $types = []): Traversable + { + try { + $result = $this->executeQuery($query, $params, $types); + + while (($row = $result->fetchNumeric()) !== false) { + yield $row; + } + } catch (Driver\Exception $e) { + throw $this->convertExceptionDuringQuery($e, $query, $params, $types); + } + } + + /** + * Prepares and executes an SQL query and returns the result as an iterator over rows represented + * as associative arrays. + * + * @param string $query SQL query + * @param list|array $params Query parameters + * @param array|array $types Parameter types + * + * @return Traversable> + * + * @throws Exception + */ + public function iterateAssociative(string $query, array $params = [], array $types = []): Traversable + { + try { + $result = $this->executeQuery($query, $params, $types); + + while (($row = $result->fetchAssociative()) !== false) { + yield $row; + } + } catch (Driver\Exception $e) { + throw $this->convertExceptionDuringQuery($e, $query, $params, $types); + } + } + + /** + * Prepares and executes an SQL query and returns the result as an iterator with the keys + * mapped to the first column and the values mapped to the second column. + * + * @param string $query SQL query + * @param list|array $params Query parameters + * @param array|array $types Parameter types + * + * @return Traversable + * + * @throws Exception + */ + public function iterateKeyValue(string $query, array $params = [], array $types = []): Traversable + { + return $this->executeQuery($query, $params, $types)->iterateKeyValue(); + } + + /** + * Prepares and executes an SQL query and returns the result as an iterator with the keys mapped + * to the first column and the values being an associative array representing the rest of the columns + * and their values. + * + * @param string $query SQL query + * @param list|array $params Query parameters + * @param array|array $types Parameter types + * + * @return Traversable> + * + * @throws Exception + */ + public function iterateAssociativeIndexed(string $query, array $params = [], array $types = []): Traversable + { + return $this->executeQuery($query, $params, $types)->iterateAssociativeIndexed(); + } + + /** + * Prepares and executes an SQL query and returns the result as an iterator over the first column values. + * + * @param string $query SQL query + * @param list|array $params Query parameters + * @param array|array $types Parameter types + * + * @return Traversable + * + * @throws Exception + */ + public function iterateColumn(string $query, array $params = [], array $types = []): Traversable + { + try { + $result = $this->executeQuery($query, $params, $types); + + while (($value = $result->fetchOne()) !== false) { + yield $value; + } + } catch (Driver\Exception $e) { + throw $this->convertExceptionDuringQuery($e, $query, $params, $types); + } + } + + /** + * Prepares an SQL statement. + * + * @param string $sql The SQL statement to prepare. + * + * @throws Exception + */ + public function prepare(string $sql): Statement + { + return new Statement($sql, $this); + } + + /** + * Executes an, optionally parametrized, SQL query. + * + * If the query is parametrized, a prepared statement is used. + * If an SQLLogger is configured, the execution is logged. + * + * @param string $sql SQL query + * @param list|array $params Query parameters + * @param array|array $types Parameter types + * + * @throws Exception + */ + public function executeQuery( + string $sql, + array $params = [], + $types = [], + ?QueryCacheProfile $qcp = null + ): Result { + if ($qcp !== null) { + return $this->executeCacheQuery($sql, $params, $types, $qcp); + } + + $connection = $this->getWrappedConnection(); + + $logger = $this->_config->getSQLLogger(); + if ($logger !== null) { + $logger->startQuery($sql, $params, $types); + } + + try { + if (count($params) > 0) { + if ($this->needsArrayParameterConversion($params, $types)) { + [$sql, $params, $types] = $this->expandArrayParameters($sql, $params, $types); + } + + $stmt = $connection->prepare($sql); + if (count($types) > 0) { + $this->_bindTypedValues($stmt, $params, $types); + $result = $stmt->execute(); + } else { + $result = $stmt->execute($params); + } + } else { + $result = $connection->query($sql); + } + + return new Result($result, $this); + } catch (Driver\Exception $e) { + throw $this->convertExceptionDuringQuery($e, $sql, $params, $types); + } finally { + if ($logger !== null) { + $logger->stopQuery(); + } + } + } + + /** + * Executes a caching query. + * + * @param string $sql SQL query + * @param list|array $params Query parameters + * @param array|array $types Parameter types + * + * @throws CacheException + * @throws Exception + */ + public function executeCacheQuery($sql, $params, $types, QueryCacheProfile $qcp): Result + { + $resultCache = $qcp->getResultCacheDriver() ?? $this->_config->getResultCacheImpl(); + + if ($resultCache === null) { + throw CacheException::noResultDriverConfigured(); + } + + $connectionParams = $this->params; + unset($connectionParams['platform']); + + [$cacheKey, $realKey] = $qcp->generateCacheKeys($sql, $params, $types, $connectionParams); + + // fetch the row pointers entry + $data = $resultCache->fetch($cacheKey); + + if ($data !== false) { + // is the real key part of this row pointers map or is the cache only pointing to other cache keys? + if (isset($data[$realKey])) { + $result = new ArrayResult($data[$realKey]); + } elseif (array_key_exists($realKey, $data)) { + $result = new ArrayResult([]); + } + } + + if (! isset($result)) { + $result = new CachingResult( + $this->executeQuery($sql, $params, $types), + $resultCache, + $cacheKey, + $realKey, + $qcp->getLifetime() + ); + } + + return new Result($result, $this); + } + + /** + * Executes an SQL statement with the given parameters and returns the number of affected rows. + * + * Could be used for: + * - DML statements: INSERT, UPDATE, DELETE, etc. + * - DDL statements: CREATE, DROP, ALTER, etc. + * - DCL statements: GRANT, REVOKE, etc. + * - Session control statements: ALTER SESSION, SET, DECLARE, etc. + * - Other statements that don't yield a row set. + * + * This method supports PDO binding types as well as DBAL mapping types. + * + * @param string $sql SQL statement + * @param list|array $params Statement parameters + * @param array|array $types Parameter types + * + * @return int The number of affected rows. + * + * @throws Exception + */ + public function executeStatement($sql, array $params = [], array $types = []) + { + $connection = $this->getWrappedConnection(); + + $logger = $this->_config->getSQLLogger(); + if ($logger !== null) { + $logger->startQuery($sql, $params, $types); + } + + try { + if (count($params) > 0) { + if ($this->needsArrayParameterConversion($params, $types)) { + [$sql, $params, $types] = $this->expandArrayParameters($sql, $params, $types); + } + + $stmt = $connection->prepare($sql); + + if (count($types) > 0) { + $this->_bindTypedValues($stmt, $params, $types); + + $result = $stmt->execute(); + } else { + $result = $stmt->execute($params); + } + + return $result->rowCount(); + } + + return $connection->exec($sql); + } catch (Driver\Exception $e) { + throw $this->convertExceptionDuringQuery($e, $sql, $params, $types); + } finally { + if ($logger !== null) { + $logger->stopQuery(); + } + } + } + + /** + * Returns the current transaction nesting level. + * + * @return int The nesting level. A value of 0 means there's no active transaction. + */ + public function getTransactionNestingLevel() + { + return $this->transactionNestingLevel; + } + + /** + * Returns the ID of the last inserted row, or the last value from a sequence object, + * depending on the underlying driver. + * + * Note: This method may not return a meaningful or consistent result across different drivers, + * because the underlying database may not even support the notion of AUTO_INCREMENT/IDENTITY + * columns or sequences. + * + * @param string|null $name Name of the sequence object from which the ID should be returned. + * + * @return string A string representation of the last inserted ID. + * + * @throws Exception + */ + public function lastInsertId($name = null) + { + try { + return $this->getWrappedConnection()->lastInsertId($name); + } catch (Driver\Exception $e) { + throw $this->convertException($e); + } + } + + /** + * Executes a function in a transaction. + * + * The function gets passed this Connection instance as an (optional) parameter. + * + * If an exception occurs during execution of the function or transaction commit, + * the transaction is rolled back and the exception re-thrown. + * + * @param Closure $func The function to execute transactionally. + * + * @return mixed The value returned by $func + * + * @throws Throwable + */ + public function transactional(Closure $func) + { + $this->beginTransaction(); + try { + $res = $func($this); + $this->commit(); + + return $res; + } catch (Throwable $e) { + $this->rollBack(); + + throw $e; + } + } + + /** + * Sets if nested transactions should use savepoints. + * + * @param bool $nestTransactionsWithSavepoints + * + * @return void + * + * @throws Exception + */ + public function setNestTransactionsWithSavepoints($nestTransactionsWithSavepoints) + { + if ($this->transactionNestingLevel > 0) { + throw ConnectionException::mayNotAlterNestedTransactionWithSavepointsInTransaction(); + } + + if (! $this->getDatabasePlatform()->supportsSavepoints()) { + throw ConnectionException::savepointsNotSupported(); + } + + $this->nestTransactionsWithSavepoints = (bool) $nestTransactionsWithSavepoints; + } + + /** + * Gets if nested transactions should use savepoints. + * + * @return bool + */ + public function getNestTransactionsWithSavepoints() + { + return $this->nestTransactionsWithSavepoints; + } + + /** + * Returns the savepoint name to use for nested transactions are false if they are not supported + * "savepointFormat" parameter is not set + * + * @return mixed A string with the savepoint name or false. + */ + protected function _getNestedTransactionSavePointName() + { + return 'DOCTRINE2_SAVEPOINT_' . $this->transactionNestingLevel; + } + + /** + * @return bool + * + * @throws Exception + */ + public function beginTransaction() + { + $connection = $this->getWrappedConnection(); + + ++$this->transactionNestingLevel; + + $logger = $this->_config->getSQLLogger(); + + if ($this->transactionNestingLevel === 1) { + if ($logger !== null) { + $logger->startQuery('"START TRANSACTION"'); + } + + $connection->beginTransaction(); + + if ($logger !== null) { + $logger->stopQuery(); + } + } elseif ($this->nestTransactionsWithSavepoints) { + if ($logger !== null) { + $logger->startQuery('"SAVEPOINT"'); + } + + $this->createSavepoint($this->_getNestedTransactionSavePointName()); + if ($logger !== null) { + $logger->stopQuery(); + } + } + + return true; + } + + /** + * @return bool + * + * @throws Exception + */ + public function commit() + { + if ($this->transactionNestingLevel === 0) { + throw ConnectionException::noActiveTransaction(); + } + + if ($this->isRollbackOnly) { + throw ConnectionException::commitFailedRollbackOnly(); + } + + $result = true; + + $connection = $this->getWrappedConnection(); + + $logger = $this->_config->getSQLLogger(); + + if ($this->transactionNestingLevel === 1) { + if ($logger !== null) { + $logger->startQuery('"COMMIT"'); + } + + $result = $connection->commit(); + + if ($logger !== null) { + $logger->stopQuery(); + } + } elseif ($this->nestTransactionsWithSavepoints) { + if ($logger !== null) { + $logger->startQuery('"RELEASE SAVEPOINT"'); + } + + $this->releaseSavepoint($this->_getNestedTransactionSavePointName()); + if ($logger !== null) { + $logger->stopQuery(); + } + } + + --$this->transactionNestingLevel; + + if ($this->autoCommit !== false || $this->transactionNestingLevel !== 0) { + return $result; + } + + $this->beginTransaction(); + + return $result; + } + + /** + * Commits all current nesting transactions. + * + * @throws Exception + */ + private function commitAll(): void + { + while ($this->transactionNestingLevel !== 0) { + if ($this->autoCommit === false && $this->transactionNestingLevel === 1) { + // When in no auto-commit mode, the last nesting commit immediately starts a new transaction. + // Therefore we need to do the final commit here and then leave to avoid an infinite loop. + $this->commit(); + + return; + } + + $this->commit(); + } + } + + /** + * Cancels any database changes done during the current transaction. + * + * @return bool + * + * @throws Exception + */ + public function rollBack() + { + if ($this->transactionNestingLevel === 0) { + throw ConnectionException::noActiveTransaction(); + } + + $connection = $this->getWrappedConnection(); + + $logger = $this->_config->getSQLLogger(); + + if ($this->transactionNestingLevel === 1) { + if ($logger !== null) { + $logger->startQuery('"ROLLBACK"'); + } + + $this->transactionNestingLevel = 0; + $connection->rollBack(); + $this->isRollbackOnly = false; + if ($logger !== null) { + $logger->stopQuery(); + } + + if ($this->autoCommit === false) { + $this->beginTransaction(); + } + } elseif ($this->nestTransactionsWithSavepoints) { + if ($logger !== null) { + $logger->startQuery('"ROLLBACK TO SAVEPOINT"'); + } + + $this->rollbackSavepoint($this->_getNestedTransactionSavePointName()); + --$this->transactionNestingLevel; + if ($logger !== null) { + $logger->stopQuery(); + } + } else { + $this->isRollbackOnly = true; + --$this->transactionNestingLevel; + } + + return true; + } + + /** + * Creates a new savepoint. + * + * @param string $savepoint The name of the savepoint to create. + * + * @return void + * + * @throws Exception + */ + public function createSavepoint($savepoint) + { + $platform = $this->getDatabasePlatform(); + + if (! $platform->supportsSavepoints()) { + throw ConnectionException::savepointsNotSupported(); + } + + $this->executeStatement($platform->createSavePoint($savepoint)); + } + + /** + * Releases the given savepoint. + * + * @param string $savepoint The name of the savepoint to release. + * + * @return void + * + * @throws Exception + */ + public function releaseSavepoint($savepoint) + { + $platform = $this->getDatabasePlatform(); + + if (! $platform->supportsSavepoints()) { + throw ConnectionException::savepointsNotSupported(); + } + + if (! $platform->supportsReleaseSavepoints()) { + return; + } + + $this->executeStatement($platform->releaseSavePoint($savepoint)); + } + + /** + * Rolls back to the given savepoint. + * + * @param string $savepoint The name of the savepoint to rollback to. + * + * @return void + * + * @throws Exception + */ + public function rollbackSavepoint($savepoint) + { + $platform = $this->getDatabasePlatform(); + + if (! $platform->supportsSavepoints()) { + throw ConnectionException::savepointsNotSupported(); + } + + $this->executeStatement($platform->rollbackSavePoint($savepoint)); + } + + /** + * Gets the wrapped driver connection. + * + * @return DriverConnection + * + * @throws Exception + */ + public function getWrappedConnection() + { + $this->connect(); + + assert($this->_conn !== null); + + return $this->_conn; + } + + /** + * Creates a SchemaManager that can be used to inspect or change the + * database schema through the connection. + * + * @throws Exception + */ + public function createSchemaManager(): AbstractSchemaManager + { + return $this->_driver->getSchemaManager( + $this, + $this->getDatabasePlatform() + ); + } + + /** + * Gets the SchemaManager that can be used to inspect or change the + * database schema through the connection. + * + * @deprecated Use {@link createSchemaManager()} instead. + * + * @return AbstractSchemaManager + * + * @throws Exception + */ + public function getSchemaManager() + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4515', + 'Connection::getSchemaManager() is deprecated, use Connection::createSchemaManager() instead.' + ); + + if ($this->_schemaManager === null) { + $this->_schemaManager = $this->createSchemaManager(); + } + + return $this->_schemaManager; + } + + /** + * Marks the current transaction so that the only possible + * outcome for the transaction to be rolled back. + * + * @return void + * + * @throws ConnectionException If no transaction is active. + */ + public function setRollbackOnly() + { + if ($this->transactionNestingLevel === 0) { + throw ConnectionException::noActiveTransaction(); + } + + $this->isRollbackOnly = true; + } + + /** + * Checks whether the current transaction is marked for rollback only. + * + * @return bool + * + * @throws ConnectionException If no transaction is active. + */ + public function isRollbackOnly() + { + if ($this->transactionNestingLevel === 0) { + throw ConnectionException::noActiveTransaction(); + } + + return $this->isRollbackOnly; + } + + /** + * Converts a given value to its database representation according to the conversion + * rules of a specific DBAL mapping type. + * + * @param mixed $value The value to convert. + * @param string $type The name of the DBAL mapping type. + * + * @return mixed The converted value. + * + * @throws Exception + */ + public function convertToDatabaseValue($value, $type) + { + return Type::getType($type)->convertToDatabaseValue($value, $this->getDatabasePlatform()); + } + + /** + * Converts a given value to its PHP representation according to the conversion + * rules of a specific DBAL mapping type. + * + * @param mixed $value The value to convert. + * @param string $type The name of the DBAL mapping type. + * + * @return mixed The converted type. + * + * @throws Exception + */ + public function convertToPHPValue($value, $type) + { + return Type::getType($type)->convertToPHPValue($value, $this->getDatabasePlatform()); + } + + /** + * Binds a set of parameters, some or all of which are typed with a PDO binding type + * or DBAL mapping type, to a given statement. + * + * @param DriverStatement $stmt Prepared statement + * @param list|array $params Statement parameters + * @param array|array $types Parameter types + * + * @throws Exception + */ + private function _bindTypedValues(DriverStatement $stmt, array $params, array $types): void + { + // Check whether parameters are positional or named. Mixing is not allowed. + if (is_int(key($params))) { + $bindIndex = 1; + + foreach ($params as $key => $value) { + if (isset($types[$key])) { + $type = $types[$key]; + [$value, $bindingType] = $this->getBindingInfo($value, $type); + $stmt->bindValue($bindIndex, $value, $bindingType); + } else { + $stmt->bindValue($bindIndex, $value); + } + + ++$bindIndex; + } + } else { + // Named parameters + foreach ($params as $name => $value) { + if (isset($types[$name])) { + $type = $types[$name]; + [$value, $bindingType] = $this->getBindingInfo($value, $type); + $stmt->bindValue($name, $value, $bindingType); + } else { + $stmt->bindValue($name, $value); + } + } + } + } + + /** + * Gets the binding type of a given type. + * + * @param mixed $value The value to bind. + * @param int|string|Type|null $type The type to bind (PDO or DBAL). + * + * @return mixed[] [0] => the (escaped) value, [1] => the binding type. + * + * @throws Exception + */ + private function getBindingInfo($value, $type) + { + if (is_string($type)) { + $type = Type::getType($type); + } + + if ($type instanceof Type) { + $value = $type->convertToDatabaseValue($value, $this->getDatabasePlatform()); + $bindingType = $type->getBindingType(); + } else { + $bindingType = $type; + } + + return [$value, $bindingType]; + } + + /** + * Creates a new instance of a SQL query builder. + * + * @return QueryBuilder + */ + public function createQueryBuilder() + { + return new Query\QueryBuilder($this); + } + + /** + * @internal + * + * @param list|array $params + * @param array|array $types + */ + final public function convertExceptionDuringQuery( + Driver\Exception $e, + string $sql, + array $params = [], + array $types = [] + ): DriverException { + return $this->handleDriverException($e, new Query($sql, $params, $types)); + } + + /** + * @internal + */ + final public function convertException(Driver\Exception $e): DriverException + { + return $this->handleDriverException($e, null); + } + + /** + * @param array|array $params + * @param array|array $types + * + * @return array{string, list, array} + */ + private function expandArrayParameters(string $sql, array $params, array $types): array + { + if ($this->parser === null) { + $this->parser = $this->getDatabasePlatform()->createSQLParser(); + } + + $visitor = new ExpandArrayParameters($params, $types); + + $this->parser->parse($sql, $visitor); + + return [ + $visitor->getSQL(), + $visitor->getParameters(), + $visitor->getTypes(), + ]; + } + + /** + * @param array|array $params + * @param array|array $types + */ + private function needsArrayParameterConversion(array $params, array $types): bool + { + if (is_string(key($params))) { + return true; + } + + foreach ($types as $type) { + if ($type === self::PARAM_INT_ARRAY || $type === self::PARAM_STR_ARRAY) { + return true; + } + } + + return false; + } + + private function handleDriverException( + Driver\Exception $driverException, + ?Query $query + ): DriverException { + if ($this->exceptionConverter === null) { + $this->exceptionConverter = $this->_driver->getExceptionConverter(); + } + + $exception = $this->exceptionConverter->convert($driverException, $query); + + if ($exception instanceof ConnectionLost) { + $this->close(); + } + + return $exception; + } + + /** + * BC layer for a wide-spread use-case of old DBAL APIs + * + * @deprecated This API is deprecated and will be removed after 2022 + * + * @param array $params The query parameters + * @param array $types The parameter types + */ + public function executeUpdate(string $sql, array $params = [], array $types = []): int + { + return $this->executeStatement($sql, $params, $types); + } + + /** + * BC layer for a wide-spread use-case of old DBAL APIs + * + * @deprecated This API is deprecated and will be removed after 2022 + */ + public function query(string $sql): Result + { + return $this->executeQuery($sql); + } + + /** + * BC layer for a wide-spread use-case of old DBAL APIs + * + * @deprecated This API is deprecated and will be removed after 2022 + */ + public function exec(string $sql): int + { + return $this->executeStatement($sql); + } +} diff --git a/app/vendor/doctrine/dbal/src/ConnectionException.php b/app/vendor/doctrine/dbal/src/ConnectionException.php new file mode 100644 index 000000000..8426ca288 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/ConnectionException.php @@ -0,0 +1,41 @@ +executeQuery("DELETE FROM table"); + * + * Be aware that Connection#executeQuery is a method specifically for READ + * operations only. + * + * Use Connection#executeStatement for any SQL statement that changes/updates + * state in the database (UPDATE, INSERT, DELETE or DDL statements). + * + * This connection is limited to replica operations using the + * Connection#executeQuery operation only, because it wouldn't be compatible + * with the ORM or SchemaManager code otherwise. Both use all the other + * operations in a context where writes could happen to a replica, which makes + * this restricted approach necessary. + * + * You can manually connect to the primary at any time by calling: + * + * $conn->ensureConnectedToPrimary(); + * + * Instantiation through the DriverManager looks like: + * + * @psalm-import-type Params from DriverManager + * @example + * + * $conn = DriverManager::getConnection(array( + * 'wrapperClass' => 'Doctrine\DBAL\Connections\PrimaryReadReplicaConnection', + * 'driver' => 'pdo_mysql', + * 'primary' => array('user' => '', 'password' => '', 'host' => '', 'dbname' => ''), + * 'replica' => array( + * array('user' => 'replica1', 'password', 'host' => '', 'dbname' => ''), + * array('user' => 'replica2', 'password', 'host' => '', 'dbname' => ''), + * ) + * )); + * + * You can also pass 'driverOptions' and any other documented option to each of this drivers + * to pass additional information. + */ +class PrimaryReadReplicaConnection extends Connection +{ + /** + * Primary and Replica connection (one of the randomly picked replicas). + * + * @var DriverConnection[]|null[] + */ + protected $connections = ['primary' => null, 'replica' => null]; + + /** + * You can keep the replica connection and then switch back to it + * during the request if you know what you are doing. + * + * @var bool + */ + protected $keepReplica = false; + + /** + * Creates Primary Replica Connection. + * + * @internal The connection can be only instantiated by the driver manager. + * + * @param array $params + * @psalm-param Params $params + * @phpstan-param array $params + * + * @throws Exception + * @throws InvalidArgumentException + */ + public function __construct( + array $params, + Driver $driver, + ?Configuration $config = null, + ?EventManager $eventManager = null + ) { + if (! isset($params['replica'], $params['primary'])) { + throw new InvalidArgumentException('primary or replica configuration missing'); + } + + if (count($params['replica']) === 0) { + throw new InvalidArgumentException('You have to configure at least one replica.'); + } + + if (isset($params['driver'])) { + $params['primary']['driver'] = $params['driver']; + + foreach ($params['replica'] as $replicaKey => $replica) { + $params['replica'][$replicaKey]['driver'] = $params['driver']; + } + } + + $this->keepReplica = (bool) ($params['keepReplica'] ?? false); + + parent::__construct($params, $driver, $config, $eventManager); + } + + /** + * Checks if the connection is currently towards the primary or not. + */ + public function isConnectedToPrimary(): bool + { + return $this->_conn !== null && $this->_conn === $this->connections['primary']; + } + + /** + * @param string|null $connectionName + * + * @return bool + */ + public function connect($connectionName = null) + { + if ($connectionName !== null) { + throw new InvalidArgumentException( + 'Passing a connection name as first argument is not supported anymore.' + . ' Use ensureConnectedToPrimary()/ensureConnectedToReplica() instead.' + ); + } + + return $this->performConnect(); + } + + protected function performConnect(?string $connectionName = null): bool + { + $requestedConnectionChange = ($connectionName !== null); + $connectionName = $connectionName ?? 'replica'; + + if ($connectionName !== 'replica' && $connectionName !== 'primary') { + throw new InvalidArgumentException('Invalid option to connect(), only primary or replica allowed.'); + } + + // If we have a connection open, and this is not an explicit connection + // change request, then abort right here, because we are already done. + // This prevents writes to the replica in case of "keepReplica" option enabled. + if ($this->_conn !== null && ! $requestedConnectionChange) { + return false; + } + + $forcePrimaryAsReplica = false; + + if ($this->getTransactionNestingLevel() > 0) { + $connectionName = 'primary'; + $forcePrimaryAsReplica = true; + } + + if (isset($this->connections[$connectionName])) { + $this->_conn = $this->connections[$connectionName]; + + if ($forcePrimaryAsReplica && ! $this->keepReplica) { + $this->connections['replica'] = $this->_conn; + } + + return false; + } + + if ($connectionName === 'primary') { + $this->connections['primary'] = $this->_conn = $this->connectTo($connectionName); + + // Set replica connection to primary to avoid invalid reads + if (! $this->keepReplica) { + $this->connections['replica'] = $this->connections['primary']; + } + } else { + $this->connections['replica'] = $this->_conn = $this->connectTo($connectionName); + } + + if ($this->_eventManager->hasListeners(Events::postConnect)) { + $eventArgs = new ConnectionEventArgs($this); + $this->_eventManager->dispatchEvent(Events::postConnect, $eventArgs); + } + + return true; + } + + /** + * Connects to the primary node of the database cluster. + * + * All following statements after this will be executed against the primary node. + */ + public function ensureConnectedToPrimary(): bool + { + return $this->performConnect('primary'); + } + + /** + * Connects to a replica node of the database cluster. + * + * All following statements after this will be executed against the replica node, + * unless the keepReplica option is set to false and a primary connection + * was already opened. + */ + public function ensureConnectedToReplica(): bool + { + return $this->performConnect('replica'); + } + + /** + * Connects to a specific connection. + * + * @param string $connectionName + * + * @return DriverConnection + * + * @throws Exception + */ + protected function connectTo($connectionName) + { + $params = $this->getParams(); + + $connectionParams = $this->chooseConnectionConfiguration($connectionName, $params); + + try { + return $this->_driver->connect($connectionParams); + } catch (DriverException $e) { + throw $this->convertException($e); + } + } + + /** + * @param string $connectionName + * @param mixed[] $params + * + * @return mixed + */ + protected function chooseConnectionConfiguration($connectionName, $params) + { + if ($connectionName === 'primary') { + return $params['primary']; + } + + $config = $params['replica'][array_rand($params['replica'])]; + + if (! isset($config['charset']) && isset($params['primary']['charset'])) { + $config['charset'] = $params['primary']['charset']; + } + + return $config; + } + + /** + * {@inheritDoc} + */ + public function executeStatement($sql, array $params = [], array $types = []) + { + $this->ensureConnectedToPrimary(); + + return parent::executeStatement($sql, $params, $types); + } + + /** + * {@inheritDoc} + */ + public function beginTransaction() + { + $this->ensureConnectedToPrimary(); + + return parent::beginTransaction(); + } + + /** + * {@inheritDoc} + */ + public function commit() + { + $this->ensureConnectedToPrimary(); + + return parent::commit(); + } + + /** + * {@inheritDoc} + */ + public function rollBack() + { + $this->ensureConnectedToPrimary(); + + return parent::rollBack(); + } + + /** + * {@inheritDoc} + */ + public function close() + { + unset($this->connections['primary'], $this->connections['replica']); + + parent::close(); + + $this->_conn = null; + $this->connections = ['primary' => null, 'replica' => null]; + } + + /** + * {@inheritDoc} + */ + public function createSavepoint($savepoint) + { + $this->ensureConnectedToPrimary(); + + parent::createSavepoint($savepoint); + } + + /** + * {@inheritDoc} + */ + public function releaseSavepoint($savepoint) + { + $this->ensureConnectedToPrimary(); + + parent::releaseSavepoint($savepoint); + } + + /** + * {@inheritDoc} + */ + public function rollbackSavepoint($savepoint) + { + $this->ensureConnectedToPrimary(); + + parent::rollbackSavepoint($savepoint); + } + + public function prepare(string $sql): Statement + { + $this->ensureConnectedToPrimary(); + + return parent::prepare($sql); + } +} diff --git a/app/vendor/doctrine/dbal/src/Driver.php b/app/vendor/doctrine/dbal/src/Driver.php new file mode 100644 index 000000000..50a6005f9 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Driver.php @@ -0,0 +1,48 @@ +getCode()) { + case 1213: + return new DeadlockException($exception, $query); + + case 1205: + return new LockWaitTimeoutException($exception, $query); + + case 1050: + return new TableExistsException($exception, $query); + + case 1051: + case 1146: + return new TableNotFoundException($exception, $query); + + case 1216: + case 1217: + case 1451: + case 1452: + case 1701: + return new ForeignKeyConstraintViolationException($exception, $query); + + case 1062: + case 1557: + case 1569: + case 1586: + return new UniqueConstraintViolationException($exception, $query); + + case 1054: + case 1166: + case 1611: + return new InvalidFieldNameException($exception, $query); + + case 1052: + case 1060: + case 1110: + return new NonUniqueFieldNameException($exception, $query); + + case 1064: + case 1149: + case 1287: + case 1341: + case 1342: + case 1343: + case 1344: + case 1382: + case 1479: + case 1541: + case 1554: + case 1626: + return new SyntaxErrorException($exception, $query); + + case 1044: + case 1045: + case 1046: + case 1049: + case 1095: + case 1142: + case 1143: + case 1227: + case 1370: + case 1429: + case 2002: + case 2005: + return new ConnectionException($exception, $query); + + case 2006: + return new ConnectionLost($exception, $query); + + case 1048: + case 1121: + case 1138: + case 1171: + case 1252: + case 1263: + case 1364: + case 1566: + return new NotNullConstraintViolationException($exception, $query); + } + + return new DriverException($exception, $query); + } +} diff --git a/app/vendor/doctrine/dbal/src/Driver/API/OCI/ExceptionConverter.php b/app/vendor/doctrine/dbal/src/Driver/API/OCI/ExceptionConverter.php new file mode 100644 index 000000000..f25e58d6c --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Driver/API/OCI/ExceptionConverter.php @@ -0,0 +1,68 @@ +getCode()) { + case 1: + case 2299: + case 38911: + return new UniqueConstraintViolationException($exception, $query); + + case 904: + return new InvalidFieldNameException($exception, $query); + + case 918: + case 960: + return new NonUniqueFieldNameException($exception, $query); + + case 923: + return new SyntaxErrorException($exception, $query); + + case 942: + return new TableNotFoundException($exception, $query); + + case 955: + return new TableExistsException($exception, $query); + + case 1017: + case 12545: + return new ConnectionException($exception, $query); + + case 1400: + return new NotNullConstraintViolationException($exception, $query); + + case 2266: + case 2291: + case 2292: + return new ForeignKeyConstraintViolationException($exception, $query); + } + + return new DriverException($exception, $query); + } +} diff --git a/app/vendor/doctrine/dbal/src/Driver/API/PostgreSQL/ExceptionConverter.php b/app/vendor/doctrine/dbal/src/Driver/API/PostgreSQL/ExceptionConverter.php new file mode 100644 index 000000000..b9530d0b2 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Driver/API/PostgreSQL/ExceptionConverter.php @@ -0,0 +1,85 @@ +getSQLState()) { + case '40001': + case '40P01': + return new DeadlockException($exception, $query); + + case '0A000': + // Foreign key constraint violations during a TRUNCATE operation + // are considered "feature not supported" in PostgreSQL. + if (strpos($exception->getMessage(), 'truncate') !== false) { + return new ForeignKeyConstraintViolationException($exception, $query); + } + + break; + + case '23502': + return new NotNullConstraintViolationException($exception, $query); + + case '23503': + return new ForeignKeyConstraintViolationException($exception, $query); + + case '23505': + return new UniqueConstraintViolationException($exception, $query); + + case '42601': + return new SyntaxErrorException($exception, $query); + + case '42702': + return new NonUniqueFieldNameException($exception, $query); + + case '42703': + return new InvalidFieldNameException($exception, $query); + + case '42P01': + return new TableNotFoundException($exception, $query); + + case '42P07': + return new TableExistsException($exception, $query); + + case '08006': + return new ConnectionException($exception, $query); + } + + // Prior to fixing https://bugs.php.net/bug.php?id=64705 (PHP 7.3.22 and PHP 7.4.10), + // in some cases (mainly connection errors) the PDO exception wouldn't provide a SQLSTATE via its code. + // We have to match against the SQLSTATE in the error message in these cases. + if ($exception->getCode() === 7 && strpos($exception->getMessage(), 'SQLSTATE[08006]') !== false) { + return new ConnectionException($exception, $query); + } + + return new DriverException($exception, $query); + } +} diff --git a/app/vendor/doctrine/dbal/src/Driver/API/SQLSrv/ExceptionConverter.php b/app/vendor/doctrine/dbal/src/Driver/API/SQLSrv/ExceptionConverter.php new file mode 100644 index 000000000..3fc3ff081 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Driver/API/SQLSrv/ExceptionConverter.php @@ -0,0 +1,21 @@ +getMessage(), 'database is locked') !== false) { + return new LockWaitTimeoutException($exception, $query); + } + + if ( + strpos($exception->getMessage(), 'must be unique') !== false || + strpos($exception->getMessage(), 'is not unique') !== false || + strpos($exception->getMessage(), 'are not unique') !== false || + strpos($exception->getMessage(), 'UNIQUE constraint failed') !== false + ) { + return new UniqueConstraintViolationException($exception, $query); + } + + if ( + strpos($exception->getMessage(), 'may not be NULL') !== false || + strpos($exception->getMessage(), 'NOT NULL constraint failed') !== false + ) { + return new NotNullConstraintViolationException($exception, $query); + } + + if (strpos($exception->getMessage(), 'no such table:') !== false) { + return new TableNotFoundException($exception, $query); + } + + if (strpos($exception->getMessage(), 'already exists') !== false) { + return new TableExistsException($exception, $query); + } + + if (strpos($exception->getMessage(), 'has no column named') !== false) { + return new InvalidFieldNameException($exception, $query); + } + + if (strpos($exception->getMessage(), 'ambiguous column name') !== false) { + return new NonUniqueFieldNameException($exception, $query); + } + + if (strpos($exception->getMessage(), 'syntax error') !== false) { + return new SyntaxErrorException($exception, $query); + } + + if (strpos($exception->getMessage(), 'attempt to write a readonly database') !== false) { + return new ReadOnlyException($exception, $query); + } + + if (strpos($exception->getMessage(), 'unable to open database file') !== false) { + return new ConnectionException($exception, $query); + } + + return new DriverException($exception, $query); + } +} diff --git a/app/vendor/doctrine/dbal/src/Driver/AbstractDB2Driver.php b/app/vendor/doctrine/dbal/src/Driver/AbstractDB2Driver.php new file mode 100644 index 000000000..d8c707bb0 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Driver/AbstractDB2Driver.php @@ -0,0 +1,38 @@ +sqlState = $sqlState; + } + + /** + * {@inheritdoc} + */ + public function getSQLState() + { + return $this->sqlState; + } +} diff --git a/app/vendor/doctrine/dbal/src/Driver/AbstractMySQLDriver.php b/app/vendor/doctrine/dbal/src/Driver/AbstractMySQLDriver.php new file mode 100644 index 000000000..31949b9c1 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Driver/AbstractMySQLDriver.php @@ -0,0 +1,136 @@ +getMariaDbMysqlVersionNumber($version), '10.2.7', '>=')) { + return new MariaDb1027Platform(); + } + + if (! $mariadb) { + $oracleMysqlVersion = $this->getOracleMysqlVersionNumber($version); + if (version_compare($oracleMysqlVersion, '8', '>=')) { + return new MySQL80Platform(); + } + + if (version_compare($oracleMysqlVersion, '5.7.9', '>=')) { + return new MySQL57Platform(); + } + } + + return $this->getDatabasePlatform(); + } + + /** + * Get a normalized 'version number' from the server string + * returned by Oracle MySQL servers. + * + * @param string $versionString Version string returned by the driver, i.e. '5.7.10' + * + * @throws Exception + */ + private function getOracleMysqlVersionNumber(string $versionString): string + { + if ( + preg_match( + '/^(?P\d+)(?:\.(?P\d+)(?:\.(?P\d+))?)?/', + $versionString, + $versionParts + ) === 0 + ) { + throw Exception::invalidPlatformVersionSpecified( + $versionString, + '..' + ); + } + + $majorVersion = $versionParts['major']; + $minorVersion = $versionParts['minor'] ?? 0; + $patchVersion = $versionParts['patch'] ?? null; + + if ($majorVersion === '5' && $minorVersion === '7' && $patchVersion === null) { + $patchVersion = '9'; + } + + return $majorVersion . '.' . $minorVersion . '.' . $patchVersion; + } + + /** + * Detect MariaDB server version, including hack for some mariadb distributions + * that starts with the prefix '5.5.5-' + * + * @param string $versionString Version string as returned by mariadb server, i.e. '5.5.5-Mariadb-10.0.8-xenial' + * + * @throws Exception + */ + private function getMariaDbMysqlVersionNumber(string $versionString): string + { + if ( + preg_match( + '/^(?:5\.5\.5-)?(mariadb-)?(?P\d+)\.(?P\d+)\.(?P\d+)/i', + $versionString, + $versionParts + ) === 0 + ) { + throw Exception::invalidPlatformVersionSpecified( + $versionString, + '^(?:5\.5\.5-)?(mariadb-)?..' + ); + } + + return $versionParts['major'] . '.' . $versionParts['minor'] . '.' . $versionParts['patch']; + } + + /** + * {@inheritdoc} + * + * @return MySQLPlatform + */ + public function getDatabasePlatform() + { + return new MySQLPlatform(); + } + + /** + * {@inheritdoc} + * + * @return MySQLSchemaManager + */ + public function getSchemaManager(Connection $conn, AbstractPlatform $platform) + { + return new MySQLSchemaManager($conn, $platform); + } + + public function getExceptionConverter(): ExceptionConverter + { + return new MySQL\ExceptionConverter(); + } +} diff --git a/app/vendor/doctrine/dbal/src/Driver/AbstractOracleDriver.php b/app/vendor/doctrine/dbal/src/Driver/AbstractOracleDriver.php new file mode 100644 index 000000000..80e4a02c8 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Driver/AbstractOracleDriver.php @@ -0,0 +1,51 @@ +string = $string; + } + + public function __toString(): string + { + return $this->string; + } + + /** + * Creates the object from an array representation + * + * @param mixed[] $params + */ + public static function fromArray(array $params): self + { + return new self(self::renderParams($params)); + } + + /** + * Creates the object from the given DBAL connection parameters. + * + * @param mixed[] $params + */ + public static function fromConnectionParameters(array $params): self + { + if (isset($params['connectstring'])) { + return new self($params['connectstring']); + } + + if (! isset($params['host'])) { + return new self($params['dbname'] ?? ''); + } + + $connectData = []; + + if (isset($params['servicename']) || isset($params['dbname'])) { + $serviceKey = 'SID'; + + if (isset($params['service'])) { + $serviceKey = 'SERVICE_NAME'; + } + + $serviceName = $params['servicename'] ?? $params['dbname']; + + $connectData[$serviceKey] = $serviceName; + } + + if (isset($params['instancename'])) { + $connectData['INSTANCE_NAME'] = $params['instancename']; + } + + if (! empty($params['pooled'])) { + $connectData['SERVER'] = 'POOLED'; + } + + return self::fromArray([ + 'DESCRIPTION' => [ + 'ADDRESS' => [ + 'PROTOCOL' => 'TCP', + 'HOST' => $params['host'], + 'PORT' => $params['port'] ?? 1521, + ], + 'CONNECT_DATA' => $connectData, + ], + ]); + } + + /** + * @param mixed[] $params + */ + private static function renderParams(array $params): string + { + $chunks = []; + + foreach ($params as $key => $value) { + $string = self::renderValue($value); + + if ($string === '') { + continue; + } + + $chunks[] = sprintf('(%s=%s)', $key, $string); + } + + return implode('', $chunks); + } + + /** + * @param mixed $value + */ + private static function renderValue($value): string + { + if (is_array($value)) { + return self::renderParams($value); + } + + return (string) $value; + } +} diff --git a/app/vendor/doctrine/dbal/src/Driver/AbstractPostgreSQLDriver.php b/app/vendor/doctrine/dbal/src/Driver/AbstractPostgreSQLDriver.php new file mode 100644 index 000000000..6b11d6178 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Driver/AbstractPostgreSQLDriver.php @@ -0,0 +1,67 @@ +\d+)(?:\.(?P\d+)(?:\.(?P\d+))?)?/', $version, $versionParts) === 0) { + throw Exception::invalidPlatformVersionSpecified( + $version, + '..' + ); + } + + $majorVersion = $versionParts['major']; + $minorVersion = $versionParts['minor'] ?? 0; + $patchVersion = $versionParts['patch'] ?? 0; + $version = $majorVersion . '.' . $minorVersion . '.' . $patchVersion; + + if (version_compare($version, '10.0', '>=')) { + return new PostgreSQL100Platform(); + } + + return new PostgreSQL94Platform(); + } + + /** + * {@inheritdoc} + */ + public function getDatabasePlatform() + { + return new PostgreSQL94Platform(); + } + + /** + * {@inheritdoc} + */ + public function getSchemaManager(Connection $conn, AbstractPlatform $platform) + { + return new PostgreSQLSchemaManager($conn, $platform); + } + + public function getExceptionConverter(): ExceptionConverter + { + return new PostgreSQL\ExceptionConverter(); + } +} diff --git a/app/vendor/doctrine/dbal/src/Driver/AbstractSQLServerDriver.php b/app/vendor/doctrine/dbal/src/Driver/AbstractSQLServerDriver.php new file mode 100644 index 000000000..b3d0928bb --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Driver/AbstractSQLServerDriver.php @@ -0,0 +1,38 @@ +fetchNumeric(); + + if ($row === false) { + return false; + } + + return $row[0]; + } + + /** + * @return list> + * + * @throws Exception + */ + public static function fetchAllNumeric(Result $result): array + { + $rows = []; + + while (($row = $result->fetchNumeric()) !== false) { + $rows[] = $row; + } + + return $rows; + } + + /** + * @return list> + * + * @throws Exception + */ + public static function fetchAllAssociative(Result $result): array + { + $rows = []; + + while (($row = $result->fetchAssociative()) !== false) { + $rows[] = $row; + } + + return $rows; + } + + /** + * @return list + * + * @throws Exception + */ + public static function fetchFirstColumn(Result $result): array + { + $rows = []; + + while (($row = $result->fetchOne()) !== false) { + $rows[] = $row; + } + + return $rows; + } +} diff --git a/app/vendor/doctrine/dbal/src/Driver/IBMDB2/Connection.php b/app/vendor/doctrine/dbal/src/Driver/IBMDB2/Connection.php new file mode 100644 index 000000000..c8e36da3e --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Driver/IBMDB2/Connection.php @@ -0,0 +1,165 @@ + $driverOptions + * + * @throws Exception + */ + public function __construct( + string $database, + bool $persistent, + string $username, + string $password, + array $driverOptions = [] + ) { + if ($persistent) { + $conn = db2_pconnect($database, $username, $password, $driverOptions); + } else { + $conn = db2_connect($database, $username, $password, $driverOptions); + } + + if ($conn === false) { + throw ConnectionFailed::new(); + } + + $this->conn = $conn; + } + + /** + * {@inheritdoc} + */ + public function getServerVersion() + { + $serverInfo = db2_server_info($this->conn); + assert($serverInfo instanceof stdClass); + + return $serverInfo->DBMS_VER; + } + + public function prepare(string $sql): DriverStatement + { + $stmt = @db2_prepare($this->conn, $sql); + + if ($stmt === false) { + throw PrepareFailed::new(error_get_last()); + } + + return new Statement($stmt); + } + + public function query(string $sql): ResultInterface + { + return $this->prepare($sql)->execute(); + } + + /** + * {@inheritdoc} + */ + public function quote($value, $type = ParameterType::STRING) + { + $value = db2_escape_string($value); + + if ($type === ParameterType::INTEGER) { + return $value; + } + + return "'" . $value . "'"; + } + + public function exec(string $sql): int + { + $stmt = @db2_exec($this->conn, $sql); + + if ($stmt === false) { + throw ConnectionError::new($this->conn); + } + + return db2_num_rows($stmt); + } + + /** + * {@inheritdoc} + */ + public function lastInsertId($name = null) + { + return db2_last_insert_id($this->conn); + } + + /** + * {@inheritdoc} + */ + public function beginTransaction() + { + $result = db2_autocommit($this->conn, DB2_AUTOCOMMIT_OFF); + assert(is_bool($result)); + + return $result; + } + + /** + * {@inheritdoc} + */ + public function commit() + { + if (! db2_commit($this->conn)) { + throw ConnectionError::new($this->conn); + } + + $result = db2_autocommit($this->conn, DB2_AUTOCOMMIT_ON); + assert(is_bool($result)); + + return $result; + } + + /** + * {@inheritdoc} + */ + public function rollBack() + { + if (! db2_rollback($this->conn)) { + throw ConnectionError::new($this->conn); + } + + $result = db2_autocommit($this->conn, DB2_AUTOCOMMIT_ON); + assert(is_bool($result)); + + return $result; + } +} diff --git a/app/vendor/doctrine/dbal/src/Driver/IBMDB2/DataSourceName.php b/app/vendor/doctrine/dbal/src/Driver/IBMDB2/DataSourceName.php new file mode 100644 index 000000000..e1ec42f2d --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Driver/IBMDB2/DataSourceName.php @@ -0,0 +1,77 @@ +string = $string; + } + + public function toString(): string + { + return $this->string; + } + + /** + * Creates the object from an array representation + * + * @param array $params + */ + public static function fromArray(array $params): self + { + $chunks = []; + + foreach ($params as $key => $value) { + $chunks[] = sprintf('%s=%s', $key, $value); + } + + return new self(implode(';', $chunks)); + } + + /** + * Creates the object from the given DBAL connection parameters. + * + * @param array $params + */ + public static function fromConnectionParameters(array $params): self + { + if (isset($params['dbname']) && strpos($params['dbname'], '=') !== false) { + return new self($params['dbname']); + } + + $dsnParams = []; + + foreach ( + [ + 'host' => 'HOSTNAME', + 'port' => 'PORT', + 'protocol' => 'PROTOCOL', + 'dbname' => 'DATABASE', + 'user' => 'UID', + 'password' => 'PWD', + ] as $dbalParam => $dsnParam + ) { + if (! isset($params[$dbalParam])) { + continue; + } + + $dsnParams[$dsnParam] = $params[$dbalParam]; + } + + return self::fromArray($dsnParams); + } +} diff --git a/app/vendor/doctrine/dbal/src/Driver/IBMDB2/Driver.php b/app/vendor/doctrine/dbal/src/Driver/IBMDB2/Driver.php new file mode 100644 index 000000000..c08165520 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Driver/IBMDB2/Driver.php @@ -0,0 +1,24 @@ +toString(), + isset($params['persistent']) && $params['persistent'] === true, + $params['user'] ?? '', + $params['password'] ?? '', + $params['driverOptions'] ?? [] + ); + } +} diff --git a/app/vendor/doctrine/dbal/src/Driver/IBMDB2/Exception/CannotCopyStreamToStream.php b/app/vendor/doctrine/dbal/src/Driver/IBMDB2/Exception/CannotCopyStreamToStream.php new file mode 100644 index 000000000..86821688c --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Driver/IBMDB2/Exception/CannotCopyStreamToStream.php @@ -0,0 +1,29 @@ +statement = $statement; + } + + /** + * {@inheritDoc} + */ + public function fetchNumeric() + { + $row = @db2_fetch_array($this->statement); + + if ($row === false && db2_stmt_error($this->statement) !== '02000') { + throw StatementError::new($this->statement); + } + + return $row; + } + + /** + * {@inheritDoc} + */ + public function fetchAssociative() + { + $row = @db2_fetch_assoc($this->statement); + + if ($row === false && db2_stmt_error($this->statement) !== '02000') { + throw StatementError::new($this->statement); + } + + return $row; + } + + /** + * {@inheritDoc} + */ + public function fetchOne() + { + return FetchUtils::fetchOne($this); + } + + /** + * {@inheritDoc} + */ + public function fetchAllNumeric(): array + { + return FetchUtils::fetchAllNumeric($this); + } + + /** + * {@inheritDoc} + */ + public function fetchAllAssociative(): array + { + return FetchUtils::fetchAllAssociative($this); + } + + /** + * {@inheritDoc} + */ + public function fetchFirstColumn(): array + { + return FetchUtils::fetchFirstColumn($this); + } + + public function rowCount(): int + { + return @db2_num_rows($this->statement); + } + + public function columnCount(): int + { + $count = db2_num_fields($this->statement); + + if ($count !== false) { + return $count; + } + + return 0; + } + + public function free(): void + { + db2_free_result($this->statement); + } +} diff --git a/app/vendor/doctrine/dbal/src/Driver/IBMDB2/Statement.php b/app/vendor/doctrine/dbal/src/Driver/IBMDB2/Statement.php new file mode 100644 index 000000000..c655ea74a --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Driver/IBMDB2/Statement.php @@ -0,0 +1,198 @@ +stmt = $stmt; + } + + /** + * {@inheritdoc} + */ + public function bindValue($param, $value, $type = ParameterType::STRING) + { + assert(is_int($param)); + + return $this->bindParam($param, $value, $type); + } + + /** + * {@inheritdoc} + */ + public function bindParam($param, &$variable, $type = ParameterType::STRING, $length = null) + { + assert(is_int($param)); + + switch ($type) { + case ParameterType::INTEGER: + $this->bind($param, $variable, DB2_PARAM_IN, DB2_LONG); + break; + + case ParameterType::LARGE_OBJECT: + if (isset($this->lobs[$param])) { + [, $handle] = $this->lobs[$param]; + fclose($handle); + } + + $handle = $this->createTemporaryFile(); + $path = stream_get_meta_data($handle)['uri']; + + $this->bind($param, $path, DB2_PARAM_FILE, DB2_BINARY); + + $this->lobs[$param] = [&$variable, $handle]; + break; + + default: + $this->bind($param, $variable, DB2_PARAM_IN, DB2_CHAR); + break; + } + + return true; + } + + /** + * @param int $position Parameter position + * @param mixed $variable + * + * @throws Exception + */ + private function bind($position, &$variable, int $parameterType, int $dataType): void + { + $this->bindParam[$position] =& $variable; + + if (! db2_bind_param($this->stmt, $position, 'variable', $parameterType, $dataType)) { + throw StatementError::new($this->stmt); + } + } + + /** + * {@inheritdoc} + */ + public function execute($params = null): ResultInterface + { + if ($params === null) { + ksort($this->bindParam); + + $params = []; + + foreach ($this->bindParam as $value) { + $params[] = $value; + } + } + + foreach ($this->lobs as [$source, $target]) { + if (is_resource($source)) { + $this->copyStreamToStream($source, $target); + + continue; + } + + $this->writeStringToStream($source, $target); + } + + $result = db2_execute($this->stmt, $params); + + foreach ($this->lobs as [, $handle]) { + fclose($handle); + } + + $this->lobs = []; + + if ($result === false) { + throw StatementError::new($this->stmt); + } + + return new Result($this->stmt); + } + + /** + * @return resource + * + * @throws Exception + */ + private function createTemporaryFile() + { + $handle = @tmpfile(); + + if ($handle === false) { + throw CannotCreateTemporaryFile::new(error_get_last()); + } + + return $handle; + } + + /** + * @param resource $source + * @param resource $target + * + * @throws Exception + */ + private function copyStreamToStream($source, $target): void + { + if (@stream_copy_to_stream($source, $target) === false) { + throw CannotCopyStreamToStream::new(error_get_last()); + } + } + + /** + * @param resource $target + * + * @throws Exception + */ + private function writeStringToStream(string $string, $target): void + { + if (@fwrite($target, $string) === false) { + throw CannotWriteToTemporaryFile::new(error_get_last()); + } + } +} diff --git a/app/vendor/doctrine/dbal/src/Driver/Middleware.php b/app/vendor/doctrine/dbal/src/Driver/Middleware.php new file mode 100644 index 000000000..4629d9a85 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Driver/Middleware.php @@ -0,0 +1,12 @@ + $preInitializers + * @param iterable $postInitializers + * + * @throws Exception + */ + public function __construct( + ?string $host = null, + ?string $username = null, + ?string $password = null, + ?string $database = null, + ?int $port = null, + ?string $socket = null, + ?int $flags = null, + iterable $preInitializers = [], + iterable $postInitializers = [] + ) { + $connection = mysqli_init(); + assert($connection !== false); + + foreach ($preInitializers as $initializer) { + $initializer->initialize($connection); + } + + if (! @$connection->real_connect($host, $username, $password, $database, $port, $socket, $flags)) { + throw ConnectionFailed::new($connection); + } + + foreach ($postInitializers as $initializer) { + $initializer->initialize($connection); + } + + $this->conn = $connection; + } + + /** + * Retrieves mysqli native resource handle. + * + * Could be used if part of your application is not using DBAL. + * + * @return mysqli + */ + public function getWrappedResourceHandle() + { + return $this->conn; + } + + /** + * {@inheritdoc} + * + * The server version detection includes a special case for MariaDB + * to support '5.5.5-' prefixed versions introduced in Maria 10+ + * + * @link https://jira.mariadb.org/browse/MDEV-4088 + */ + public function getServerVersion() + { + $serverInfos = $this->conn->get_server_info(); + if (stripos($serverInfos, 'mariadb') !== false) { + return $serverInfos; + } + + $majorVersion = floor($this->conn->server_version / 10000); + $minorVersion = floor(($this->conn->server_version - $majorVersion * 10000) / 100); + $patchVersion = floor($this->conn->server_version - $majorVersion * 10000 - $minorVersion * 100); + + return $majorVersion . '.' . $minorVersion . '.' . $patchVersion; + } + + public function prepare(string $sql): DriverStatement + { + return new Statement($this->conn, $sql); + } + + public function query(string $sql): ResultInterface + { + return $this->prepare($sql)->execute(); + } + + /** + * {@inheritdoc} + */ + public function quote($value, $type = ParameterType::STRING) + { + return "'" . $this->conn->escape_string($value) . "'"; + } + + public function exec(string $sql): int + { + if ($this->conn->query($sql) === false) { + throw ConnectionError::new($this->conn); + } + + return $this->conn->affected_rows; + } + + /** + * {@inheritdoc} + */ + public function lastInsertId($name = null) + { + return $this->conn->insert_id; + } + + /** + * {@inheritdoc} + */ + public function beginTransaction() + { + $this->conn->query('START TRANSACTION'); + + return true; + } + + /** + * {@inheritdoc} + */ + public function commit() + { + return $this->conn->commit(); + } + + /** + * {@inheritdoc} + */ + public function rollBack() + { + return $this->conn->rollback(); + } +} diff --git a/app/vendor/doctrine/dbal/src/Driver/Mysqli/Driver.php b/app/vendor/doctrine/dbal/src/Driver/Mysqli/Driver.php new file mode 100644 index 000000000..28897ed3d --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Driver/Mysqli/Driver.php @@ -0,0 +1,119 @@ +withOptions($preInitializers, $driverOptions); + } + + $preInitializers = $this->withSecure($preInitializers, $params); + $postInitializers = $this->withCharset($postInitializers, $params); + + return new Connection( + $host, + $params['user'] ?? null, + $params['password'] ?? null, + $params['dbname'] ?? null, + $params['port'] ?? null, + $params['unix_socket'] ?? null, + $flags, + $preInitializers, + $postInitializers + ); + } + + /** + * @param list $initializers + * @param array $options + * + * @return list + */ + private function withOptions(array $initializers, array $options): array + { + if (count($options) !== 0) { + $initializers[] = new Options($options); + } + + return $initializers; + } + + /** + * @param list $initializers + * @param array $params + * + * @return list + */ + private function withSecure(array $initializers, array $params): array + { + if ( + isset($params['ssl_key']) || + isset($params['ssl_cert']) || + isset($params['ssl_ca']) || + isset($params['ssl_capath']) || + isset($params['ssl_cipher']) + ) { + $initializers[] = new Secure( + $params['ssl_key'] ?? '', + $params['ssl_cert'] ?? '', + $params['ssl_ca'] ?? '', + $params['ssl_capath'] ?? '', + $params['ssl_cipher'] ?? '' + ); + } + + return $initializers; + } + + /** + * @param list $initializers + * @param array $params + * + * @return list + */ + private function withCharset(array $initializers, array $params): array + { + if (isset($params['charset'])) { + $initializers[] = new Charset($params['charset']); + } + + return $initializers; + } +} diff --git a/app/vendor/doctrine/dbal/src/Driver/Mysqli/Exception/ConnectionError.php b/app/vendor/doctrine/dbal/src/Driver/Mysqli/Exception/ConnectionError.php new file mode 100644 index 000000000..25c33f065 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Driver/Mysqli/Exception/ConnectionError.php @@ -0,0 +1,21 @@ +error, $connection->sqlstate, $connection->errno); + } +} diff --git a/app/vendor/doctrine/dbal/src/Driver/Mysqli/Exception/ConnectionFailed.php b/app/vendor/doctrine/dbal/src/Driver/Mysqli/Exception/ConnectionFailed.php new file mode 100644 index 000000000..16cab72e5 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Driver/Mysqli/Exception/ConnectionFailed.php @@ -0,0 +1,21 @@ +connect_error, 'HY000', $connection->connect_errno); + } +} diff --git a/app/vendor/doctrine/dbal/src/Driver/Mysqli/Exception/FailedReadingStreamOffset.php b/app/vendor/doctrine/dbal/src/Driver/Mysqli/Exception/FailedReadingStreamOffset.php new file mode 100644 index 000000000..6f26dbec8 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Driver/Mysqli/Exception/FailedReadingStreamOffset.php @@ -0,0 +1,22 @@ +error), + $connection->sqlstate, + $connection->errno + ); + } +} diff --git a/app/vendor/doctrine/dbal/src/Driver/Mysqli/Exception/InvalidOption.php b/app/vendor/doctrine/dbal/src/Driver/Mysqli/Exception/InvalidOption.php new file mode 100644 index 000000000..962175679 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Driver/Mysqli/Exception/InvalidOption.php @@ -0,0 +1,27 @@ +error, $statement->sqlstate, $statement->errno); + } +} diff --git a/app/vendor/doctrine/dbal/src/Driver/Mysqli/Initializer.php b/app/vendor/doctrine/dbal/src/Driver/Mysqli/Initializer.php new file mode 100644 index 000000000..9966da46b --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Driver/Mysqli/Initializer.php @@ -0,0 +1,16 @@ +charset = $charset; + } + + public function initialize(mysqli $connection): void + { + if ($connection->set_charset($this->charset)) { + return; + } + + throw InvalidCharset::fromCharset($connection, $this->charset); + } +} diff --git a/app/vendor/doctrine/dbal/src/Driver/Mysqli/Initializer/Options.php b/app/vendor/doctrine/dbal/src/Driver/Mysqli/Initializer/Options.php new file mode 100644 index 000000000..bcf2fc2d1 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Driver/Mysqli/Initializer/Options.php @@ -0,0 +1,34 @@ + */ + private $options; + + /** + * @param array $options + */ + public function __construct(array $options) + { + $this->options = $options; + } + + public function initialize(mysqli $connection): void + { + foreach ($this->options as $option => $value) { + if (! mysqli_options($connection, $option, $value)) { + throw InvalidOption::fromOption($option, $value); + } + } + } +} diff --git a/app/vendor/doctrine/dbal/src/Driver/Mysqli/Initializer/Secure.php b/app/vendor/doctrine/dbal/src/Driver/Mysqli/Initializer/Secure.php new file mode 100644 index 000000000..9d6db4e0e --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Driver/Mysqli/Initializer/Secure.php @@ -0,0 +1,40 @@ +key = $key; + $this->cert = $cert; + $this->ca = $ca; + $this->capath = $capath; + $this->cipher = $cipher; + } + + public function initialize(mysqli $connection): void + { + $connection->ssl_set($this->key, $this->cert, $this->ca, $this->capath, $this->cipher); + } +} diff --git a/app/vendor/doctrine/dbal/src/Driver/Mysqli/Result.php b/app/vendor/doctrine/dbal/src/Driver/Mysqli/Result.php new file mode 100644 index 000000000..11e00f0b2 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Driver/Mysqli/Result.php @@ -0,0 +1,187 @@ + + */ + private $columnNames = []; + + /** @var mixed[] */ + private $boundValues = []; + + /** + * @internal The result can be only instantiated by its driver connection or statement. + * + * @throws Exception + */ + public function __construct(mysqli_stmt $statement) + { + $this->statement = $statement; + + $meta = $statement->result_metadata(); + + if ($meta === false) { + return; + } + + $this->hasColumns = true; + + $fields = $meta->fetch_fields(); + assert(is_array($fields)); + + $this->columnNames = array_map(static function (stdClass $field): string { + return $field->name; + }, $fields); + + $meta->free(); + + // Store result of every execution which has it. Otherwise it will be impossible + // to execute a new statement in case if the previous one has non-fetched rows + // @link http://dev.mysql.com/doc/refman/5.7/en/commands-out-of-sync.html + $this->statement->store_result(); + + // Bind row values _after_ storing the result. Otherwise, if mysqli is compiled with libmysql, + // it will have to allocate as much memory as it may be needed for the given column type + // (e.g. for a LONGBLOB column it's 4 gigabytes) + // @link https://bugs.php.net/bug.php?id=51386#1270673122 + // + // Make sure that the values are bound after each execution. Otherwise, if free() has been + // previously called on the result, the values are unbound making the statement unusable. + // + // It's also important that row values are bound after _each_ call to store_result(). Otherwise, + // if mysqli is compiled with libmysql, subsequently fetched string values will get truncated + // to the length of the ones fetched during the previous execution. + $this->boundValues = array_fill(0, count($this->columnNames), null); + + $refs = []; + foreach ($this->boundValues as &$value) { + $refs[] =& $value; + } + + if (! $this->statement->bind_result(...$refs)) { + throw StatementError::new($this->statement); + } + } + + /** + * {@inheritdoc} + */ + public function fetchNumeric() + { + $ret = $this->statement->fetch(); + + if ($ret === false) { + throw StatementError::new($this->statement); + } + + if ($ret === null) { + return false; + } + + $values = []; + + foreach ($this->boundValues as $v) { + $values[] = $v; + } + + return $values; + } + + /** + * {@inheritDoc} + */ + public function fetchAssociative() + { + $values = $this->fetchNumeric(); + + if ($values === false) { + return false; + } + + return array_combine($this->columnNames, $values); + } + + /** + * {@inheritdoc} + */ + public function fetchOne() + { + return FetchUtils::fetchOne($this); + } + + /** + * {@inheritdoc} + */ + public function fetchAllNumeric(): array + { + return FetchUtils::fetchAllNumeric($this); + } + + /** + * {@inheritdoc} + */ + public function fetchAllAssociative(): array + { + return FetchUtils::fetchAllAssociative($this); + } + + /** + * {@inheritdoc} + */ + public function fetchFirstColumn(): array + { + return FetchUtils::fetchFirstColumn($this); + } + + public function rowCount(): int + { + if ($this->hasColumns) { + return $this->statement->num_rows; + } + + return $this->statement->affected_rows; + } + + public function columnCount(): int + { + return $this->statement->field_count; + } + + public function free(): void + { + $this->statement->free_result(); + } +} diff --git a/app/vendor/doctrine/dbal/src/Driver/Mysqli/Statement.php b/app/vendor/doctrine/dbal/src/Driver/Mysqli/Statement.php new file mode 100644 index 000000000..9f802e112 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Driver/Mysqli/Statement.php @@ -0,0 +1,227 @@ + 's', + ParameterType::STRING => 's', + ParameterType::BINARY => 's', + ParameterType::BOOLEAN => 'i', + ParameterType::NULL => 's', + ParameterType::INTEGER => 'i', + ParameterType::LARGE_OBJECT => 'b', + ]; + + /** @var mysqli */ + protected $_conn; + + /** @var mysqli_stmt */ + protected $_stmt; + + /** @var mixed[]|null */ + protected $_bindedValues; + + /** @var string */ + protected $types; + + /** + * Contains ref values for bindValue(). + * + * @var mixed[] + */ + protected $_values = []; + + /** + * @internal The statement can be only instantiated by its driver connection. + * + * @param string $prepareString + * + * @throws Exception + */ + public function __construct(mysqli $conn, $prepareString) + { + $this->_conn = $conn; + + $stmt = $conn->prepare($prepareString); + + if ($stmt === false) { + throw ConnectionError::new($this->_conn); + } + + $this->_stmt = $stmt; + + $paramCount = $this->_stmt->param_count; + if (0 >= $paramCount) { + return; + } + + $this->types = str_repeat('s', $paramCount); + $this->_bindedValues = array_fill(1, $paramCount, null); + } + + /** + * {@inheritdoc} + */ + public function bindParam($param, &$variable, $type = ParameterType::STRING, $length = null) + { + assert(is_int($param)); + + if (! isset(self::$_paramTypeMap[$type])) { + throw UnknownParameterType::new($type); + } + + $this->_bindedValues[$param] =& $variable; + $this->types[$param - 1] = self::$_paramTypeMap[$type]; + + return true; + } + + /** + * {@inheritdoc} + */ + public function bindValue($param, $value, $type = ParameterType::STRING) + { + assert(is_int($param)); + + if (! isset(self::$_paramTypeMap[$type])) { + throw UnknownParameterType::new($type); + } + + $this->_values[$param] = $value; + $this->_bindedValues[$param] =& $this->_values[$param]; + $this->types[$param - 1] = self::$_paramTypeMap[$type]; + + return true; + } + + /** + * {@inheritdoc} + */ + public function execute($params = null): ResultInterface + { + if ($this->_bindedValues !== null) { + if ($params !== null) { + if (! $this->bindUntypedValues($params)) { + throw StatementError::new($this->_stmt); + } + } else { + $this->bindTypedParameters(); + } + } + + if (! $this->_stmt->execute()) { + throw StatementError::new($this->_stmt); + } + + return new Result($this->_stmt); + } + + /** + * Binds parameters with known types previously bound to the statement + * + * @throws Exception + */ + private function bindTypedParameters(): void + { + $streams = $values = []; + $types = $this->types; + + foreach ($this->_bindedValues as $parameter => $value) { + assert(is_int($parameter)); + + if (! isset($types[$parameter - 1])) { + $types[$parameter - 1] = static::$_paramTypeMap[ParameterType::STRING]; + } + + if ($types[$parameter - 1] === static::$_paramTypeMap[ParameterType::LARGE_OBJECT]) { + if (is_resource($value)) { + if (get_resource_type($value) !== 'stream') { + throw NonStreamResourceUsedAsLargeObject::new($parameter); + } + + $streams[$parameter] = $value; + $values[$parameter] = null; + continue; + } + + $types[$parameter - 1] = static::$_paramTypeMap[ParameterType::STRING]; + } + + $values[$parameter] = $value; + } + + if (! $this->_stmt->bind_param($types, ...$values)) { + throw StatementError::new($this->_stmt); + } + + $this->sendLongData($streams); + } + + /** + * Handle $this->_longData after regular query parameters have been bound + * + * @param array $streams + * + * @throws Exception + */ + private function sendLongData(array $streams): void + { + foreach ($streams as $paramNr => $stream) { + while (! feof($stream)) { + $chunk = fread($stream, 8192); + + if ($chunk === false) { + throw FailedReadingStreamOffset::new($paramNr); + } + + if (! $this->_stmt->send_long_data($paramNr - 1, $chunk)) { + throw StatementError::new($this->_stmt); + } + } + } + } + + /** + * Binds a array of values to bound parameters. + * + * @param mixed[] $values + * + * @return bool + */ + private function bindUntypedValues(array $values) + { + $params = []; + $types = str_repeat('s', count($values)); + + foreach ($values as &$v) { + $params[] =& $v; + } + + return $this->_stmt->bind_param($types, ...$params); + } +} diff --git a/app/vendor/doctrine/dbal/src/Driver/OCI8/Connection.php b/app/vendor/doctrine/dbal/src/Driver/OCI8/Connection.php new file mode 100644 index 000000000..1bc5c62ce --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Driver/OCI8/Connection.php @@ -0,0 +1,174 @@ +dbh = $dbh; + $this->executionMode = new ExecutionMode(); + } + + /** + * {@inheritdoc} + */ + public function getServerVersion() + { + $version = oci_server_version($this->dbh); + + if ($version === false) { + throw Error::new($this->dbh); + } + + assert(preg_match('/\s+(\d+\.\d+\.\d+\.\d+\.\d+)\s+/', $version, $matches) === 1); + + return $matches[1]; + } + + public function prepare(string $sql): DriverStatement + { + return new Statement($this->dbh, $sql, $this->executionMode); + } + + public function query(string $sql): ResultInterface + { + return $this->prepare($sql)->execute(); + } + + /** + * {@inheritdoc} + */ + public function quote($value, $type = ParameterType::STRING) + { + if (is_int($value) || is_float($value)) { + return $value; + } + + $value = str_replace("'", "''", $value); + + return "'" . addcslashes($value, "\000\n\r\\\032") . "'"; + } + + public function exec(string $sql): int + { + return $this->prepare($sql)->execute()->rowCount(); + } + + /** + * {@inheritdoc} + * + * @param string|null $name + * + * @return int|false + */ + public function lastInsertId($name = null) + { + if ($name === null) { + return false; + } + + $result = $this->query('SELECT ' . $name . '.CURRVAL FROM DUAL')->fetchOne(); + + if ($result === false) { + throw SequenceDoesNotExist::new(); + } + + return (int) $result; + } + + /** + * {@inheritdoc} + */ + public function beginTransaction() + { + $this->executionMode->disableAutoCommit(); + + return true; + } + + /** + * {@inheritdoc} + */ + public function commit() + { + if (! oci_commit($this->dbh)) { + throw Error::new($this->dbh); + } + + $this->executionMode->enableAutoCommit(); + + return true; + } + + /** + * {@inheritdoc} + */ + public function rollBack() + { + if (! oci_rollback($this->dbh)) { + throw Error::new($this->dbh); + } + + $this->executionMode->enableAutoCommit(); + + return true; + } +} diff --git a/app/vendor/doctrine/dbal/src/Driver/OCI8/ConvertPositionalToNamedPlaceholders.php b/app/vendor/doctrine/dbal/src/Driver/OCI8/ConvertPositionalToNamedPlaceholders.php new file mode 100644 index 000000000..483879d47 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Driver/OCI8/ConvertPositionalToNamedPlaceholders.php @@ -0,0 +1,58 @@ +). + * + * Oracle does not support positional parameters, hence this method converts all + * positional parameters into artificially named parameters. + * + * @internal This class is not covered by the backward compatibility promise + */ +final class ConvertPositionalToNamedPlaceholders implements Visitor +{ + /** @var list */ + private $buffer = []; + + /** @var array */ + private $parameterMap = []; + + public function acceptOther(string $sql): void + { + $this->buffer[] = $sql; + } + + public function acceptPositionalParameter(string $sql): void + { + $position = count($this->parameterMap) + 1; + $param = ':param' . $position; + + $this->parameterMap[$position] = $param; + + $this->buffer[] = $param; + } + + public function acceptNamedParameter(string $sql): void + { + $this->buffer[] = $sql; + } + + public function getSQL(): string + { + return implode('', $this->buffer); + } + + /** + * @return array + */ + public function getParameterMap(): array + { + return $this->parameterMap; + } +} diff --git a/app/vendor/doctrine/dbal/src/Driver/OCI8/Driver.php b/app/vendor/doctrine/dbal/src/Driver/OCI8/Driver.php new file mode 100644 index 000000000..351ffb87a --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Driver/OCI8/Driver.php @@ -0,0 +1,42 @@ +_constructDsn($params), + $params['charset'] ?? '', + $params['sessionMode'] ?? OCI_NO_AUTO_COMMIT, + $params['persistent'] ?? false + ); + } + + /** + * Constructs the Oracle DSN. + * + * @param mixed[] $params + * + * @return string The DSN. + */ + protected function _constructDsn(array $params) + { + return $this->getEasyConnectString($params); + } +} diff --git a/app/vendor/doctrine/dbal/src/Driver/OCI8/Exception/ConnectionFailed.php b/app/vendor/doctrine/dbal/src/Driver/OCI8/Exception/ConnectionFailed.php new file mode 100644 index 000000000..cefe9a3ad --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Driver/OCI8/Exception/ConnectionFailed.php @@ -0,0 +1,26 @@ +isAutoCommitEnabled = true; + } + + public function disableAutoCommit(): void + { + $this->isAutoCommitEnabled = false; + } + + public function isAutoCommitEnabled(): bool + { + return $this->isAutoCommitEnabled; + } +} diff --git a/app/vendor/doctrine/dbal/src/Driver/OCI8/Result.php b/app/vendor/doctrine/dbal/src/Driver/OCI8/Result.php new file mode 100644 index 000000000..8f77da759 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Driver/OCI8/Result.php @@ -0,0 +1,147 @@ +statement = $statement; + } + + /** + * {@inheritDoc} + */ + public function fetchNumeric() + { + return $this->fetch(OCI_NUM); + } + + /** + * {@inheritDoc} + */ + public function fetchAssociative() + { + return $this->fetch(OCI_ASSOC); + } + + /** + * {@inheritDoc} + */ + public function fetchOne() + { + return FetchUtils::fetchOne($this); + } + + /** + * {@inheritDoc} + */ + public function fetchAllNumeric(): array + { + return $this->fetchAll(OCI_NUM, OCI_FETCHSTATEMENT_BY_ROW); + } + + /** + * {@inheritDoc} + */ + public function fetchAllAssociative(): array + { + return $this->fetchAll(OCI_ASSOC, OCI_FETCHSTATEMENT_BY_ROW); + } + + /** + * {@inheritDoc} + */ + public function fetchFirstColumn(): array + { + return $this->fetchAll(OCI_NUM, OCI_FETCHSTATEMENT_BY_COLUMN)[0]; + } + + public function rowCount(): int + { + $count = oci_num_rows($this->statement); + + if ($count !== false) { + return $count; + } + + return 0; + } + + public function columnCount(): int + { + $count = oci_num_fields($this->statement); + + if ($count !== false) { + return $count; + } + + return 0; + } + + public function free(): void + { + oci_cancel($this->statement); + } + + /** + * @return mixed|false + * + * @throws Exception + */ + private function fetch(int $mode) + { + $result = oci_fetch_array($this->statement, $mode | OCI_RETURN_NULLS | OCI_RETURN_LOBS); + + if ($result === false && oci_error($this->statement) !== false) { + throw Error::new($this->statement); + } + + return $result; + } + + /** + * @return array + */ + private function fetchAll(int $mode, int $fetchStructure): array + { + oci_fetch_all( + $this->statement, + $result, + 0, + -1, + $mode | OCI_RETURN_NULLS | $fetchStructure | OCI_RETURN_LOBS + ); + + return $result; + } +} diff --git a/app/vendor/doctrine/dbal/src/Driver/OCI8/Statement.php b/app/vendor/doctrine/dbal/src/Driver/OCI8/Statement.php new file mode 100644 index 000000000..1f3afda20 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Driver/OCI8/Statement.php @@ -0,0 +1,165 @@ +parse($query, $visitor); + + $stmt = oci_parse($dbh, $visitor->getSQL()); + assert(is_resource($stmt)); + + $this->_sth = $stmt; + $this->_dbh = $dbh; + $this->_paramMap = $visitor->getParameterMap(); + $this->executionMode = $executionMode; + } + + /** + * {@inheritdoc} + */ + public function bindValue($param, $value, $type = ParameterType::STRING) + { + return $this->bindParam($param, $value, $type, null); + } + + /** + * {@inheritdoc} + */ + public function bindParam($param, &$variable, $type = ParameterType::STRING, $length = null) + { + if (is_int($param)) { + if (! isset($this->_paramMap[$param])) { + throw UnknownParameterIndex::new($param); + } + + $param = $this->_paramMap[$param]; + } + + if ($type === ParameterType::LARGE_OBJECT) { + $lob = oci_new_descriptor($this->_dbh, OCI_D_LOB); + + assert($lob !== false); + + $lob->writeTemporary($variable, OCI_TEMP_BLOB); + + $variable =& $lob; + } + + $this->boundValues[$param] =& $variable; + + return oci_bind_by_name( + $this->_sth, + $param, + $variable, + $length ?? -1, + $this->convertParameterType($type) + ); + } + + /** + * Converts DBAL parameter type to oci8 parameter type + */ + private function convertParameterType(int $type): int + { + switch ($type) { + case ParameterType::BINARY: + return OCI_B_BIN; + + case ParameterType::LARGE_OBJECT: + return OCI_B_BLOB; + + default: + return SQLT_CHR; + } + } + + /** + * {@inheritdoc} + */ + public function execute($params = null): ResultInterface + { + if ($params !== null) { + foreach ($params as $key => $val) { + if (is_int($key)) { + $this->bindValue($key + 1, $val); + } else { + $this->bindValue($key, $val); + } + } + } + + if ($this->executionMode->isAutoCommitEnabled()) { + $mode = OCI_COMMIT_ON_SUCCESS; + } else { + $mode = OCI_NO_AUTO_COMMIT; + } + + $ret = @oci_execute($this->_sth, $mode); + if (! $ret) { + throw Error::new($this->_sth); + } + + return new Result($this->_sth); + } +} diff --git a/app/vendor/doctrine/dbal/src/Driver/PDO/Connection.php b/app/vendor/doctrine/dbal/src/Driver/PDO/Connection.php new file mode 100644 index 000000000..169016937 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Driver/PDO/Connection.php @@ -0,0 +1,151 @@ +connection = new PDO($dsn, (string) $user, (string) $password, (array) $options); + $this->connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + } catch (PDOException $exception) { + throw Exception::new($exception); + } + } + + public function exec(string $sql): int + { + try { + $result = $this->connection->exec($sql); + + assert($result !== false); + + return $result; + } catch (PDOException $exception) { + throw Exception::new($exception); + } + } + + /** + * {@inheritdoc} + */ + public function getServerVersion() + { + return $this->connection->getAttribute(PDO::ATTR_SERVER_VERSION); + } + + /** + * {@inheritDoc} + * + * @return Statement + */ + public function prepare(string $sql): StatementInterface + { + try { + $stmt = $this->connection->prepare($sql); + assert($stmt instanceof PDOStatement); + + return $this->createStatement($stmt); + } catch (PDOException $exception) { + throw Exception::new($exception); + } + } + + public function query(string $sql): ResultInterface + { + try { + $stmt = $this->connection->query($sql); + assert($stmt instanceof PDOStatement); + + return new Result($stmt); + } catch (PDOException $exception) { + throw Exception::new($exception); + } + } + + /** + * {@inheritdoc} + */ + public function quote($value, $type = ParameterType::STRING) + { + return $this->connection->quote($value, $type); + } + + /** + * {@inheritdoc} + */ + public function lastInsertId($name = null) + { + try { + if ($name === null) { + return $this->connection->lastInsertId(); + } + + return $this->connection->lastInsertId($name); + } catch (PDOException $exception) { + throw Exception::new($exception); + } + } + + /** + * Creates a wrapped statement + */ + protected function createStatement(PDOStatement $stmt): Statement + { + return new Statement($stmt); + } + + /** + * {@inheritDoc} + */ + public function beginTransaction() + { + return $this->connection->beginTransaction(); + } + + /** + * {@inheritDoc} + */ + public function commit() + { + return $this->connection->commit(); + } + + /** + * {@inheritDoc} + */ + public function rollBack() + { + return $this->connection->rollBack(); + } + + public function getWrappedConnection(): PDO + { + return $this->connection; + } +} diff --git a/app/vendor/doctrine/dbal/src/Driver/PDO/Exception.php b/app/vendor/doctrine/dbal/src/Driver/PDO/Exception.php new file mode 100644 index 000000000..49f55951d --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Driver/PDO/Exception.php @@ -0,0 +1,28 @@ +errorInfo !== null) { + [$sqlState, $code] = $exception->errorInfo; + } else { + $code = $exception->getCode(); + $sqlState = null; + } + + return new self($exception->getMessage(), $sqlState, $code, $exception); + } +} diff --git a/app/vendor/doctrine/dbal/src/Driver/PDO/MySQL/Driver.php b/app/vendor/doctrine/dbal/src/Driver/PDO/MySQL/Driver.php new file mode 100644 index 000000000..50c05a40f --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Driver/PDO/MySQL/Driver.php @@ -0,0 +1,64 @@ +constructPdoDsn($params), + $params['user'] ?? '', + $params['password'] ?? '', + $driverOptions + ); + } + + /** + * Constructs the MySQL PDO DSN. + * + * @param mixed[] $params + * + * @return string The DSN. + */ + protected function constructPdoDsn(array $params) + { + $dsn = 'mysql:'; + if (isset($params['host']) && $params['host'] !== '') { + $dsn .= 'host=' . $params['host'] . ';'; + } + + if (isset($params['port'])) { + $dsn .= 'port=' . $params['port'] . ';'; + } + + if (isset($params['dbname'])) { + $dsn .= 'dbname=' . $params['dbname'] . ';'; + } + + if (isset($params['unix_socket'])) { + $dsn .= 'unix_socket=' . $params['unix_socket'] . ';'; + } + + if (isset($params['charset'])) { + $dsn .= 'charset=' . $params['charset'] . ';'; + } + + return $dsn; + } +} diff --git a/app/vendor/doctrine/dbal/src/Driver/PDO/OCI/Driver.php b/app/vendor/doctrine/dbal/src/Driver/PDO/OCI/Driver.php new file mode 100644 index 000000000..a2c1f4652 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Driver/PDO/OCI/Driver.php @@ -0,0 +1,49 @@ +constructPdoDsn($params), + $params['user'] ?? '', + $params['password'] ?? '', + $driverOptions + ); + } + + /** + * Constructs the Oracle PDO DSN. + * + * @param mixed[] $params + * + * @return string The DSN. + */ + private function constructPdoDsn(array $params) + { + $dsn = 'oci:dbname=' . $this->getEasyConnectString($params); + + if (isset($params['charset'])) { + $dsn .= ';charset=' . $params['charset']; + } + + return $dsn; + } +} diff --git a/app/vendor/doctrine/dbal/src/Driver/PDO/PgSQL/Driver.php b/app/vendor/doctrine/dbal/src/Driver/PDO/PgSQL/Driver.php new file mode 100644 index 000000000..e9620bde7 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Driver/PDO/PgSQL/Driver.php @@ -0,0 +1,109 @@ +_constructPdoDsn($params), + $params['user'] ?? '', + $params['password'] ?? '', + $driverOptions, + ); + + if ( + defined('PDO::PGSQL_ATTR_DISABLE_PREPARES') + && (! isset($driverOptions[PDO::PGSQL_ATTR_DISABLE_PREPARES]) + || $driverOptions[PDO::PGSQL_ATTR_DISABLE_PREPARES] === true + ) + ) { + $connection->getWrappedConnection()->setAttribute(PDO::PGSQL_ATTR_DISABLE_PREPARES, true); + } + + /* defining client_encoding via SET NAMES to avoid inconsistent DSN support + * - the 'client_encoding' connection param only works with postgres >= 9.1 + * - passing client_encoding via the 'options' param breaks pgbouncer support + */ + if (isset($params['charset'])) { + $connection->exec('SET NAMES \'' . $params['charset'] . '\''); + } + + return $connection; + } + + /** + * Constructs the Postgres PDO DSN. + * + * @param mixed[] $params + * + * @return string The DSN. + */ + private function _constructPdoDsn(array $params) + { + $dsn = 'pgsql:'; + + if (isset($params['host']) && $params['host'] !== '') { + $dsn .= 'host=' . $params['host'] . ';'; + } + + if (isset($params['port']) && $params['port'] !== '') { + $dsn .= 'port=' . $params['port'] . ';'; + } + + if (isset($params['dbname'])) { + $dsn .= 'dbname=' . $params['dbname'] . ';'; + } elseif (isset($params['default_dbname'])) { + $dsn .= 'dbname=' . $params['default_dbname'] . ';'; + } else { + // Used for temporary connections to allow operations like dropping the database currently connected to. + // Connecting without an explicit database does not work, therefore "postgres" database is used + // as it is mostly present in every server setup. + $dsn .= 'dbname=postgres;'; + } + + if (isset($params['sslmode'])) { + $dsn .= 'sslmode=' . $params['sslmode'] . ';'; + } + + if (isset($params['sslrootcert'])) { + $dsn .= 'sslrootcert=' . $params['sslrootcert'] . ';'; + } + + if (isset($params['sslcert'])) { + $dsn .= 'sslcert=' . $params['sslcert'] . ';'; + } + + if (isset($params['sslkey'])) { + $dsn .= 'sslkey=' . $params['sslkey'] . ';'; + } + + if (isset($params['sslcrl'])) { + $dsn .= 'sslcrl=' . $params['sslcrl'] . ';'; + } + + if (isset($params['application_name'])) { + $dsn .= 'application_name=' . $params['application_name'] . ';'; + } + + return $dsn; + } +} diff --git a/app/vendor/doctrine/dbal/src/Driver/PDO/Result.php b/app/vendor/doctrine/dbal/src/Driver/PDO/Result.php new file mode 100644 index 000000000..888716d81 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Driver/PDO/Result.php @@ -0,0 +1,130 @@ +statement = $statement; + } + + /** + * {@inheritDoc} + */ + public function fetchNumeric() + { + return $this->fetch(PDO::FETCH_NUM); + } + + /** + * {@inheritDoc} + */ + public function fetchAssociative() + { + return $this->fetch(PDO::FETCH_ASSOC); + } + + /** + * {@inheritDoc} + */ + public function fetchOne() + { + return $this->fetch(PDO::FETCH_COLUMN); + } + + /** + * {@inheritDoc} + */ + public function fetchAllNumeric(): array + { + return $this->fetchAll(PDO::FETCH_NUM); + } + + /** + * {@inheritDoc} + */ + public function fetchAllAssociative(): array + { + return $this->fetchAll(PDO::FETCH_ASSOC); + } + + /** + * {@inheritDoc} + */ + public function fetchFirstColumn(): array + { + return $this->fetchAll(PDO::FETCH_COLUMN); + } + + public function rowCount(): int + { + try { + return $this->statement->rowCount(); + } catch (PDOException $exception) { + throw Exception::new($exception); + } + } + + public function columnCount(): int + { + try { + return $this->statement->columnCount(); + } catch (PDOException $exception) { + throw Exception::new($exception); + } + } + + public function free(): void + { + $this->statement->closeCursor(); + } + + /** + * @return mixed|false + * + * @throws Exception + */ + private function fetch(int $mode) + { + try { + return $this->statement->fetch($mode); + } catch (PDOException $exception) { + throw Exception::new($exception); + } + } + + /** + * @return list + * + * @throws Exception + */ + private function fetchAll(int $mode): array + { + try { + $data = $this->statement->fetchAll($mode); + } catch (PDOException $exception) { + throw Exception::new($exception); + } + + assert(is_array($data)); + + return $data; + } +} diff --git a/app/vendor/doctrine/dbal/src/Driver/PDO/SQLSrv/Connection.php b/app/vendor/doctrine/dbal/src/Driver/PDO/SQLSrv/Connection.php new file mode 100644 index 000000000..a64f4245a --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Driver/PDO/SQLSrv/Connection.php @@ -0,0 +1,97 @@ +connection = $connection; + } + + public function prepare(string $sql): StatementInterface + { + return new Statement( + $this->connection->prepare($sql) + ); + } + + public function query(string $sql): Result + { + return $this->connection->query($sql); + } + + /** + * {@inheritDoc} + */ + public function quote($value, $type = ParameterType::STRING) + { + return $this->connection->quote($value, $type); + } + + public function exec(string $sql): int + { + return $this->connection->exec($sql); + } + + /** + * {@inheritDoc} + */ + public function lastInsertId($name = null) + { + if ($name === null) { + return $this->connection->lastInsertId($name); + } + + return $this->prepare('SELECT CONVERT(VARCHAR(MAX), current_value) FROM sys.sequences WHERE name = ?') + ->execute([$name]) + ->fetchOne(); + } + + /** + * {@inheritDoc} + */ + public function beginTransaction() + { + return $this->connection->beginTransaction(); + } + + /** + * {@inheritDoc} + */ + public function commit() + { + return $this->connection->commit(); + } + + /** + * {@inheritDoc} + */ + public function rollBack() + { + return $this->connection->rollBack(); + } + + /** + * {@inheritDoc} + */ + public function getServerVersion() + { + return $this->connection->getServerVersion(); + } + + public function getWrappedConnection(): PDO + { + return $this->connection->getWrappedConnection(); + } +} diff --git a/app/vendor/doctrine/dbal/src/Driver/PDO/SQLSrv/Driver.php b/app/vendor/doctrine/dbal/src/Driver/PDO/SQLSrv/Driver.php new file mode 100644 index 000000000..c48425049 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Driver/PDO/SQLSrv/Driver.php @@ -0,0 +1,99 @@ + $value) { + if (is_int($option)) { + $pdoOptions[$option] = $value; + } else { + $dsnOptions[$option] = $value; + } + } + } + + if (! empty($params['persistent'])) { + $pdoOptions[PDO::ATTR_PERSISTENT] = true; + } + + return new Connection( + new PDOConnection( + $this->_constructPdoDsn($params, $dsnOptions), + $params['user'] ?? '', + $params['password'] ?? '', + $pdoOptions + ) + ); + } + + /** + * Constructs the Sqlsrv PDO DSN. + * + * @param mixed[] $params + * @param string[] $connectionOptions + * + * @return string The DSN. + * + * @throws Exception + */ + private function _constructPdoDsn(array $params, array $connectionOptions) + { + $dsn = 'sqlsrv:server='; + + if (isset($params['host'])) { + $dsn .= $params['host']; + + if (isset($params['port'])) { + $dsn .= ',' . $params['port']; + } + } elseif (isset($params['port'])) { + throw PortWithoutHost::new(); + } + + if (isset($params['dbname'])) { + $connectionOptions['Database'] = $params['dbname']; + } + + if (isset($params['MultipleActiveResultSets'])) { + $connectionOptions['MultipleActiveResultSets'] = $params['MultipleActiveResultSets'] ? 'true' : 'false'; + } + + return $dsn . $this->getConnectionOptionsDsn($connectionOptions); + } + + /** + * Converts a connection options array to the DSN + * + * @param string[] $connectionOptions + */ + private function getConnectionOptionsDsn(array $connectionOptions): string + { + $connectionOptionsDsn = ''; + + foreach ($connectionOptions as $paramName => $paramValue) { + $connectionOptionsDsn .= sprintf(';%s=%s', $paramName, $paramValue); + } + + return $connectionOptionsDsn; + } +} diff --git a/app/vendor/doctrine/dbal/src/Driver/PDO/SQLSrv/Statement.php b/app/vendor/doctrine/dbal/src/Driver/PDO/SQLSrv/Statement.php new file mode 100644 index 000000000..d2da1625c --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Driver/PDO/SQLSrv/Statement.php @@ -0,0 +1,80 @@ +statement = $statement; + } + + /** + * {@inheritdoc} + * + * @param string|int $param + * @param mixed $variable + * @param int $type + * @param int|null $length + * @param mixed $driverOptions The usage of the argument is deprecated. + */ + public function bindParam($param, &$variable, $type = ParameterType::STRING, $length = null, $driverOptions = null) + { + if (func_num_args() > 4) { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4533', + 'The $driverOptions argument of Statement::bindParam() is deprecated.' + ); + } + + switch ($type) { + case ParameterType::LARGE_OBJECT: + case ParameterType::BINARY: + if ($driverOptions === null) { + $driverOptions = PDO::SQLSRV_ENCODING_BINARY; + } + + break; + + case ParameterType::ASCII: + $type = ParameterType::STRING; + $length = 0; + $driverOptions = PDO::SQLSRV_ENCODING_SYSTEM; + break; + } + + return $this->statement->bindParam($param, $variable, $type, $length, $driverOptions); + } + + /** + * {@inheritdoc} + */ + public function bindValue($param, $value, $type = ParameterType::STRING) + { + return $this->bindParam($param, $value, $type); + } + + /** + * {@inheritdoc} + */ + public function execute($params = null): Result + { + return $this->statement->execute($params); + } +} diff --git a/app/vendor/doctrine/dbal/src/Driver/PDO/SQLite/Driver.php b/app/vendor/doctrine/dbal/src/Driver/PDO/SQLite/Driver.php new file mode 100644 index 000000000..d85ba28fa --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Driver/PDO/SQLite/Driver.php @@ -0,0 +1,71 @@ + ['callback' => [SqlitePlatform::class, 'udfSqrt'], 'numArgs' => 1], + 'mod' => ['callback' => [SqlitePlatform::class, 'udfMod'], 'numArgs' => 2], + 'locate' => ['callback' => [SqlitePlatform::class, 'udfLocate'], 'numArgs' => -1], + ]; + + /** + * {@inheritdoc} + * + * @return Connection + */ + public function connect(array $params) + { + $driverOptions = $params['driverOptions'] ?? []; + + if (isset($driverOptions['userDefinedFunctions'])) { + $this->_userDefinedFunctions = array_merge( + $this->_userDefinedFunctions, + $driverOptions['userDefinedFunctions'] + ); + unset($driverOptions['userDefinedFunctions']); + } + + $connection = new Connection( + $this->_constructPdoDsn($params), + $params['user'] ?? '', + $params['password'] ?? '', + $driverOptions + ); + + $pdo = $connection->getWrappedConnection(); + + foreach ($this->_userDefinedFunctions as $fn => $data) { + $pdo->sqliteCreateFunction($fn, $data['callback'], $data['numArgs']); + } + + return $connection; + } + + /** + * Constructs the Sqlite PDO DSN. + * + * @param mixed[] $params + * + * @return string The DSN. + */ + protected function _constructPdoDsn(array $params) + { + $dsn = 'sqlite:'; + if (isset($params['path'])) { + $dsn .= $params['path']; + } elseif (isset($params['memory'])) { + $dsn .= ':memory:'; + } + + return $dsn; + } +} diff --git a/app/vendor/doctrine/dbal/src/Driver/PDO/Statement.php b/app/vendor/doctrine/dbal/src/Driver/PDO/Statement.php new file mode 100644 index 000000000..1461239e6 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Driver/PDO/Statement.php @@ -0,0 +1,115 @@ + PDO::PARAM_NULL, + ParameterType::INTEGER => PDO::PARAM_INT, + ParameterType::STRING => PDO::PARAM_STR, + ParameterType::ASCII => PDO::PARAM_STR, + ParameterType::BINARY => PDO::PARAM_LOB, + ParameterType::LARGE_OBJECT => PDO::PARAM_LOB, + ParameterType::BOOLEAN => PDO::PARAM_BOOL, + ]; + + /** @var PDOStatement */ + private $stmt; + + /** + * @internal The statement can be only instantiated by its driver connection. + */ + public function __construct(PDOStatement $stmt) + { + $this->stmt = $stmt; + } + + /** + * {@inheritdoc} + */ + public function bindValue($param, $value, $type = ParameterType::STRING) + { + $type = $this->convertParamType($type); + + try { + return $this->stmt->bindValue($param, $value, $type); + } catch (PDOException $exception) { + throw Exception::new($exception); + } + } + + /** + * {@inheritDoc} + * + * @param mixed $param + * @param mixed $variable + * @param int $type + * @param int|null $length + * @param mixed $driverOptions The usage of the argument is deprecated. + * + * @return bool + */ + public function bindParam($param, &$variable, $type = ParameterType::STRING, $length = null, $driverOptions = null) + { + if (func_num_args() > 4) { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4533', + 'The $driverOptions argument of Statement::bindParam() is deprecated.' + ); + } + + $type = $this->convertParamType($type); + + try { + return $this->stmt->bindParam($param, $variable, $type, ...array_slice(func_get_args(), 3)); + } catch (PDOException $exception) { + throw Exception::new($exception); + } + } + + /** + * {@inheritdoc} + */ + public function execute($params = null): ResultInterface + { + try { + $this->stmt->execute($params); + } catch (PDOException $exception) { + throw Exception::new($exception); + } + + return new Result($this->stmt); + } + + /** + * Converts DBAL parameter type to PDO parameter type + * + * @param int $type Parameter type + * + * @throws ExceptionInterface + */ + private function convertParamType(int $type): int + { + if (! isset(self::PARAM_TYPE_MAP[$type])) { + throw UnknownParameterType::new($type); + } + + return self::PARAM_TYPE_MAP[$type]; + } +} diff --git a/app/vendor/doctrine/dbal/src/Driver/Result.php b/app/vendor/doctrine/dbal/src/Driver/Result.php new file mode 100644 index 000000000..7843a9589 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Driver/Result.php @@ -0,0 +1,93 @@ +|false + * + * @throws Exception + */ + public function fetchNumeric(); + + /** + * Returns the next row of the result as an associative array or FALSE if there are no more rows. + * + * @return array|false + * + * @throws Exception + */ + public function fetchAssociative(); + + /** + * Returns the first value of the next row of the result or FALSE if there are no more rows. + * + * @return mixed|false + * + * @throws Exception + */ + public function fetchOne(); + + /** + * Returns an array containing all of the result rows represented as numeric arrays. + * + * @return list> + * + * @throws Exception + */ + public function fetchAllNumeric(): array; + + /** + * Returns an array containing all of the result rows represented as associative arrays. + * + * @return list> + * + * @throws Exception + */ + public function fetchAllAssociative(): array; + + /** + * Returns an array containing the values of the first column of the result. + * + * @return list + * + * @throws Exception + */ + public function fetchFirstColumn(): array; + + /** + * Returns the number of rows affected by the DELETE, INSERT, or UPDATE statement that produced the result. + * + * If the statement executed a SELECT query or a similar platform-specific SQL (e.g. DESCRIBE, SHOW, etc.), + * some database drivers may return the number of rows returned by that query. However, this behaviour + * is not guaranteed for all drivers and should not be relied on in portable applications. + * + * @return int The number of rows. + * + * @throws Exception + */ + public function rowCount(): int; + + /** + * Returns the number of columns in the result + * + * @return int The number of columns in the result. If the columns cannot be counted, + * this method must return 0. + * + * @throws Exception + */ + public function columnCount(): int; + + /** + * Discards the non-fetched portion of the result, enabling the originating statement to be executed again. + */ + public function free(): void; +} diff --git a/app/vendor/doctrine/dbal/src/Driver/SQLSrv/Connection.php b/app/vendor/doctrine/dbal/src/Driver/SQLSrv/Connection.php new file mode 100644 index 000000000..e37ea9006 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Driver/SQLSrv/Connection.php @@ -0,0 +1,156 @@ +conn = $conn; + } + + /** + * {@inheritdoc} + */ + public function getServerVersion() + { + $serverInfo = sqlsrv_server_info($this->conn); + + return $serverInfo['SQLServerVersion']; + } + + public function prepare(string $sql): DriverStatement + { + return new Statement($this->conn, $sql); + } + + public function query(string $sql): ResultInterface + { + return $this->prepare($sql)->execute(); + } + + /** + * {@inheritDoc} + */ + public function quote($value, $type = ParameterType::STRING) + { + if (is_int($value)) { + return $value; + } + + if (is_float($value)) { + return sprintf('%F', $value); + } + + return "'" . str_replace("'", "''", $value) . "'"; + } + + public function exec(string $sql): int + { + $stmt = sqlsrv_query($this->conn, $sql); + + if ($stmt === false) { + throw Error::new(); + } + + $rowsAffected = sqlsrv_rows_affected($stmt); + + if ($rowsAffected === false) { + throw Error::new(); + } + + return $rowsAffected; + } + + /** + * {@inheritDoc} + */ + public function lastInsertId($name = null) + { + if ($name !== null) { + $result = $this->prepare('SELECT CONVERT(VARCHAR(MAX), current_value) FROM sys.sequences WHERE name = ?') + ->execute([$name]); + } else { + $result = $this->query('SELECT @@IDENTITY'); + } + + return $result->fetchOne(); + } + + /** + * {@inheritDoc} + */ + public function beginTransaction() + { + if (! sqlsrv_begin_transaction($this->conn)) { + throw Error::new(); + } + + return true; + } + + /** + * {@inheritDoc} + */ + public function commit() + { + if (! sqlsrv_commit($this->conn)) { + throw Error::new(); + } + + return true; + } + + /** + * {@inheritDoc} + */ + public function rollBack() + { + if (! sqlsrv_rollback($this->conn)) { + throw Error::new(); + } + + return true; + } +} diff --git a/app/vendor/doctrine/dbal/src/Driver/SQLSrv/Driver.php b/app/vendor/doctrine/dbal/src/Driver/SQLSrv/Driver.php new file mode 100644 index 000000000..efa9ccfe9 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Driver/SQLSrv/Driver.php @@ -0,0 +1,56 @@ +statement = $stmt; + } + + /** + * {@inheritDoc} + */ + public function fetchNumeric() + { + return $this->fetch(SQLSRV_FETCH_NUMERIC); + } + + /** + * {@inheritDoc} + */ + public function fetchAssociative() + { + return $this->fetch(SQLSRV_FETCH_ASSOC); + } + + /** + * {@inheritDoc} + */ + public function fetchOne() + { + return FetchUtils::fetchOne($this); + } + + /** + * {@inheritDoc} + */ + public function fetchAllNumeric(): array + { + return FetchUtils::fetchAllNumeric($this); + } + + /** + * {@inheritDoc} + */ + public function fetchAllAssociative(): array + { + return FetchUtils::fetchAllAssociative($this); + } + + /** + * {@inheritDoc} + */ + public function fetchFirstColumn(): array + { + return FetchUtils::fetchFirstColumn($this); + } + + public function rowCount(): int + { + $count = sqlsrv_rows_affected($this->statement); + + if ($count !== false) { + return $count; + } + + return 0; + } + + public function columnCount(): int + { + $count = sqlsrv_num_fields($this->statement); + + if ($count !== false) { + return $count; + } + + return 0; + } + + public function free(): void + { + // emulate it by fetching and discarding rows, similarly to what PDO does in this case + // @link http://php.net/manual/en/pdostatement.closecursor.php + // @link https://github.com/php/php-src/blob/php-7.0.11/ext/pdo/pdo_stmt.c#L2075 + // deliberately do not consider multiple result sets, since doctrine/dbal doesn't support them + while (sqlsrv_fetch($this->statement)) { + } + } + + /** + * @return mixed|false + */ + private function fetch(int $fetchType) + { + return sqlsrv_fetch_array($this->statement, $fetchType) ?? false; + } +} diff --git a/app/vendor/doctrine/dbal/src/Driver/SQLSrv/Statement.php b/app/vendor/doctrine/dbal/src/Driver/SQLSrv/Statement.php new file mode 100644 index 000000000..8267bc0de --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Driver/SQLSrv/Statement.php @@ -0,0 +1,191 @@ +conn = $conn; + $this->sql = $sql; + + if (stripos($sql, 'INSERT INTO ') !== 0) { + return; + } + + $this->sql .= self::LAST_INSERT_ID_SQL; + } + + /** + * {@inheritdoc} + */ + public function bindValue($param, $value, $type = ParameterType::STRING) + { + assert(is_int($param)); + + $this->variables[$param] = $value; + $this->types[$param] = $type; + + return true; + } + + /** + * {@inheritdoc} + */ + public function bindParam($param, &$variable, $type = ParameterType::STRING, $length = null) + { + assert(is_int($param)); + + $this->variables[$param] =& $variable; + $this->types[$param] = $type; + + // unset the statement resource if it exists as the new one will need to be bound to the new variable + $this->stmt = null; + + return true; + } + + /** + * {@inheritdoc} + */ + public function execute($params = null): ResultInterface + { + if ($params !== null) { + foreach ($params as $key => $val) { + if (is_int($key)) { + $this->bindValue($key + 1, $val); + } else { + $this->bindValue($key, $val); + } + } + } + + if ($this->stmt === null) { + $this->stmt = $this->prepare(); + } + + if (! sqlsrv_execute($this->stmt)) { + throw Error::new(); + } + + return new Result($this->stmt); + } + + /** + * Prepares SQL Server statement resource + * + * @return resource + * + * @throws Exception + */ + private function prepare() + { + $params = []; + + foreach ($this->variables as $column => &$variable) { + switch ($this->types[$column]) { + case ParameterType::LARGE_OBJECT: + $params[$column - 1] = [ + &$variable, + SQLSRV_PARAM_IN, + SQLSRV_PHPTYPE_STREAM(SQLSRV_ENC_BINARY), + SQLSRV_SQLTYPE_VARBINARY('max'), + ]; + break; + + case ParameterType::BINARY: + $params[$column - 1] = [ + &$variable, + SQLSRV_PARAM_IN, + SQLSRV_PHPTYPE_STRING(SQLSRV_ENC_BINARY), + ]; + break; + + case ParameterType::ASCII: + $params[$column - 1] = [ + &$variable, + SQLSRV_PARAM_IN, + SQLSRV_PHPTYPE_STRING(SQLSRV_ENC_CHAR), + ]; + break; + + default: + $params[$column - 1] =& $variable; + break; + } + } + + $stmt = sqlsrv_prepare($this->conn, $this->sql, $params); + + if ($stmt === false) { + throw Error::new(); + } + + return $stmt; + } +} diff --git a/app/vendor/doctrine/dbal/src/Driver/ServerInfoAwareConnection.php b/app/vendor/doctrine/dbal/src/Driver/ServerInfoAwareConnection.php new file mode 100644 index 000000000..622f98c6c --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Driver/ServerInfoAwareConnection.php @@ -0,0 +1,18 @@ +execute() is called. + * + * As mentioned above, the named parameters are not natively supported by the mysqli driver, use executeQuery(), + * fetchAll(), fetchArray(), fetchColumn(), fetchAssoc() methods to have the named parameter emulated by doctrine. + * + * Most parameters are input parameters, that is, parameters that are + * used in a read-only fashion to build up the query. Some drivers support the invocation + * of stored procedures that return data as output parameters, and some also as input/output + * parameters that both send in data and are updated to receive it. + * + * @param string|int $param Parameter identifier. For a prepared statement using named placeholders, + * this will be a parameter name of the form :name. For a prepared statement using + * question mark placeholders, this will be the 1-indexed position of the parameter. + * @param mixed $variable Name of the PHP variable to bind to the SQL statement parameter. + * @param int $type Explicit data type for the parameter using the {@link ParameterType} + * constants. + * @param int|null $length You must specify maxlength when using an OUT bind + * so that PHP allocates enough memory to hold the returned value. + * + * @return bool TRUE on success or FALSE on failure. + * + * @throws Exception + */ + public function bindParam($param, &$variable, $type = ParameterType::STRING, $length = null); + + /** + * Executes a prepared statement + * + * If the prepared statement included parameter markers, you must either: + * call {@link bindParam()} to bind PHP variables to the parameter markers: + * bound variables pass their value as input and receive the output value, + * if any, of their associated parameter markers or pass an array of input-only + * parameter values. + * + * @param mixed[]|null $params A numeric array of values with as many elements as there are + * bound parameters in the SQL statement being executed. + * + * @throws Exception + */ + public function execute($params = null): Result; +} diff --git a/app/vendor/doctrine/dbal/src/DriverManager.php b/app/vendor/doctrine/dbal/src/DriverManager.php new file mode 100644 index 000000000..58a0cc579 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/DriverManager.php @@ -0,0 +1,478 @@ +, + * driverClass?: class-string, + * driverOptions?: array, + * host?: string, + * password?: string, + * path?: string, + * pdo?: \PDO, + * platform?: Platforms\AbstractPlatform, + * port?: int, + * user?: string, + * } + * @psalm-type Params = array{ + * charset?: string, + * dbname?: string, + * default_dbname?: string, + * driver?: key-of, + * driverClass?: class-string, + * driverOptions?: array, + * host?: string, + * keepSlave?: bool, + * keepReplica?: bool, + * master?: OverrideParams, + * memory?: bool, + * password?: string, + * path?: string, + * pdo?: \PDO, + * platform?: Platforms\AbstractPlatform, + * port?: int, + * primary?: OverrideParams, + * replica?: array, + * sharding?: array, + * slaves?: array, + * user?: string, + * wrapperClass?: class-string, + * } + */ +final class DriverManager +{ + /** + * List of supported drivers and their mappings to the driver classes. + * + * To add your own driver use the 'driverClass' parameter to {@link DriverManager::getConnection()}. + */ + private const DRIVER_MAP = [ + 'pdo_mysql' => PDO\MySQL\Driver::class, + 'pdo_sqlite' => PDO\SQLite\Driver::class, + 'pdo_pgsql' => PDO\PgSQL\Driver::class, + 'pdo_oci' => PDO\OCI\Driver::class, + 'oci8' => OCI8\Driver::class, + 'ibm_db2' => IBMDB2\Driver::class, + 'pdo_sqlsrv' => PDO\SQLSrv\Driver::class, + 'mysqli' => Mysqli\Driver::class, + 'sqlsrv' => SQLSrv\Driver::class, + ]; + + /** + * List of URL schemes from a database URL and their mappings to driver. + * + * @var string[] + */ + private static $driverSchemeAliases = [ + 'db2' => 'ibm_db2', + 'mssql' => 'pdo_sqlsrv', + 'mysql' => 'pdo_mysql', + 'mysql2' => 'pdo_mysql', // Amazon RDS, for some weird reason + 'postgres' => 'pdo_pgsql', + 'postgresql' => 'pdo_pgsql', + 'pgsql' => 'pdo_pgsql', + 'sqlite' => 'pdo_sqlite', + 'sqlite3' => 'pdo_sqlite', + ]; + + /** + * Private constructor. This class cannot be instantiated. + * + * @codeCoverageIgnore + */ + private function __construct() + { + } + + /** + * Creates a connection object based on the specified parameters. + * This method returns a Doctrine\DBAL\Connection which wraps the underlying + * driver connection. + * + * $params must contain at least one of the following. + * + * Either 'driver' with one of the array keys of {@link DRIVER_MAP}, + * OR 'driverClass' that contains the full class name (with namespace) of the + * driver class to instantiate. + * + * Other (optional) parameters: + * + * user (string): + * The username to use when connecting. + * + * password (string): + * The password to use when connecting. + * + * driverOptions (array): + * Any additional driver-specific options for the driver. These are just passed + * through to the driver. + * + * wrapperClass: + * You may specify a custom wrapper class through the 'wrapperClass' + * parameter but this class MUST inherit from Doctrine\DBAL\Connection. + * + * driverClass: + * The driver class to use. + * + * @param array $params + * @param Configuration|null $config The configuration to use. + * @param EventManager|null $eventManager The event manager to use. + * @psalm-param array{ + * charset?: string, + * dbname?: string, + * default_dbname?: string, + * driver?: key-of, + * driverClass?: class-string, + * driverOptions?: array, + * host?: string, + * keepSlave?: bool, + * keepReplica?: bool, + * master?: OverrideParams, + * memory?: bool, + * password?: string, + * path?: string, + * pdo?: \PDO, + * platform?: Platforms\AbstractPlatform, + * port?: int, + * primary?: OverrideParams, + * replica?: array, + * sharding?: array, + * slaves?: array, + * user?: string, + * wrapperClass?: class-string, + * } $params + * @phpstan-param array $params + * + * @psalm-return ($params is array{wrapperClass:mixed} ? T : Connection) + * + * @throws Exception + * + * @template T of Connection + */ + public static function getConnection( + array $params, + ?Configuration $config = null, + ?EventManager $eventManager = null + ): Connection { + // create default config and event manager, if not set + if ($config === null) { + $config = new Configuration(); + } + + if ($eventManager === null) { + $eventManager = new EventManager(); + } + + $params = self::parseDatabaseUrl($params); + + // URL support for PrimaryReplicaConnection + if (isset($params['primary'])) { + $params['primary'] = self::parseDatabaseUrl($params['primary']); + } + + if (isset($params['replica'])) { + foreach ($params['replica'] as $key => $replicaParams) { + $params['replica'][$key] = self::parseDatabaseUrl($replicaParams); + } + } + + $driver = self::createDriver($params); + + foreach ($config->getMiddlewares() as $middleware) { + $driver = $middleware->wrap($driver); + } + + $wrapperClass = Connection::class; + if (isset($params['wrapperClass'])) { + if (! is_subclass_of($params['wrapperClass'], $wrapperClass)) { + throw Exception::invalidWrapperClass($params['wrapperClass']); + } + + /** @var class-string $wrapperClass */ + $wrapperClass = $params['wrapperClass']; + } + + return new $wrapperClass($params, $driver, $config, $eventManager); + } + + /** + * Returns the list of supported drivers. + * + * @return string[] + */ + public static function getAvailableDrivers(): array + { + return array_keys(self::DRIVER_MAP); + } + + /** + * @param array $params + * @psalm-param Params $params + * @phpstan-param array $params + * + * @throws Exception + */ + private static function createDriver(array $params): Driver + { + if (isset($params['driverClass'])) { + $interfaces = class_implements($params['driverClass']); + + if ($interfaces === false || ! in_array(Driver::class, $interfaces, true)) { + throw Exception::invalidDriverClass($params['driverClass']); + } + + return new $params['driverClass'](); + } + + if (isset($params['driver'])) { + if (! isset(self::DRIVER_MAP[$params['driver']])) { + throw Exception::unknownDriver($params['driver'], array_keys(self::DRIVER_MAP)); + } + + $class = self::DRIVER_MAP[$params['driver']]; + + return new $class(); + } + + throw Exception::driverRequired(); + } + + /** + * Normalizes the given connection URL path. + * + * @return string The normalized connection URL path + */ + private static function normalizeDatabaseUrlPath(string $urlPath): string + { + // Trim leading slash from URL path. + return substr($urlPath, 1); + } + + /** + * Extracts parts from a database URL, if present, and returns an + * updated list of parameters. + * + * @param mixed[] $params The list of parameters. + * @psalm-param Params $params + * @phpstan-param array $params + * + * @return mixed[] A modified list of parameters with info from a database + * URL extracted into indidivual parameter parts. + * @psalm-return Params + * @phpstan-return array + * + * @throws Exception + */ + private static function parseDatabaseUrl(array $params): array + { + if (! isset($params['url'])) { + return $params; + } + + // (pdo_)?sqlite3?:///... => (pdo_)?sqlite3?://localhost/... or else the URL will be invalid + $url = preg_replace('#^((?:pdo_)?sqlite3?):///#', '$1://localhost/', $params['url']); + assert(is_string($url)); + + $url = parse_url($url); + + if ($url === false) { + throw new Exception('Malformed parameter "url".'); + } + + foreach ($url as $param => $value) { + if (! is_string($value)) { + continue; + } + + $url[$param] = rawurldecode($value); + } + + $params = self::parseDatabaseUrlScheme($url['scheme'] ?? null, $params); + + if (isset($url['host'])) { + $params['host'] = $url['host']; + } + + if (isset($url['port'])) { + $params['port'] = $url['port']; + } + + if (isset($url['user'])) { + $params['user'] = $url['user']; + } + + if (isset($url['pass'])) { + $params['password'] = $url['pass']; + } + + $params = self::parseDatabaseUrlPath($url, $params); + $params = self::parseDatabaseUrlQuery($url, $params); + + return $params; + } + + /** + * Parses the given connection URL and resolves the given connection parameters. + * + * Assumes that the connection URL scheme is already parsed and resolved into the given connection parameters + * via {@link parseDatabaseUrlScheme}. + * + * @see parseDatabaseUrlScheme + * + * @param mixed[] $url The URL parts to evaluate. + * @param mixed[] $params The connection parameters to resolve. + * + * @return mixed[] The resolved connection parameters. + */ + private static function parseDatabaseUrlPath(array $url, array $params): array + { + if (! isset($url['path'])) { + return $params; + } + + $url['path'] = self::normalizeDatabaseUrlPath($url['path']); + + // If we do not have a known DBAL driver, we do not know any connection URL path semantics to evaluate + // and therefore treat the path as regular DBAL connection URL path. + if (! isset($params['driver'])) { + return self::parseRegularDatabaseUrlPath($url, $params); + } + + if (strpos($params['driver'], 'sqlite') !== false) { + return self::parseSqliteDatabaseUrlPath($url, $params); + } + + return self::parseRegularDatabaseUrlPath($url, $params); + } + + /** + * Parses the query part of the given connection URL and resolves the given connection parameters. + * + * @param mixed[] $url The connection URL parts to evaluate. + * @param mixed[] $params The connection parameters to resolve. + * + * @return mixed[] The resolved connection parameters. + */ + private static function parseDatabaseUrlQuery(array $url, array $params): array + { + if (! isset($url['query'])) { + return $params; + } + + $query = []; + + parse_str($url['query'], $query); // simply ingest query as extra params, e.g. charset or sslmode + + return array_merge($params, $query); // parse_str wipes existing array elements + } + + /** + * Parses the given regular connection URL and resolves the given connection parameters. + * + * Assumes that the "path" URL part is already normalized via {@link normalizeDatabaseUrlPath}. + * + * @see normalizeDatabaseUrlPath + * + * @param mixed[] $url The regular connection URL parts to evaluate. + * @param mixed[] $params The connection parameters to resolve. + * + * @return mixed[] The resolved connection parameters. + */ + private static function parseRegularDatabaseUrlPath(array $url, array $params): array + { + $params['dbname'] = $url['path']; + + return $params; + } + + /** + * Parses the given SQLite connection URL and resolves the given connection parameters. + * + * Assumes that the "path" URL part is already normalized via {@link normalizeDatabaseUrlPath}. + * + * @see normalizeDatabaseUrlPath + * + * @param mixed[] $url The SQLite connection URL parts to evaluate. + * @param mixed[] $params The connection parameters to resolve. + * + * @return mixed[] The resolved connection parameters. + */ + private static function parseSqliteDatabaseUrlPath(array $url, array $params): array + { + if ($url['path'] === ':memory:') { + $params['memory'] = true; + + return $params; + } + + $params['path'] = $url['path']; // pdo_sqlite driver uses 'path' instead of 'dbname' key + + return $params; + } + + /** + * Parses the scheme part from given connection URL and resolves the given connection parameters. + * + * @param string|null $scheme The connection URL scheme, if available + * @param mixed[] $params The connection parameters to resolve. + * + * @return mixed[] The resolved connection parameters. + * + * @throws Exception If parsing failed or resolution is not possible. + */ + private static function parseDatabaseUrlScheme(?string $scheme, array $params): array + { + if ($scheme !== null) { + // The requested driver from the URL scheme takes precedence + // over the default custom driver from the connection parameters (if any). + unset($params['driverClass']); + + // URL schemes must not contain underscores, but dashes are ok + $driver = str_replace('-', '_', $scheme); + + // The requested driver from the URL scheme takes precedence over the + // default driver from the connection parameters. If the driver is + // an alias (e.g. "postgres"), map it to the actual name ("pdo-pgsql"). + // Otherwise, let checkParams decide later if the driver exists. + $params['driver'] = self::$driverSchemeAliases[$driver] ?? $driver; + + return $params; + } + + // If a schemeless connection URL is given, we require a default driver or default custom driver + // as connection parameter. + if (! isset($params['driverClass']) && ! isset($params['driver'])) { + throw Exception::driverRequired($params['url']); + } + + return $params; + } +} diff --git a/app/vendor/doctrine/dbal/src/Event/ConnectionEventArgs.php b/app/vendor/doctrine/dbal/src/Event/ConnectionEventArgs.php new file mode 100644 index 000000000..eeddb91a5 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Event/ConnectionEventArgs.php @@ -0,0 +1,28 @@ +connection = $connection; + } + + /** + * @return Connection + */ + public function getConnection() + { + return $this->connection; + } +} diff --git a/app/vendor/doctrine/dbal/src/Event/Listeners/OracleSessionInit.php b/app/vendor/doctrine/dbal/src/Event/Listeners/OracleSessionInit.php new file mode 100644 index 000000000..d6d1fd9d1 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Event/Listeners/OracleSessionInit.php @@ -0,0 +1,77 @@ + 'HH24:MI:SS', + 'NLS_DATE_FORMAT' => 'YYYY-MM-DD HH24:MI:SS', + 'NLS_TIMESTAMP_FORMAT' => 'YYYY-MM-DD HH24:MI:SS', + 'NLS_TIMESTAMP_TZ_FORMAT' => 'YYYY-MM-DD HH24:MI:SS TZH:TZM', + 'NLS_NUMERIC_CHARACTERS' => '.,', + ]; + + /** + * @param string[] $oracleSessionVars + */ + public function __construct(array $oracleSessionVars = []) + { + $this->_defaultSessionVars = array_merge($this->_defaultSessionVars, $oracleSessionVars); + } + + /** + * @return void + * + * @throws Exception + */ + public function postConnect(ConnectionEventArgs $args) + { + if (count($this->_defaultSessionVars) === 0) { + return; + } + + $vars = []; + foreach (array_change_key_case($this->_defaultSessionVars, CASE_UPPER) as $option => $value) { + if ($option === 'CURRENT_SCHEMA') { + $vars[] = $option . ' = ' . $value; + } else { + $vars[] = $option . " = '" . $value . "'"; + } + } + + $sql = 'ALTER SESSION SET ' . implode(' ', $vars); + $args->getConnection()->executeStatement($sql); + } + + /** + * {@inheritdoc} + */ + public function getSubscribedEvents() + { + return [Events::postConnect]; + } +} diff --git a/app/vendor/doctrine/dbal/src/Event/Listeners/SQLSessionInit.php b/app/vendor/doctrine/dbal/src/Event/Listeners/SQLSessionInit.php new file mode 100644 index 000000000..f7a4e9129 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Event/Listeners/SQLSessionInit.php @@ -0,0 +1,43 @@ +sql = $sql; + } + + /** + * @return void + * + * @throws Exception + */ + public function postConnect(ConnectionEventArgs $args) + { + $args->getConnection()->executeStatement($this->sql); + } + + /** + * {@inheritdoc} + */ + public function getSubscribedEvents() + { + return [Events::postConnect]; + } +} diff --git a/app/vendor/doctrine/dbal/src/Event/SchemaAlterTableAddColumnEventArgs.php b/app/vendor/doctrine/dbal/src/Event/SchemaAlterTableAddColumnEventArgs.php new file mode 100644 index 000000000..e61a48d06 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Event/SchemaAlterTableAddColumnEventArgs.php @@ -0,0 +1,92 @@ +column = $column; + $this->tableDiff = $tableDiff; + $this->platform = $platform; + } + + /** + * @return Column + */ + public function getColumn() + { + return $this->column; + } + + /** + * @return TableDiff + */ + public function getTableDiff() + { + return $this->tableDiff; + } + + /** + * @return AbstractPlatform + */ + public function getPlatform() + { + return $this->platform; + } + + /** + * Passing multiple SQL statements as an array is deprecated. Pass each statement as an individual argument instead. + * + * @param string|string[] $sql + * + * @return SchemaAlterTableAddColumnEventArgs + */ + public function addSql($sql) + { + if (is_array($sql)) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/3580', + 'Passing multiple SQL statements as an array to SchemaAlterTableAddColumnEventaArrgs::addSql() ' . + 'is deprecated. Pass each statement as an individual argument instead.' + ); + } + + $this->sql = array_merge($this->sql, is_array($sql) ? $sql : func_get_args()); + + return $this; + } + + /** + * @return string[] + */ + public function getSql() + { + return $this->sql; + } +} diff --git a/app/vendor/doctrine/dbal/src/Event/SchemaAlterTableChangeColumnEventArgs.php b/app/vendor/doctrine/dbal/src/Event/SchemaAlterTableChangeColumnEventArgs.php new file mode 100644 index 000000000..e9ebb66ce --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Event/SchemaAlterTableChangeColumnEventArgs.php @@ -0,0 +1,82 @@ +columnDiff = $columnDiff; + $this->tableDiff = $tableDiff; + $this->platform = $platform; + } + + /** + * @return ColumnDiff + */ + public function getColumnDiff() + { + return $this->columnDiff; + } + + /** + * @return TableDiff + */ + public function getTableDiff() + { + return $this->tableDiff; + } + + /** + * @return AbstractPlatform + */ + public function getPlatform() + { + return $this->platform; + } + + /** + * Passing multiple SQL statements as an array is deprecated. Pass each statement as an individual argument instead. + * + * @param string|string[] $sql + * + * @return SchemaAlterTableChangeColumnEventArgs + */ + public function addSql($sql) + { + $this->sql = array_merge($this->sql, is_array($sql) ? $sql : func_get_args()); + + return $this; + } + + /** + * @return string[] + */ + public function getSql() + { + return $this->sql; + } +} diff --git a/app/vendor/doctrine/dbal/src/Event/SchemaAlterTableEventArgs.php b/app/vendor/doctrine/dbal/src/Event/SchemaAlterTableEventArgs.php new file mode 100644 index 000000000..9c2b9b31e --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Event/SchemaAlterTableEventArgs.php @@ -0,0 +1,69 @@ +tableDiff = $tableDiff; + $this->platform = $platform; + } + + /** + * @return TableDiff + */ + public function getTableDiff() + { + return $this->tableDiff; + } + + /** + * @return AbstractPlatform + */ + public function getPlatform() + { + return $this->platform; + } + + /** + * Passing multiple SQL statements as an array is deprecated. Pass each statement as an individual argument instead. + * + * @param string|string[] $sql + * + * @return SchemaAlterTableEventArgs + */ + public function addSql($sql) + { + $this->sql = array_merge($this->sql, is_array($sql) ? $sql : func_get_args()); + + return $this; + } + + /** + * @return string[] + */ + public function getSql() + { + return $this->sql; + } +} diff --git a/app/vendor/doctrine/dbal/src/Event/SchemaAlterTableRemoveColumnEventArgs.php b/app/vendor/doctrine/dbal/src/Event/SchemaAlterTableRemoveColumnEventArgs.php new file mode 100644 index 000000000..d32af5975 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Event/SchemaAlterTableRemoveColumnEventArgs.php @@ -0,0 +1,82 @@ +column = $column; + $this->tableDiff = $tableDiff; + $this->platform = $platform; + } + + /** + * @return Column + */ + public function getColumn() + { + return $this->column; + } + + /** + * @return TableDiff + */ + public function getTableDiff() + { + return $this->tableDiff; + } + + /** + * @return AbstractPlatform + */ + public function getPlatform() + { + return $this->platform; + } + + /** + * Passing multiple SQL statements as an array is deprecated. Pass each statement as an individual argument instead. + * + * @param string|string[] $sql + * + * @return SchemaAlterTableRemoveColumnEventArgs + */ + public function addSql($sql) + { + $this->sql = array_merge($this->sql, is_array($sql) ? $sql : func_get_args()); + + return $this; + } + + /** + * @return string[] + */ + public function getSql() + { + return $this->sql; + } +} diff --git a/app/vendor/doctrine/dbal/src/Event/SchemaAlterTableRenameColumnEventArgs.php b/app/vendor/doctrine/dbal/src/Event/SchemaAlterTableRenameColumnEventArgs.php new file mode 100644 index 000000000..6d52b6c0d --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Event/SchemaAlterTableRenameColumnEventArgs.php @@ -0,0 +1,97 @@ +oldColumnName = $oldColumnName; + $this->column = $column; + $this->tableDiff = $tableDiff; + $this->platform = $platform; + } + + /** + * @return string + */ + public function getOldColumnName() + { + return $this->oldColumnName; + } + + /** + * @return Column + */ + public function getColumn() + { + return $this->column; + } + + /** + * @return TableDiff + */ + public function getTableDiff() + { + return $this->tableDiff; + } + + /** + * @return AbstractPlatform + */ + public function getPlatform() + { + return $this->platform; + } + + /** + * Passing multiple SQL statements as an array is deprecated. Pass each statement as an individual argument instead. + * + * @param string|string[] $sql + * + * @return SchemaAlterTableRenameColumnEventArgs + */ + public function addSql($sql) + { + $this->sql = array_merge($this->sql, is_array($sql) ? $sql : func_get_args()); + + return $this; + } + + /** + * @return string[] + */ + public function getSql() + { + return $this->sql; + } +} diff --git a/app/vendor/doctrine/dbal/src/Event/SchemaColumnDefinitionEventArgs.php b/app/vendor/doctrine/dbal/src/Event/SchemaColumnDefinitionEventArgs.php new file mode 100644 index 000000000..58efa7b50 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Event/SchemaColumnDefinitionEventArgs.php @@ -0,0 +1,97 @@ +tableColumn = $tableColumn; + $this->table = $table; + $this->database = $database; + $this->connection = $connection; + } + + /** + * Allows to clear the column which means the column will be excluded from + * tables column list. + * + * @return SchemaColumnDefinitionEventArgs + */ + public function setColumn(?Column $column = null) + { + $this->column = $column; + + return $this; + } + + /** + * @return Column|null + */ + public function getColumn() + { + return $this->column; + } + + /** + * @return mixed[] + */ + public function getTableColumn() + { + return $this->tableColumn; + } + + /** + * @return string + */ + public function getTable() + { + return $this->table; + } + + /** + * @return string + */ + public function getDatabase() + { + return $this->database; + } + + /** + * @return Connection + */ + public function getConnection() + { + return $this->connection; + } +} diff --git a/app/vendor/doctrine/dbal/src/Event/SchemaCreateTableColumnEventArgs.php b/app/vendor/doctrine/dbal/src/Event/SchemaCreateTableColumnEventArgs.php new file mode 100644 index 000000000..246d2de07 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Event/SchemaCreateTableColumnEventArgs.php @@ -0,0 +1,82 @@ +column = $column; + $this->table = $table; + $this->platform = $platform; + } + + /** + * @return Column + */ + public function getColumn() + { + return $this->column; + } + + /** + * @return Table + */ + public function getTable() + { + return $this->table; + } + + /** + * @return AbstractPlatform + */ + public function getPlatform() + { + return $this->platform; + } + + /** + * Passing multiple SQL statements as an array is deprecated. Pass each statement as an individual argument instead. + * + * @param string|string[] $sql + * + * @return SchemaCreateTableColumnEventArgs + */ + public function addSql($sql) + { + $this->sql = array_merge($this->sql, is_array($sql) ? $sql : func_get_args()); + + return $this; + } + + /** + * @return string[] + */ + public function getSql() + { + return $this->sql; + } +} diff --git a/app/vendor/doctrine/dbal/src/Event/SchemaCreateTableEventArgs.php b/app/vendor/doctrine/dbal/src/Event/SchemaCreateTableEventArgs.php new file mode 100644 index 000000000..e9829a645 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Event/SchemaCreateTableEventArgs.php @@ -0,0 +1,97 @@ +table = $table; + $this->columns = $columns; + $this->options = $options; + $this->platform = $platform; + } + + /** + * @return Table + */ + public function getTable() + { + return $this->table; + } + + /** + * @return mixed[][] + */ + public function getColumns() + { + return $this->columns; + } + + /** + * @return mixed[] + */ + public function getOptions() + { + return $this->options; + } + + /** + * @return AbstractPlatform + */ + public function getPlatform() + { + return $this->platform; + } + + /** + * Passing multiple SQL statements as an array is deprecated. Pass each statement as an individual argument instead. + * + * @param string|string[] $sql + * + * @return SchemaCreateTableEventArgs + */ + public function addSql($sql) + { + $this->sql = array_merge($this->sql, is_array($sql) ? $sql : func_get_args()); + + return $this; + } + + /** + * @return string[] + */ + public function getSql() + { + return $this->sql; + } +} diff --git a/app/vendor/doctrine/dbal/src/Event/SchemaDropTableEventArgs.php b/app/vendor/doctrine/dbal/src/Event/SchemaDropTableEventArgs.php new file mode 100644 index 000000000..072e1efb9 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Event/SchemaDropTableEventArgs.php @@ -0,0 +1,69 @@ +table = $table; + $this->platform = $platform; + } + + /** + * @return string|Table + */ + public function getTable() + { + return $this->table; + } + + /** + * @return AbstractPlatform + */ + public function getPlatform() + { + return $this->platform; + } + + /** + * @param string $sql + * + * @return SchemaDropTableEventArgs + */ + public function setSql($sql) + { + $this->sql = $sql; + + return $this; + } + + /** + * @return string|null + */ + public function getSql() + { + return $this->sql; + } +} diff --git a/app/vendor/doctrine/dbal/src/Event/SchemaEventArgs.php b/app/vendor/doctrine/dbal/src/Event/SchemaEventArgs.php new file mode 100644 index 000000000..df2bdae09 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Event/SchemaEventArgs.php @@ -0,0 +1,32 @@ +preventDefault = true; + + return $this; + } + + /** + * @return bool + */ + public function isDefaultPrevented() + { + return $this->preventDefault; + } +} diff --git a/app/vendor/doctrine/dbal/src/Event/SchemaIndexDefinitionEventArgs.php b/app/vendor/doctrine/dbal/src/Event/SchemaIndexDefinitionEventArgs.php new file mode 100644 index 000000000..82c17a26a --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Event/SchemaIndexDefinitionEventArgs.php @@ -0,0 +1,83 @@ +tableIndex = $tableIndex; + $this->table = $table; + $this->connection = $connection; + } + + /** + * Allows to clear the index which means the index will be excluded from tables index list. + * + * @return SchemaIndexDefinitionEventArgs + */ + public function setIndex(?Index $index = null) + { + $this->index = $index; + + return $this; + } + + /** + * @return Index|null + */ + public function getIndex() + { + return $this->index; + } + + /** + * @return mixed[] + */ + public function getTableIndex() + { + return $this->tableIndex; + } + + /** + * @return string + */ + public function getTable() + { + return $this->table; + } + + /** + * @return Connection + */ + public function getConnection() + { + return $this->connection; + } +} diff --git a/app/vendor/doctrine/dbal/src/Events.php b/app/vendor/doctrine/dbal/src/Events.php new file mode 100644 index 000000000..de30815ca --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Events.php @@ -0,0 +1,33 @@ +getMessage(); + } else { + $message = 'An exception occurred in the driver: ' . $driverException->getMessage(); + } + + parent::__construct($message, $driverException->getCode(), $driverException); + + $this->query = $query; + } + + /** + * {@inheritDoc} + */ + public function getSQLState() + { + $previous = $this->getPrevious(); + assert($previous instanceof TheDriverException); + + return $previous->getSQLState(); + } + + public function getQuery(): ?Query + { + return $this->query; + } +} diff --git a/app/vendor/doctrine/dbal/src/Exception/ForeignKeyConstraintViolationException.php b/app/vendor/doctrine/dbal/src/Exception/ForeignKeyConstraintViolationException.php new file mode 100644 index 000000000..f1a612b21 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Exception/ForeignKeyConstraintViolationException.php @@ -0,0 +1,12 @@ +|array */ + private $originalParameters; + + /** @var array|array */ + private $originalTypes; + + /** @var int */ + private $originalParameterIndex = 0; + + /** @var list */ + private $convertedSQL = []; + + /** @var list */ + private $convertedParameteres = []; + + /** @var array */ + private $convertedTypes = []; + + /** + * @param array|array $parameters + * @param array|array $types + */ + public function __construct(array $parameters, array $types) + { + $this->originalParameters = $parameters; + $this->originalTypes = $types; + } + + public function acceptPositionalParameter(string $sql): void + { + $index = $this->originalParameterIndex; + + if (! array_key_exists($index, $this->originalParameters)) { + throw MissingPositionalParameter::new($index); + } + + $this->acceptParameter($index, $this->originalParameters[$index]); + + $this->originalParameterIndex++; + } + + public function acceptNamedParameter(string $sql): void + { + $name = substr($sql, 1); + + if (! array_key_exists($name, $this->originalParameters)) { + throw MissingNamedParameter::new($name); + } + + $this->acceptParameter($name, $this->originalParameters[$name]); + } + + public function acceptOther(string $sql): void + { + $this->convertedSQL[] = $sql; + } + + public function getSQL(): string + { + return implode('', $this->convertedSQL); + } + + /** + * @return list + */ + public function getParameters(): array + { + return $this->convertedParameteres; + } + + /** + * @param int|string $key + * @param mixed $value + */ + private function acceptParameter($key, $value): void + { + if (! isset($this->originalTypes[$key])) { + $this->convertedSQL[] = '?'; + $this->convertedParameteres[] = $value; + + return; + } + + $type = $this->originalTypes[$key]; + + if ($type !== Connection::PARAM_INT_ARRAY && $type !== Connection::PARAM_STR_ARRAY) { + $this->appendTypedParameter([$value], $type); + + return; + } + + if (count($value) === 0) { + $this->convertedSQL[] = 'NULL'; + + return; + } + + $this->appendTypedParameter($value, $type - Connection::ARRAY_PARAM_OFFSET); + } + + /** + * @return array + */ + public function getTypes(): array + { + return $this->convertedTypes; + } + + /** + * @param list $values + * @param Type|int|string|null $type + */ + private function appendTypedParameter(array $values, $type): void + { + $this->convertedSQL[] = implode(', ', array_fill(0, count($values), '?')); + + $index = count($this->convertedParameteres); + + foreach ($values as $value) { + $this->convertedParameteres[] = $value; + $this->convertedTypes[$index] = $type; + + $index++; + } + } +} diff --git a/app/vendor/doctrine/dbal/src/FetchMode.php b/app/vendor/doctrine/dbal/src/FetchMode.php new file mode 100644 index 000000000..79fa6a3f3 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/FetchMode.php @@ -0,0 +1,16 @@ +getDriver() instanceof Driver\PDO\SQLite\Driver) { + throw new Exception('Cannot use TableGenerator with SQLite.'); + } + + $this->conn = DriverManager::getConnection( + $conn->getParams(), + $conn->getConfiguration(), + $conn->getEventManager() + ); + + $this->generatorTableName = $generatorTableName; + } + + /** + * Generates the next unused value for the given sequence name. + * + * @param string $sequence + * + * @return int + * + * @throws Exception + */ + public function nextValue($sequence) + { + if (isset($this->sequences[$sequence])) { + $value = $this->sequences[$sequence]['value']; + $this->sequences[$sequence]['value']++; + if ($this->sequences[$sequence]['value'] >= $this->sequences[$sequence]['max']) { + unset($this->sequences[$sequence]); + } + + return $value; + } + + $this->conn->beginTransaction(); + + try { + $platform = $this->conn->getDatabasePlatform(); + $sql = 'SELECT sequence_value, sequence_increment_by' + . ' FROM ' . $platform->appendLockHint($this->generatorTableName, LockMode::PESSIMISTIC_WRITE) + . ' WHERE sequence_name = ? ' . $platform->getWriteLockSQL(); + $row = $this->conn->fetchAssociative($sql, [$sequence]); + + if ($row !== false) { + $row = array_change_key_case($row, CASE_LOWER); + + $value = $row['sequence_value']; + $value++; + + assert(is_int($value)); + + if ($row['sequence_increment_by'] > 1) { + $this->sequences[$sequence] = [ + 'value' => $value, + 'max' => $row['sequence_value'] + $row['sequence_increment_by'], + ]; + } + + $sql = 'UPDATE ' . $this->generatorTableName . ' ' . + 'SET sequence_value = sequence_value + sequence_increment_by ' . + 'WHERE sequence_name = ? AND sequence_value = ?'; + $rows = $this->conn->executeStatement($sql, [$sequence, $row['sequence_value']]); + + if ($rows !== 1) { + throw new Exception('Race-condition detected while updating sequence. Aborting generation'); + } + } else { + $this->conn->insert( + $this->generatorTableName, + ['sequence_name' => $sequence, 'sequence_value' => 1, 'sequence_increment_by' => 1] + ); + $value = 1; + } + + $this->conn->commit(); + } catch (Throwable $e) { + $this->conn->rollBack(); + + throw new Exception( + 'Error occurred while generating ID with TableGenerator, aborted generation: ' . $e->getMessage(), + 0, + $e + ); + } + + return $value; + } +} diff --git a/app/vendor/doctrine/dbal/src/Id/TableGeneratorSchemaVisitor.php b/app/vendor/doctrine/dbal/src/Id/TableGeneratorSchemaVisitor.php new file mode 100644 index 000000000..3ec22f37c --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Id/TableGeneratorSchemaVisitor.php @@ -0,0 +1,71 @@ +generatorTableName = $generatorTableName; + } + + /** + * {@inheritdoc} + */ + public function acceptSchema(Schema $schema) + { + $table = $schema->createTable($this->generatorTableName); + $table->addColumn('sequence_name', 'string'); + $table->addColumn('sequence_value', 'integer', ['default' => 1]); + $table->addColumn('sequence_increment_by', 'integer', ['default' => 1]); + } + + /** + * {@inheritdoc} + */ + public function acceptTable(Table $table) + { + } + + /** + * {@inheritdoc} + */ + public function acceptColumn(Table $table, Column $column) + { + } + + /** + * {@inheritdoc} + */ + public function acceptForeignKey(Table $localTable, ForeignKeyConstraint $fkConstraint) + { + } + + /** + * {@inheritdoc} + */ + public function acceptIndex(Table $table, Index $index) + { + } + + /** + * {@inheritdoc} + */ + public function acceptSequence(Sequence $sequence) + { + } +} diff --git a/app/vendor/doctrine/dbal/src/LockMode.php b/app/vendor/doctrine/dbal/src/LockMode.php new file mode 100644 index 000000000..1a7ed2397 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/LockMode.php @@ -0,0 +1,23 @@ +> + */ + public $queries = []; + + /** + * If Debug Stack is enabled (log queries) or not. + * + * @var bool + */ + public $enabled = true; + + /** @var float|null */ + public $start = null; + + /** @var int */ + public $currentQuery = 0; + + /** + * {@inheritdoc} + */ + public function startQuery($sql, ?array $params = null, ?array $types = null) + { + if (! $this->enabled) { + return; + } + + $this->start = microtime(true); + + $this->queries[++$this->currentQuery] = [ + 'sql' => $sql, + 'params' => $params, + 'types' => $types, + 'executionMS' => 0, + ]; + } + + /** + * {@inheritdoc} + */ + public function stopQuery() + { + if (! $this->enabled) { + return; + } + + $this->queries[$this->currentQuery]['executionMS'] = microtime(true) - $this->start; + } +} diff --git a/app/vendor/doctrine/dbal/src/Logging/LoggerChain.php b/app/vendor/doctrine/dbal/src/Logging/LoggerChain.php new file mode 100644 index 000000000..9b44dc0e3 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Logging/LoggerChain.php @@ -0,0 +1,40 @@ + */ + private $loggers; + + /** + * @param iterable $loggers + */ + public function __construct(iterable $loggers = []) + { + $this->loggers = $loggers; + } + + /** + * {@inheritdoc} + */ + public function startQuery($sql, ?array $params = null, ?array $types = null) + { + foreach ($this->loggers as $logger) { + $logger->startQuery($sql, $params, $types); + } + } + + /** + * {@inheritdoc} + */ + public function stopQuery() + { + foreach ($this->loggers as $logger) { + $logger->stopQuery(); + } + } +} diff --git a/app/vendor/doctrine/dbal/src/Logging/SQLLogger.php b/app/vendor/doctrine/dbal/src/Logging/SQLLogger.php new file mode 100644 index 000000000..a0bdf1bf6 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Logging/SQLLogger.php @@ -0,0 +1,29 @@ +|array|null $params Statement parameters + * @param array|array|null $types Parameter types + * + * @return void + */ + public function startQuery($sql, ?array $params = null, ?array $types = null); + + /** + * Marks the last started query as stopped. This can be used for timing of queries. + * + * @return void + */ + public function stopQuery(); +} diff --git a/app/vendor/doctrine/dbal/src/ParameterType.php b/app/vendor/doctrine/dbal/src/ParameterType.php new file mode 100644 index 000000000..77917e870 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/ParameterType.php @@ -0,0 +1,57 @@ +_eventManager = $eventManager; + } + + /** + * Gets the EventManager used by the Platform. + * + * @return EventManager|null + */ + public function getEventManager() + { + return $this->_eventManager; + } + + /** + * Returns the SQL snippet that declares a boolean column. + * + * @param mixed[] $column + * + * @return string + */ + abstract public function getBooleanTypeDeclarationSQL(array $column); + + /** + * Returns the SQL snippet that declares a 4 byte integer column. + * + * @param mixed[] $column + * + * @return string + */ + abstract public function getIntegerTypeDeclarationSQL(array $column); + + /** + * Returns the SQL snippet that declares an 8 byte integer column. + * + * @param mixed[] $column + * + * @return string + */ + abstract public function getBigIntTypeDeclarationSQL(array $column); + + /** + * Returns the SQL snippet that declares a 2 byte integer column. + * + * @param mixed[] $column + * + * @return string + */ + abstract public function getSmallIntTypeDeclarationSQL(array $column); + + /** + * Returns the SQL snippet that declares common properties of an integer column. + * + * @param mixed[] $column + * + * @return string + */ + abstract protected function _getCommonIntegerTypeDeclarationSQL(array $column); + + /** + * Lazy load Doctrine Type Mappings. + * + * @return void + */ + abstract protected function initializeDoctrineTypeMappings(); + + /** + * Initializes Doctrine Type Mappings with the platform defaults + * and with all additional type mappings. + * + * @return void + */ + private function initializeAllDoctrineTypeMappings() + { + $this->initializeDoctrineTypeMappings(); + + foreach (Type::getTypesMap() as $typeName => $className) { + foreach (Type::getType($typeName)->getMappedDatabaseTypes($this) as $dbType) { + $this->doctrineTypeMapping[$dbType] = $typeName; + } + } + } + + /** + * Returns the SQL snippet used to declare a column that can + * store characters in the ASCII character set + * + * @param mixed[] $column + */ + public function getAsciiStringTypeDeclarationSQL(array $column): string + { + return $this->getVarcharTypeDeclarationSQL($column); + } + + /** + * Returns the SQL snippet used to declare a VARCHAR column type. + * + * @param mixed[] $column + * + * @return string + */ + public function getVarcharTypeDeclarationSQL(array $column) + { + if (! isset($column['length'])) { + $column['length'] = $this->getVarcharDefaultLength(); + } + + $fixed = $column['fixed'] ?? false; + + $maxLength = $fixed + ? $this->getCharMaxLength() + : $this->getVarcharMaxLength(); + + if ($column['length'] > $maxLength) { + return $this->getClobTypeDeclarationSQL($column); + } + + return $this->getVarcharTypeDeclarationSQLSnippet($column['length'], $fixed); + } + + /** + * Returns the SQL snippet used to declare a BINARY/VARBINARY column type. + * + * @param mixed[] $column The column definition. + * + * @return string + */ + public function getBinaryTypeDeclarationSQL(array $column) + { + if (! isset($column['length'])) { + $column['length'] = $this->getBinaryDefaultLength(); + } + + $fixed = $column['fixed'] ?? false; + + $maxLength = $this->getBinaryMaxLength(); + + if ($column['length'] > $maxLength) { + if ($maxLength > 0) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/3187', + 'Binary column length %d is greater than supported by the platform (%d).' + . ' Reduce the column length or use a BLOB column instead.', + $column['length'], + $maxLength + ); + } + + return $this->getBlobTypeDeclarationSQL($column); + } + + return $this->getBinaryTypeDeclarationSQLSnippet($column['length'], $fixed); + } + + /** + * Returns the SQL snippet to declare a GUID/UUID column. + * + * By default this maps directly to a CHAR(36) and only maps to more + * special datatypes when the underlying databases support this datatype. + * + * @param mixed[] $column + * + * @return string + */ + public function getGuidTypeDeclarationSQL(array $column) + { + $column['length'] = 36; + $column['fixed'] = true; + + return $this->getVarcharTypeDeclarationSQL($column); + } + + /** + * Returns the SQL snippet to declare a JSON column. + * + * By default this maps directly to a CLOB and only maps to more + * special datatypes when the underlying databases support this datatype. + * + * @param mixed[] $column + * + * @return string + */ + public function getJsonTypeDeclarationSQL(array $column) + { + return $this->getClobTypeDeclarationSQL($column); + } + + /** + * @param int|false $length + * @param bool $fixed + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + protected function getVarcharTypeDeclarationSQLSnippet($length, $fixed) + { + throw Exception::notSupported('VARCHARs not supported by Platform.'); + } + + /** + * Returns the SQL snippet used to declare a BINARY/VARBINARY column type. + * + * @param int|false $length The length of the column. + * @param bool $fixed Whether the column length is fixed. + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + protected function getBinaryTypeDeclarationSQLSnippet($length, $fixed) + { + throw Exception::notSupported('BINARY/VARBINARY column types are not supported by this platform.'); + } + + /** + * Returns the SQL snippet used to declare a CLOB column type. + * + * @param mixed[] $column + * + * @return string + */ + abstract public function getClobTypeDeclarationSQL(array $column); + + /** + * Returns the SQL Snippet used to declare a BLOB column type. + * + * @param mixed[] $column + * + * @return string + */ + abstract public function getBlobTypeDeclarationSQL(array $column); + + /** + * Gets the name of the platform. + * + * @return string + */ + abstract public function getName(); + + /** + * Registers a doctrine type to be used in conjunction with a column type of this platform. + * + * @param string $dbType + * @param string $doctrineType + * + * @return void + * + * @throws Exception If the type is not found. + */ + public function registerDoctrineTypeMapping($dbType, $doctrineType) + { + if ($this->doctrineTypeMapping === null) { + $this->initializeAllDoctrineTypeMappings(); + } + + if (! Types\Type::hasType($doctrineType)) { + throw Exception::typeNotFound($doctrineType); + } + + $dbType = strtolower($dbType); + $this->doctrineTypeMapping[$dbType] = $doctrineType; + + $doctrineType = Type::getType($doctrineType); + + if (! $doctrineType->requiresSQLCommentHint($this)) { + return; + } + + $this->markDoctrineTypeCommented($doctrineType); + } + + /** + * Gets the Doctrine type that is mapped for the given database column type. + * + * @param string $dbType + * + * @return string + * + * @throws Exception + */ + public function getDoctrineTypeMapping($dbType) + { + if ($this->doctrineTypeMapping === null) { + $this->initializeAllDoctrineTypeMappings(); + } + + $dbType = strtolower($dbType); + + if (! isset($this->doctrineTypeMapping[$dbType])) { + throw new Exception( + 'Unknown database type ' . $dbType . ' requested, ' . static::class . ' may not support it.' + ); + } + + return $this->doctrineTypeMapping[$dbType]; + } + + /** + * Checks if a database type is currently supported by this platform. + * + * @param string $dbType + * + * @return bool + */ + public function hasDoctrineTypeMappingFor($dbType) + { + if ($this->doctrineTypeMapping === null) { + $this->initializeAllDoctrineTypeMappings(); + } + + $dbType = strtolower($dbType); + + return isset($this->doctrineTypeMapping[$dbType]); + } + + /** + * Initializes the Doctrine Type comments instance variable for in_array() checks. + * + * @return void + */ + protected function initializeCommentedDoctrineTypes() + { + $this->doctrineTypeComments = []; + + foreach (Type::getTypesMap() as $typeName => $className) { + $type = Type::getType($typeName); + + if (! $type->requiresSQLCommentHint($this)) { + continue; + } + + $this->doctrineTypeComments[] = $typeName; + } + } + + /** + * Is it necessary for the platform to add a parsable type comment to allow reverse engineering the given type? + * + * @return bool + */ + public function isCommentedDoctrineType(Type $doctrineType) + { + if ($this->doctrineTypeComments === null) { + $this->initializeCommentedDoctrineTypes(); + } + + assert(is_array($this->doctrineTypeComments)); + + return in_array($doctrineType->getName(), $this->doctrineTypeComments, true); + } + + /** + * Marks this type as to be commented in ALTER TABLE and CREATE TABLE statements. + * + * @param string|Type $doctrineType + * + * @return void + */ + public function markDoctrineTypeCommented($doctrineType) + { + if ($this->doctrineTypeComments === null) { + $this->initializeCommentedDoctrineTypes(); + } + + assert(is_array($this->doctrineTypeComments)); + + $this->doctrineTypeComments[] = $doctrineType instanceof Type ? $doctrineType->getName() : $doctrineType; + } + + /** + * Gets the comment to append to a column comment that helps parsing this type in reverse engineering. + * + * @return string + */ + public function getDoctrineTypeComment(Type $doctrineType) + { + return '(DC2Type:' . $doctrineType->getName() . ')'; + } + + /** + * Gets the comment of a passed column modified by potential doctrine type comment hints. + * + * @return string|null + */ + protected function getColumnComment(Column $column) + { + $comment = $column->getComment(); + + if ($this->isCommentedDoctrineType($column->getType())) { + $comment .= $this->getDoctrineTypeComment($column->getType()); + } + + return $comment; + } + + /** + * Gets the character used for identifier quoting. + * + * @return string + */ + public function getIdentifierQuoteCharacter() + { + return '"'; + } + + /** + * Gets the string portion that starts an SQL comment. + * + * @return string + */ + public function getSqlCommentStartString() + { + return '--'; + } + + /** + * Gets the string portion that ends an SQL comment. + * + * @return string + */ + public function getSqlCommentEndString() + { + return "\n"; + } + + /** + * Gets the maximum length of a char column. + */ + public function getCharMaxLength(): int + { + return $this->getVarcharMaxLength(); + } + + /** + * Gets the maximum length of a varchar column. + * + * @return int + */ + public function getVarcharMaxLength() + { + return 4000; + } + + /** + * Gets the default length of a varchar column. + * + * @return int + */ + public function getVarcharDefaultLength() + { + return 255; + } + + /** + * Gets the maximum length of a binary column. + * + * @return int + */ + public function getBinaryMaxLength() + { + return 4000; + } + + /** + * Gets the default length of a binary column. + * + * @return int + */ + public function getBinaryDefaultLength() + { + return 255; + } + + /** + * Gets all SQL wildcard characters of the platform. + * + * @return string[] + */ + public function getWildcards() + { + return ['%', '_']; + } + + /** + * Returns the regular expression operator. + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getRegexpExpression() + { + throw Exception::notSupported(__METHOD__); + } + + /** + * Returns the SQL snippet to get the average value of a column. + * + * @param string $column The column to use. + * + * @return string Generated SQL including an AVG aggregate function. + */ + public function getAvgExpression($column) + { + return 'AVG(' . $column . ')'; + } + + /** + * Returns the SQL snippet to get the number of rows (without a NULL value) of a column. + * + * If a '*' is used instead of a column the number of selected rows is returned. + * + * @param string|int $column The column to use. + * + * @return string Generated SQL including a COUNT aggregate function. + */ + public function getCountExpression($column) + { + return 'COUNT(' . $column . ')'; + } + + /** + * Returns the SQL snippet to get the highest value of a column. + * + * @param string $column The column to use. + * + * @return string Generated SQL including a MAX aggregate function. + */ + public function getMaxExpression($column) + { + return 'MAX(' . $column . ')'; + } + + /** + * Returns the SQL snippet to get the lowest value of a column. + * + * @param string $column The column to use. + * + * @return string Generated SQL including a MIN aggregate function. + */ + public function getMinExpression($column) + { + return 'MIN(' . $column . ')'; + } + + /** + * Returns the SQL snippet to get the total sum of a column. + * + * @param string $column The column to use. + * + * @return string Generated SQL including a SUM aggregate function. + */ + public function getSumExpression($column) + { + return 'SUM(' . $column . ')'; + } + + // scalar functions + + /** + * Returns the SQL snippet to get the md5 sum of a column. + * + * Note: Not SQL92, but common functionality. + * + * @param string $column + * + * @return string + */ + public function getMd5Expression($column) + { + return 'MD5(' . $column . ')'; + } + + /** + * Returns the SQL snippet to get the length of a text column. + * + * @param string $column + * + * @return string + */ + public function getLengthExpression($column) + { + return 'LENGTH(' . $column . ')'; + } + + /** + * Returns the SQL snippet to get the squared value of a column. + * + * @param string $column The column to use. + * + * @return string Generated SQL including an SQRT aggregate function. + */ + public function getSqrtExpression($column) + { + return 'SQRT(' . $column . ')'; + } + + /** + * Returns the SQL snippet to round a numeric column to the number of decimals specified. + * + * @param string $column + * @param int $decimals + * + * @return string + */ + public function getRoundExpression($column, $decimals = 0) + { + return 'ROUND(' . $column . ', ' . $decimals . ')'; + } + + /** + * Returns the SQL snippet to get the remainder of the division operation $expression1 / $expression2. + * + * @param string $expression1 + * @param string $expression2 + * + * @return string + */ + public function getModExpression($expression1, $expression2) + { + return 'MOD(' . $expression1 . ', ' . $expression2 . ')'; + } + + /** + * Returns the SQL snippet to trim a string. + * + * @param string $str The expression to apply the trim to. + * @param int $mode The position of the trim (leading/trailing/both). + * @param string|bool $char The char to trim, has to be quoted already. Defaults to space. + * + * @return string + */ + public function getTrimExpression($str, $mode = TrimMode::UNSPECIFIED, $char = false) + { + $expression = ''; + + switch ($mode) { + case TrimMode::LEADING: + $expression = 'LEADING '; + break; + + case TrimMode::TRAILING: + $expression = 'TRAILING '; + break; + + case TrimMode::BOTH: + $expression = 'BOTH '; + break; + } + + if ($char !== false) { + $expression .= $char . ' '; + } + + if ($mode !== TrimMode::UNSPECIFIED || $char !== false) { + $expression .= 'FROM '; + } + + return 'TRIM(' . $expression . $str . ')'; + } + + /** + * Returns the SQL snippet to trim trailing space characters from the expression. + * + * @param string $str Literal string or column name. + * + * @return string + */ + public function getRtrimExpression($str) + { + return 'RTRIM(' . $str . ')'; + } + + /** + * Returns the SQL snippet to trim leading space characters from the expression. + * + * @param string $str Literal string or column name. + * + * @return string + */ + public function getLtrimExpression($str) + { + return 'LTRIM(' . $str . ')'; + } + + /** + * Returns the SQL snippet to change all characters from the expression to uppercase, + * according to the current character set mapping. + * + * @param string $str Literal string or column name. + * + * @return string + */ + public function getUpperExpression($str) + { + return 'UPPER(' . $str . ')'; + } + + /** + * Returns the SQL snippet to change all characters from the expression to lowercase, + * according to the current character set mapping. + * + * @param string $str Literal string or column name. + * + * @return string + */ + public function getLowerExpression($str) + { + return 'LOWER(' . $str . ')'; + } + + /** + * Returns the SQL snippet to get the position of the first occurrence of substring $substr in string $str. + * + * @param string $str Literal string. + * @param string $substr Literal string to find. + * @param int|false $startPos Position to start at, beginning of string by default. + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getLocateExpression($str, $substr, $startPos = false) + { + throw Exception::notSupported(__METHOD__); + } + + /** + * Returns the SQL snippet to get the current system date. + * + * @return string + */ + public function getNowExpression() + { + return 'NOW()'; + } + + /** + * Returns a SQL snippet to get a substring inside an SQL statement. + * + * Note: Not SQL92, but common functionality. + * + * SQLite only supports the 2 parameter variant of this function. + * + * @param string $string An sql string literal or column name/alias. + * @param int $start Where to start the substring portion. + * @param int|null $length The substring portion length. + * + * @return string + */ + public function getSubstringExpression($string, $start, $length = null) + { + if ($length === null) { + return 'SUBSTRING(' . $string . ' FROM ' . $start . ')'; + } + + return 'SUBSTRING(' . $string . ' FROM ' . $start . ' FOR ' . $length . ')'; + } + + /** + * Returns a SQL snippet to concatenate the given expressions. + * + * Accepts an arbitrary number of string parameters. Each parameter must contain an expression. + * + * @return string + */ + public function getConcatExpression() + { + return implode(' || ', func_get_args()); + } + + /** + * Returns the SQL for a logical not. + * + * Example: + * + * $q = new Doctrine_Query(); + * $e = $q->expr; + * $q->select('*')->from('table') + * ->where($e->eq('id', $e->not('null')); + * + * + * @param string $expression + * + * @return string The logical expression. + */ + public function getNotExpression($expression) + { + return 'NOT(' . $expression . ')'; + } + + /** + * Returns the SQL that checks if an expression is null. + * + * @param string $expression The expression that should be compared to null. + * + * @return string The logical expression. + */ + public function getIsNullExpression($expression) + { + return $expression . ' IS NULL'; + } + + /** + * Returns the SQL that checks if an expression is not null. + * + * @param string $expression The expression that should be compared to null. + * + * @return string The logical expression. + */ + public function getIsNotNullExpression($expression) + { + return $expression . ' IS NOT NULL'; + } + + /** + * Returns the SQL that checks if an expression evaluates to a value between two values. + * + * The parameter $expression is checked if it is between $value1 and $value2. + * + * Note: There is a slight difference in the way BETWEEN works on some databases. + * http://www.w3schools.com/sql/sql_between.asp. If you want complete database + * independence you should avoid using between(). + * + * @param string $expression The value to compare to. + * @param string $value1 The lower value to compare with. + * @param string $value2 The higher value to compare with. + * + * @return string The logical expression. + */ + public function getBetweenExpression($expression, $value1, $value2) + { + return $expression . ' BETWEEN ' . $value1 . ' AND ' . $value2; + } + + /** + * Returns the SQL to get the arccosine of a value. + * + * @param string $value + * + * @return string + */ + public function getAcosExpression($value) + { + return 'ACOS(' . $value . ')'; + } + + /** + * Returns the SQL to get the sine of a value. + * + * @param string $value + * + * @return string + */ + public function getSinExpression($value) + { + return 'SIN(' . $value . ')'; + } + + /** + * Returns the SQL to get the PI value. + * + * @return string + */ + public function getPiExpression() + { + return 'PI()'; + } + + /** + * Returns the SQL to get the cosine of a value. + * + * @param string $value + * + * @return string + */ + public function getCosExpression($value) + { + return 'COS(' . $value . ')'; + } + + /** + * Returns the SQL to calculate the difference in days between the two passed dates. + * + * Computes diff = date1 - date2. + * + * @param string $date1 + * @param string $date2 + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getDateDiffExpression($date1, $date2) + { + throw Exception::notSupported(__METHOD__); + } + + /** + * Returns the SQL to add the number of given seconds to a date. + * + * @param string $date + * @param int $seconds + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getDateAddSecondsExpression($date, $seconds) + { + return $this->getDateArithmeticIntervalExpression($date, '+', $seconds, DateIntervalUnit::SECOND); + } + + /** + * Returns the SQL to subtract the number of given seconds from a date. + * + * @param string $date + * @param int $seconds + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getDateSubSecondsExpression($date, $seconds) + { + return $this->getDateArithmeticIntervalExpression($date, '-', $seconds, DateIntervalUnit::SECOND); + } + + /** + * Returns the SQL to add the number of given minutes to a date. + * + * @param string $date + * @param int $minutes + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getDateAddMinutesExpression($date, $minutes) + { + return $this->getDateArithmeticIntervalExpression($date, '+', $minutes, DateIntervalUnit::MINUTE); + } + + /** + * Returns the SQL to subtract the number of given minutes from a date. + * + * @param string $date + * @param int $minutes + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getDateSubMinutesExpression($date, $minutes) + { + return $this->getDateArithmeticIntervalExpression($date, '-', $minutes, DateIntervalUnit::MINUTE); + } + + /** + * Returns the SQL to add the number of given hours to a date. + * + * @param string $date + * @param int $hours + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getDateAddHourExpression($date, $hours) + { + return $this->getDateArithmeticIntervalExpression($date, '+', $hours, DateIntervalUnit::HOUR); + } + + /** + * Returns the SQL to subtract the number of given hours to a date. + * + * @param string $date + * @param int $hours + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getDateSubHourExpression($date, $hours) + { + return $this->getDateArithmeticIntervalExpression($date, '-', $hours, DateIntervalUnit::HOUR); + } + + /** + * Returns the SQL to add the number of given days to a date. + * + * @param string $date + * @param int $days + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getDateAddDaysExpression($date, $days) + { + return $this->getDateArithmeticIntervalExpression($date, '+', $days, DateIntervalUnit::DAY); + } + + /** + * Returns the SQL to subtract the number of given days to a date. + * + * @param string $date + * @param int $days + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getDateSubDaysExpression($date, $days) + { + return $this->getDateArithmeticIntervalExpression($date, '-', $days, DateIntervalUnit::DAY); + } + + /** + * Returns the SQL to add the number of given weeks to a date. + * + * @param string $date + * @param int $weeks + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getDateAddWeeksExpression($date, $weeks) + { + return $this->getDateArithmeticIntervalExpression($date, '+', $weeks, DateIntervalUnit::WEEK); + } + + /** + * Returns the SQL to subtract the number of given weeks from a date. + * + * @param string $date + * @param int $weeks + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getDateSubWeeksExpression($date, $weeks) + { + return $this->getDateArithmeticIntervalExpression($date, '-', $weeks, DateIntervalUnit::WEEK); + } + + /** + * Returns the SQL to add the number of given months to a date. + * + * @param string $date + * @param int $months + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getDateAddMonthExpression($date, $months) + { + return $this->getDateArithmeticIntervalExpression($date, '+', $months, DateIntervalUnit::MONTH); + } + + /** + * Returns the SQL to subtract the number of given months to a date. + * + * @param string $date + * @param int $months + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getDateSubMonthExpression($date, $months) + { + return $this->getDateArithmeticIntervalExpression($date, '-', $months, DateIntervalUnit::MONTH); + } + + /** + * Returns the SQL to add the number of given quarters to a date. + * + * @param string $date + * @param int $quarters + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getDateAddQuartersExpression($date, $quarters) + { + return $this->getDateArithmeticIntervalExpression($date, '+', $quarters, DateIntervalUnit::QUARTER); + } + + /** + * Returns the SQL to subtract the number of given quarters from a date. + * + * @param string $date + * @param int $quarters + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getDateSubQuartersExpression($date, $quarters) + { + return $this->getDateArithmeticIntervalExpression($date, '-', $quarters, DateIntervalUnit::QUARTER); + } + + /** + * Returns the SQL to add the number of given years to a date. + * + * @param string $date + * @param int $years + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getDateAddYearsExpression($date, $years) + { + return $this->getDateArithmeticIntervalExpression($date, '+', $years, DateIntervalUnit::YEAR); + } + + /** + * Returns the SQL to subtract the number of given years from a date. + * + * @param string $date + * @param int $years + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getDateSubYearsExpression($date, $years) + { + return $this->getDateArithmeticIntervalExpression($date, '-', $years, DateIntervalUnit::YEAR); + } + + /** + * Returns the SQL for a date arithmetic expression. + * + * @param string $date The column or literal representing a date to perform the arithmetic operation on. + * @param string $operator The arithmetic operator (+ or -). + * @param int $interval The interval that shall be calculated into the date. + * @param string $unit The unit of the interval that shall be calculated into the date. + * One of the DATE_INTERVAL_UNIT_* constants. + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + protected function getDateArithmeticIntervalExpression($date, $operator, $interval, $unit) + { + throw Exception::notSupported(__METHOD__); + } + + /** + * Returns the SQL bit AND comparison expression. + * + * @param string $value1 + * @param string $value2 + * + * @return string + */ + public function getBitAndComparisonExpression($value1, $value2) + { + return '(' . $value1 . ' & ' . $value2 . ')'; + } + + /** + * Returns the SQL bit OR comparison expression. + * + * @param string $value1 + * @param string $value2 + * + * @return string + */ + public function getBitOrComparisonExpression($value1, $value2) + { + return '(' . $value1 . ' | ' . $value2 . ')'; + } + + /** + * Returns the SQL expression which represents the currently selected database. + */ + abstract public function getCurrentDatabaseExpression(): string; + + /** + * Returns the FOR UPDATE expression. + * + * @return string + */ + public function getForUpdateSQL() + { + return 'FOR UPDATE'; + } + + /** + * Honors that some SQL vendors such as MsSql use table hints for locking instead of the + * ANSI SQL FOR UPDATE specification. + * + * @param string $fromClause The FROM clause to append the hint for the given lock mode to + * @param int $lockMode One of the Doctrine\DBAL\LockMode::* constants + */ + public function appendLockHint(string $fromClause, int $lockMode): string + { + switch ($lockMode) { + case LockMode::NONE: + case LockMode::OPTIMISTIC: + case LockMode::PESSIMISTIC_READ: + case LockMode::PESSIMISTIC_WRITE: + return $fromClause; + + default: + throw InvalidLockMode::fromLockMode($lockMode); + } + } + + /** + * Returns the SQL snippet to append to any SELECT statement which locks rows in shared read lock. + * + * This defaults to the ANSI SQL "FOR UPDATE", which is an exclusive lock (Write). Some database + * vendors allow to lighten this constraint up to be a real read lock. + * + * @return string + */ + public function getReadLockSQL() + { + return $this->getForUpdateSQL(); + } + + /** + * Returns the SQL snippet to append to any SELECT statement which obtains an exclusive lock on the rows. + * + * The semantics of this lock mode should equal the SELECT .. FOR UPDATE of the ANSI SQL standard. + * + * @return string + */ + public function getWriteLockSQL() + { + return $this->getForUpdateSQL(); + } + + /** + * Returns the SQL snippet to drop an existing database. + * + * @param string $name The name of the database that should be dropped. + * + * @return string + */ + public function getDropDatabaseSQL($name) + { + return 'DROP DATABASE ' . $name; + } + + /** + * Returns the SQL snippet to drop a schema. + */ + public function getDropSchemaSQL(string $schemaName): string + { + return 'DROP SCHEMA ' . $schemaName; + } + + /** + * Returns the SQL snippet to drop an existing table. + * + * @param Table|string $table + * + * @return string + * + * @throws InvalidArgumentException + */ + public function getDropTableSQL($table) + { + $tableArg = $table; + + if ($table instanceof Table) { + $table = $table->getQuotedName($this); + } + + if (! is_string($table)) { + throw new InvalidArgumentException( + __METHOD__ . '() expects $table parameter to be string or ' . Table::class . '.' + ); + } + + if ($this->_eventManager !== null && $this->_eventManager->hasListeners(Events::onSchemaDropTable)) { + $eventArgs = new SchemaDropTableEventArgs($tableArg, $this); + $this->_eventManager->dispatchEvent(Events::onSchemaDropTable, $eventArgs); + + if ($eventArgs->isDefaultPrevented()) { + $sql = $eventArgs->getSql(); + + if ($sql === null) { + throw new UnexpectedValueException('Default implementation of DROP TABLE was overridden with NULL'); + } + + return $sql; + } + } + + return 'DROP TABLE ' . $table; + } + + /** + * Returns the SQL to safely drop a temporary table WITHOUT implicitly committing an open transaction. + * + * @param Table|string $table + * + * @return string + */ + public function getDropTemporaryTableSQL($table) + { + return $this->getDropTableSQL($table); + } + + /** + * Returns the SQL to drop an index from a table. + * + * @param Index|string $index + * @param Table|string $table + * + * @return string + * + * @throws InvalidArgumentException + */ + public function getDropIndexSQL($index, $table = null) + { + if ($index instanceof Index) { + $index = $index->getQuotedName($this); + } elseif (! is_string($index)) { + throw new InvalidArgumentException( + __METHOD__ . '() expects $index parameter to be string or ' . Index::class . '.' + ); + } + + return 'DROP INDEX ' . $index; + } + + /** + * Returns the SQL to drop a constraint. + * + * @param Constraint|string $constraint + * @param Table|string $table + * + * @return string + */ + public function getDropConstraintSQL($constraint, $table) + { + if (! $constraint instanceof Constraint) { + $constraint = new Identifier($constraint); + } + + if (! $table instanceof Table) { + $table = new Identifier($table); + } + + $constraint = $constraint->getQuotedName($this); + $table = $table->getQuotedName($this); + + return 'ALTER TABLE ' . $table . ' DROP CONSTRAINT ' . $constraint; + } + + /** + * Returns the SQL to drop a foreign key. + * + * @param ForeignKeyConstraint|string $foreignKey + * @param Table|string $table + * + * @return string + */ + public function getDropForeignKeySQL($foreignKey, $table) + { + if (! $foreignKey instanceof ForeignKeyConstraint) { + $foreignKey = new Identifier($foreignKey); + } + + if (! $table instanceof Table) { + $table = new Identifier($table); + } + + $foreignKey = $foreignKey->getQuotedName($this); + $table = $table->getQuotedName($this); + + return 'ALTER TABLE ' . $table . ' DROP FOREIGN KEY ' . $foreignKey; + } + + /** + * Returns the SQL statement(s) to create a table with the specified name, columns and constraints + * on this platform. + * + * @param int $createFlags + * + * @return string[] The sequence of SQL statements. + * + * @throws Exception + * @throws InvalidArgumentException + */ + public function getCreateTableSQL(Table $table, $createFlags = self::CREATE_INDEXES) + { + if (! is_int($createFlags)) { + throw new InvalidArgumentException( + 'Second argument of AbstractPlatform::getCreateTableSQL() has to be integer.' + ); + } + + if (count($table->getColumns()) === 0) { + throw Exception::noColumnsSpecifiedForTable($table->getName()); + } + + $tableName = $table->getQuotedName($this); + $options = $table->getOptions(); + $options['uniqueConstraints'] = []; + $options['indexes'] = []; + $options['primary'] = []; + + if (($createFlags & self::CREATE_INDEXES) > 0) { + foreach ($table->getIndexes() as $index) { + if (! $index->isPrimary()) { + $options['indexes'][$index->getQuotedName($this)] = $index; + + continue; + } + + $options['primary'] = $index->getQuotedColumns($this); + $options['primary_index'] = $index; + } + + foreach ($table->getUniqueConstraints() as $uniqueConstraint) { + $options['uniqueConstraints'][$uniqueConstraint->getQuotedName($this)] = $uniqueConstraint; + } + } + + if (($createFlags & self::CREATE_FOREIGNKEYS) > 0) { + $options['foreignKeys'] = []; + + foreach ($table->getForeignKeys() as $fkConstraint) { + $options['foreignKeys'][] = $fkConstraint; + } + } + + $columnSql = []; + $columns = []; + + foreach ($table->getColumns() as $column) { + if ( + $this->_eventManager !== null + && $this->_eventManager->hasListeners(Events::onSchemaCreateTableColumn) + ) { + $eventArgs = new SchemaCreateTableColumnEventArgs($column, $table, $this); + + $this->_eventManager->dispatchEvent(Events::onSchemaCreateTableColumn, $eventArgs); + + $columnSql = array_merge($columnSql, $eventArgs->getSql()); + + if ($eventArgs->isDefaultPrevented()) { + continue; + } + } + + $name = $column->getQuotedName($this); + + $columnData = array_merge($column->toArray(), [ + 'name' => $name, + 'version' => $column->hasPlatformOption('version') ? $column->getPlatformOption('version') : false, + 'comment' => $this->getColumnComment($column), + ]); + + if ($columnData['type'] instanceof Types\StringType && $columnData['length'] === null) { + $columnData['length'] = 255; + } + + if (in_array($column->getName(), $options['primary'], true)) { + $columnData['primary'] = true; + } + + $columns[$name] = $columnData; + } + + if ($this->_eventManager !== null && $this->_eventManager->hasListeners(Events::onSchemaCreateTable)) { + $eventArgs = new SchemaCreateTableEventArgs($table, $columns, $options, $this); + + $this->_eventManager->dispatchEvent(Events::onSchemaCreateTable, $eventArgs); + + if ($eventArgs->isDefaultPrevented()) { + return array_merge($eventArgs->getSql(), $columnSql); + } + } + + $sql = $this->_getCreateTableSQL($tableName, $columns, $options); + + if ($this->supportsCommentOnStatement()) { + if ($table->hasOption('comment')) { + $sql[] = $this->getCommentOnTableSQL($tableName, $table->getOption('comment')); + } + + foreach ($table->getColumns() as $column) { + $comment = $this->getColumnComment($column); + + if ($comment === null || $comment === '') { + continue; + } + + $sql[] = $this->getCommentOnColumnSQL($tableName, $column->getQuotedName($this), $comment); + } + } + + return array_merge($sql, $columnSql); + } + + protected function getCommentOnTableSQL(string $tableName, ?string $comment): string + { + $tableName = new Identifier($tableName); + + return sprintf( + 'COMMENT ON TABLE %s IS %s', + $tableName->getQuotedName($this), + $this->quoteStringLiteral((string) $comment) + ); + } + + /** + * @param string $tableName + * @param string $columnName + * @param string|null $comment + * + * @return string + */ + public function getCommentOnColumnSQL($tableName, $columnName, $comment) + { + $tableName = new Identifier($tableName); + $columnName = new Identifier($columnName); + + return sprintf( + 'COMMENT ON COLUMN %s.%s IS %s', + $tableName->getQuotedName($this), + $columnName->getQuotedName($this), + $this->quoteStringLiteral((string) $comment) + ); + } + + /** + * Returns the SQL to create inline comment on a column. + * + * @param string $comment + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getInlineColumnCommentSQL($comment) + { + if (! $this->supportsInlineColumnComments()) { + throw Exception::notSupported(__METHOD__); + } + + return 'COMMENT ' . $this->quoteStringLiteral($comment); + } + + /** + * Returns the SQL used to create a table. + * + * @param string $name + * @param mixed[][] $columns + * @param mixed[] $options + * + * @return string[] + */ + protected function _getCreateTableSQL($name, array $columns, array $options = []) + { + $columnListSql = $this->getColumnDeclarationListSQL($columns); + + if (isset($options['uniqueConstraints']) && ! empty($options['uniqueConstraints'])) { + foreach ($options['uniqueConstraints'] as $index => $definition) { + $columnListSql .= ', ' . $this->getUniqueConstraintDeclarationSQL($index, $definition); + } + } + + if (isset($options['primary']) && ! empty($options['primary'])) { + $columnListSql .= ', PRIMARY KEY(' . implode(', ', array_unique(array_values($options['primary']))) . ')'; + } + + if (isset($options['indexes']) && ! empty($options['indexes'])) { + foreach ($options['indexes'] as $index => $definition) { + $columnListSql .= ', ' . $this->getIndexDeclarationSQL($index, $definition); + } + } + + $query = 'CREATE TABLE ' . $name . ' (' . $columnListSql; + $check = $this->getCheckDeclarationSQL($columns); + + if (! empty($check)) { + $query .= ', ' . $check; + } + + $query .= ')'; + + $sql = [$query]; + + if (isset($options['foreignKeys'])) { + foreach ((array) $options['foreignKeys'] as $definition) { + $sql[] = $this->getCreateForeignKeySQL($definition, $name); + } + } + + return $sql; + } + + /** + * @return string + */ + public function getCreateTemporaryTableSnippetSQL() + { + return 'CREATE TEMPORARY TABLE'; + } + + /** + * Returns the SQL to create a sequence on this platform. + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getCreateSequenceSQL(Sequence $sequence) + { + throw Exception::notSupported(__METHOD__); + } + + /** + * Returns the SQL to change a sequence on this platform. + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getAlterSequenceSQL(Sequence $sequence) + { + throw Exception::notSupported(__METHOD__); + } + + /** + * Returns the SQL to create a constraint on a table on this platform. + * + * @param Table|string $table + * + * @return string + * + * @throws InvalidArgumentException + */ + public function getCreateConstraintSQL(Constraint $constraint, $table) + { + if ($table instanceof Table) { + $table = $table->getQuotedName($this); + } + + $query = 'ALTER TABLE ' . $table . ' ADD CONSTRAINT ' . $constraint->getQuotedName($this); + + $columnList = '(' . implode(', ', $constraint->getQuotedColumns($this)) . ')'; + + $referencesClause = ''; + if ($constraint instanceof Index) { + if ($constraint->isPrimary()) { + $query .= ' PRIMARY KEY'; + } elseif ($constraint->isUnique()) { + $query .= ' UNIQUE'; + } else { + throw new InvalidArgumentException( + 'Can only create primary or unique constraints, no common indexes with getCreateConstraintSQL().' + ); + } + } elseif ($constraint instanceof UniqueConstraint) { + $query .= ' UNIQUE'; + } elseif ($constraint instanceof ForeignKeyConstraint) { + $query .= ' FOREIGN KEY'; + + $referencesClause = ' REFERENCES ' . $constraint->getQuotedForeignTableName($this) . + ' (' . implode(', ', $constraint->getQuotedForeignColumns($this)) . ')'; + } + + $query .= ' ' . $columnList . $referencesClause; + + return $query; + } + + /** + * Returns the SQL to create an index on a table on this platform. + * + * @param Table|string $table The name of the table on which the index is to be created. + * + * @return string + * + * @throws InvalidArgumentException + */ + public function getCreateIndexSQL(Index $index, $table) + { + if ($table instanceof Table) { + $table = $table->getQuotedName($this); + } + + $name = $index->getQuotedName($this); + $columns = $index->getColumns(); + + if (count($columns) === 0) { + throw new InvalidArgumentException("Incomplete definition. 'columns' required."); + } + + if ($index->isPrimary()) { + return $this->getCreatePrimaryKeySQL($index, $table); + } + + $query = 'CREATE ' . $this->getCreateIndexSQLFlags($index) . 'INDEX ' . $name . ' ON ' . $table; + $query .= ' (' . $this->getIndexFieldDeclarationListSQL($index) . ')' . $this->getPartialIndexSQL($index); + + return $query; + } + + /** + * Adds condition for partial index. + * + * @return string + */ + protected function getPartialIndexSQL(Index $index) + { + if ($this->supportsPartialIndexes() && $index->hasOption('where')) { + return ' WHERE ' . $index->getOption('where'); + } + + return ''; + } + + /** + * Adds additional flags for index generation. + * + * @return string + */ + protected function getCreateIndexSQLFlags(Index $index) + { + return $index->isUnique() ? 'UNIQUE ' : ''; + } + + /** + * Returns the SQL to create an unnamed primary key constraint. + * + * @param Table|string $table + * + * @return string + */ + public function getCreatePrimaryKeySQL(Index $index, $table) + { + if ($table instanceof Table) { + $table = $table->getQuotedName($this); + } + + return 'ALTER TABLE ' . $table . ' ADD PRIMARY KEY (' . $this->getIndexFieldDeclarationListSQL($index) . ')'; + } + + /** + * Returns the SQL to create a named schema. + * + * @param string $schemaName + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getCreateSchemaSQL($schemaName) + { + throw Exception::notSupported(__METHOD__); + } + + /** + * Quotes a string so that it can be safely used as a table or column name, + * even if it is a reserved word of the platform. This also detects identifier + * chains separated by dot and quotes them independently. + * + * NOTE: Just because you CAN use quoted identifiers doesn't mean + * you SHOULD use them. In general, they end up causing way more + * problems than they solve. + * + * @param string $str The identifier name to be quoted. + * + * @return string The quoted identifier string. + */ + public function quoteIdentifier($str) + { + if (strpos($str, '.') !== false) { + $parts = array_map([$this, 'quoteSingleIdentifier'], explode('.', $str)); + + return implode('.', $parts); + } + + return $this->quoteSingleIdentifier($str); + } + + /** + * Quotes a single identifier (no dot chain separation). + * + * @param string $str The identifier name to be quoted. + * + * @return string The quoted identifier string. + */ + public function quoteSingleIdentifier($str) + { + $c = $this->getIdentifierQuoteCharacter(); + + return $c . str_replace($c, $c . $c, $str) . $c; + } + + /** + * Returns the SQL to create a new foreign key. + * + * @param ForeignKeyConstraint $foreignKey The foreign key constraint. + * @param Table|string $table The name of the table on which the foreign key is to be created. + * + * @return string + */ + public function getCreateForeignKeySQL(ForeignKeyConstraint $foreignKey, $table) + { + if ($table instanceof Table) { + $table = $table->getQuotedName($this); + } + + return 'ALTER TABLE ' . $table . ' ADD ' . $this->getForeignKeyDeclarationSQL($foreignKey); + } + + /** + * Gets the SQL statements for altering an existing table. + * + * This method returns an array of SQL statements, since some platforms need several statements. + * + * @return string[] + * + * @throws Exception If not supported on this platform. + */ + public function getAlterTableSQL(TableDiff $diff) + { + throw Exception::notSupported(__METHOD__); + } + + /** + * @param mixed[] $columnSql + * + * @return bool + */ + protected function onSchemaAlterTableAddColumn(Column $column, TableDiff $diff, &$columnSql) + { + if ($this->_eventManager === null) { + return false; + } + + if (! $this->_eventManager->hasListeners(Events::onSchemaAlterTableAddColumn)) { + return false; + } + + $eventArgs = new SchemaAlterTableAddColumnEventArgs($column, $diff, $this); + $this->_eventManager->dispatchEvent(Events::onSchemaAlterTableAddColumn, $eventArgs); + + $columnSql = array_merge($columnSql, $eventArgs->getSql()); + + return $eventArgs->isDefaultPrevented(); + } + + /** + * @param string[] $columnSql + * + * @return bool + */ + protected function onSchemaAlterTableRemoveColumn(Column $column, TableDiff $diff, &$columnSql) + { + if ($this->_eventManager === null) { + return false; + } + + if (! $this->_eventManager->hasListeners(Events::onSchemaAlterTableRemoveColumn)) { + return false; + } + + $eventArgs = new SchemaAlterTableRemoveColumnEventArgs($column, $diff, $this); + $this->_eventManager->dispatchEvent(Events::onSchemaAlterTableRemoveColumn, $eventArgs); + + $columnSql = array_merge($columnSql, $eventArgs->getSql()); + + return $eventArgs->isDefaultPrevented(); + } + + /** + * @param string[] $columnSql + * + * @return bool + */ + protected function onSchemaAlterTableChangeColumn(ColumnDiff $columnDiff, TableDiff $diff, &$columnSql) + { + if ($this->_eventManager === null) { + return false; + } + + if (! $this->_eventManager->hasListeners(Events::onSchemaAlterTableChangeColumn)) { + return false; + } + + $eventArgs = new SchemaAlterTableChangeColumnEventArgs($columnDiff, $diff, $this); + $this->_eventManager->dispatchEvent(Events::onSchemaAlterTableChangeColumn, $eventArgs); + + $columnSql = array_merge($columnSql, $eventArgs->getSql()); + + return $eventArgs->isDefaultPrevented(); + } + + /** + * @param string $oldColumnName + * @param string[] $columnSql + * + * @return bool + */ + protected function onSchemaAlterTableRenameColumn($oldColumnName, Column $column, TableDiff $diff, &$columnSql) + { + if ($this->_eventManager === null) { + return false; + } + + if (! $this->_eventManager->hasListeners(Events::onSchemaAlterTableRenameColumn)) { + return false; + } + + $eventArgs = new SchemaAlterTableRenameColumnEventArgs($oldColumnName, $column, $diff, $this); + $this->_eventManager->dispatchEvent(Events::onSchemaAlterTableRenameColumn, $eventArgs); + + $columnSql = array_merge($columnSql, $eventArgs->getSql()); + + return $eventArgs->isDefaultPrevented(); + } + + /** + * @param string[] $sql + * + * @return bool + */ + protected function onSchemaAlterTable(TableDiff $diff, &$sql) + { + if ($this->_eventManager === null) { + return false; + } + + if (! $this->_eventManager->hasListeners(Events::onSchemaAlterTable)) { + return false; + } + + $eventArgs = new SchemaAlterTableEventArgs($diff, $this); + $this->_eventManager->dispatchEvent(Events::onSchemaAlterTable, $eventArgs); + + $sql = array_merge($sql, $eventArgs->getSql()); + + return $eventArgs->isDefaultPrevented(); + } + + /** + * @return string[] + */ + protected function getPreAlterTableIndexForeignKeySQL(TableDiff $diff) + { + $tableName = $diff->getName($this)->getQuotedName($this); + + $sql = []; + if ($this->supportsForeignKeyConstraints()) { + foreach ($diff->removedForeignKeys as $foreignKey) { + $sql[] = $this->getDropForeignKeySQL($foreignKey, $tableName); + } + + foreach ($diff->changedForeignKeys as $foreignKey) { + $sql[] = $this->getDropForeignKeySQL($foreignKey, $tableName); + } + } + + foreach ($diff->removedIndexes as $index) { + $sql[] = $this->getDropIndexSQL($index, $tableName); + } + + foreach ($diff->changedIndexes as $index) { + $sql[] = $this->getDropIndexSQL($index, $tableName); + } + + return $sql; + } + + /** + * @return string[] + */ + protected function getPostAlterTableIndexForeignKeySQL(TableDiff $diff) + { + $sql = []; + $newName = $diff->getNewName(); + + if ($newName !== false) { + $tableName = $newName->getQuotedName($this); + } else { + $tableName = $diff->getName($this)->getQuotedName($this); + } + + if ($this->supportsForeignKeyConstraints()) { + foreach ($diff->addedForeignKeys as $foreignKey) { + $sql[] = $this->getCreateForeignKeySQL($foreignKey, $tableName); + } + + foreach ($diff->changedForeignKeys as $foreignKey) { + $sql[] = $this->getCreateForeignKeySQL($foreignKey, $tableName); + } + } + + foreach ($diff->addedIndexes as $index) { + $sql[] = $this->getCreateIndexSQL($index, $tableName); + } + + foreach ($diff->changedIndexes as $index) { + $sql[] = $this->getCreateIndexSQL($index, $tableName); + } + + foreach ($diff->renamedIndexes as $oldIndexName => $index) { + $oldIndexName = new Identifier($oldIndexName); + $sql = array_merge( + $sql, + $this->getRenameIndexSQL($oldIndexName->getQuotedName($this), $index, $tableName) + ); + } + + return $sql; + } + + /** + * Returns the SQL for renaming an index on a table. + * + * @param string $oldIndexName The name of the index to rename from. + * @param Index $index The definition of the index to rename to. + * @param string $tableName The table to rename the given index on. + * + * @return string[] The sequence of SQL statements for renaming the given index. + */ + protected function getRenameIndexSQL($oldIndexName, Index $index, $tableName) + { + return [ + $this->getDropIndexSQL($oldIndexName, $tableName), + $this->getCreateIndexSQL($index, $tableName), + ]; + } + + /** + * Gets declaration of a number of columns in bulk. + * + * @param mixed[][] $columns A multidimensional associative array. + * The first dimension determines the column name, while the second + * dimension is keyed with the name of the properties + * of the column being declared as array indexes. Currently, the types + * of supported column properties are as follows: + * + * length + * Integer value that determines the maximum length of the text + * column. If this argument is missing the column should be + * declared to have the longest length allowed by the DBMS. + * + * default + * Text value to be used as default for this column. + * + * notnull + * Boolean flag that indicates whether this column is constrained + * to not be set to null. + * charset + * Text value with the default CHARACTER SET for this column. + * collation + * Text value with the default COLLATION for this column. + * unique + * unique constraint + * + * @return string + */ + public function getColumnDeclarationListSQL(array $columns) + { + $declarations = []; + + foreach ($columns as $name => $column) { + $declarations[] = $this->getColumnDeclarationSQL($name, $column); + } + + return implode(', ', $declarations); + } + + /** + * Obtains DBMS specific SQL code portion needed to declare a generic type + * column to be used in statements like CREATE TABLE. + * + * @param string $name The name the column to be declared. + * @param mixed[] $column An associative array with the name of the properties + * of the column being declared as array indexes. Currently, the types + * of supported column properties are as follows: + * + * length + * Integer value that determines the maximum length of the text + * column. If this argument is missing the column should be + * declared to have the longest length allowed by the DBMS. + * + * default + * Text value to be used as default for this column. + * + * notnull + * Boolean flag that indicates whether this column is constrained + * to not be set to null. + * charset + * Text value with the default CHARACTER SET for this column. + * collation + * Text value with the default COLLATION for this column. + * unique + * unique constraint + * check + * column check constraint + * columnDefinition + * a string that defines the complete column + * + * @return string DBMS specific SQL code portion that should be used to declare the column. + * + * @throws Exception + */ + public function getColumnDeclarationSQL($name, array $column) + { + if (isset($column['columnDefinition'])) { + $declaration = $this->getCustomTypeDeclarationSQL($column); + } else { + $default = $this->getDefaultValueDeclarationSQL($column); + + $charset = ! empty($column['charset']) ? + ' ' . $this->getColumnCharsetDeclarationSQL($column['charset']) : ''; + + $collation = ! empty($column['collation']) ? + ' ' . $this->getColumnCollationDeclarationSQL($column['collation']) : ''; + + $notnull = ! empty($column['notnull']) ? ' NOT NULL' : ''; + + $unique = ! empty($column['unique']) ? + ' ' . $this->getUniqueFieldDeclarationSQL() : ''; + + $check = ! empty($column['check']) ? ' ' . $column['check'] : ''; + + $typeDecl = $column['type']->getSQLDeclaration($column, $this); + $declaration = $typeDecl . $charset . $default . $notnull . $unique . $check . $collation; + + if ($this->supportsInlineColumnComments() && isset($column['comment']) && $column['comment'] !== '') { + $declaration .= ' ' . $this->getInlineColumnCommentSQL($column['comment']); + } + } + + return $name . ' ' . $declaration; + } + + /** + * Returns the SQL snippet that declares a floating point column of arbitrary precision. + * + * @param mixed[] $column + * + * @return string + */ + public function getDecimalTypeDeclarationSQL(array $column) + { + $column['precision'] = ! isset($column['precision']) || empty($column['precision']) + ? 10 : $column['precision']; + $column['scale'] = ! isset($column['scale']) || empty($column['scale']) + ? 0 : $column['scale']; + + return 'NUMERIC(' . $column['precision'] . ', ' . $column['scale'] . ')'; + } + + /** + * Obtains DBMS specific SQL code portion needed to set a default value + * declaration to be used in statements like CREATE TABLE. + * + * @param mixed[] $column The column definition array. + * + * @return string DBMS specific SQL code portion needed to set a default value. + */ + public function getDefaultValueDeclarationSQL($column) + { + if (! isset($column['default'])) { + return empty($column['notnull']) ? ' DEFAULT NULL' : ''; + } + + $default = $column['default']; + + if (! isset($column['type'])) { + return " DEFAULT '" . $default . "'"; + } + + $type = $column['type']; + + if ($type instanceof Types\PhpIntegerMappingType) { + return ' DEFAULT ' . $default; + } + + if ($type instanceof Types\PhpDateTimeMappingType && $default === $this->getCurrentTimestampSQL()) { + return ' DEFAULT ' . $this->getCurrentTimestampSQL(); + } + + if ($type instanceof Types\TimeType && $default === $this->getCurrentTimeSQL()) { + return ' DEFAULT ' . $this->getCurrentTimeSQL(); + } + + if ($type instanceof Types\DateType && $default === $this->getCurrentDateSQL()) { + return ' DEFAULT ' . $this->getCurrentDateSQL(); + } + + if ($type instanceof Types\BooleanType) { + return " DEFAULT '" . $this->convertBooleans($default) . "'"; + } + + return ' DEFAULT ' . $this->quoteStringLiteral($default); + } + + /** + * Obtains DBMS specific SQL code portion needed to set a CHECK constraint + * declaration to be used in statements like CREATE TABLE. + * + * @param string[]|mixed[][] $definition The check definition. + * + * @return string DBMS specific SQL code portion needed to set a CHECK constraint. + */ + public function getCheckDeclarationSQL(array $definition) + { + $constraints = []; + foreach ($definition as $column => $def) { + if (is_string($def)) { + $constraints[] = 'CHECK (' . $def . ')'; + } else { + if (isset($def['min'])) { + $constraints[] = 'CHECK (' . $column . ' >= ' . $def['min'] . ')'; + } + + if (isset($def['max'])) { + $constraints[] = 'CHECK (' . $column . ' <= ' . $def['max'] . ')'; + } + } + } + + return implode(', ', $constraints); + } + + /** + * Obtains DBMS specific SQL code portion needed to set a unique + * constraint declaration to be used in statements like CREATE TABLE. + * + * @param string $name The name of the unique constraint. + * @param UniqueConstraint $constraint The unique constraint definition. + * + * @return string DBMS specific SQL code portion needed to set a constraint. + * + * @throws InvalidArgumentException + */ + public function getUniqueConstraintDeclarationSQL($name, UniqueConstraint $constraint) + { + $columns = $constraint->getQuotedColumns($this); + $name = new Identifier($name); + + if (count($columns) === 0) { + throw new InvalidArgumentException("Incomplete definition. 'columns' required."); + } + + $constraintFlags = array_merge(['UNIQUE'], array_map('strtoupper', $constraint->getFlags())); + $constraintName = $name->getQuotedName($this); + $columnListNames = $this->getColumnsFieldDeclarationListSQL($columns); + + return sprintf('CONSTRAINT %s %s (%s)', $constraintName, implode(' ', $constraintFlags), $columnListNames); + } + + /** + * Obtains DBMS specific SQL code portion needed to set an index + * declaration to be used in statements like CREATE TABLE. + * + * @param string $name The name of the index. + * @param Index $index The index definition. + * + * @return string DBMS specific SQL code portion needed to set an index. + * + * @throws InvalidArgumentException + */ + public function getIndexDeclarationSQL($name, Index $index) + { + $columns = $index->getColumns(); + $name = new Identifier($name); + + if (count($columns) === 0) { + throw new InvalidArgumentException("Incomplete definition. 'columns' required."); + } + + return $this->getCreateIndexSQLFlags($index) . 'INDEX ' . $name->getQuotedName($this) + . ' (' . $this->getIndexFieldDeclarationListSQL($index) . ')' . $this->getPartialIndexSQL($index); + } + + /** + * Obtains SQL code portion needed to create a custom column, + * e.g. when a column has the "columnDefinition" keyword. + * Only "AUTOINCREMENT" and "PRIMARY KEY" are added if appropriate. + * + * @param mixed[] $column + * + * @return string + */ + public function getCustomTypeDeclarationSQL(array $column) + { + return $column['columnDefinition']; + } + + /** + * Obtains DBMS specific SQL code portion needed to set an index + * declaration to be used in statements like CREATE TABLE. + */ + public function getIndexFieldDeclarationListSQL(Index $index): string + { + return implode(', ', $index->getQuotedColumns($this)); + } + + /** + * Obtains DBMS specific SQL code portion needed to set an index + * declaration to be used in statements like CREATE TABLE. + * + * @param mixed[] $columns + */ + public function getColumnsFieldDeclarationListSQL(array $columns): string + { + $ret = []; + + foreach ($columns as $column => $definition) { + if (is_array($definition)) { + $ret[] = $column; + } else { + $ret[] = $definition; + } + } + + return implode(', ', $ret); + } + + /** + * Returns the required SQL string that fits between CREATE ... TABLE + * to create the table as a temporary table. + * + * Should be overridden in driver classes to return the correct string for the + * specific database type. + * + * The default is to return the string "TEMPORARY" - this will result in a + * SQL error for any database that does not support temporary tables, or that + * requires a different SQL command from "CREATE TEMPORARY TABLE". + * + * @return string The string required to be placed between "CREATE" and "TABLE" + * to generate a temporary table, if possible. + */ + public function getTemporaryTableSQL() + { + return 'TEMPORARY'; + } + + /** + * Some vendors require temporary table names to be qualified specially. + * + * @param string $tableName + * + * @return string + */ + public function getTemporaryTableName($tableName) + { + return $tableName; + } + + /** + * Obtain DBMS specific SQL code portion needed to set the FOREIGN KEY constraint + * of a column declaration to be used in statements like CREATE TABLE. + * + * @return string DBMS specific SQL code portion needed to set the FOREIGN KEY constraint + * of a column declaration. + */ + public function getForeignKeyDeclarationSQL(ForeignKeyConstraint $foreignKey) + { + $sql = $this->getForeignKeyBaseDeclarationSQL($foreignKey); + $sql .= $this->getAdvancedForeignKeyOptionsSQL($foreignKey); + + return $sql; + } + + /** + * Returns the FOREIGN KEY query section dealing with non-standard options + * as MATCH, INITIALLY DEFERRED, ON UPDATE, ... + * + * @param ForeignKeyConstraint $foreignKey The foreign key definition. + * + * @return string + */ + public function getAdvancedForeignKeyOptionsSQL(ForeignKeyConstraint $foreignKey) + { + $query = ''; + if ($foreignKey->hasOption('onUpdate')) { + $query .= ' ON UPDATE ' . $this->getForeignKeyReferentialActionSQL($foreignKey->getOption('onUpdate')); + } + + if ($foreignKey->hasOption('onDelete')) { + $query .= ' ON DELETE ' . $this->getForeignKeyReferentialActionSQL($foreignKey->getOption('onDelete')); + } + + return $query; + } + + /** + * Returns the given referential action in uppercase if valid, otherwise throws an exception. + * + * @param string $action The foreign key referential action. + * + * @return string + * + * @throws InvalidArgumentException If unknown referential action given. + */ + public function getForeignKeyReferentialActionSQL($action) + { + $upper = strtoupper($action); + switch ($upper) { + case 'CASCADE': + case 'SET NULL': + case 'NO ACTION': + case 'RESTRICT': + case 'SET DEFAULT': + return $upper; + + default: + throw new InvalidArgumentException('Invalid foreign key action: ' . $upper); + } + } + + /** + * Obtains DBMS specific SQL code portion needed to set the FOREIGN KEY constraint + * of a column declaration to be used in statements like CREATE TABLE. + * + * @return string + * + * @throws InvalidArgumentException + */ + public function getForeignKeyBaseDeclarationSQL(ForeignKeyConstraint $foreignKey) + { + $sql = ''; + if (strlen($foreignKey->getName()) > 0) { + $sql .= 'CONSTRAINT ' . $foreignKey->getQuotedName($this) . ' '; + } + + $sql .= 'FOREIGN KEY ('; + + if (count($foreignKey->getLocalColumns()) === 0) { + throw new InvalidArgumentException("Incomplete definition. 'local' required."); + } + + if (count($foreignKey->getForeignColumns()) === 0) { + throw new InvalidArgumentException("Incomplete definition. 'foreign' required."); + } + + if (strlen($foreignKey->getForeignTableName()) === 0) { + throw new InvalidArgumentException("Incomplete definition. 'foreignTable' required."); + } + + return $sql . implode(', ', $foreignKey->getQuotedLocalColumns($this)) + . ') REFERENCES ' + . $foreignKey->getQuotedForeignTableName($this) . ' (' + . implode(', ', $foreignKey->getQuotedForeignColumns($this)) . ')'; + } + + /** + * Obtains DBMS specific SQL code portion needed to set the UNIQUE constraint + * of a column declaration to be used in statements like CREATE TABLE. + * + * @return string DBMS specific SQL code portion needed to set the UNIQUE constraint + * of a column declaration. + */ + public function getUniqueFieldDeclarationSQL() + { + return 'UNIQUE'; + } + + /** + * Obtains DBMS specific SQL code portion needed to set the CHARACTER SET + * of a column declaration to be used in statements like CREATE TABLE. + * + * @param string $charset The name of the charset. + * + * @return string DBMS specific SQL code portion needed to set the CHARACTER SET + * of a column declaration. + */ + public function getColumnCharsetDeclarationSQL($charset) + { + return ''; + } + + /** + * Obtains DBMS specific SQL code portion needed to set the COLLATION + * of a column declaration to be used in statements like CREATE TABLE. + * + * @param string $collation The name of the collation. + * + * @return string DBMS specific SQL code portion needed to set the COLLATION + * of a column declaration. + */ + public function getColumnCollationDeclarationSQL($collation) + { + return $this->supportsColumnCollation() ? 'COLLATE ' . $collation : ''; + } + + /** + * Whether the platform prefers identity columns (eg. autoincrement) for ID generation. + * Subclasses should override this method to return TRUE if they prefer identity columns. + * + * @return bool + */ + public function prefersIdentityColumns() + { + return false; + } + + /** + * Some platforms need the boolean values to be converted. + * + * The default conversion in this implementation converts to integers (false => 0, true => 1). + * + * Note: if the input is not a boolean the original input might be returned. + * + * There are two contexts when converting booleans: Literals and Prepared Statements. + * This method should handle the literal case + * + * @param mixed $item A boolean or an array of them. + * + * @return mixed A boolean database value or an array of them. + */ + public function convertBooleans($item) + { + if (is_array($item)) { + foreach ($item as $k => $value) { + if (! is_bool($value)) { + continue; + } + + $item[$k] = (int) $value; + } + } elseif (is_bool($item)) { + $item = (int) $item; + } + + return $item; + } + + /** + * Some platforms have boolean literals that needs to be correctly converted + * + * The default conversion tries to convert value into bool "(bool)$item" + * + * @param mixed $item + * + * @return bool|null + */ + public function convertFromBoolean($item) + { + return $item === null ? null : (bool) $item; + } + + /** + * This method should handle the prepared statements case. When there is no + * distinction, it's OK to use the same method. + * + * Note: if the input is not a boolean the original input might be returned. + * + * @param mixed $item A boolean or an array of them. + * + * @return mixed A boolean database value or an array of them. + */ + public function convertBooleansToDatabaseValue($item) + { + return $this->convertBooleans($item); + } + + /** + * Returns the SQL specific for the platform to get the current date. + * + * @return string + */ + public function getCurrentDateSQL() + { + return 'CURRENT_DATE'; + } + + /** + * Returns the SQL specific for the platform to get the current time. + * + * @return string + */ + public function getCurrentTimeSQL() + { + return 'CURRENT_TIME'; + } + + /** + * Returns the SQL specific for the platform to get the current timestamp + * + * @return string + */ + public function getCurrentTimestampSQL() + { + return 'CURRENT_TIMESTAMP'; + } + + /** + * Returns the SQL for a given transaction isolation level Connection constant. + * + * @param int $level + * + * @return string + * + * @throws InvalidArgumentException + */ + protected function _getTransactionIsolationLevelSQL($level) + { + switch ($level) { + case TransactionIsolationLevel::READ_UNCOMMITTED: + return 'READ UNCOMMITTED'; + + case TransactionIsolationLevel::READ_COMMITTED: + return 'READ COMMITTED'; + + case TransactionIsolationLevel::REPEATABLE_READ: + return 'REPEATABLE READ'; + + case TransactionIsolationLevel::SERIALIZABLE: + return 'SERIALIZABLE'; + + default: + throw new InvalidArgumentException('Invalid isolation level:' . $level); + } + } + + /** + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getListDatabasesSQL() + { + throw Exception::notSupported(__METHOD__); + } + + /** + * Returns the SQL statement for retrieving the namespaces defined in the database. + * + * @deprecated Use {@link AbstractSchemaManager::listSchemaNames()} instead. + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getListNamespacesSQL() + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4503', + 'AbstractPlatform::getListNamespacesSQL() is deprecated,' + . ' use AbstractSchemaManager::listSchemaNames() instead.' + ); + + throw Exception::notSupported(__METHOD__); + } + + /** + * @param string $database + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getListSequencesSQL($database) + { + throw Exception::notSupported(__METHOD__); + } + + /** + * @param string $table + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getListTableConstraintsSQL($table) + { + throw Exception::notSupported(__METHOD__); + } + + /** + * @param string $table + * @param string $database + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getListTableColumnsSQL($table, $database = null) + { + throw Exception::notSupported(__METHOD__); + } + + /** + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getListTablesSQL() + { + throw Exception::notSupported(__METHOD__); + } + + /** + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getListUsersSQL() + { + throw Exception::notSupported(__METHOD__); + } + + /** + * Returns the SQL to list all views of a database or user. + * + * @param string $database + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getListViewsSQL($database) + { + throw Exception::notSupported(__METHOD__); + } + + /** + * Returns the list of indexes for the current database. + * + * The current database parameter is optional but will always be passed + * when using the SchemaManager API and is the database the given table is in. + * + * Attention: Some platforms only support currentDatabase when they + * are connected with that database. Cross-database information schema + * requests may be impossible. + * + * @param string $table + * @param string $database + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getListTableIndexesSQL($table, $database = null) + { + throw Exception::notSupported(__METHOD__); + } + + /** + * @param string $table + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getListTableForeignKeysSQL($table) + { + throw Exception::notSupported(__METHOD__); + } + + /** + * @param string $name + * @param string $sql + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getCreateViewSQL($name, $sql) + { + throw Exception::notSupported(__METHOD__); + } + + /** + * @param string $name + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getDropViewSQL($name) + { + throw Exception::notSupported(__METHOD__); + } + + /** + * Returns the SQL snippet to drop an existing sequence. + * + * @param Sequence|string $sequence + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getDropSequenceSQL($sequence) + { + throw Exception::notSupported(__METHOD__); + } + + /** + * @param string $sequence + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getSequenceNextValSQL($sequence) + { + throw Exception::notSupported(__METHOD__); + } + + /** + * Returns the SQL to create a new database. + * + * @param string $name The name of the database that should be created. + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getCreateDatabaseSQL($name) + { + throw Exception::notSupported(__METHOD__); + } + + /** + * Returns the SQL to set the transaction isolation level. + * + * @param int $level + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getSetTransactionIsolationSQL($level) + { + throw Exception::notSupported(__METHOD__); + } + + /** + * Obtains DBMS specific SQL to be used to create datetime columns in + * statements like CREATE TABLE. + * + * @param mixed[] $column + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getDateTimeTypeDeclarationSQL(array $column) + { + throw Exception::notSupported(__METHOD__); + } + + /** + * Obtains DBMS specific SQL to be used to create datetime with timezone offset columns. + * + * @param mixed[] $column + * + * @return string + */ + public function getDateTimeTzTypeDeclarationSQL(array $column) + { + return $this->getDateTimeTypeDeclarationSQL($column); + } + + /** + * Obtains DBMS specific SQL to be used to create date columns in statements + * like CREATE TABLE. + * + * @param mixed[] $column + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getDateTypeDeclarationSQL(array $column) + { + throw Exception::notSupported(__METHOD__); + } + + /** + * Obtains DBMS specific SQL to be used to create time columns in statements + * like CREATE TABLE. + * + * @param mixed[] $column + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getTimeTypeDeclarationSQL(array $column) + { + throw Exception::notSupported(__METHOD__); + } + + /** + * @param mixed[] $column + * + * @return string + */ + public function getFloatDeclarationSQL(array $column) + { + return 'DOUBLE PRECISION'; + } + + /** + * Gets the default transaction isolation level of the platform. + * + * @see TransactionIsolationLevel + * + * @return int The default isolation level. + */ + public function getDefaultTransactionIsolationLevel() + { + return TransactionIsolationLevel::READ_COMMITTED; + } + + /* supports*() methods */ + + /** + * Whether the platform supports sequences. + * + * @return bool + */ + public function supportsSequences() + { + return false; + } + + /** + * Whether the platform supports identity columns. + * + * Identity columns are columns that receive an auto-generated value from the + * database on insert of a row. + * + * @return bool + */ + public function supportsIdentityColumns() + { + return false; + } + + /** + * Whether the platform emulates identity columns through sequences. + * + * Some platforms that do not support identity columns natively + * but support sequences can emulate identity columns by using + * sequences. + * + * @return bool + */ + public function usesSequenceEmulatedIdentityColumns() + { + return false; + } + + /** + * Returns the name of the sequence for a particular identity column in a particular table. + * + * @see usesSequenceEmulatedIdentityColumns + * + * @param string $tableName The name of the table to return the sequence name for. + * @param string $columnName The name of the identity column in the table to return the sequence name for. + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getIdentitySequenceName($tableName, $columnName) + { + throw Exception::notSupported(__METHOD__); + } + + /** + * Whether the platform supports indexes. + * + * @return bool + */ + public function supportsIndexes() + { + return true; + } + + /** + * Whether the platform supports partial indexes. + * + * @return bool + */ + public function supportsPartialIndexes() + { + return false; + } + + /** + * Whether the platform supports indexes with column length definitions. + */ + public function supportsColumnLengthIndexes(): bool + { + return false; + } + + /** + * Whether the platform supports altering tables. + * + * @return bool + */ + public function supportsAlterTable() + { + return true; + } + + /** + * Whether the platform supports transactions. + * + * @return bool + */ + public function supportsTransactions() + { + return true; + } + + /** + * Whether the platform supports savepoints. + * + * @return bool + */ + public function supportsSavepoints() + { + return true; + } + + /** + * Whether the platform supports releasing savepoints. + * + * @return bool + */ + public function supportsReleaseSavepoints() + { + return $this->supportsSavepoints(); + } + + /** + * Whether the platform supports primary key constraints. + * + * @return bool + */ + public function supportsPrimaryConstraints() + { + return true; + } + + /** + * Whether the platform supports foreign key constraints. + * + * @return bool + */ + public function supportsForeignKeyConstraints() + { + return true; + } + + /** + * Whether the platform supports database schemas. + * + * @return bool + */ + public function supportsSchemas() + { + return false; + } + + /** + * Whether this platform can emulate schemas. + * + * Platforms that either support or emulate schemas don't automatically + * filter a schema for the namespaced elements in {@link AbstractManager::createSchema()}. + * + * @return bool + */ + public function canEmulateSchemas() + { + return false; + } + + /** + * Returns the default schema name. + * + * @return string + * + * @throws Exception If not supported on this platform. + */ + public function getDefaultSchemaName() + { + throw Exception::notSupported(__METHOD__); + } + + /** + * Whether this platform supports create database. + * + * Some databases don't allow to create and drop databases at all or only with certain tools. + * + * @return bool + */ + public function supportsCreateDropDatabase() + { + return true; + } + + /** + * Whether the platform supports getting the affected rows of a recent update/delete type query. + * + * @return bool + */ + public function supportsGettingAffectedRows() + { + return true; + } + + /** + * Whether this platform support to add inline column comments as postfix. + * + * @return bool + */ + public function supportsInlineColumnComments() + { + return false; + } + + /** + * Whether this platform support the proprietary syntax "COMMENT ON asset". + * + * @return bool + */ + public function supportsCommentOnStatement() + { + return false; + } + + /** + * Does this platform have native guid type. + * + * @return bool + */ + public function hasNativeGuidType() + { + return false; + } + + /** + * Does this platform have native JSON type. + * + * @return bool + */ + public function hasNativeJsonType() + { + return false; + } + + /** + * Whether this platform supports views. + * + * @return bool + */ + public function supportsViews() + { + return true; + } + + /** + * Does this platform support column collation? + * + * @return bool + */ + public function supportsColumnCollation() + { + return false; + } + + /** + * Gets the format string, as accepted by the date() function, that describes + * the format of a stored datetime value of this platform. + * + * @return string The format string. + */ + public function getDateTimeFormatString() + { + return 'Y-m-d H:i:s'; + } + + /** + * Gets the format string, as accepted by the date() function, that describes + * the format of a stored datetime with timezone value of this platform. + * + * @return string The format string. + */ + public function getDateTimeTzFormatString() + { + return 'Y-m-d H:i:s'; + } + + /** + * Gets the format string, as accepted by the date() function, that describes + * the format of a stored date value of this platform. + * + * @return string The format string. + */ + public function getDateFormatString() + { + return 'Y-m-d'; + } + + /** + * Gets the format string, as accepted by the date() function, that describes + * the format of a stored time value of this platform. + * + * @return string The format string. + */ + public function getTimeFormatString() + { + return 'H:i:s'; + } + + /** + * Adds an driver-specific LIMIT clause to the query. + * + * @param string $query + * @param int|null $limit + * @param int $offset + * + * @return string + * + * @throws Exception + */ + final public function modifyLimitQuery($query, $limit, $offset = 0) + { + if ($offset < 0) { + throw new Exception(sprintf( + 'Offset must be a positive integer or zero, %d given', + $offset + )); + } + + if ($offset > 0 && ! $this->supportsLimitOffset()) { + throw new Exception(sprintf( + 'Platform %s does not support offset values in limit queries.', + $this->getName() + )); + } + + return $this->doModifyLimitQuery($query, $limit, $offset); + } + + /** + * Adds an platform-specific LIMIT clause to the query. + * + * @param string $query + * @param int|null $limit + * @param int $offset + * + * @return string + */ + protected function doModifyLimitQuery($query, $limit, $offset) + { + if ($limit !== null) { + $query .= ' LIMIT ' . $limit; + } + + if ($offset > 0) { + $query .= ' OFFSET ' . $offset; + } + + return $query; + } + + /** + * Whether the database platform support offsets in modify limit clauses. + * + * @return bool + */ + public function supportsLimitOffset() + { + return true; + } + + /** + * Maximum length of any given database identifier, like tables or column names. + * + * @return int + */ + public function getMaxIdentifierLength() + { + return 63; + } + + /** + * Returns the insert SQL for an empty insert statement. + * + * @param string $quotedTableName + * @param string $quotedIdentifierColumnName + * + * @return string + */ + public function getEmptyIdentityInsertSQL($quotedTableName, $quotedIdentifierColumnName) + { + return 'INSERT INTO ' . $quotedTableName . ' (' . $quotedIdentifierColumnName . ') VALUES (null)'; + } + + /** + * Generates a Truncate Table SQL statement for a given table. + * + * Cascade is not supported on many platforms but would optionally cascade the truncate by + * following the foreign keys. + * + * @param string $tableName + * @param bool $cascade + * + * @return string + */ + public function getTruncateTableSQL($tableName, $cascade = false) + { + $tableIdentifier = new Identifier($tableName); + + return 'TRUNCATE ' . $tableIdentifier->getQuotedName($this); + } + + /** + * This is for test reasons, many vendors have special requirements for dummy statements. + * + * @return string + */ + public function getDummySelectSQL() + { + $expression = func_num_args() > 0 ? func_get_arg(0) : '1'; + + return sprintf('SELECT %s', $expression); + } + + /** + * Returns the SQL to create a new savepoint. + * + * @param string $savepoint + * + * @return string + */ + public function createSavePoint($savepoint) + { + return 'SAVEPOINT ' . $savepoint; + } + + /** + * Returns the SQL to release a savepoint. + * + * @param string $savepoint + * + * @return string + */ + public function releaseSavePoint($savepoint) + { + return 'RELEASE SAVEPOINT ' . $savepoint; + } + + /** + * Returns the SQL to rollback a savepoint. + * + * @param string $savepoint + * + * @return string + */ + public function rollbackSavePoint($savepoint) + { + return 'ROLLBACK TO SAVEPOINT ' . $savepoint; + } + + /** + * Returns the keyword list instance of this platform. + * + * @return KeywordList + * + * @throws Exception If no keyword list is specified. + */ + final public function getReservedKeywordsList() + { + // Check for an existing instantiation of the keywords class. + if ($this->_keywords === null) { + // Store the instance so it doesn't need to be generated on every request. + $this->_keywords = $this->createReservedKeywordsList(); + } + + return $this->_keywords; + } + + /** + * Creates an instance of the reserved keyword list of this platform. + * + * This method will become @abstract in DBAL 4.0.0. + * + * @throws Exception + */ + protected function createReservedKeywordsList(): KeywordList + { + $class = $this->getReservedKeywordsClass(); + $keywords = new $class(); + if (! $keywords instanceof KeywordList) { + throw Exception::notSupported(__METHOD__); + } + + return $keywords; + } + + /** + * Returns the class name of the reserved keywords list. + * + * @deprecated Implement {@link createReservedKeywordsList()} instead. + * + * @return string + * @psalm-return class-string + * + * @throws Exception If not supported on this platform. + */ + protected function getReservedKeywordsClass() + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4510', + 'AbstractPlatform::getReservedKeywordsClass() is deprecated,' + . ' use AbstractPlatform::createReservedKeywordsList() instead.' + ); + + throw Exception::notSupported(__METHOD__); + } + + /** + * Quotes a literal string. + * This method is NOT meant to fix SQL injections! + * It is only meant to escape this platform's string literal + * quote character inside the given literal string. + * + * @param string $str The literal string to be quoted. + * + * @return string The quoted literal string. + */ + public function quoteStringLiteral($str) + { + $c = $this->getStringLiteralQuoteCharacter(); + + return $c . str_replace($c, $c . $c, $str) . $c; + } + + /** + * Gets the character used for string literal quoting. + * + * @return string + */ + public function getStringLiteralQuoteCharacter() + { + return "'"; + } + + /** + * Escapes metacharacters in a string intended to be used with a LIKE + * operator. + * + * @param string $inputString a literal, unquoted string + * @param string $escapeChar should be reused by the caller in the LIKE + * expression. + */ + final public function escapeStringForLike(string $inputString, string $escapeChar): string + { + return preg_replace( + '~([' . preg_quote($this->getLikeWildcardCharacters() . $escapeChar, '~') . '])~u', + addcslashes($escapeChar, '\\') . '$1', + $inputString + ); + } + + /** + * @internal + */ + public function createSQLParser(): Parser + { + return new Parser(false); + } + + protected function getLikeWildcardCharacters(): string + { + return '%_'; + } +} diff --git a/app/vendor/doctrine/dbal/src/Platforms/DB2Platform.php b/app/vendor/doctrine/dbal/src/Platforms/DB2Platform.php new file mode 100644 index 000000000..036310545 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Platforms/DB2Platform.php @@ -0,0 +1,928 @@ +getCharMaxLength(); + } + + return parent::getVarcharTypeDeclarationSQL($column); + } + + /** + * {@inheritDoc} + */ + public function getBlobTypeDeclarationSQL(array $column) + { + // todo blob(n) with $column['length']; + return 'BLOB(1M)'; + } + + /** + * {@inheritDoc} + */ + public function initializeDoctrineTypeMappings() + { + $this->doctrineTypeMapping = [ + 'bigint' => 'bigint', + 'binary' => 'binary', + 'blob' => 'blob', + 'character' => 'string', + 'clob' => 'text', + 'date' => 'date', + 'decimal' => 'decimal', + 'double' => 'float', + 'integer' => 'integer', + 'real' => 'float', + 'smallint' => 'smallint', + 'time' => 'time', + 'timestamp' => 'datetime', + 'varbinary' => 'binary', + 'varchar' => 'string', + ]; + } + + /** + * {@inheritdoc} + */ + public function isCommentedDoctrineType(Type $doctrineType) + { + if ($doctrineType->getName() === Types::BOOLEAN) { + // We require a commented boolean type in order to distinguish between boolean and smallint + // as both (have to) map to the same native type. + return true; + } + + return parent::isCommentedDoctrineType($doctrineType); + } + + /** + * {@inheritDoc} + */ + protected function getVarcharTypeDeclarationSQLSnippet($length, $fixed) + { + return $fixed ? ($length > 0 ? 'CHAR(' . $length . ')' : 'CHAR(254)') + : ($length > 0 ? 'VARCHAR(' . $length . ')' : 'VARCHAR(255)'); + } + + /** + * {@inheritdoc} + */ + protected function getBinaryTypeDeclarationSQLSnippet($length, $fixed) + { + return $this->getVarcharTypeDeclarationSQLSnippet($length, $fixed) . ' FOR BIT DATA'; + } + + /** + * {@inheritDoc} + */ + public function getClobTypeDeclarationSQL(array $column) + { + // todo clob(n) with $column['length']; + return 'CLOB(1M)'; + } + + /** + * {@inheritDoc} + */ + public function getName() + { + return 'db2'; + } + + /** + * {@inheritDoc} + */ + public function getBooleanTypeDeclarationSQL(array $column) + { + return 'SMALLINT'; + } + + /** + * {@inheritDoc} + */ + public function getIntegerTypeDeclarationSQL(array $column) + { + return 'INTEGER' . $this->_getCommonIntegerTypeDeclarationSQL($column); + } + + /** + * {@inheritDoc} + */ + public function getBigIntTypeDeclarationSQL(array $column) + { + return 'BIGINT' . $this->_getCommonIntegerTypeDeclarationSQL($column); + } + + /** + * {@inheritDoc} + */ + public function getSmallIntTypeDeclarationSQL(array $column) + { + return 'SMALLINT' . $this->_getCommonIntegerTypeDeclarationSQL($column); + } + + /** + * {@inheritDoc} + */ + protected function _getCommonIntegerTypeDeclarationSQL(array $column) + { + $autoinc = ''; + if (! empty($column['autoincrement'])) { + $autoinc = ' GENERATED BY DEFAULT AS IDENTITY'; + } + + return $autoinc; + } + + /** + * {@inheritdoc} + */ + public function getBitAndComparisonExpression($value1, $value2) + { + return 'BITAND(' . $value1 . ', ' . $value2 . ')'; + } + + /** + * {@inheritdoc} + */ + public function getBitOrComparisonExpression($value1, $value2) + { + return 'BITOR(' . $value1 . ', ' . $value2 . ')'; + } + + /** + * {@inheritdoc} + */ + protected function getDateArithmeticIntervalExpression($date, $operator, $interval, $unit) + { + switch ($unit) { + case DateIntervalUnit::WEEK: + $interval *= 7; + $unit = DateIntervalUnit::DAY; + break; + + case DateIntervalUnit::QUARTER: + $interval *= 3; + $unit = DateIntervalUnit::MONTH; + break; + } + + return $date . ' ' . $operator . ' ' . $interval . ' ' . $unit; + } + + /** + * {@inheritdoc} + */ + public function getDateDiffExpression($date1, $date2) + { + return 'DAYS(' . $date1 . ') - DAYS(' . $date2 . ')'; + } + + /** + * {@inheritDoc} + */ + public function getDateTimeTypeDeclarationSQL(array $column) + { + if (isset($column['version']) && $column['version'] === true) { + return 'TIMESTAMP(0) WITH DEFAULT'; + } + + return 'TIMESTAMP(0)'; + } + + /** + * {@inheritDoc} + */ + public function getDateTypeDeclarationSQL(array $column) + { + return 'DATE'; + } + + /** + * {@inheritDoc} + */ + public function getTimeTypeDeclarationSQL(array $column) + { + return 'TIME'; + } + + /** + * {@inheritdoc} + */ + public function getTruncateTableSQL($tableName, $cascade = false) + { + $tableIdentifier = new Identifier($tableName); + + return 'TRUNCATE ' . $tableIdentifier->getQuotedName($this) . ' IMMEDIATE'; + } + + /** + * This code fragment is originally from the Zend_Db_Adapter_Db2 class, but has been edited. + * + * @param string $table + * @param string $database + * + * @return string + */ + public function getListTableColumnsSQL($table, $database = null) + { + $table = $this->quoteStringLiteral($table); + + // We do the funky subquery and join syscat.columns.default this crazy way because + // as of db2 v10, the column is CLOB(64k) and the distinct operator won't allow a CLOB, + // it wants shorter stuff like a varchar. + return " + SELECT + cols.default, + subq.* + FROM ( + SELECT DISTINCT + c.tabschema, + c.tabname, + c.colname, + c.colno, + c.typename, + c.codepage, + c.nulls, + c.length, + c.scale, + c.identity, + tc.type AS tabconsttype, + c.remarks AS comment, + k.colseq, + CASE + WHEN c.generated = 'D' THEN 1 + ELSE 0 + END AS autoincrement + FROM syscat.columns c + LEFT JOIN (syscat.keycoluse k JOIN syscat.tabconst tc + ON (k.tabschema = tc.tabschema + AND k.tabname = tc.tabname + AND tc.type = 'P')) + ON (c.tabschema = k.tabschema + AND c.tabname = k.tabname + AND c.colname = k.colname) + WHERE UPPER(c.tabname) = UPPER(" . $table . ') + ORDER BY c.colno + ) subq + JOIN syscat.columns cols + ON subq.tabschema = cols.tabschema + AND subq.tabname = cols.tabname + AND subq.colno = cols.colno + ORDER BY subq.colno + '; + } + + /** + * {@inheritDoc} + */ + public function getListTablesSQL() + { + return "SELECT NAME FROM SYSIBM.SYSTABLES WHERE TYPE = 'T'"; + } + + /** + * {@inheritDoc} + */ + public function getListViewsSQL($database) + { + return 'SELECT NAME, TEXT FROM SYSIBM.SYSVIEWS'; + } + + /** + * {@inheritDoc} + */ + public function getListTableIndexesSQL($table, $database = null) + { + $table = $this->quoteStringLiteral($table); + + return "SELECT idx.INDNAME AS key_name, + idxcol.COLNAME AS column_name, + CASE + WHEN idx.UNIQUERULE = 'P' THEN 1 + ELSE 0 + END AS primary, + CASE + WHEN idx.UNIQUERULE = 'D' THEN 1 + ELSE 0 + END AS non_unique + FROM SYSCAT.INDEXES AS idx + JOIN SYSCAT.INDEXCOLUSE AS idxcol + ON idx.INDSCHEMA = idxcol.INDSCHEMA AND idx.INDNAME = idxcol.INDNAME + WHERE idx.TABNAME = UPPER(" . $table . ') + ORDER BY idxcol.COLSEQ ASC'; + } + + /** + * {@inheritDoc} + */ + public function getListTableForeignKeysSQL($table) + { + $table = $this->quoteStringLiteral($table); + + return "SELECT fkcol.COLNAME AS local_column, + fk.REFTABNAME AS foreign_table, + pkcol.COLNAME AS foreign_column, + fk.CONSTNAME AS index_name, + CASE + WHEN fk.UPDATERULE = 'R' THEN 'RESTRICT' + ELSE NULL + END AS on_update, + CASE + WHEN fk.DELETERULE = 'C' THEN 'CASCADE' + WHEN fk.DELETERULE = 'N' THEN 'SET NULL' + WHEN fk.DELETERULE = 'R' THEN 'RESTRICT' + ELSE NULL + END AS on_delete + FROM SYSCAT.REFERENCES AS fk + JOIN SYSCAT.KEYCOLUSE AS fkcol + ON fk.CONSTNAME = fkcol.CONSTNAME + AND fk.TABSCHEMA = fkcol.TABSCHEMA + AND fk.TABNAME = fkcol.TABNAME + JOIN SYSCAT.KEYCOLUSE AS pkcol + ON fk.REFKEYNAME = pkcol.CONSTNAME + AND fk.REFTABSCHEMA = pkcol.TABSCHEMA + AND fk.REFTABNAME = pkcol.TABNAME + WHERE fk.TABNAME = UPPER(" . $table . ') + ORDER BY fkcol.COLSEQ ASC'; + } + + /** + * {@inheritDoc} + */ + public function getCreateViewSQL($name, $sql) + { + return 'CREATE VIEW ' . $name . ' AS ' . $sql; + } + + /** + * {@inheritDoc} + */ + public function getDropViewSQL($name) + { + return 'DROP VIEW ' . $name; + } + + /** + * {@inheritDoc} + */ + public function getCreateDatabaseSQL($name) + { + return 'CREATE DATABASE ' . $name; + } + + /** + * {@inheritDoc} + */ + public function getDropDatabaseSQL($name) + { + return 'DROP DATABASE ' . $name; + } + + /** + * {@inheritDoc} + */ + public function supportsCreateDropDatabase() + { + return false; + } + + /** + * {@inheritDoc} + */ + public function supportsReleaseSavepoints() + { + return false; + } + + /** + * {@inheritdoc} + */ + public function supportsCommentOnStatement() + { + return true; + } + + /** + * {@inheritDoc} + */ + public function getCurrentDateSQL() + { + return 'CURRENT DATE'; + } + + /** + * {@inheritDoc} + */ + public function getCurrentTimeSQL() + { + return 'CURRENT TIME'; + } + + /** + * {@inheritDoc} + */ + public function getCurrentTimestampSQL() + { + return 'CURRENT TIMESTAMP'; + } + + /** + * {@inheritDoc} + */ + public function getIndexDeclarationSQL($name, Index $index) + { + // Index declaration in statements like CREATE TABLE is not supported. + throw Exception::notSupported(__METHOD__); + } + + /** + * {@inheritDoc} + */ + protected function _getCreateTableSQL($name, array $columns, array $options = []) + { + $indexes = []; + if (isset($options['indexes'])) { + $indexes = $options['indexes']; + } + + $options['indexes'] = []; + + $sqls = parent::_getCreateTableSQL($name, $columns, $options); + + foreach ($indexes as $definition) { + $sqls[] = $this->getCreateIndexSQL($definition, $name); + } + + return $sqls; + } + + /** + * {@inheritDoc} + */ + public function getAlterTableSQL(TableDiff $diff) + { + $sql = []; + $columnSql = []; + $commentsSQL = []; + + $queryParts = []; + foreach ($diff->addedColumns as $column) { + if ($this->onSchemaAlterTableAddColumn($column, $diff, $columnSql)) { + continue; + } + + $columnDef = $column->toArray(); + $queryPart = 'ADD COLUMN ' . $this->getColumnDeclarationSQL($column->getQuotedName($this), $columnDef); + + // Adding non-nullable columns to a table requires a default value to be specified. + if ( + ! empty($columnDef['notnull']) && + ! isset($columnDef['default']) && + empty($columnDef['autoincrement']) + ) { + $queryPart .= ' WITH DEFAULT'; + } + + $queryParts[] = $queryPart; + + $comment = $this->getColumnComment($column); + + if ($comment === null || $comment === '') { + continue; + } + + $commentsSQL[] = $this->getCommentOnColumnSQL( + $diff->getName($this)->getQuotedName($this), + $column->getQuotedName($this), + $comment + ); + } + + foreach ($diff->removedColumns as $column) { + if ($this->onSchemaAlterTableRemoveColumn($column, $diff, $columnSql)) { + continue; + } + + $queryParts[] = 'DROP COLUMN ' . $column->getQuotedName($this); + } + + foreach ($diff->changedColumns as $columnDiff) { + if ($this->onSchemaAlterTableChangeColumn($columnDiff, $diff, $columnSql)) { + continue; + } + + if ($columnDiff->hasChanged('comment')) { + $commentsSQL[] = $this->getCommentOnColumnSQL( + $diff->getName($this)->getQuotedName($this), + $columnDiff->column->getQuotedName($this), + $this->getColumnComment($columnDiff->column) + ); + + if (count($columnDiff->changedProperties) === 1) { + continue; + } + } + + $this->gatherAlterColumnSQL($diff->getName($this), $columnDiff, $sql, $queryParts); + } + + foreach ($diff->renamedColumns as $oldColumnName => $column) { + if ($this->onSchemaAlterTableRenameColumn($oldColumnName, $column, $diff, $columnSql)) { + continue; + } + + $oldColumnName = new Identifier($oldColumnName); + + $queryParts[] = 'RENAME COLUMN ' . $oldColumnName->getQuotedName($this) . + ' TO ' . $column->getQuotedName($this); + } + + $tableSql = []; + + if (! $this->onSchemaAlterTable($diff, $tableSql)) { + if (count($queryParts) > 0) { + $sql[] = 'ALTER TABLE ' . $diff->getName($this)->getQuotedName($this) . ' ' . implode(' ', $queryParts); + } + + // Some table alteration operations require a table reorganization. + if (! empty($diff->removedColumns) || ! empty($diff->changedColumns)) { + $sql[] = "CALL SYSPROC.ADMIN_CMD ('REORG TABLE " . $diff->getName($this)->getQuotedName($this) . "')"; + } + + $sql = array_merge($sql, $commentsSQL); + + $newName = $diff->getNewName(); + + if ($newName !== false) { + $sql[] = sprintf( + 'RENAME TABLE %s TO %s', + $diff->getName($this)->getQuotedName($this), + $newName->getQuotedName($this) + ); + } + + $sql = array_merge( + $this->getPreAlterTableIndexForeignKeySQL($diff), + $sql, + $this->getPostAlterTableIndexForeignKeySQL($diff) + ); + } + + return array_merge($sql, $tableSql, $columnSql); + } + + /** + * Gathers the table alteration SQL for a given column diff. + * + * @param Identifier $table The table to gather the SQL for. + * @param ColumnDiff $columnDiff The column diff to evaluate. + * @param string[] $sql The sequence of table alteration statements to fill. + * @param mixed[] $queryParts The sequence of column alteration clauses to fill. + */ + private function gatherAlterColumnSQL( + Identifier $table, + ColumnDiff $columnDiff, + array &$sql, + array &$queryParts + ): void { + $alterColumnClauses = $this->getAlterColumnClausesSQL($columnDiff); + + if (empty($alterColumnClauses)) { + return; + } + + // If we have a single column alteration, we can append the clause to the main query. + if (count($alterColumnClauses) === 1) { + $queryParts[] = current($alterColumnClauses); + + return; + } + + // We have multiple alterations for the same column, + // so we need to trigger a complete ALTER TABLE statement + // for each ALTER COLUMN clause. + foreach ($alterColumnClauses as $alterColumnClause) { + $sql[] = 'ALTER TABLE ' . $table->getQuotedName($this) . ' ' . $alterColumnClause; + } + } + + /** + * Returns the ALTER COLUMN SQL clauses for altering a column described by the given column diff. + * + * @param ColumnDiff $columnDiff The column diff to evaluate. + * + * @return string[] + */ + private function getAlterColumnClausesSQL(ColumnDiff $columnDiff) + { + $column = $columnDiff->column->toArray(); + + $alterClause = 'ALTER COLUMN ' . $columnDiff->column->getQuotedName($this); + + if ($column['columnDefinition'] !== null) { + return [$alterClause . ' ' . $column['columnDefinition']]; + } + + $clauses = []; + + if ( + $columnDiff->hasChanged('type') || + $columnDiff->hasChanged('length') || + $columnDiff->hasChanged('precision') || + $columnDiff->hasChanged('scale') || + $columnDiff->hasChanged('fixed') + ) { + $clauses[] = $alterClause . ' SET DATA TYPE ' . $column['type']->getSQLDeclaration($column, $this); + } + + if ($columnDiff->hasChanged('notnull')) { + $clauses[] = $column['notnull'] ? $alterClause . ' SET NOT NULL' : $alterClause . ' DROP NOT NULL'; + } + + if ($columnDiff->hasChanged('default')) { + if (isset($column['default'])) { + $defaultClause = $this->getDefaultValueDeclarationSQL($column); + + if ($defaultClause !== '') { + $clauses[] = $alterClause . ' SET' . $defaultClause; + } + } else { + $clauses[] = $alterClause . ' DROP DEFAULT'; + } + } + + return $clauses; + } + + /** + * {@inheritDoc} + */ + protected function getPreAlterTableIndexForeignKeySQL(TableDiff $diff) + { + $sql = []; + $table = $diff->getName($this)->getQuotedName($this); + + foreach ($diff->removedIndexes as $remKey => $remIndex) { + foreach ($diff->addedIndexes as $addKey => $addIndex) { + if ($remIndex->getColumns() !== $addIndex->getColumns()) { + continue; + } + + if ($remIndex->isPrimary()) { + $sql[] = 'ALTER TABLE ' . $table . ' DROP PRIMARY KEY'; + } elseif ($remIndex->isUnique()) { + $sql[] = 'ALTER TABLE ' . $table . ' DROP UNIQUE ' . $remIndex->getQuotedName($this); + } else { + $sql[] = $this->getDropIndexSQL($remIndex, $table); + } + + $sql[] = $this->getCreateIndexSQL($addIndex, $table); + + unset($diff->removedIndexes[$remKey], $diff->addedIndexes[$addKey]); + + break; + } + } + + $sql = array_merge($sql, parent::getPreAlterTableIndexForeignKeySQL($diff)); + + return $sql; + } + + /** + * {@inheritdoc} + */ + protected function getRenameIndexSQL($oldIndexName, Index $index, $tableName) + { + if (strpos($tableName, '.') !== false) { + [$schema] = explode('.', $tableName); + $oldIndexName = $schema . '.' . $oldIndexName; + } + + return ['RENAME INDEX ' . $oldIndexName . ' TO ' . $index->getQuotedName($this)]; + } + + /** + * {@inheritDoc} + */ + public function getDefaultValueDeclarationSQL($column) + { + if (! empty($column['autoincrement'])) { + return ''; + } + + if (! empty($column['version'])) { + if ((string) $column['type'] !== 'DateTime') { + $column['default'] = '1'; + } + } + + return parent::getDefaultValueDeclarationSQL($column); + } + + /** + * {@inheritDoc} + */ + public function getEmptyIdentityInsertSQL($quotedTableName, $quotedIdentifierColumnName) + { + return 'INSERT INTO ' . $quotedTableName . ' (' . $quotedIdentifierColumnName . ') VALUES (DEFAULT)'; + } + + /** + * {@inheritDoc} + */ + public function getCreateTemporaryTableSnippetSQL() + { + return 'DECLARE GLOBAL TEMPORARY TABLE'; + } + + /** + * {@inheritDoc} + */ + public function getTemporaryTableName($tableName) + { + return 'SESSION.' . $tableName; + } + + /** + * {@inheritDoc} + */ + protected function doModifyLimitQuery($query, $limit, $offset) + { + $where = []; + + if ($offset > 0) { + $where[] = sprintf('db22.DC_ROWNUM >= %d', $offset + 1); + } + + if ($limit !== null) { + $where[] = sprintf('db22.DC_ROWNUM <= %d', $offset + $limit); + } + + if (empty($where)) { + return $query; + } + + // Todo OVER() needs ORDER BY data! + return sprintf( + 'SELECT db22.* FROM (SELECT db21.*, ROW_NUMBER() OVER() AS DC_ROWNUM FROM (%s) db21) db22 WHERE %s', + $query, + implode(' AND ', $where) + ); + } + + /** + * {@inheritDoc} + */ + public function getLocateExpression($str, $substr, $startPos = false) + { + if ($startPos === false) { + return 'LOCATE(' . $substr . ', ' . $str . ')'; + } + + return 'LOCATE(' . $substr . ', ' . $str . ', ' . $startPos . ')'; + } + + /** + * {@inheritDoc} + */ + public function getSubstringExpression($string, $start, $length = null) + { + if ($length === null) { + return 'SUBSTR(' . $string . ', ' . $start . ')'; + } + + return 'SUBSTR(' . $string . ', ' . $start . ', ' . $length . ')'; + } + + public function getCurrentDatabaseExpression(): string + { + return 'CURRENT_USER'; + } + + /** + * {@inheritDoc} + */ + public function supportsIdentityColumns() + { + return true; + } + + /** + * {@inheritDoc} + */ + public function prefersIdentityColumns() + { + return true; + } + + /** + * {@inheritDoc} + */ + public function getForUpdateSQL() + { + return ' WITH RR USE AND KEEP UPDATE LOCKS'; + } + + /** + * {@inheritDoc} + */ + public function getDummySelectSQL() + { + $expression = func_num_args() > 0 ? func_get_arg(0) : '1'; + + return sprintf('SELECT %s FROM sysibm.sysdummy1', $expression); + } + + /** + * {@inheritDoc} + * + * DB2 supports savepoints, but they work semantically different than on other vendor platforms. + * + * TODO: We have to investigate how to get DB2 up and running with savepoints. + */ + public function supportsSavepoints() + { + return false; + } + + /** + * {@inheritDoc} + * + * @deprecated Implement {@link createReservedKeywordsList()} instead. + */ + protected function getReservedKeywordsClass() + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4510', + 'DB2Platform::getReservedKeywordsClass() is deprecated,' + . ' use DB2Platform::createReservedKeywordsList() instead.' + ); + + return Keywords\DB2Keywords::class; + } + + public function getListTableCommentsSQL(string $table): string + { + return sprintf( + <<<'SQL' +SELECT REMARKS + FROM SYSIBM.SYSTABLES + WHERE NAME = UPPER( %s ) +SQL + , + $this->quoteStringLiteral($table) + ); + } +} diff --git a/app/vendor/doctrine/dbal/src/Platforms/DateIntervalUnit.php b/app/vendor/doctrine/dbal/src/Platforms/DateIntervalUnit.php new file mode 100644 index 000000000..c1f3ca592 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Platforms/DateIntervalUnit.php @@ -0,0 +1,31 @@ +keywords === null) { + $this->initializeKeywords(); + } + + return isset($this->keywords[strtoupper($word)]); + } + + /** + * @return void + */ + protected function initializeKeywords() + { + $this->keywords = array_flip(array_map('strtoupper', $this->getKeywords())); + } + + /** + * Returns the list of keywords. + * + * @return string[] + */ + abstract protected function getKeywords(); + + /** + * Returns the name of this keyword list. + * + * @return string + */ + abstract public function getName(); +} diff --git a/app/vendor/doctrine/dbal/src/Platforms/Keywords/MariaDb102Keywords.php b/app/vendor/doctrine/dbal/src/Platforms/Keywords/MariaDb102Keywords.php new file mode 100644 index 000000000..8cb2befe8 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Platforms/Keywords/MariaDb102Keywords.php @@ -0,0 +1,271 @@ +keywordLists = $keywordLists; + } + + /** + * @return string[] + */ + public function getViolations() + { + return $this->violations; + } + + /** + * @param string $word + * + * @return string[] + */ + private function isReservedWord($word) + { + if ($word[0] === '`') { + $word = str_replace('`', '', $word); + } + + $keywordLists = []; + foreach ($this->keywordLists as $keywordList) { + if (! $keywordList->isKeyword($word)) { + continue; + } + + $keywordLists[] = $keywordList->getName(); + } + + return $keywordLists; + } + + /** + * @param string $asset + * @param string[] $violatedPlatforms + * + * @return void + */ + private function addViolation($asset, $violatedPlatforms) + { + if (count($violatedPlatforms) === 0) { + return; + } + + $this->violations[] = $asset . ' keyword violations: ' . implode(', ', $violatedPlatforms); + } + + /** + * {@inheritdoc} + */ + public function acceptColumn(Table $table, Column $column) + { + $this->addViolation( + 'Table ' . $table->getName() . ' column ' . $column->getName(), + $this->isReservedWord($column->getName()) + ); + } + + /** + * {@inheritdoc} + */ + public function acceptForeignKey(Table $localTable, ForeignKeyConstraint $fkConstraint) + { + } + + /** + * {@inheritdoc} + */ + public function acceptIndex(Table $table, Index $index) + { + } + + /** + * {@inheritdoc} + */ + public function acceptSchema(Schema $schema) + { + } + + /** + * {@inheritdoc} + */ + public function acceptSequence(Sequence $sequence) + { + } + + /** + * {@inheritdoc} + */ + public function acceptTable(Table $table) + { + $this->addViolation( + 'Table ' . $table->getName(), + $this->isReservedWord($table->getName()) + ); + } +} diff --git a/app/vendor/doctrine/dbal/src/Platforms/Keywords/SQLServer2012Keywords.php b/app/vendor/doctrine/dbal/src/Platforms/Keywords/SQLServer2012Keywords.php new file mode 100644 index 000000000..24e190bf5 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Platforms/Keywords/SQLServer2012Keywords.php @@ -0,0 +1,213 @@ +doctrineTypeMapping['json'] = Types::JSON; + } +} diff --git a/app/vendor/doctrine/dbal/src/Platforms/MySQL57Platform.php b/app/vendor/doctrine/dbal/src/Platforms/MySQL57Platform.php new file mode 100644 index 000000000..f29204cf4 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Platforms/MySQL57Platform.php @@ -0,0 +1,87 @@ +getQuotedName($this)]; + } + + /** + * {@inheritdoc} + * + * @deprecated Implement {@link createReservedKeywordsList()} instead. + */ + protected function getReservedKeywordsClass() + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4510', + 'MySQL57Platform::getReservedKeywordsClass() is deprecated,' + . ' use MySQL57Platform::createReservedKeywordsList() instead.' + ); + + return Keywords\MySQL57Keywords::class; + } + + /** + * {@inheritdoc} + */ + protected function initializeDoctrineTypeMappings() + { + parent::initializeDoctrineTypeMappings(); + + $this->doctrineTypeMapping['json'] = Types::JSON; + } +} diff --git a/app/vendor/doctrine/dbal/src/Platforms/MySQL80Platform.php b/app/vendor/doctrine/dbal/src/Platforms/MySQL80Platform.php new file mode 100644 index 000000000..808e93449 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Platforms/MySQL80Platform.php @@ -0,0 +1,28 @@ + 0) { + $query .= ' OFFSET ' . $offset; + } + } elseif ($offset > 0) { + // 2^64-1 is the maximum of unsigned BIGINT, the biggest limit possible + $query .= ' LIMIT 18446744073709551615 OFFSET ' . $offset; + } + + return $query; + } + + /** + * {@inheritDoc} + */ + public function getIdentifierQuoteCharacter() + { + return '`'; + } + + /** + * {@inheritDoc} + */ + public function getRegexpExpression() + { + return 'RLIKE'; + } + + /** + * {@inheritDoc} + */ + public function getLocateExpression($str, $substr, $startPos = false) + { + if ($startPos === false) { + return 'LOCATE(' . $substr . ', ' . $str . ')'; + } + + return 'LOCATE(' . $substr . ', ' . $str . ', ' . $startPos . ')'; + } + + /** + * {@inheritDoc} + */ + public function getConcatExpression() + { + return sprintf('CONCAT(%s)', implode(', ', func_get_args())); + } + + /** + * {@inheritdoc} + */ + protected function getDateArithmeticIntervalExpression($date, $operator, $interval, $unit) + { + $function = $operator === '+' ? 'DATE_ADD' : 'DATE_SUB'; + + return $function . '(' . $date . ', INTERVAL ' . $interval . ' ' . $unit . ')'; + } + + /** + * {@inheritDoc} + */ + public function getDateDiffExpression($date1, $date2) + { + return 'DATEDIFF(' . $date1 . ', ' . $date2 . ')'; + } + + public function getCurrentDatabaseExpression(): string + { + return 'DATABASE()'; + } + + /** + * {@inheritDoc} + */ + public function getListDatabasesSQL() + { + return 'SHOW DATABASES'; + } + + /** + * {@inheritDoc} + */ + public function getListTableConstraintsSQL($table) + { + return 'SHOW INDEX FROM ' . $table; + } + + /** + * {@inheritDoc} + * + * Two approaches to listing the table indexes. The information_schema is + * preferred, because it doesn't cause problems with SQL keywords such as "order" or "table". + */ + public function getListTableIndexesSQL($table, $database = null) + { + if ($database !== null) { + $database = $this->quoteStringLiteral($database); + $table = $this->quoteStringLiteral($table); + + return 'SELECT NON_UNIQUE AS Non_Unique, INDEX_NAME AS Key_name, COLUMN_NAME AS Column_Name,' . + ' SUB_PART AS Sub_Part, INDEX_TYPE AS Index_Type' . + ' FROM information_schema.STATISTICS WHERE TABLE_NAME = ' . $table . + ' AND TABLE_SCHEMA = ' . $database . + ' ORDER BY SEQ_IN_INDEX ASC'; + } + + return 'SHOW INDEX FROM ' . $table; + } + + /** + * {@inheritDoc} + */ + public function getListViewsSQL($database) + { + $database = $this->quoteStringLiteral($database); + + return 'SELECT * FROM information_schema.VIEWS WHERE TABLE_SCHEMA = ' . $database; + } + + /** + * @param string $table + * @param string|null $database + * + * @return string + */ + public function getListTableForeignKeysSQL($table, $database = null) + { + $table = $this->quoteStringLiteral($table); + + if ($database !== null) { + $database = $this->quoteStringLiteral($database); + } + + $sql = 'SELECT DISTINCT k.`CONSTRAINT_NAME`, k.`COLUMN_NAME`, k.`REFERENCED_TABLE_NAME`, ' . + 'k.`REFERENCED_COLUMN_NAME` /*!50116 , c.update_rule, c.delete_rule */ ' . + 'FROM information_schema.key_column_usage k /*!50116 ' . + 'INNER JOIN information_schema.referential_constraints c ON ' . + ' c.constraint_name = k.constraint_name AND ' . + ' c.table_name = ' . $table . ' */ WHERE k.table_name = ' . $table; + + $databaseNameSql = $database ?? 'DATABASE()'; + + return $sql . ' AND k.table_schema = ' . $databaseNameSql + . ' /*!50116 AND c.constraint_schema = ' . $databaseNameSql . ' */' + . ' AND k.`REFERENCED_COLUMN_NAME` is not NULL'; + } + + /** + * {@inheritDoc} + */ + public function getCreateViewSQL($name, $sql) + { + return 'CREATE VIEW ' . $name . ' AS ' . $sql; + } + + /** + * {@inheritDoc} + */ + public function getDropViewSQL($name) + { + return 'DROP VIEW ' . $name; + } + + /** + * {@inheritDoc} + */ + protected function getVarcharTypeDeclarationSQLSnippet($length, $fixed) + { + return $fixed ? ($length > 0 ? 'CHAR(' . $length . ')' : 'CHAR(255)') + : ($length > 0 ? 'VARCHAR(' . $length . ')' : 'VARCHAR(255)'); + } + + /** + * {@inheritdoc} + */ + protected function getBinaryTypeDeclarationSQLSnippet($length, $fixed) + { + return $fixed + ? 'BINARY(' . ($length > 0 ? $length : 255) . ')' + : 'VARBINARY(' . ($length > 0 ? $length : 255) . ')'; + } + + /** + * Gets the SQL snippet used to declare a CLOB column type. + * TINYTEXT : 2 ^ 8 - 1 = 255 + * TEXT : 2 ^ 16 - 1 = 65535 + * MEDIUMTEXT : 2 ^ 24 - 1 = 16777215 + * LONGTEXT : 2 ^ 32 - 1 = 4294967295 + * + * {@inheritDoc} + */ + public function getClobTypeDeclarationSQL(array $column) + { + if (! empty($column['length']) && is_numeric($column['length'])) { + $length = $column['length']; + + if ($length <= static::LENGTH_LIMIT_TINYTEXT) { + return 'TINYTEXT'; + } + + if ($length <= static::LENGTH_LIMIT_TEXT) { + return 'TEXT'; + } + + if ($length <= static::LENGTH_LIMIT_MEDIUMTEXT) { + return 'MEDIUMTEXT'; + } + } + + return 'LONGTEXT'; + } + + /** + * {@inheritDoc} + */ + public function getDateTimeTypeDeclarationSQL(array $column) + { + if (isset($column['version']) && $column['version'] === true) { + return 'TIMESTAMP'; + } + + return 'DATETIME'; + } + + /** + * {@inheritDoc} + */ + public function getDateTypeDeclarationSQL(array $column) + { + return 'DATE'; + } + + /** + * {@inheritDoc} + */ + public function getTimeTypeDeclarationSQL(array $column) + { + return 'TIME'; + } + + /** + * {@inheritDoc} + */ + public function getBooleanTypeDeclarationSQL(array $column) + { + return 'TINYINT(1)'; + } + + /** + * {@inheritDoc} + * + * MySQL prefers "autoincrement" identity columns since sequences can only + * be emulated with a table. + */ + public function prefersIdentityColumns() + { + return true; + } + + /** + * {@inheritDoc} + * + * MySQL supports this through AUTO_INCREMENT columns. + */ + public function supportsIdentityColumns() + { + return true; + } + + /** + * {@inheritDoc} + */ + public function supportsInlineColumnComments() + { + return true; + } + + /** + * {@inheritDoc} + */ + public function supportsColumnCollation() + { + return true; + } + + /** + * {@inheritDoc} + */ + public function getListTablesSQL() + { + return "SHOW FULL TABLES WHERE Table_type = 'BASE TABLE'"; + } + + /** + * {@inheritDoc} + */ + public function getListTableColumnsSQL($table, $database = null) + { + $table = $this->quoteStringLiteral($table); + + if ($database !== null) { + $database = $this->quoteStringLiteral($database); + } else { + $database = 'DATABASE()'; + } + + return 'SELECT COLUMN_NAME AS Field, COLUMN_TYPE AS Type, IS_NULLABLE AS `Null`, ' . + 'COLUMN_KEY AS `Key`, COLUMN_DEFAULT AS `Default`, EXTRA AS Extra, COLUMN_COMMENT AS Comment, ' . + 'CHARACTER_SET_NAME AS CharacterSet, COLLATION_NAME AS Collation ' . + 'FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = ' . $database . ' AND TABLE_NAME = ' . $table . + ' ORDER BY ORDINAL_POSITION ASC'; + } + + public function getListTableMetadataSQL(string $table, ?string $database = null): string + { + return sprintf( + <<<'SQL' +SELECT ENGINE, AUTO_INCREMENT, TABLE_COLLATION, TABLE_COMMENT, CREATE_OPTIONS +FROM information_schema.TABLES +WHERE TABLE_TYPE = 'BASE TABLE' AND TABLE_SCHEMA = %s AND TABLE_NAME = %s +SQL + , + $database !== null ? $this->quoteStringLiteral($database) : 'DATABASE()', + $this->quoteStringLiteral($table) + ); + } + + /** + * {@inheritDoc} + */ + public function getCreateDatabaseSQL($name) + { + return 'CREATE DATABASE ' . $name; + } + + /** + * {@inheritDoc} + */ + public function getDropDatabaseSQL($name) + { + return 'DROP DATABASE ' . $name; + } + + /** + * {@inheritDoc} + */ + protected function _getCreateTableSQL($name, array $columns, array $options = []) + { + $queryFields = $this->getColumnDeclarationListSQL($columns); + + if (isset($options['uniqueConstraints']) && ! empty($options['uniqueConstraints'])) { + foreach ($options['uniqueConstraints'] as $constraintName => $definition) { + $queryFields .= ', ' . $this->getUniqueConstraintDeclarationSQL($constraintName, $definition); + } + } + + // add all indexes + if (isset($options['indexes']) && ! empty($options['indexes'])) { + foreach ($options['indexes'] as $indexName => $definition) { + $queryFields .= ', ' . $this->getIndexDeclarationSQL($indexName, $definition); + } + } + + // attach all primary keys + if (isset($options['primary']) && ! empty($options['primary'])) { + $keyColumns = array_unique(array_values($options['primary'])); + $queryFields .= ', PRIMARY KEY(' . implode(', ', $keyColumns) . ')'; + } + + $query = 'CREATE '; + + if (! empty($options['temporary'])) { + $query .= 'TEMPORARY '; + } + + $query .= 'TABLE ' . $name . ' (' . $queryFields . ') '; + $query .= $this->buildTableOptions($options); + $query .= $this->buildPartitionOptions($options); + + $sql = [$query]; + $engine = 'INNODB'; + + if (isset($options['engine'])) { + $engine = strtoupper(trim($options['engine'])); + } + + // Propagate foreign key constraints only for InnoDB. + if (isset($options['foreignKeys']) && $engine === 'INNODB') { + foreach ((array) $options['foreignKeys'] as $definition) { + $sql[] = $this->getCreateForeignKeySQL($definition, $name); + } + } + + return $sql; + } + + /** + * {@inheritdoc} + */ + public function getDefaultValueDeclarationSQL($column) + { + // Unset the default value if the given column definition does not allow default values. + if ($column['type'] instanceof TextType || $column['type'] instanceof BlobType) { + $column['default'] = null; + } + + return parent::getDefaultValueDeclarationSQL($column); + } + + /** + * Build SQL for table options + * + * @param mixed[] $options + * + * @return string + */ + private function buildTableOptions(array $options) + { + if (isset($options['table_options'])) { + return $options['table_options']; + } + + $tableOptions = []; + + // Charset + if (! isset($options['charset'])) { + $options['charset'] = 'utf8'; + } + + $tableOptions[] = sprintf('DEFAULT CHARACTER SET %s', $options['charset']); + + // Collate + if (! isset($options['collate'])) { + $options['collate'] = $options['charset'] . '_unicode_ci'; + } + + $tableOptions[] = $this->getColumnCollationDeclarationSQL($options['collate']); + + // Engine + if (! isset($options['engine'])) { + $options['engine'] = 'InnoDB'; + } + + $tableOptions[] = sprintf('ENGINE = %s', $options['engine']); + + // Auto increment + if (isset($options['auto_increment'])) { + $tableOptions[] = sprintf('AUTO_INCREMENT = %s', $options['auto_increment']); + } + + // Comment + if (isset($options['comment'])) { + $tableOptions[] = sprintf('COMMENT = %s ', $this->quoteStringLiteral($options['comment'])); + } + + // Row format + if (isset($options['row_format'])) { + $tableOptions[] = sprintf('ROW_FORMAT = %s', $options['row_format']); + } + + return implode(' ', $tableOptions); + } + + /** + * Build SQL for partition options. + * + * @param mixed[] $options + * + * @return string + */ + private function buildPartitionOptions(array $options) + { + return isset($options['partition_options']) + ? ' ' . $options['partition_options'] + : ''; + } + + /** + * {@inheritDoc} + */ + public function getAlterTableSQL(TableDiff $diff) + { + $columnSql = []; + $queryParts = []; + $newName = $diff->getNewName(); + + if ($newName !== false) { + $queryParts[] = 'RENAME TO ' . $newName->getQuotedName($this); + } + + foreach ($diff->addedColumns as $column) { + if ($this->onSchemaAlterTableAddColumn($column, $diff, $columnSql)) { + continue; + } + + $columnArray = array_merge($column->toArray(), [ + 'comment' => $this->getColumnComment($column), + ]); + + $queryParts[] = 'ADD ' . $this->getColumnDeclarationSQL($column->getQuotedName($this), $columnArray); + } + + foreach ($diff->removedColumns as $column) { + if ($this->onSchemaAlterTableRemoveColumn($column, $diff, $columnSql)) { + continue; + } + + $queryParts[] = 'DROP ' . $column->getQuotedName($this); + } + + foreach ($diff->changedColumns as $columnDiff) { + if ($this->onSchemaAlterTableChangeColumn($columnDiff, $diff, $columnSql)) { + continue; + } + + $column = $columnDiff->column; + $columnArray = $column->toArray(); + + // Don't propagate default value changes for unsupported column types. + if ( + $columnDiff->hasChanged('default') && + count($columnDiff->changedProperties) === 1 && + ($columnArray['type'] instanceof TextType || $columnArray['type'] instanceof BlobType) + ) { + continue; + } + + $columnArray['comment'] = $this->getColumnComment($column); + $queryParts[] = 'CHANGE ' . ($columnDiff->getOldColumnName()->getQuotedName($this)) . ' ' + . $this->getColumnDeclarationSQL($column->getQuotedName($this), $columnArray); + } + + foreach ($diff->renamedColumns as $oldColumnName => $column) { + if ($this->onSchemaAlterTableRenameColumn($oldColumnName, $column, $diff, $columnSql)) { + continue; + } + + $oldColumnName = new Identifier($oldColumnName); + $columnArray = $column->toArray(); + $columnArray['comment'] = $this->getColumnComment($column); + $queryParts[] = 'CHANGE ' . $oldColumnName->getQuotedName($this) . ' ' + . $this->getColumnDeclarationSQL($column->getQuotedName($this), $columnArray); + } + + if (isset($diff->addedIndexes['primary'])) { + $keyColumns = array_unique(array_values($diff->addedIndexes['primary']->getColumns())); + $queryParts[] = 'ADD PRIMARY KEY (' . implode(', ', $keyColumns) . ')'; + unset($diff->addedIndexes['primary']); + } elseif (isset($diff->changedIndexes['primary'])) { + // Necessary in case the new primary key includes a new auto_increment column + foreach ($diff->changedIndexes['primary']->getColumns() as $columnName) { + if (isset($diff->addedColumns[$columnName]) && $diff->addedColumns[$columnName]->getAutoincrement()) { + $keyColumns = array_unique(array_values($diff->changedIndexes['primary']->getColumns())); + $queryParts[] = 'DROP PRIMARY KEY'; + $queryParts[] = 'ADD PRIMARY KEY (' . implode(', ', $keyColumns) . ')'; + unset($diff->changedIndexes['primary']); + break; + } + } + } + + $sql = []; + $tableSql = []; + + if (! $this->onSchemaAlterTable($diff, $tableSql)) { + if (count($queryParts) > 0) { + $sql[] = 'ALTER TABLE ' . $diff->getName($this)->getQuotedName($this) . ' ' + . implode(', ', $queryParts); + } + + $sql = array_merge( + $this->getPreAlterTableIndexForeignKeySQL($diff), + $sql, + $this->getPostAlterTableIndexForeignKeySQL($diff) + ); + } + + return array_merge($sql, $tableSql, $columnSql); + } + + /** + * {@inheritDoc} + */ + protected function getPreAlterTableIndexForeignKeySQL(TableDiff $diff) + { + $sql = []; + $table = $diff->getName($this)->getQuotedName($this); + + foreach ($diff->changedIndexes as $changedIndex) { + $sql = array_merge($sql, $this->getPreAlterTableAlterPrimaryKeySQL($diff, $changedIndex)); + } + + foreach ($diff->removedIndexes as $remKey => $remIndex) { + $sql = array_merge($sql, $this->getPreAlterTableAlterPrimaryKeySQL($diff, $remIndex)); + + foreach ($diff->addedIndexes as $addKey => $addIndex) { + if ($remIndex->getColumns() !== $addIndex->getColumns()) { + continue; + } + + $indexClause = 'INDEX ' . $addIndex->getName(); + + if ($addIndex->isPrimary()) { + $indexClause = 'PRIMARY KEY'; + } elseif ($addIndex->isUnique()) { + $indexClause = 'UNIQUE INDEX ' . $addIndex->getName(); + } + + $query = 'ALTER TABLE ' . $table . ' DROP INDEX ' . $remIndex->getName() . ', '; + $query .= 'ADD ' . $indexClause; + $query .= ' (' . $this->getIndexFieldDeclarationListSQL($addIndex) . ')'; + + $sql[] = $query; + + unset($diff->removedIndexes[$remKey], $diff->addedIndexes[$addKey]); + + break; + } + } + + $engine = 'INNODB'; + + if ($diff->fromTable instanceof Table && $diff->fromTable->hasOption('engine')) { + $engine = strtoupper(trim($diff->fromTable->getOption('engine'))); + } + + // Suppress foreign key constraint propagation on non-supporting engines. + if ($engine !== 'INNODB') { + $diff->addedForeignKeys = []; + $diff->changedForeignKeys = []; + $diff->removedForeignKeys = []; + } + + $sql = array_merge( + $sql, + $this->getPreAlterTableAlterIndexForeignKeySQL($diff), + parent::getPreAlterTableIndexForeignKeySQL($diff), + $this->getPreAlterTableRenameIndexForeignKeySQL($diff) + ); + + return $sql; + } + + /** + * @return string[] + * + * @throws Exception + */ + private function getPreAlterTableAlterPrimaryKeySQL(TableDiff $diff, Index $index) + { + $sql = []; + + if (! $index->isPrimary() || ! $diff->fromTable instanceof Table) { + return $sql; + } + + $tableName = $diff->getName($this)->getQuotedName($this); + + // Dropping primary keys requires to unset autoincrement attribute on the particular column first. + foreach ($index->getColumns() as $columnName) { + if (! $diff->fromTable->hasColumn($columnName)) { + continue; + } + + $column = $diff->fromTable->getColumn($columnName); + + if ($column->getAutoincrement() !== true) { + continue; + } + + $column->setAutoincrement(false); + + $sql[] = 'ALTER TABLE ' . $tableName . ' MODIFY ' . + $this->getColumnDeclarationSQL($column->getQuotedName($this), $column->toArray()); + + // original autoincrement information might be needed later on by other parts of the table alteration + $column->setAutoincrement(true); + } + + return $sql; + } + + /** + * @param TableDiff $diff The table diff to gather the SQL for. + * + * @return string[] + * + * @throws Exception + */ + private function getPreAlterTableAlterIndexForeignKeySQL(TableDiff $diff) + { + $sql = []; + $table = $diff->getName($this)->getQuotedName($this); + + foreach ($diff->changedIndexes as $changedIndex) { + // Changed primary key + if (! $changedIndex->isPrimary() || ! ($diff->fromTable instanceof Table)) { + continue; + } + + foreach ($diff->fromTable->getPrimaryKeyColumns() as $columnName => $column) { + // Check if an autoincrement column was dropped from the primary key. + if (! $column->getAutoincrement() || in_array($columnName, $changedIndex->getColumns(), true)) { + continue; + } + + // The autoincrement attribute needs to be removed from the dropped column + // before we can drop and recreate the primary key. + $column->setAutoincrement(false); + + $sql[] = 'ALTER TABLE ' . $table . ' MODIFY ' . + $this->getColumnDeclarationSQL($column->getQuotedName($this), $column->toArray()); + + // Restore the autoincrement attribute as it might be needed later on + // by other parts of the table alteration. + $column->setAutoincrement(true); + } + } + + return $sql; + } + + /** + * @param TableDiff $diff The table diff to gather the SQL for. + * + * @return string[] + */ + protected function getPreAlterTableRenameIndexForeignKeySQL(TableDiff $diff) + { + $sql = []; + $tableName = $diff->getName($this)->getQuotedName($this); + + foreach ($this->getRemainingForeignKeyConstraintsRequiringRenamedIndexes($diff) as $foreignKey) { + if (in_array($foreignKey, $diff->changedForeignKeys, true)) { + continue; + } + + $sql[] = $this->getDropForeignKeySQL($foreignKey, $tableName); + } + + return $sql; + } + + /** + * Returns the remaining foreign key constraints that require one of the renamed indexes. + * + * "Remaining" here refers to the diff between the foreign keys currently defined in the associated + * table and the foreign keys to be removed. + * + * @param TableDiff $diff The table diff to evaluate. + * + * @return ForeignKeyConstraint[] + */ + private function getRemainingForeignKeyConstraintsRequiringRenamedIndexes(TableDiff $diff) + { + if (empty($diff->renamedIndexes) || ! $diff->fromTable instanceof Table) { + return []; + } + + $foreignKeys = []; + /** @var ForeignKeyConstraint[] $remainingForeignKeys */ + $remainingForeignKeys = array_diff_key( + $diff->fromTable->getForeignKeys(), + $diff->removedForeignKeys + ); + + foreach ($remainingForeignKeys as $foreignKey) { + foreach ($diff->renamedIndexes as $index) { + if ($foreignKey->intersectsIndexColumns($index)) { + $foreignKeys[] = $foreignKey; + + break; + } + } + } + + return $foreignKeys; + } + + /** + * {@inheritdoc} + */ + protected function getPostAlterTableIndexForeignKeySQL(TableDiff $diff) + { + return array_merge( + parent::getPostAlterTableIndexForeignKeySQL($diff), + $this->getPostAlterTableRenameIndexForeignKeySQL($diff) + ); + } + + /** + * @param TableDiff $diff The table diff to gather the SQL for. + * + * @return string[] + */ + protected function getPostAlterTableRenameIndexForeignKeySQL(TableDiff $diff) + { + $sql = []; + $newName = $diff->getNewName(); + + if ($newName !== false) { + $tableName = $newName->getQuotedName($this); + } else { + $tableName = $diff->getName($this)->getQuotedName($this); + } + + foreach ($this->getRemainingForeignKeyConstraintsRequiringRenamedIndexes($diff) as $foreignKey) { + if (in_array($foreignKey, $diff->changedForeignKeys, true)) { + continue; + } + + $sql[] = $this->getCreateForeignKeySQL($foreignKey, $tableName); + } + + return $sql; + } + + /** + * {@inheritDoc} + */ + protected function getCreateIndexSQLFlags(Index $index) + { + $type = ''; + if ($index->isUnique()) { + $type .= 'UNIQUE '; + } elseif ($index->hasFlag('fulltext')) { + $type .= 'FULLTEXT '; + } elseif ($index->hasFlag('spatial')) { + $type .= 'SPATIAL '; + } + + return $type; + } + + /** + * {@inheritDoc} + */ + public function getIntegerTypeDeclarationSQL(array $column) + { + return 'INT' . $this->_getCommonIntegerTypeDeclarationSQL($column); + } + + /** + * {@inheritDoc} + */ + public function getBigIntTypeDeclarationSQL(array $column) + { + return 'BIGINT' . $this->_getCommonIntegerTypeDeclarationSQL($column); + } + + /** + * {@inheritDoc} + */ + public function getSmallIntTypeDeclarationSQL(array $column) + { + return 'SMALLINT' . $this->_getCommonIntegerTypeDeclarationSQL($column); + } + + /** + * {@inheritdoc} + */ + public function getFloatDeclarationSQL(array $column) + { + return 'DOUBLE PRECISION' . $this->getUnsignedDeclaration($column); + } + + /** + * {@inheritdoc} + */ + public function getDecimalTypeDeclarationSQL(array $column) + { + return parent::getDecimalTypeDeclarationSQL($column) . $this->getUnsignedDeclaration($column); + } + + /** + * Get unsigned declaration for a column. + * + * @param mixed[] $columnDef + * + * @return string + */ + private function getUnsignedDeclaration(array $columnDef) + { + return ! empty($columnDef['unsigned']) ? ' UNSIGNED' : ''; + } + + /** + * {@inheritDoc} + */ + protected function _getCommonIntegerTypeDeclarationSQL(array $column) + { + $autoinc = ''; + if (! empty($column['autoincrement'])) { + $autoinc = ' AUTO_INCREMENT'; + } + + return $this->getUnsignedDeclaration($column) . $autoinc; + } + + /** + * {@inheritDoc} + */ + public function getColumnCharsetDeclarationSQL($charset) + { + return 'CHARACTER SET ' . $charset; + } + + /** + * {@inheritDoc} + */ + public function getColumnCollationDeclarationSQL($collation) + { + return 'COLLATE ' . $this->quoteSingleIdentifier($collation); + } + + /** + * {@inheritDoc} + */ + public function getAdvancedForeignKeyOptionsSQL(ForeignKeyConstraint $foreignKey) + { + $query = ''; + if ($foreignKey->hasOption('match')) { + $query .= ' MATCH ' . $foreignKey->getOption('match'); + } + + $query .= parent::getAdvancedForeignKeyOptionsSQL($foreignKey); + + return $query; + } + + /** + * {@inheritDoc} + */ + public function getDropIndexSQL($index, $table = null) + { + if ($index instanceof Index) { + $indexName = $index->getQuotedName($this); + } elseif (is_string($index)) { + $indexName = $index; + } else { + throw new InvalidArgumentException( + __METHOD__ . '() expects $index parameter to be string or ' . Index::class . '.' + ); + } + + if ($table instanceof Table) { + $table = $table->getQuotedName($this); + } elseif (! is_string($table)) { + throw new InvalidArgumentException( + __METHOD__ . '() expects $table parameter to be string or ' . Table::class . '.' + ); + } + + if ($index instanceof Index && $index->isPrimary()) { + // MySQL primary keys are always named "PRIMARY", + // so we cannot use them in statements because of them being keyword. + return $this->getDropPrimaryKeySQL($table); + } + + return 'DROP INDEX ' . $indexName . ' ON ' . $table; + } + + /** + * @param string $table + * + * @return string + */ + protected function getDropPrimaryKeySQL($table) + { + return 'ALTER TABLE ' . $table . ' DROP PRIMARY KEY'; + } + + /** + * {@inheritDoc} + */ + public function getSetTransactionIsolationSQL($level) + { + return 'SET SESSION TRANSACTION ISOLATION LEVEL ' . $this->_getTransactionIsolationLevelSQL($level); + } + + /** + * {@inheritDoc} + */ + public function getName() + { + return 'mysql'; + } + + /** + * {@inheritDoc} + */ + public function getReadLockSQL() + { + return 'LOCK IN SHARE MODE'; + } + + /** + * {@inheritDoc} + */ + protected function initializeDoctrineTypeMappings() + { + $this->doctrineTypeMapping = [ + 'bigint' => 'bigint', + 'binary' => 'binary', + 'blob' => 'blob', + 'char' => 'string', + 'date' => 'date', + 'datetime' => 'datetime', + 'decimal' => 'decimal', + 'double' => 'float', + 'float' => 'float', + 'int' => 'integer', + 'integer' => 'integer', + 'longblob' => 'blob', + 'longtext' => 'text', + 'mediumblob' => 'blob', + 'mediumint' => 'integer', + 'mediumtext' => 'text', + 'numeric' => 'decimal', + 'real' => 'float', + 'set' => 'simple_array', + 'smallint' => 'smallint', + 'string' => 'string', + 'text' => 'text', + 'time' => 'time', + 'timestamp' => 'datetime', + 'tinyblob' => 'blob', + 'tinyint' => 'boolean', + 'tinytext' => 'text', + 'varbinary' => 'binary', + 'varchar' => 'string', + 'year' => 'date', + ]; + } + + /** + * {@inheritDoc} + */ + public function getVarcharMaxLength() + { + return 65535; + } + + /** + * {@inheritdoc} + */ + public function getBinaryMaxLength() + { + return 65535; + } + + /** + * {@inheritDoc} + * + * @deprecated Implement {@link createReservedKeywordsList()} instead. + */ + protected function getReservedKeywordsClass() + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4510', + 'MySQLPlatform::getReservedKeywordsClass() is deprecated,' + . ' use MySQLPlatform::createReservedKeywordsList() instead.' + ); + + return Keywords\MySQLKeywords::class; + } + + /** + * {@inheritDoc} + * + * MySQL commits a transaction implicitly when DROP TABLE is executed, however not + * if DROP TEMPORARY TABLE is executed. + */ + public function getDropTemporaryTableSQL($table) + { + if ($table instanceof Table) { + $table = $table->getQuotedName($this); + } elseif (! is_string($table)) { + throw new InvalidArgumentException( + __METHOD__ . '() expects $table parameter to be string or ' . Table::class . '.' + ); + } + + return 'DROP TEMPORARY TABLE ' . $table; + } + + /** + * Gets the SQL Snippet used to declare a BLOB column type. + * TINYBLOB : 2 ^ 8 - 1 = 255 + * BLOB : 2 ^ 16 - 1 = 65535 + * MEDIUMBLOB : 2 ^ 24 - 1 = 16777215 + * LONGBLOB : 2 ^ 32 - 1 = 4294967295 + * + * {@inheritDoc} + */ + public function getBlobTypeDeclarationSQL(array $column) + { + if (! empty($column['length']) && is_numeric($column['length'])) { + $length = $column['length']; + + if ($length <= static::LENGTH_LIMIT_TINYBLOB) { + return 'TINYBLOB'; + } + + if ($length <= static::LENGTH_LIMIT_BLOB) { + return 'BLOB'; + } + + if ($length <= static::LENGTH_LIMIT_MEDIUMBLOB) { + return 'MEDIUMBLOB'; + } + } + + return 'LONGBLOB'; + } + + /** + * {@inheritdoc} + */ + public function quoteStringLiteral($str) + { + $str = str_replace('\\', '\\\\', $str); // MySQL requires backslashes to be escaped aswell. + + return parent::quoteStringLiteral($str); + } + + /** + * {@inheritdoc} + */ + public function getDefaultTransactionIsolationLevel() + { + return TransactionIsolationLevel::REPEATABLE_READ; + } + + public function supportsColumnLengthIndexes(): bool + { + return true; + } +} diff --git a/app/vendor/doctrine/dbal/src/Platforms/OraclePlatform.php b/app/vendor/doctrine/dbal/src/Platforms/OraclePlatform.php new file mode 100644 index 000000000..7be7621d3 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Platforms/OraclePlatform.php @@ -0,0 +1,1211 @@ +getBitAndComparisonExpression($value1, $value2) + . '+' . $value2 . ')'; + } + + /** + * {@inheritDoc} + * + * Need to specifiy minvalue, since start with is hidden in the system and MINVALUE <= START WITH. + * Therefore we can use MINVALUE to be able to get a hint what START WITH was for later introspection + * in {@see listSequences()} + */ + public function getCreateSequenceSQL(Sequence $sequence) + { + return 'CREATE SEQUENCE ' . $sequence->getQuotedName($this) . + ' START WITH ' . $sequence->getInitialValue() . + ' MINVALUE ' . $sequence->getInitialValue() . + ' INCREMENT BY ' . $sequence->getAllocationSize() . + $this->getSequenceCacheSQL($sequence); + } + + /** + * {@inheritDoc} + */ + public function getAlterSequenceSQL(Sequence $sequence) + { + return 'ALTER SEQUENCE ' . $sequence->getQuotedName($this) . + ' INCREMENT BY ' . $sequence->getAllocationSize() + . $this->getSequenceCacheSQL($sequence); + } + + /** + * Cache definition for sequences + * + * @return string + */ + private function getSequenceCacheSQL(Sequence $sequence) + { + if ($sequence->getCache() === 0) { + return ' NOCACHE'; + } + + if ($sequence->getCache() === 1) { + return ' NOCACHE'; + } + + if ($sequence->getCache() > 1) { + return ' CACHE ' . $sequence->getCache(); + } + + return ''; + } + + /** + * {@inheritDoc} + */ + public function getSequenceNextValSQL($sequence) + { + return 'SELECT ' . $sequence . '.nextval FROM DUAL'; + } + + /** + * {@inheritDoc} + */ + public function getSetTransactionIsolationSQL($level) + { + return 'SET TRANSACTION ISOLATION LEVEL ' . $this->_getTransactionIsolationLevelSQL($level); + } + + /** + * {@inheritDoc} + */ + protected function _getTransactionIsolationLevelSQL($level) + { + switch ($level) { + case TransactionIsolationLevel::READ_UNCOMMITTED: + return 'READ UNCOMMITTED'; + + case TransactionIsolationLevel::READ_COMMITTED: + return 'READ COMMITTED'; + + case TransactionIsolationLevel::REPEATABLE_READ: + case TransactionIsolationLevel::SERIALIZABLE: + return 'SERIALIZABLE'; + + default: + return parent::_getTransactionIsolationLevelSQL($level); + } + } + + /** + * {@inheritDoc} + */ + public function getBooleanTypeDeclarationSQL(array $column) + { + return 'NUMBER(1)'; + } + + /** + * {@inheritDoc} + */ + public function getIntegerTypeDeclarationSQL(array $column) + { + return 'NUMBER(10)'; + } + + /** + * {@inheritDoc} + */ + public function getBigIntTypeDeclarationSQL(array $column) + { + return 'NUMBER(20)'; + } + + /** + * {@inheritDoc} + */ + public function getSmallIntTypeDeclarationSQL(array $column) + { + return 'NUMBER(5)'; + } + + /** + * {@inheritDoc} + */ + public function getDateTimeTypeDeclarationSQL(array $column) + { + return 'TIMESTAMP(0)'; + } + + /** + * {@inheritDoc} + */ + public function getDateTimeTzTypeDeclarationSQL(array $column) + { + return 'TIMESTAMP(0) WITH TIME ZONE'; + } + + /** + * {@inheritDoc} + */ + public function getDateTypeDeclarationSQL(array $column) + { + return 'DATE'; + } + + /** + * {@inheritDoc} + */ + public function getTimeTypeDeclarationSQL(array $column) + { + return 'DATE'; + } + + /** + * {@inheritDoc} + */ + protected function _getCommonIntegerTypeDeclarationSQL(array $column) + { + return ''; + } + + /** + * {@inheritDoc} + */ + protected function getVarcharTypeDeclarationSQLSnippet($length, $fixed) + { + return $fixed ? ($length > 0 ? 'CHAR(' . $length . ')' : 'CHAR(2000)') + : ($length > 0 ? 'VARCHAR2(' . $length . ')' : 'VARCHAR2(4000)'); + } + + /** + * {@inheritdoc} + */ + protected function getBinaryTypeDeclarationSQLSnippet($length, $fixed) + { + return 'RAW(' . ($length > 0 ? $length : $this->getBinaryMaxLength()) . ')'; + } + + /** + * {@inheritdoc} + */ + public function getBinaryMaxLength() + { + return 2000; + } + + /** + * {@inheritDoc} + */ + public function getClobTypeDeclarationSQL(array $column) + { + return 'CLOB'; + } + + /** + * {@inheritDoc} + */ + public function getListDatabasesSQL() + { + return 'SELECT username FROM all_users'; + } + + /** + * {@inheritDoc} + */ + public function getListSequencesSQL($database) + { + $database = $this->normalizeIdentifier($database); + $database = $this->quoteStringLiteral($database->getName()); + + return 'SELECT sequence_name, min_value, increment_by FROM sys.all_sequences ' . + 'WHERE SEQUENCE_OWNER = ' . $database; + } + + /** + * {@inheritDoc} + */ + protected function _getCreateTableSQL($name, array $columns, array $options = []) + { + $indexes = $options['indexes'] ?? []; + $options['indexes'] = []; + $sql = parent::_getCreateTableSQL($name, $columns, $options); + + foreach ($columns as $columnName => $column) { + if (isset($column['sequence'])) { + $sql[] = $this->getCreateSequenceSQL($column['sequence']); + } + + if ( + ! isset($column['autoincrement']) || ! $column['autoincrement'] && + (! isset($column['autoinc']) || ! $column['autoinc']) + ) { + continue; + } + + $sql = array_merge($sql, $this->getCreateAutoincrementSql($columnName, $name)); + } + + if (isset($indexes) && ! empty($indexes)) { + foreach ($indexes as $index) { + $sql[] = $this->getCreateIndexSQL($index, $name); + } + } + + return $sql; + } + + /** + * {@inheritDoc} + * + * @link http://ezcomponents.org/docs/api/trunk/DatabaseSchema/ezcDbSchemaOracleReader.html + */ + public function getListTableIndexesSQL($table, $database = null) + { + $table = $this->normalizeIdentifier($table); + $table = $this->quoteStringLiteral($table->getName()); + + return "SELECT uind_col.index_name AS name, + ( + SELECT uind.index_type + FROM user_indexes uind + WHERE uind.index_name = uind_col.index_name + ) AS type, + decode( + ( + SELECT uind.uniqueness + FROM user_indexes uind + WHERE uind.index_name = uind_col.index_name + ), + 'NONUNIQUE', + 0, + 'UNIQUE', + 1 + ) AS is_unique, + uind_col.column_name AS column_name, + uind_col.column_position AS column_pos, + ( + SELECT ucon.constraint_type + FROM user_constraints ucon + WHERE ucon.index_name = uind_col.index_name + ) AS is_primary + FROM user_ind_columns uind_col + WHERE uind_col.table_name = " . $table . ' + ORDER BY uind_col.column_position ASC'; + } + + /** + * {@inheritDoc} + */ + public function getListTablesSQL() + { + return 'SELECT * FROM sys.user_tables'; + } + + /** + * {@inheritDoc} + */ + public function getListViewsSQL($database) + { + return 'SELECT view_name, text FROM sys.user_views'; + } + + /** + * {@inheritDoc} + */ + public function getCreateViewSQL($name, $sql) + { + return 'CREATE VIEW ' . $name . ' AS ' . $sql; + } + + /** + * {@inheritDoc} + */ + public function getDropViewSQL($name) + { + return 'DROP VIEW ' . $name; + } + + /** + * @param string $name + * @param string $table + * @param int $start + * + * @return string[] + */ + public function getCreateAutoincrementSql($name, $table, $start = 1) + { + $tableIdentifier = $this->normalizeIdentifier($table); + $quotedTableName = $tableIdentifier->getQuotedName($this); + $unquotedTableName = $tableIdentifier->getName(); + + $nameIdentifier = $this->normalizeIdentifier($name); + $quotedName = $nameIdentifier->getQuotedName($this); + $unquotedName = $nameIdentifier->getName(); + + $sql = []; + + $autoincrementIdentifierName = $this->getAutoincrementIdentifierName($tableIdentifier); + + $idx = new Index($autoincrementIdentifierName, [$quotedName], true, true); + + $sql[] = "DECLARE + constraints_Count NUMBER; +BEGIN + SELECT COUNT(CONSTRAINT_NAME) INTO constraints_Count + FROM USER_CONSTRAINTS + WHERE TABLE_NAME = '" . $unquotedTableName . "' + AND CONSTRAINT_TYPE = 'P'; + IF constraints_Count = 0 OR constraints_Count = '' THEN + EXECUTE IMMEDIATE '" . $this->getCreateConstraintSQL($idx, $quotedTableName) . "'; + END IF; +END;"; + + $sequenceName = $this->getIdentitySequenceName( + $tableIdentifier->isQuoted() ? $quotedTableName : $unquotedTableName, + $nameIdentifier->isQuoted() ? $quotedName : $unquotedName + ); + $sequence = new Sequence($sequenceName, $start); + $sql[] = $this->getCreateSequenceSQL($sequence); + + $sql[] = 'CREATE TRIGGER ' . $autoincrementIdentifierName . ' + BEFORE INSERT + ON ' . $quotedTableName . ' + FOR EACH ROW +DECLARE + last_Sequence NUMBER; + last_InsertID NUMBER; +BEGIN + IF (:NEW.' . $quotedName . ' IS NULL OR :NEW.' . $quotedName . ' = 0) THEN + SELECT ' . $sequenceName . '.NEXTVAL INTO :NEW.' . $quotedName . ' FROM DUAL; + ELSE + SELECT NVL(Last_Number, 0) INTO last_Sequence + FROM User_Sequences + WHERE Sequence_Name = \'' . $sequence->getName() . '\'; + SELECT :NEW.' . $quotedName . ' INTO last_InsertID FROM DUAL; + WHILE (last_InsertID > last_Sequence) LOOP + SELECT ' . $sequenceName . '.NEXTVAL INTO last_Sequence FROM DUAL; + END LOOP; + SELECT ' . $sequenceName . '.NEXTVAL INTO last_Sequence FROM DUAL; + END IF; +END;'; + + return $sql; + } + + /** + * Returns the SQL statements to drop the autoincrement for the given table name. + * + * @param string $table The table name to drop the autoincrement for. + * + * @return string[] + */ + public function getDropAutoincrementSql($table) + { + $table = $this->normalizeIdentifier($table); + $autoincrementIdentifierName = $this->getAutoincrementIdentifierName($table); + $identitySequenceName = $this->getIdentitySequenceName( + $table->isQuoted() ? $table->getQuotedName($this) : $table->getName(), + '' + ); + + return [ + 'DROP TRIGGER ' . $autoincrementIdentifierName, + $this->getDropSequenceSQL($identitySequenceName), + $this->getDropConstraintSQL($autoincrementIdentifierName, $table->getQuotedName($this)), + ]; + } + + /** + * Normalizes the given identifier. + * + * Uppercases the given identifier if it is not quoted by intention + * to reflect Oracle's internal auto uppercasing strategy of unquoted identifiers. + * + * @param string $name The identifier to normalize. + * + * @return Identifier The normalized identifier. + */ + private function normalizeIdentifier($name) + { + $identifier = new Identifier($name); + + return $identifier->isQuoted() ? $identifier : new Identifier(strtoupper($name)); + } + + /** + * Adds suffix to identifier, + * + * if the new string exceeds max identifier length, + * keeps $suffix, cuts from $identifier as much as the part exceeding. + */ + private function addSuffix(string $identifier, string $suffix): string + { + $maxPossibleLengthWithoutSuffix = $this->getMaxIdentifierLength() - strlen($suffix); + if (strlen($identifier) > $maxPossibleLengthWithoutSuffix) { + $identifier = substr($identifier, 0, $maxPossibleLengthWithoutSuffix); + } + + return $identifier . $suffix; + } + + /** + * Returns the autoincrement primary key identifier name for the given table identifier. + * + * Quotes the autoincrement primary key identifier name + * if the given table name is quoted by intention. + * + * @param Identifier $table The table identifier to return the autoincrement primary key identifier name for. + * + * @return string + */ + private function getAutoincrementIdentifierName(Identifier $table) + { + $identifierName = $this->addSuffix($table->getName(), '_AI_PK'); + + return $table->isQuoted() + ? $this->quoteSingleIdentifier($identifierName) + : $identifierName; + } + + /** + * {@inheritDoc} + */ + public function getListTableForeignKeysSQL($table) + { + $table = $this->normalizeIdentifier($table); + $table = $this->quoteStringLiteral($table->getName()); + + return "SELECT alc.constraint_name, + alc.DELETE_RULE, + cols.column_name \"local_column\", + cols.position, + ( + SELECT r_cols.table_name + FROM user_cons_columns r_cols + WHERE alc.r_constraint_name = r_cols.constraint_name + AND r_cols.position = cols.position + ) AS \"references_table\", + ( + SELECT r_cols.column_name + FROM user_cons_columns r_cols + WHERE alc.r_constraint_name = r_cols.constraint_name + AND r_cols.position = cols.position + ) AS \"foreign_column\" + FROM user_cons_columns cols + JOIN user_constraints alc + ON alc.constraint_name = cols.constraint_name + AND alc.constraint_type = 'R' + AND alc.table_name = " . $table . ' + ORDER BY cols.constraint_name ASC, cols.position ASC'; + } + + /** + * {@inheritDoc} + */ + public function getListTableConstraintsSQL($table) + { + $table = $this->normalizeIdentifier($table); + $table = $this->quoteStringLiteral($table->getName()); + + return 'SELECT * FROM user_constraints WHERE table_name = ' . $table; + } + + /** + * {@inheritDoc} + */ + public function getListTableColumnsSQL($table, $database = null) + { + $table = $this->normalizeIdentifier($table); + $table = $this->quoteStringLiteral($table->getName()); + + $tabColumnsTableName = 'user_tab_columns'; + $colCommentsTableName = 'user_col_comments'; + $tabColumnsOwnerCondition = ''; + $colCommentsOwnerCondition = ''; + + if ($database !== null && $database !== '/') { + $database = $this->normalizeIdentifier($database); + $database = $this->quoteStringLiteral($database->getName()); + $tabColumnsTableName = 'all_tab_columns'; + $colCommentsTableName = 'all_col_comments'; + $tabColumnsOwnerCondition = ' AND c.owner = ' . $database; + $colCommentsOwnerCondition = ' AND d.OWNER = c.OWNER'; + } + + return sprintf( + <<<'SQL' +SELECT c.*, + ( + SELECT d.comments + FROM %s d + WHERE d.TABLE_NAME = c.TABLE_NAME%s + AND d.COLUMN_NAME = c.COLUMN_NAME + ) AS comments +FROM %s c +WHERE c.table_name = %s%s +ORDER BY c.column_id +SQL + , + $colCommentsTableName, + $colCommentsOwnerCondition, + $tabColumnsTableName, + $table, + $tabColumnsOwnerCondition + ); + } + + /** + * {@inheritDoc} + */ + public function getDropSequenceSQL($sequence) + { + if ($sequence instanceof Sequence) { + $sequence = $sequence->getQuotedName($this); + } + + return 'DROP SEQUENCE ' . $sequence; + } + + /** + * {@inheritDoc} + */ + public function getDropForeignKeySQL($foreignKey, $table) + { + if (! $foreignKey instanceof ForeignKeyConstraint) { + $foreignKey = new Identifier($foreignKey); + } + + if (! $table instanceof Table) { + $table = new Identifier($table); + } + + $foreignKey = $foreignKey->getQuotedName($this); + $table = $table->getQuotedName($this); + + return 'ALTER TABLE ' . $table . ' DROP CONSTRAINT ' . $foreignKey; + } + + /** + * {@inheritdoc} + */ + public function getAdvancedForeignKeyOptionsSQL(ForeignKeyConstraint $foreignKey) + { + $referentialAction = ''; + + if ($foreignKey->hasOption('onDelete')) { + $referentialAction = $this->getForeignKeyReferentialActionSQL($foreignKey->getOption('onDelete')); + } + + if ($referentialAction !== '') { + return ' ON DELETE ' . $referentialAction; + } + + return ''; + } + + /** + * {@inheritdoc} + */ + public function getForeignKeyReferentialActionSQL($action) + { + $action = strtoupper($action); + + switch ($action) { + case 'RESTRICT': // RESTRICT is not supported, therefore falling back to NO ACTION. + case 'NO ACTION': + // NO ACTION cannot be declared explicitly, + // therefore returning empty string to indicate to OMIT the referential clause. + return ''; + + case 'CASCADE': + case 'SET NULL': + return $action; + + default: + // SET DEFAULT is not supported, throw exception instead. + throw new InvalidArgumentException('Invalid foreign key action: ' . $action); + } + } + + /** + * {@inheritDoc} + */ + public function getDropDatabaseSQL($name) + { + return 'DROP USER ' . $name . ' CASCADE'; + } + + /** + * {@inheritDoc} + */ + public function getAlterTableSQL(TableDiff $diff) + { + $sql = []; + $commentsSQL = []; + $columnSql = []; + + $fields = []; + + foreach ($diff->addedColumns as $column) { + if ($this->onSchemaAlterTableAddColumn($column, $diff, $columnSql)) { + continue; + } + + $fields[] = $this->getColumnDeclarationSQL($column->getQuotedName($this), $column->toArray()); + $comment = $this->getColumnComment($column); + + if ($comment === null || $comment === '') { + continue; + } + + $commentsSQL[] = $this->getCommentOnColumnSQL( + $diff->getName($this)->getQuotedName($this), + $column->getQuotedName($this), + $comment + ); + } + + if (count($fields) > 0) { + $sql[] = 'ALTER TABLE ' . $diff->getName($this)->getQuotedName($this) + . ' ADD (' . implode(', ', $fields) . ')'; + } + + $fields = []; + foreach ($diff->changedColumns as $columnDiff) { + if ($this->onSchemaAlterTableChangeColumn($columnDiff, $diff, $columnSql)) { + continue; + } + + $column = $columnDiff->column; + + // Do not generate column alteration clause if type is binary and only fixed property has changed. + // Oracle only supports binary type columns with variable length. + // Avoids unnecessary table alteration statements. + if ( + $column->getType() instanceof BinaryType && + $columnDiff->hasChanged('fixed') && + count($columnDiff->changedProperties) === 1 + ) { + continue; + } + + $columnHasChangedComment = $columnDiff->hasChanged('comment'); + + /** + * Do not add query part if only comment has changed + */ + if (! ($columnHasChangedComment && count($columnDiff->changedProperties) === 1)) { + $columnInfo = $column->toArray(); + + if (! $columnDiff->hasChanged('notnull')) { + unset($columnInfo['notnull']); + } + + $fields[] = $column->getQuotedName($this) . $this->getColumnDeclarationSQL('', $columnInfo); + } + + if (! $columnHasChangedComment) { + continue; + } + + $commentsSQL[] = $this->getCommentOnColumnSQL( + $diff->getName($this)->getQuotedName($this), + $column->getQuotedName($this), + $this->getColumnComment($column) + ); + } + + if (count($fields) > 0) { + $sql[] = 'ALTER TABLE ' . $diff->getName($this)->getQuotedName($this) + . ' MODIFY (' . implode(', ', $fields) . ')'; + } + + foreach ($diff->renamedColumns as $oldColumnName => $column) { + if ($this->onSchemaAlterTableRenameColumn($oldColumnName, $column, $diff, $columnSql)) { + continue; + } + + $oldColumnName = new Identifier($oldColumnName); + + $sql[] = 'ALTER TABLE ' . $diff->getName($this)->getQuotedName($this) . + ' RENAME COLUMN ' . $oldColumnName->getQuotedName($this) . ' TO ' . $column->getQuotedName($this); + } + + $fields = []; + foreach ($diff->removedColumns as $column) { + if ($this->onSchemaAlterTableRemoveColumn($column, $diff, $columnSql)) { + continue; + } + + $fields[] = $column->getQuotedName($this); + } + + if (count($fields) > 0) { + $sql[] = 'ALTER TABLE ' . $diff->getName($this)->getQuotedName($this) + . ' DROP (' . implode(', ', $fields) . ')'; + } + + $tableSql = []; + + if (! $this->onSchemaAlterTable($diff, $tableSql)) { + $sql = array_merge($sql, $commentsSQL); + + $newName = $diff->getNewName(); + + if ($newName !== false) { + $sql[] = sprintf( + 'ALTER TABLE %s RENAME TO %s', + $diff->getName($this)->getQuotedName($this), + $newName->getQuotedName($this) + ); + } + + $sql = array_merge( + $this->getPreAlterTableIndexForeignKeySQL($diff), + $sql, + $this->getPostAlterTableIndexForeignKeySQL($diff) + ); + } + + return array_merge($sql, $tableSql, $columnSql); + } + + /** + * {@inheritdoc} + */ + public function getColumnDeclarationSQL($name, array $column) + { + if (isset($column['columnDefinition'])) { + $columnDef = $this->getCustomTypeDeclarationSQL($column); + } else { + $default = $this->getDefaultValueDeclarationSQL($column); + + $notnull = ''; + + if (isset($column['notnull'])) { + $notnull = $column['notnull'] ? ' NOT NULL' : ' NULL'; + } + + $unique = ! empty($column['unique']) ? + ' ' . $this->getUniqueFieldDeclarationSQL() : ''; + + $check = ! empty($column['check']) ? + ' ' . $column['check'] : ''; + + $typeDecl = $column['type']->getSQLDeclaration($column, $this); + $columnDef = $typeDecl . $default . $notnull . $unique . $check; + } + + return $name . ' ' . $columnDef; + } + + /** + * {@inheritdoc} + */ + protected function getRenameIndexSQL($oldIndexName, Index $index, $tableName) + { + if (strpos($tableName, '.') !== false) { + [$schema] = explode('.', $tableName); + $oldIndexName = $schema . '.' . $oldIndexName; + } + + return ['ALTER INDEX ' . $oldIndexName . ' RENAME TO ' . $index->getQuotedName($this)]; + } + + /** + * {@inheritdoc} + */ + public function usesSequenceEmulatedIdentityColumns() + { + return true; + } + + /** + * {@inheritdoc} + */ + public function getIdentitySequenceName($tableName, $columnName) + { + $table = new Identifier($tableName); + + // No usage of column name to preserve BC compatibility with <2.5 + $identitySequenceName = $this->addSuffix($table->getName(), '_SEQ'); + + if ($table->isQuoted()) { + $identitySequenceName = '"' . $identitySequenceName . '"'; + } + + $identitySequenceIdentifier = $this->normalizeIdentifier($identitySequenceName); + + return $identitySequenceIdentifier->getQuotedName($this); + } + + /** + * {@inheritDoc} + */ + public function supportsCommentOnStatement() + { + return true; + } + + /** + * {@inheritDoc} + */ + public function getName() + { + return 'oracle'; + } + + /** + * {@inheritDoc} + */ + protected function doModifyLimitQuery($query, $limit, $offset) + { + if ($limit === null && $offset <= 0) { + return $query; + } + + if (preg_match('/^\s*SELECT/i', $query) === 1) { + if (preg_match('/\sFROM\s/i', $query) === 0) { + $query .= ' FROM dual'; + } + + $columns = ['a.*']; + + if ($offset > 0) { + $columns[] = 'ROWNUM AS doctrine_rownum'; + } + + $query = sprintf('SELECT %s FROM (%s) a', implode(', ', $columns), $query); + + if ($limit !== null) { + $query .= sprintf(' WHERE ROWNUM <= %d', $offset + $limit); + } + + if ($offset > 0) { + $query = sprintf('SELECT * FROM (%s) WHERE doctrine_rownum >= %d', $query, $offset + 1); + } + } + + return $query; + } + + /** + * {@inheritDoc} + */ + public function getCreateTemporaryTableSnippetSQL() + { + return 'CREATE GLOBAL TEMPORARY TABLE'; + } + + /** + * {@inheritDoc} + */ + public function getDateTimeTzFormatString() + { + return 'Y-m-d H:i:sP'; + } + + /** + * {@inheritDoc} + */ + public function getDateFormatString() + { + return 'Y-m-d 00:00:00'; + } + + /** + * {@inheritDoc} + */ + public function getTimeFormatString() + { + return '1900-01-01 H:i:s'; + } + + /** + * {@inheritDoc} + */ + public function getMaxIdentifierLength() + { + return 30; + } + + /** + * {@inheritDoc} + */ + public function supportsSequences() + { + return true; + } + + /** + * {@inheritDoc} + */ + public function supportsReleaseSavepoints() + { + return false; + } + + /** + * {@inheritDoc} + */ + public function getTruncateTableSQL($tableName, $cascade = false) + { + $tableIdentifier = new Identifier($tableName); + + return 'TRUNCATE TABLE ' . $tableIdentifier->getQuotedName($this); + } + + /** + * {@inheritDoc} + */ + public function getDummySelectSQL() + { + $expression = func_num_args() > 0 ? func_get_arg(0) : '1'; + + return sprintf('SELECT %s FROM DUAL', $expression); + } + + /** + * {@inheritDoc} + */ + protected function initializeDoctrineTypeMappings() + { + $this->doctrineTypeMapping = [ + 'binary_double' => 'float', + 'binary_float' => 'float', + 'binary_integer' => 'boolean', + 'blob' => 'blob', + 'char' => 'string', + 'clob' => 'text', + 'date' => 'date', + 'float' => 'float', + 'integer' => 'integer', + 'long' => 'string', + 'long raw' => 'blob', + 'nchar' => 'string', + 'nclob' => 'text', + 'number' => 'integer', + 'nvarchar2' => 'string', + 'pls_integer' => 'boolean', + 'raw' => 'binary', + 'rowid' => 'string', + 'timestamp' => 'datetime', + 'timestamptz' => 'datetimetz', + 'urowid' => 'string', + 'varchar' => 'string', + 'varchar2' => 'string', + ]; + } + + /** + * {@inheritDoc} + */ + public function releaseSavePoint($savepoint) + { + return ''; + } + + /** + * {@inheritDoc} + * + * @deprecated Implement {@link createReservedKeywordsList()} instead. + */ + protected function getReservedKeywordsClass() + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4510', + 'OraclePlatform::getReservedKeywordsClass() is deprecated,' + . ' use OraclePlatform::createReservedKeywordsList() instead.' + ); + + return Keywords\OracleKeywords::class; + } + + /** + * {@inheritDoc} + */ + public function getBlobTypeDeclarationSQL(array $column) + { + return 'BLOB'; + } + + public function getListTableCommentsSQL(string $table, ?string $database = null): string + { + $tableCommentsName = 'user_tab_comments'; + $ownerCondition = ''; + + if ($database !== null && $database !== '/') { + $tableCommentsName = 'all_tab_comments'; + $ownerCondition = ' AND owner = ' . $this->quoteStringLiteral( + $this->normalizeIdentifier($database)->getName() + ); + } + + return sprintf( + <<<'SQL' +SELECT comments FROM %s WHERE table_name = %s%s +SQL + , + $tableCommentsName, + $this->quoteStringLiteral($this->normalizeIdentifier($table)->getName()), + $ownerCondition + ); + } +} diff --git a/app/vendor/doctrine/dbal/src/Platforms/PostgreSQL100Platform.php b/app/vendor/doctrine/dbal/src/Platforms/PostgreSQL100Platform.php new file mode 100644 index 000000000..c9ca509d0 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Platforms/PostgreSQL100Platform.php @@ -0,0 +1,44 @@ +quoteStringLiteral($database) . " + AND sequence_schema NOT LIKE 'pg\_%' + AND sequence_schema != 'information_schema'"; + } +} diff --git a/app/vendor/doctrine/dbal/src/Platforms/PostgreSQL94Platform.php b/app/vendor/doctrine/dbal/src/Platforms/PostgreSQL94Platform.php new file mode 100644 index 000000000..bf21477c6 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Platforms/PostgreSQL94Platform.php @@ -0,0 +1,1307 @@ + [ + 't', + 'true', + 'y', + 'yes', + 'on', + '1', + ], + 'false' => [ + 'f', + 'false', + 'n', + 'no', + 'off', + '0', + ], + ]; + + /** + * PostgreSQL has different behavior with some drivers + * with regard to how booleans have to be handled. + * + * Enables use of 'true'/'false' or otherwise 1 and 0 instead. + * + * @param bool $flag + * + * @return void + */ + public function setUseBooleanTrueFalseStrings($flag) + { + $this->useBooleanTrueFalseStrings = (bool) $flag; + } + + /** + * {@inheritDoc} + */ + public function getSubstringExpression($string, $start, $length = null) + { + if ($length === null) { + return 'SUBSTRING(' . $string . ' FROM ' . $start . ')'; + } + + return 'SUBSTRING(' . $string . ' FROM ' . $start . ' FOR ' . $length . ')'; + } + + /** + * {@inheritDoc} + */ + public function getNowExpression() + { + return 'LOCALTIMESTAMP(0)'; + } + + /** + * {@inheritDoc} + */ + public function getRegexpExpression() + { + return 'SIMILAR TO'; + } + + /** + * {@inheritDoc} + */ + public function getLocateExpression($str, $substr, $startPos = false) + { + if ($startPos !== false) { + $str = $this->getSubstringExpression($str, $startPos); + + return 'CASE WHEN (POSITION(' . $substr . ' IN ' . $str . ') = 0) THEN 0' + . ' ELSE (POSITION(' . $substr . ' IN ' . $str . ') + ' . ($startPos - 1) . ') END'; + } + + return 'POSITION(' . $substr . ' IN ' . $str . ')'; + } + + /** + * {@inheritdoc} + */ + protected function getDateArithmeticIntervalExpression($date, $operator, $interval, $unit) + { + if ($unit === DateIntervalUnit::QUARTER) { + $interval *= 3; + $unit = DateIntervalUnit::MONTH; + } + + return '(' . $date . ' ' . $operator . ' (' . $interval . " || ' " . $unit . "')::interval)"; + } + + /** + * {@inheritDoc} + */ + public function getDateDiffExpression($date1, $date2) + { + return '(DATE(' . $date1 . ')-DATE(' . $date2 . '))'; + } + + public function getCurrentDatabaseExpression(): string + { + return 'CURRENT_DATABASE()'; + } + + /** + * {@inheritDoc} + */ + public function supportsSequences() + { + return true; + } + + /** + * {@inheritDoc} + */ + public function supportsSchemas() + { + return true; + } + + /** + * {@inheritdoc} + */ + public function getDefaultSchemaName() + { + return 'public'; + } + + /** + * {@inheritDoc} + */ + public function supportsIdentityColumns() + { + return true; + } + + /** + * {@inheritdoc} + */ + public function supportsPartialIndexes() + { + return true; + } + + /** + * {@inheritdoc} + */ + public function usesSequenceEmulatedIdentityColumns() + { + return true; + } + + /** + * {@inheritdoc} + */ + public function getIdentitySequenceName($tableName, $columnName) + { + return $tableName . '_' . $columnName . '_seq'; + } + + /** + * {@inheritDoc} + */ + public function supportsCommentOnStatement() + { + return true; + } + + /** + * {@inheritDoc} + */ + public function hasNativeGuidType() + { + return true; + } + + /** + * {@inheritDoc} + */ + public function getListDatabasesSQL() + { + return 'SELECT datname FROM pg_database'; + } + + /** + * {@inheritDoc} + * + * @deprecated Use {@link PostgreSQLSchemaManager::listSchemaNames()} instead. + */ + public function getListNamespacesSQL() + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4503', + 'PostgreSQL94Platform::getListNamespacesSQL() is deprecated,' + . ' use PostgreSQLSchemaManager::listSchemaNames() instead.' + ); + + return "SELECT schema_name AS nspname + FROM information_schema.schemata + WHERE schema_name NOT LIKE 'pg\_%' + AND schema_name != 'information_schema'"; + } + + /** + * {@inheritDoc} + */ + public function getListSequencesSQL($database) + { + return "SELECT sequence_name AS relname, + sequence_schema AS schemaname + FROM information_schema.sequences + WHERE sequence_schema NOT LIKE 'pg\_%' + AND sequence_schema != 'information_schema'"; + } + + /** + * {@inheritDoc} + */ + public function getListTablesSQL() + { + return "SELECT quote_ident(table_name) AS table_name, + table_schema AS schema_name + FROM information_schema.tables + WHERE table_schema NOT LIKE 'pg\_%' + AND table_schema != 'information_schema' + AND table_name != 'geometry_columns' + AND table_name != 'spatial_ref_sys' + AND table_type != 'VIEW'"; + } + + /** + * {@inheritDoc} + */ + public function getListViewsSQL($database) + { + return 'SELECT quote_ident(table_name) AS viewname, + table_schema AS schemaname, + view_definition AS definition + FROM information_schema.views + WHERE view_definition IS NOT NULL'; + } + + /** + * @param string $table + * @param string|null $database + * + * @return string + */ + public function getListTableForeignKeysSQL($table, $database = null) + { + return 'SELECT quote_ident(r.conname) as conname, pg_catalog.pg_get_constraintdef(r.oid, true) as condef + FROM pg_catalog.pg_constraint r + WHERE r.conrelid = + ( + SELECT c.oid + FROM pg_catalog.pg_class c, pg_catalog.pg_namespace n + WHERE ' . $this->getTableWhereClause($table) . " AND n.oid = c.relnamespace + ) + AND r.contype = 'f'"; + } + + /** + * {@inheritDoc} + */ + public function getCreateViewSQL($name, $sql) + { + return 'CREATE VIEW ' . $name . ' AS ' . $sql; + } + + /** + * {@inheritDoc} + */ + public function getDropViewSQL($name) + { + return 'DROP VIEW ' . $name; + } + + /** + * {@inheritDoc} + */ + public function getListTableConstraintsSQL($table) + { + $table = new Identifier($table); + $table = $this->quoteStringLiteral($table->getName()); + + return sprintf( + <<<'SQL' +SELECT + quote_ident(relname) as relname +FROM + pg_class +WHERE oid IN ( + SELECT indexrelid + FROM pg_index, pg_class + WHERE pg_class.relname = %s + AND pg_class.oid = pg_index.indrelid + AND (indisunique = 't' OR indisprimary = 't') + ) +SQL + , + $table + ); + } + + /** + * {@inheritDoc} + * + * @link http://ezcomponents.org/docs/api/trunk/DatabaseSchema/ezcDbSchemaPgsqlReader.html + */ + public function getListTableIndexesSQL($table, $database = null) + { + return 'SELECT quote_ident(relname) as relname, pg_index.indisunique, pg_index.indisprimary, + pg_index.indkey, pg_index.indrelid, + pg_get_expr(indpred, indrelid) AS where + FROM pg_class, pg_index + WHERE oid IN ( + SELECT indexrelid + FROM pg_index si, pg_class sc, pg_namespace sn + WHERE ' . $this->getTableWhereClause($table, 'sc', 'sn') . ' + AND sc.oid=si.indrelid AND sc.relnamespace = sn.oid + ) AND pg_index.indexrelid = oid'; + } + + /** + * @param string $table + * @param string $classAlias + * @param string $namespaceAlias + * + * @return string + */ + private function getTableWhereClause($table, $classAlias = 'c', $namespaceAlias = 'n') + { + $whereClause = $namespaceAlias . ".nspname NOT IN ('pg_catalog', 'information_schema', 'pg_toast') AND "; + if (strpos($table, '.') !== false) { + [$schema, $table] = explode('.', $table); + $schema = $this->quoteStringLiteral($schema); + } else { + $schema = 'ANY(current_schemas(false))'; + } + + $table = new Identifier($table); + $table = $this->quoteStringLiteral($table->getName()); + + return $whereClause . sprintf( + '%s.relname = %s AND %s.nspname = %s', + $classAlias, + $table, + $namespaceAlias, + $schema + ); + } + + /** + * {@inheritDoc} + */ + public function getListTableColumnsSQL($table, $database = null) + { + return "SELECT + a.attnum, + quote_ident(a.attname) AS field, + t.typname AS type, + format_type(a.atttypid, a.atttypmod) AS complete_type, + (SELECT tc.collcollate FROM pg_catalog.pg_collation tc WHERE tc.oid = a.attcollation) AS collation, + (SELECT t1.typname FROM pg_catalog.pg_type t1 WHERE t1.oid = t.typbasetype) AS domain_type, + (SELECT format_type(t2.typbasetype, t2.typtypmod) FROM + pg_catalog.pg_type t2 WHERE t2.typtype = 'd' AND t2.oid = a.atttypid) AS domain_complete_type, + a.attnotnull AS isnotnull, + (SELECT 't' + FROM pg_index + WHERE c.oid = pg_index.indrelid + AND pg_index.indkey[0] = a.attnum + AND pg_index.indisprimary = 't' + ) AS pri, + (SELECT pg_get_expr(adbin, adrelid) + FROM pg_attrdef + WHERE c.oid = pg_attrdef.adrelid + AND pg_attrdef.adnum=a.attnum + ) AS default, + (SELECT pg_description.description + FROM pg_description WHERE pg_description.objoid = c.oid AND a.attnum = pg_description.objsubid + ) AS comment + FROM pg_attribute a, pg_class c, pg_type t, pg_namespace n + WHERE " . $this->getTableWhereClause($table, 'c', 'n') . ' + AND a.attnum > 0 + AND a.attrelid = c.oid + AND a.atttypid = t.oid + AND n.oid = c.relnamespace + ORDER BY a.attnum'; + } + + /** + * {@inheritDoc} + */ + public function getCreateDatabaseSQL($name) + { + return 'CREATE DATABASE ' . $name; + } + + /** + * {@inheritDoc} + */ + public function getAdvancedForeignKeyOptionsSQL(ForeignKeyConstraint $foreignKey) + { + $query = ''; + + if ($foreignKey->hasOption('match')) { + $query .= ' MATCH ' . $foreignKey->getOption('match'); + } + + $query .= parent::getAdvancedForeignKeyOptionsSQL($foreignKey); + + if ($foreignKey->hasOption('deferrable') && $foreignKey->getOption('deferrable') !== false) { + $query .= ' DEFERRABLE'; + } else { + $query .= ' NOT DEFERRABLE'; + } + + if ( + ($foreignKey->hasOption('feferred') && $foreignKey->getOption('feferred') !== false) + || ($foreignKey->hasOption('deferred') && $foreignKey->getOption('deferred') !== false) + ) { + $query .= ' INITIALLY DEFERRED'; + } else { + $query .= ' INITIALLY IMMEDIATE'; + } + + return $query; + } + + /** + * {@inheritDoc} + */ + public function getAlterTableSQL(TableDiff $diff) + { + $sql = []; + $commentsSQL = []; + $columnSql = []; + + foreach ($diff->addedColumns as $column) { + if ($this->onSchemaAlterTableAddColumn($column, $diff, $columnSql)) { + continue; + } + + $query = 'ADD ' . $this->getColumnDeclarationSQL($column->getQuotedName($this), $column->toArray()); + $sql[] = 'ALTER TABLE ' . $diff->getName($this)->getQuotedName($this) . ' ' . $query; + + $comment = $this->getColumnComment($column); + + if ($comment === null || $comment === '') { + continue; + } + + $commentsSQL[] = $this->getCommentOnColumnSQL( + $diff->getName($this)->getQuotedName($this), + $column->getQuotedName($this), + $comment + ); + } + + foreach ($diff->removedColumns as $column) { + if ($this->onSchemaAlterTableRemoveColumn($column, $diff, $columnSql)) { + continue; + } + + $query = 'DROP ' . $column->getQuotedName($this); + $sql[] = 'ALTER TABLE ' . $diff->getName($this)->getQuotedName($this) . ' ' . $query; + } + + foreach ($diff->changedColumns as $columnDiff) { + if ($this->onSchemaAlterTableChangeColumn($columnDiff, $diff, $columnSql)) { + continue; + } + + if ($this->isUnchangedBinaryColumn($columnDiff)) { + continue; + } + + $oldColumnName = $columnDiff->getOldColumnName()->getQuotedName($this); + $column = $columnDiff->column; + + if ( + $columnDiff->hasChanged('type') + || $columnDiff->hasChanged('precision') + || $columnDiff->hasChanged('scale') + || $columnDiff->hasChanged('fixed') + ) { + $type = $column->getType(); + + // SERIAL/BIGSERIAL are not "real" types and we can't alter a column to that type + $columnDefinition = $column->toArray(); + $columnDefinition['autoincrement'] = false; + + // here was a server version check before, but DBAL API does not support this anymore. + $query = 'ALTER ' . $oldColumnName . ' TYPE ' . $type->getSQLDeclaration($columnDefinition, $this); + $sql[] = 'ALTER TABLE ' . $diff->getName($this)->getQuotedName($this) . ' ' . $query; + } + + if ($columnDiff->hasChanged('default') || $this->typeChangeBreaksDefaultValue($columnDiff)) { + $defaultClause = $column->getDefault() === null + ? ' DROP DEFAULT' + : ' SET' . $this->getDefaultValueDeclarationSQL($column->toArray()); + $query = 'ALTER ' . $oldColumnName . $defaultClause; + $sql[] = 'ALTER TABLE ' . $diff->getName($this)->getQuotedName($this) . ' ' . $query; + } + + if ($columnDiff->hasChanged('notnull')) { + $query = 'ALTER ' . $oldColumnName . ' ' . ($column->getNotnull() ? 'SET' : 'DROP') . ' NOT NULL'; + $sql[] = 'ALTER TABLE ' . $diff->getName($this)->getQuotedName($this) . ' ' . $query; + } + + if ($columnDiff->hasChanged('autoincrement')) { + if ($column->getAutoincrement()) { + // add autoincrement + $seqName = $this->getIdentitySequenceName($diff->name, $oldColumnName); + + $sql[] = 'CREATE SEQUENCE ' . $seqName; + $sql[] = "SELECT setval('" . $seqName . "', (SELECT MAX(" . $oldColumnName . ') FROM ' + . $diff->getName($this)->getQuotedName($this) . '))'; + $query = 'ALTER ' . $oldColumnName . " SET DEFAULT nextval('" . $seqName . "')"; + $sql[] = 'ALTER TABLE ' . $diff->getName($this)->getQuotedName($this) . ' ' . $query; + } else { + // Drop autoincrement, but do NOT drop the sequence. It might be re-used by other tables or have + $query = 'ALTER ' . $oldColumnName . ' DROP DEFAULT'; + $sql[] = 'ALTER TABLE ' . $diff->getName($this)->getQuotedName($this) . ' ' . $query; + } + } + + $newComment = $this->getColumnComment($column); + $oldComment = $this->getOldColumnComment($columnDiff); + + if ( + $columnDiff->hasChanged('comment') + || ($columnDiff->fromColumn !== null && $oldComment !== $newComment) + ) { + $commentsSQL[] = $this->getCommentOnColumnSQL( + $diff->getName($this)->getQuotedName($this), + $column->getQuotedName($this), + $newComment + ); + } + + if (! $columnDiff->hasChanged('length')) { + continue; + } + + $query = 'ALTER ' . $oldColumnName . ' TYPE ' + . $column->getType()->getSQLDeclaration($column->toArray(), $this); + $sql[] = 'ALTER TABLE ' . $diff->getName($this)->getQuotedName($this) . ' ' . $query; + } + + foreach ($diff->renamedColumns as $oldColumnName => $column) { + if ($this->onSchemaAlterTableRenameColumn($oldColumnName, $column, $diff, $columnSql)) { + continue; + } + + $oldColumnName = new Identifier($oldColumnName); + + $sql[] = 'ALTER TABLE ' . $diff->getName($this)->getQuotedName($this) . + ' RENAME COLUMN ' . $oldColumnName->getQuotedName($this) . ' TO ' . $column->getQuotedName($this); + } + + $tableSql = []; + + if (! $this->onSchemaAlterTable($diff, $tableSql)) { + $sql = array_merge($sql, $commentsSQL); + + $newName = $diff->getNewName(); + + if ($newName !== false) { + $sql[] = sprintf( + 'ALTER TABLE %s RENAME TO %s', + $diff->getName($this)->getQuotedName($this), + $newName->getQuotedName($this) + ); + } + + $sql = array_merge( + $this->getPreAlterTableIndexForeignKeySQL($diff), + $sql, + $this->getPostAlterTableIndexForeignKeySQL($diff) + ); + } + + return array_merge($sql, $tableSql, $columnSql); + } + + /** + * Checks whether a given column diff is a logically unchanged binary type column. + * + * Used to determine whether a column alteration for a binary type column can be skipped. + * Doctrine's {@link BinaryType} and {@link BlobType} are mapped to the same database column type on this platform + * as this platform does not have a native VARBINARY/BINARY column type. Therefore the comparator + * might detect differences for binary type columns which do not have to be propagated + * to database as there actually is no difference at database level. + * + * @param ColumnDiff $columnDiff The column diff to check against. + * + * @return bool True if the given column diff is an unchanged binary type column, false otherwise. + */ + private function isUnchangedBinaryColumn(ColumnDiff $columnDiff) + { + $columnType = $columnDiff->column->getType(); + + if (! $columnType instanceof BinaryType && ! $columnType instanceof BlobType) { + return false; + } + + $fromColumn = $columnDiff->fromColumn instanceof Column ? $columnDiff->fromColumn : null; + + if ($fromColumn !== null) { + $fromColumnType = $fromColumn->getType(); + + if (! $fromColumnType instanceof BinaryType && ! $fromColumnType instanceof BlobType) { + return false; + } + + return count(array_diff($columnDiff->changedProperties, ['type', 'length', 'fixed'])) === 0; + } + + if ($columnDiff->hasChanged('type')) { + return false; + } + + return count(array_diff($columnDiff->changedProperties, ['length', 'fixed'])) === 0; + } + + /** + * {@inheritdoc} + */ + protected function getRenameIndexSQL($oldIndexName, Index $index, $tableName) + { + if (strpos($tableName, '.') !== false) { + [$schema] = explode('.', $tableName); + $oldIndexName = $schema . '.' . $oldIndexName; + } + + return ['ALTER INDEX ' . $oldIndexName . ' RENAME TO ' . $index->getQuotedName($this)]; + } + + /** + * {@inheritdoc} + */ + public function getCommentOnColumnSQL($tableName, $columnName, $comment) + { + $tableName = new Identifier($tableName); + $columnName = new Identifier($columnName); + $comment = $comment === null ? 'NULL' : $this->quoteStringLiteral($comment); + + return sprintf( + 'COMMENT ON COLUMN %s.%s IS %s', + $tableName->getQuotedName($this), + $columnName->getQuotedName($this), + $comment + ); + } + + /** + * {@inheritDoc} + */ + public function getCreateSequenceSQL(Sequence $sequence) + { + return 'CREATE SEQUENCE ' . $sequence->getQuotedName($this) . + ' INCREMENT BY ' . $sequence->getAllocationSize() . + ' MINVALUE ' . $sequence->getInitialValue() . + ' START ' . $sequence->getInitialValue() . + $this->getSequenceCacheSQL($sequence); + } + + /** + * {@inheritDoc} + */ + public function getAlterSequenceSQL(Sequence $sequence) + { + return 'ALTER SEQUENCE ' . $sequence->getQuotedName($this) . + ' INCREMENT BY ' . $sequence->getAllocationSize() . + $this->getSequenceCacheSQL($sequence); + } + + /** + * Cache definition for sequences + * + * @return string + */ + private function getSequenceCacheSQL(Sequence $sequence) + { + if ($sequence->getCache() > 1) { + return ' CACHE ' . $sequence->getCache(); + } + + return ''; + } + + /** + * {@inheritDoc} + */ + public function getDropSequenceSQL($sequence) + { + if ($sequence instanceof Sequence) { + $sequence = $sequence->getQuotedName($this); + } + + return 'DROP SEQUENCE ' . $sequence . ' CASCADE'; + } + + /** + * {@inheritDoc} + */ + public function getCreateSchemaSQL($schemaName) + { + return 'CREATE SCHEMA ' . $schemaName; + } + + /** + * {@inheritDoc} + */ + public function getDropForeignKeySQL($foreignKey, $table) + { + return $this->getDropConstraintSQL($foreignKey, $table); + } + + /** + * {@inheritDoc} + */ + protected function _getCreateTableSQL($name, array $columns, array $options = []) + { + $queryFields = $this->getColumnDeclarationListSQL($columns); + + if (isset($options['primary']) && ! empty($options['primary'])) { + $keyColumns = array_unique(array_values($options['primary'])); + $queryFields .= ', PRIMARY KEY(' . implode(', ', $keyColumns) . ')'; + } + + $query = 'CREATE TABLE ' . $name . ' (' . $queryFields . ')'; + + $sql = [$query]; + + if (isset($options['indexes']) && ! empty($options['indexes'])) { + foreach ($options['indexes'] as $index) { + $sql[] = $this->getCreateIndexSQL($index, $name); + } + } + + if (isset($options['uniqueConstraints'])) { + foreach ($options['uniqueConstraints'] as $uniqueConstraint) { + $sql[] = $this->getCreateConstraintSQL($uniqueConstraint, $name); + } + } + + if (isset($options['foreignKeys'])) { + foreach ((array) $options['foreignKeys'] as $definition) { + $sql[] = $this->getCreateForeignKeySQL($definition, $name); + } + } + + return $sql; + } + + /** + * Converts a single boolean value. + * + * First converts the value to its native PHP boolean type + * and passes it to the given callback function to be reconverted + * into any custom representation. + * + * @param mixed $value The value to convert. + * @param callable $callback The callback function to use for converting the real boolean value. + * + * @return mixed + * + * @throws UnexpectedValueException + */ + private function convertSingleBooleanValue($value, $callback) + { + if ($value === null) { + return $callback(null); + } + + if (is_bool($value) || is_numeric($value)) { + return $callback((bool) $value); + } + + if (! is_string($value)) { + return $callback(true); + } + + /** + * Better safe than sorry: http://php.net/in_array#106319 + */ + if (in_array(strtolower(trim($value)), $this->booleanLiterals['false'], true)) { + return $callback(false); + } + + if (in_array(strtolower(trim($value)), $this->booleanLiterals['true'], true)) { + return $callback(true); + } + + throw new UnexpectedValueException("Unrecognized boolean literal '${value}'"); + } + + /** + * Converts one or multiple boolean values. + * + * First converts the value(s) to their native PHP boolean type + * and passes them to the given callback function to be reconverted + * into any custom representation. + * + * @param mixed $item The value(s) to convert. + * @param callable $callback The callback function to use for converting the real boolean value(s). + * + * @return mixed + */ + private function doConvertBooleans($item, $callback) + { + if (is_array($item)) { + foreach ($item as $key => $value) { + $item[$key] = $this->convertSingleBooleanValue($value, $callback); + } + + return $item; + } + + return $this->convertSingleBooleanValue($item, $callback); + } + + /** + * {@inheritDoc} + * + * Postgres wants boolean values converted to the strings 'true'/'false'. + */ + public function convertBooleans($item) + { + if (! $this->useBooleanTrueFalseStrings) { + return parent::convertBooleans($item); + } + + return $this->doConvertBooleans( + $item, + /** + * @param mixed $value + */ + static function ($value) { + if ($value === null) { + return 'NULL'; + } + + return $value === true ? 'true' : 'false'; + } + ); + } + + /** + * {@inheritDoc} + */ + public function convertBooleansToDatabaseValue($item) + { + if (! $this->useBooleanTrueFalseStrings) { + return parent::convertBooleansToDatabaseValue($item); + } + + return $this->doConvertBooleans( + $item, + /** + * @param mixed $value + */ + static function ($value): ?int { + return $value === null ? null : (int) $value; + } + ); + } + + /** + * {@inheritDoc} + */ + public function convertFromBoolean($item) + { + if ($item !== null && in_array(strtolower($item), $this->booleanLiterals['false'], true)) { + return false; + } + + return parent::convertFromBoolean($item); + } + + /** + * {@inheritDoc} + */ + public function getSequenceNextValSQL($sequence) + { + return "SELECT NEXTVAL('" . $sequence . "')"; + } + + /** + * {@inheritDoc} + */ + public function getSetTransactionIsolationSQL($level) + { + return 'SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL ' + . $this->_getTransactionIsolationLevelSQL($level); + } + + /** + * {@inheritDoc} + */ + public function getBooleanTypeDeclarationSQL(array $column) + { + return 'BOOLEAN'; + } + + /** + * {@inheritDoc} + */ + public function getIntegerTypeDeclarationSQL(array $column) + { + if (! empty($column['autoincrement'])) { + return 'SERIAL'; + } + + return 'INT'; + } + + /** + * {@inheritDoc} + */ + public function getBigIntTypeDeclarationSQL(array $column) + { + if (! empty($column['autoincrement'])) { + return 'BIGSERIAL'; + } + + return 'BIGINT'; + } + + /** + * {@inheritDoc} + */ + public function getSmallIntTypeDeclarationSQL(array $column) + { + if (! empty($column['autoincrement'])) { + return 'SMALLSERIAL'; + } + + return 'SMALLINT'; + } + + /** + * {@inheritDoc} + */ + public function getGuidTypeDeclarationSQL(array $column) + { + return 'UUID'; + } + + /** + * {@inheritDoc} + */ + public function getDateTimeTypeDeclarationSQL(array $column) + { + return 'TIMESTAMP(0) WITHOUT TIME ZONE'; + } + + /** + * {@inheritDoc} + */ + public function getDateTimeTzTypeDeclarationSQL(array $column) + { + return 'TIMESTAMP(0) WITH TIME ZONE'; + } + + /** + * {@inheritDoc} + */ + public function getDateTypeDeclarationSQL(array $column) + { + return 'DATE'; + } + + /** + * {@inheritDoc} + */ + public function getTimeTypeDeclarationSQL(array $column) + { + return 'TIME(0) WITHOUT TIME ZONE'; + } + + /** + * {@inheritDoc} + */ + protected function _getCommonIntegerTypeDeclarationSQL(array $column) + { + return ''; + } + + /** + * {@inheritDoc} + */ + protected function getVarcharTypeDeclarationSQLSnippet($length, $fixed) + { + return $fixed ? ($length > 0 ? 'CHAR(' . $length . ')' : 'CHAR(255)') + : ($length > 0 ? 'VARCHAR(' . $length . ')' : 'VARCHAR(255)'); + } + + /** + * {@inheritdoc} + */ + protected function getBinaryTypeDeclarationSQLSnippet($length, $fixed) + { + return 'BYTEA'; + } + + /** + * {@inheritDoc} + */ + public function getClobTypeDeclarationSQL(array $column) + { + return 'TEXT'; + } + + /** + * {@inheritDoc} + */ + public function getName() + { + return 'postgresql'; + } + + /** + * {@inheritDoc} + */ + public function getDateTimeTzFormatString() + { + return 'Y-m-d H:i:sO'; + } + + /** + * {@inheritDoc} + */ + public function getEmptyIdentityInsertSQL($quotedTableName, $quotedIdentifierColumnName) + { + return 'INSERT INTO ' . $quotedTableName . ' (' . $quotedIdentifierColumnName . ') VALUES (DEFAULT)'; + } + + /** + * {@inheritDoc} + */ + public function getTruncateTableSQL($tableName, $cascade = false) + { + $tableIdentifier = new Identifier($tableName); + $sql = 'TRUNCATE ' . $tableIdentifier->getQuotedName($this); + + if ($cascade) { + $sql .= ' CASCADE'; + } + + return $sql; + } + + /** + * {@inheritDoc} + */ + public function getReadLockSQL() + { + return 'FOR SHARE'; + } + + /** + * {@inheritDoc} + */ + protected function initializeDoctrineTypeMappings() + { + $this->doctrineTypeMapping = [ + 'bigint' => 'bigint', + 'bigserial' => 'bigint', + 'bool' => 'boolean', + 'boolean' => 'boolean', + 'bpchar' => 'string', + 'bytea' => 'blob', + 'char' => 'string', + 'date' => 'date', + 'datetime' => 'datetime', + 'decimal' => 'decimal', + 'double' => 'float', + 'double precision' => 'float', + 'float' => 'float', + 'float4' => 'float', + 'float8' => 'float', + 'inet' => 'string', + 'int' => 'integer', + 'int2' => 'smallint', + 'int4' => 'integer', + 'int8' => 'bigint', + 'integer' => 'integer', + 'interval' => 'string', + 'json' => 'json', + 'jsonb' => 'json', + 'money' => 'decimal', + 'numeric' => 'decimal', + 'serial' => 'integer', + 'serial4' => 'integer', + 'serial8' => 'bigint', + 'real' => 'float', + 'smallint' => 'smallint', + 'text' => 'text', + 'time' => 'time', + 'timestamp' => 'datetime', + 'timestamptz' => 'datetimetz', + 'timetz' => 'time', + 'tsvector' => 'text', + 'uuid' => 'guid', + 'varchar' => 'string', + 'year' => 'date', + '_varchar' => 'string', + ]; + } + + /** + * {@inheritDoc} + */ + public function getVarcharMaxLength() + { + return 65535; + } + + /** + * {@inheritdoc} + */ + public function getBinaryMaxLength() + { + return 0; + } + + /** + * {@inheritdoc} + */ + public function getBinaryDefaultLength() + { + return 0; + } + + /** + * {@inheritdoc} + */ + public function hasNativeJsonType() + { + return true; + } + + /** + * {@inheritDoc} + * + * @deprecated Implement {@link createReservedKeywordsList()} instead. + */ + protected function getReservedKeywordsClass() + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4510', + 'PostgreSQL94Platform::getReservedKeywordsClass() is deprecated,' + . ' use PostgreSQL94Platform::createReservedKeywordsList() instead.' + ); + + return Keywords\PostgreSQL94Keywords::class; + } + + /** + * {@inheritDoc} + */ + public function getBlobTypeDeclarationSQL(array $column) + { + return 'BYTEA'; + } + + /** + * {@inheritdoc} + */ + public function getDefaultValueDeclarationSQL($column) + { + if ($this->isSerialColumn($column)) { + return ''; + } + + return parent::getDefaultValueDeclarationSQL($column); + } + + /** + * {@inheritdoc} + */ + public function supportsColumnCollation() + { + return true; + } + + /** + * {@inheritdoc} + */ + public function getColumnCollationDeclarationSQL($collation) + { + return 'COLLATE ' . $this->quoteSingleIdentifier($collation); + } + + /** + * {@inheritdoc} + */ + public function getJsonTypeDeclarationSQL(array $column) + { + if (! empty($column['jsonb'])) { + return 'JSONB'; + } + + return 'JSON'; + } + + /** + * @param mixed[] $column + */ + private function isSerialColumn(array $column): bool + { + return isset($column['type'], $column['autoincrement']) + && $column['autoincrement'] === true + && $this->isNumericType($column['type']); + } + + /** + * Check whether the type of a column is changed in a way that invalidates the default value for the column + */ + private function typeChangeBreaksDefaultValue(ColumnDiff $columnDiff): bool + { + if ($columnDiff->fromColumn === null) { + return $columnDiff->hasChanged('type'); + } + + $oldTypeIsNumeric = $this->isNumericType($columnDiff->fromColumn->getType()); + $newTypeIsNumeric = $this->isNumericType($columnDiff->column->getType()); + + // default should not be changed when switching between numeric types and the default comes from a sequence + return $columnDiff->hasChanged('type') + && ! ($oldTypeIsNumeric && $newTypeIsNumeric && $columnDiff->column->getAutoincrement()); + } + + private function isNumericType(Type $type): bool + { + return $type instanceof IntegerType || $type instanceof BigIntType; + } + + private function getOldColumnComment(ColumnDiff $columnDiff): ?string + { + return $columnDiff->fromColumn !== null ? $this->getColumnComment($columnDiff->fromColumn) : null; + } + + public function getListTableMetadataSQL(string $table, ?string $schema = null): string + { + if ($schema !== null) { + $table = $schema . '.' . $table; + } + + return sprintf( + <<<'SQL' +SELECT obj_description(%s::regclass) AS table_comment; +SQL + , + $this->quoteStringLiteral($table) + ); + } +} diff --git a/app/vendor/doctrine/dbal/src/Platforms/SQLServer2012Platform.php b/app/vendor/doctrine/dbal/src/Platforms/SQLServer2012Platform.php new file mode 100644 index 000000000..d94784d6c --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Platforms/SQLServer2012Platform.php @@ -0,0 +1,1731 @@ +getConvertExpression('date', 'GETDATE()'); + } + + /** + * {@inheritdoc} + */ + public function getCurrentTimeSQL() + { + return $this->getConvertExpression('time', 'GETDATE()'); + } + + /** + * Returns an expression that converts an expression of one data type to another. + * + * @param string $dataType The target native data type. Alias data types cannot be used. + * @param string $expression The SQL expression to convert. + * + * @return string + */ + private function getConvertExpression($dataType, $expression) + { + return sprintf('CONVERT(%s, %s)', $dataType, $expression); + } + + /** + * {@inheritdoc} + */ + protected function getDateArithmeticIntervalExpression($date, $operator, $interval, $unit) + { + $factorClause = ''; + + if ($operator === '-') { + $factorClause = '-1 * '; + } + + return 'DATEADD(' . $unit . ', ' . $factorClause . $interval . ', ' . $date . ')'; + } + + /** + * {@inheritDoc} + */ + public function getDateDiffExpression($date1, $date2) + { + return 'DATEDIFF(day, ' . $date2 . ',' . $date1 . ')'; + } + + /** + * {@inheritDoc} + * + * Microsoft SQL Server prefers "autoincrement" identity columns + * since sequences can only be emulated with a table. + */ + public function prefersIdentityColumns() + { + return true; + } + + /** + * {@inheritDoc} + * + * Microsoft SQL Server supports this through AUTO_INCREMENT columns. + */ + public function supportsIdentityColumns() + { + return true; + } + + /** + * {@inheritDoc} + */ + public function supportsReleaseSavepoints() + { + return false; + } + + /** + * {@inheritdoc} + */ + public function supportsSchemas() + { + return true; + } + + /** + * {@inheritdoc} + */ + public function getDefaultSchemaName() + { + return 'dbo'; + } + + /** + * {@inheritDoc} + */ + public function supportsColumnCollation() + { + return true; + } + + public function supportsSequences(): bool + { + return true; + } + + public function getAlterSequenceSQL(Sequence $sequence): string + { + return 'ALTER SEQUENCE ' . $sequence->getQuotedName($this) . + ' INCREMENT BY ' . $sequence->getAllocationSize(); + } + + public function getCreateSequenceSQL(Sequence $sequence): string + { + return 'CREATE SEQUENCE ' . $sequence->getQuotedName($this) . + ' START WITH ' . $sequence->getInitialValue() . + ' INCREMENT BY ' . $sequence->getAllocationSize() . + ' MINVALUE ' . $sequence->getInitialValue(); + } + + /** + * {@inheritdoc} + */ + public function getDropSequenceSQL($sequence): string + { + if ($sequence instanceof Sequence) { + $sequence = $sequence->getQuotedName($this); + } + + return 'DROP SEQUENCE ' . $sequence; + } + + /** + * {@inheritdoc} + */ + public function getListSequencesSQL($database) + { + return 'SELECT seq.name, + CAST( + seq.increment AS VARCHAR(MAX) + ) AS increment, -- CAST avoids driver error for sql_variant type + CAST( + seq.start_value AS VARCHAR(MAX) + ) AS start_value -- CAST avoids driver error for sql_variant type + FROM sys.sequences AS seq'; + } + + /** + * {@inheritdoc} + */ + public function getSequenceNextValSQL($sequence) + { + return 'SELECT NEXT VALUE FOR ' . $sequence; + } + + /** + * {@inheritDoc} + */ + public function hasNativeGuidType() + { + return true; + } + + /** + * {@inheritDoc} + */ + public function getCreateDatabaseSQL($name) + { + return 'CREATE DATABASE ' . $name; + } + + /** + * {@inheritDoc} + */ + public function getDropDatabaseSQL($name) + { + return 'DROP DATABASE ' . $name; + } + + /** + * {@inheritDoc} + */ + public function supportsCreateDropDatabase() + { + return true; + } + + /** + * {@inheritDoc} + */ + public function getCreateSchemaSQL($schemaName) + { + return 'CREATE SCHEMA ' . $schemaName; + } + + /** + * {@inheritDoc} + */ + public function getDropForeignKeySQL($foreignKey, $table) + { + if (! $foreignKey instanceof ForeignKeyConstraint) { + $foreignKey = new Identifier($foreignKey); + } + + if (! $table instanceof Table) { + $table = new Identifier($table); + } + + $foreignKey = $foreignKey->getQuotedName($this); + $table = $table->getQuotedName($this); + + return 'ALTER TABLE ' . $table . ' DROP CONSTRAINT ' . $foreignKey; + } + + /** + * {@inheritDoc} + */ + public function getDropIndexSQL($index, $table = null) + { + if ($index instanceof Index) { + $index = $index->getQuotedName($this); + } elseif (! is_string($index)) { + throw new InvalidArgumentException( + __METHOD__ . '() expects $index parameter to be string or ' . Index::class . '.' + ); + } + + if (! isset($table)) { + return 'DROP INDEX ' . $index; + } + + if ($table instanceof Table) { + $table = $table->getQuotedName($this); + } + + return sprintf( + <<getCommentOnTableSQL($name, $tableComment); + } + + // @todo does other code breaks because of this? + // force primary keys to be not null + foreach ($columns as &$column) { + if (! empty($column['primary'])) { + $column['notnull'] = true; + } + + // Build default constraints SQL statements. + if (isset($column['default'])) { + $defaultConstraintsSql[] = 'ALTER TABLE ' . $name . + ' ADD' . $this->getDefaultConstraintDeclarationSQL($name, $column); + } + + if (empty($column['comment']) && ! is_numeric($column['comment'])) { + continue; + } + + $commentsSql[] = $this->getCreateColumnCommentSQL($name, $column['name'], $column['comment']); + } + + $columnListSql = $this->getColumnDeclarationListSQL($columns); + + if (isset($options['uniqueConstraints']) && ! empty($options['uniqueConstraints'])) { + foreach ($options['uniqueConstraints'] as $constraintName => $definition) { + $columnListSql .= ', ' . $this->getUniqueConstraintDeclarationSQL($constraintName, $definition); + } + } + + if (isset($options['primary']) && ! empty($options['primary'])) { + $flags = ''; + if (isset($options['primary_index']) && $options['primary_index']->hasFlag('nonclustered')) { + $flags = ' NONCLUSTERED'; + } + + $columnListSql .= ', PRIMARY KEY' . $flags + . ' (' . implode(', ', array_unique(array_values($options['primary']))) . ')'; + } + + $query = 'CREATE TABLE ' . $name . ' (' . $columnListSql; + + $check = $this->getCheckDeclarationSQL($columns); + if (! empty($check)) { + $query .= ', ' . $check; + } + + $query .= ')'; + + $sql = [$query]; + + if (isset($options['indexes']) && ! empty($options['indexes'])) { + foreach ($options['indexes'] as $index) { + $sql[] = $this->getCreateIndexSQL($index, $name); + } + } + + if (isset($options['foreignKeys'])) { + foreach ((array) $options['foreignKeys'] as $definition) { + $sql[] = $this->getCreateForeignKeySQL($definition, $name); + } + } + + return array_merge($sql, $commentsSql, $defaultConstraintsSql); + } + + /** + * {@inheritDoc} + */ + public function getCreatePrimaryKeySQL(Index $index, $table) + { + if ($table instanceof Table) { + $identifier = $table->getQuotedName($this); + } else { + $identifier = $table; + } + + $sql = 'ALTER TABLE ' . $identifier . ' ADD PRIMARY KEY'; + + if ($index->hasFlag('nonclustered')) { + $sql .= ' NONCLUSTERED'; + } + + return $sql . ' (' . $this->getIndexFieldDeclarationListSQL($index) . ')'; + } + + /** + * Returns the SQL statement for creating a column comment. + * + * SQL Server does not support native column comments, + * therefore the extended properties functionality is used + * as a workaround to store them. + * The property name used to store column comments is "MS_Description" + * which provides compatibility with SQL Server Management Studio, + * as column comments are stored in the same property there when + * specifying a column's "Description" attribute. + * + * @param string $tableName The quoted table name to which the column belongs. + * @param string $columnName The quoted column name to create the comment for. + * @param string|null $comment The column's comment. + * + * @return string + */ + protected function getCreateColumnCommentSQL($tableName, $columnName, $comment) + { + if (strpos($tableName, '.') !== false) { + [$schemaSQL, $tableSQL] = explode('.', $tableName); + $schemaSQL = $this->quoteStringLiteral($schemaSQL); + $tableSQL = $this->quoteStringLiteral($tableSQL); + } else { + $schemaSQL = "'dbo'"; + $tableSQL = $this->quoteStringLiteral($tableName); + } + + return $this->getAddExtendedPropertySQL( + 'MS_Description', + $comment, + 'SCHEMA', + $schemaSQL, + 'TABLE', + $tableSQL, + 'COLUMN', + $columnName + ); + } + + /** + * Returns the SQL snippet for declaring a default constraint. + * + * @param string $table Name of the table to return the default constraint declaration for. + * @param mixed[] $column Column definition. + * + * @return string + * + * @throws InvalidArgumentException + */ + public function getDefaultConstraintDeclarationSQL($table, array $column) + { + if (! isset($column['default'])) { + throw new InvalidArgumentException("Incomplete column definition. 'default' required."); + } + + $columnName = new Identifier($column['name']); + + return ' CONSTRAINT ' . + $this->generateDefaultConstraintName($table, $column['name']) . + $this->getDefaultValueDeclarationSQL($column) . + ' FOR ' . $columnName->getQuotedName($this); + } + + /** + * {@inheritDoc} + */ + public function getCreateIndexSQL(Index $index, $table) + { + $constraint = parent::getCreateIndexSQL($index, $table); + + if ($index->isUnique() && ! $index->isPrimary()) { + $constraint = $this->_appendUniqueConstraintDefinition($constraint, $index); + } + + return $constraint; + } + + /** + * {@inheritDoc} + */ + protected function getCreateIndexSQLFlags(Index $index) + { + $type = ''; + if ($index->isUnique()) { + $type .= 'UNIQUE '; + } + + if ($index->hasFlag('clustered')) { + $type .= 'CLUSTERED '; + } elseif ($index->hasFlag('nonclustered')) { + $type .= 'NONCLUSTERED '; + } + + return $type; + } + + /** + * Extend unique key constraint with required filters + * + * @param string $sql + * + * @return string + */ + private function _appendUniqueConstraintDefinition($sql, Index $index) + { + $fields = []; + + foreach ($index->getQuotedColumns($this) as $field) { + $fields[] = $field . ' IS NOT NULL'; + } + + return $sql . ' WHERE ' . implode(' AND ', $fields); + } + + /** + * {@inheritDoc} + */ + public function getAlterTableSQL(TableDiff $diff) + { + $queryParts = []; + $sql = []; + $columnSql = []; + $commentsSql = []; + + foreach ($diff->addedColumns as $column) { + if ($this->onSchemaAlterTableAddColumn($column, $diff, $columnSql)) { + continue; + } + + $columnDef = $column->toArray(); + $addColumnSql = 'ADD ' . $this->getColumnDeclarationSQL($column->getQuotedName($this), $columnDef); + if (isset($columnDef['default'])) { + $addColumnSql .= ' CONSTRAINT ' . + $this->generateDefaultConstraintName($diff->name, $column->getQuotedName($this)) . + $this->getDefaultValueDeclarationSQL($columnDef); + } + + $queryParts[] = $addColumnSql; + + $comment = $this->getColumnComment($column); + + if (empty($comment) && ! is_numeric($comment)) { + continue; + } + + $commentsSql[] = $this->getCreateColumnCommentSQL( + $diff->name, + $column->getQuotedName($this), + $comment + ); + } + + foreach ($diff->removedColumns as $column) { + if ($this->onSchemaAlterTableRemoveColumn($column, $diff, $columnSql)) { + continue; + } + + $queryParts[] = 'DROP COLUMN ' . $column->getQuotedName($this); + } + + foreach ($diff->changedColumns as $columnDiff) { + if ($this->onSchemaAlterTableChangeColumn($columnDiff, $diff, $columnSql)) { + continue; + } + + $column = $columnDiff->column; + $comment = $this->getColumnComment($column); + $hasComment = ! empty($comment) || is_numeric($comment); + + if ($columnDiff->fromColumn instanceof Column) { + $fromComment = $this->getColumnComment($columnDiff->fromColumn); + $hasFromComment = ! empty($fromComment) || is_numeric($fromComment); + + if ($hasFromComment && $hasComment && $fromComment !== $comment) { + $commentsSql[] = $this->getAlterColumnCommentSQL( + $diff->name, + $column->getQuotedName($this), + $comment + ); + } elseif ($hasFromComment && ! $hasComment) { + $commentsSql[] = $this->getDropColumnCommentSQL($diff->name, $column->getQuotedName($this)); + } elseif (! $hasFromComment && $hasComment) { + $commentsSql[] = $this->getCreateColumnCommentSQL( + $diff->name, + $column->getQuotedName($this), + $comment + ); + } + } + + // Do not add query part if only comment has changed. + if ($columnDiff->hasChanged('comment') && count($columnDiff->changedProperties) === 1) { + continue; + } + + $requireDropDefaultConstraint = $this->alterColumnRequiresDropDefaultConstraint($columnDiff); + + if ($requireDropDefaultConstraint) { + $queryParts[] = $this->getAlterTableDropDefaultConstraintClause( + $diff->name, + $columnDiff->oldColumnName + ); + } + + $columnDef = $column->toArray(); + + $queryParts[] = 'ALTER COLUMN ' . + $this->getColumnDeclarationSQL($column->getQuotedName($this), $columnDef); + + if ( + ! isset($columnDef['default']) + || (! $requireDropDefaultConstraint && ! $columnDiff->hasChanged('default')) + ) { + continue; + } + + $queryParts[] = $this->getAlterTableAddDefaultConstraintClause($diff->name, $column); + } + + foreach ($diff->renamedColumns as $oldColumnName => $column) { + if ($this->onSchemaAlterTableRenameColumn($oldColumnName, $column, $diff, $columnSql)) { + continue; + } + + $oldColumnName = new Identifier($oldColumnName); + + $sql[] = "sp_rename '" . + $diff->getName($this)->getQuotedName($this) . '.' . $oldColumnName->getQuotedName($this) . + "', '" . $column->getQuotedName($this) . "', 'COLUMN'"; + + // Recreate default constraint with new column name if necessary (for future reference). + if ($column->getDefault() === null) { + continue; + } + + $queryParts[] = $this->getAlterTableDropDefaultConstraintClause( + $diff->name, + $oldColumnName->getQuotedName($this) + ); + $queryParts[] = $this->getAlterTableAddDefaultConstraintClause($diff->name, $column); + } + + $tableSql = []; + + if ($this->onSchemaAlterTable($diff, $tableSql)) { + return array_merge($tableSql, $columnSql); + } + + foreach ($queryParts as $query) { + $sql[] = 'ALTER TABLE ' . $diff->getName($this)->getQuotedName($this) . ' ' . $query; + } + + $sql = array_merge($sql, $commentsSql); + + $newName = $diff->getNewName(); + + if ($newName !== false) { + $sql[] = "sp_rename '" . $diff->getName($this)->getQuotedName($this) . "', '" . $newName->getName() . "'"; + + /** + * Rename table's default constraints names + * to match the new table name. + * This is necessary to ensure that the default + * constraints can be referenced in future table + * alterations as the table name is encoded in + * default constraints' names. + */ + $sql[] = "DECLARE @sql NVARCHAR(MAX) = N''; " . + "SELECT @sql += N'EXEC sp_rename N''' + dc.name + ''', N''' " . + "+ REPLACE(dc.name, '" . $this->generateIdentifierName($diff->name) . "', " . + "'" . $this->generateIdentifierName($newName->getName()) . "') + ''', ''OBJECT'';' " . + 'FROM sys.default_constraints dc ' . + 'JOIN sys.tables tbl ON dc.parent_object_id = tbl.object_id ' . + "WHERE tbl.name = '" . $newName->getName() . "';" . + 'EXEC sp_executesql @sql'; + } + + $sql = array_merge( + $this->getPreAlterTableIndexForeignKeySQL($diff), + $sql, + $this->getPostAlterTableIndexForeignKeySQL($diff) + ); + + return array_merge($sql, $tableSql, $columnSql); + } + + /** + * Returns the SQL clause for adding a default constraint in an ALTER TABLE statement. + * + * @param string $tableName The name of the table to generate the clause for. + * @param Column $column The column to generate the clause for. + * + * @return string + */ + private function getAlterTableAddDefaultConstraintClause($tableName, Column $column) + { + $columnDef = $column->toArray(); + $columnDef['name'] = $column->getQuotedName($this); + + return 'ADD' . $this->getDefaultConstraintDeclarationSQL($tableName, $columnDef); + } + + /** + * Returns the SQL clause for dropping an existing default constraint in an ALTER TABLE statement. + * + * @param string $tableName The name of the table to generate the clause for. + * @param string $columnName The name of the column to generate the clause for. + * + * @return string + */ + private function getAlterTableDropDefaultConstraintClause($tableName, $columnName) + { + return 'DROP CONSTRAINT ' . $this->generateDefaultConstraintName($tableName, $columnName); + } + + /** + * Checks whether a column alteration requires dropping its default constraint first. + * + * Different to other database vendors SQL Server implements column default values + * as constraints and therefore changes in a column's default value as well as changes + * in a column's type require dropping the default constraint first before being to + * alter the particular column to the new definition. + * + * @param ColumnDiff $columnDiff The column diff to evaluate. + * + * @return bool True if the column alteration requires dropping its default constraint first, false otherwise. + */ + private function alterColumnRequiresDropDefaultConstraint(ColumnDiff $columnDiff) + { + // We can only decide whether to drop an existing default constraint + // if we know the original default value. + if (! $columnDiff->fromColumn instanceof Column) { + return false; + } + + // We only need to drop an existing default constraint if we know the + // column was defined with a default value before. + if ($columnDiff->fromColumn->getDefault() === null) { + return false; + } + + // We need to drop an existing default constraint if the column was + // defined with a default value before and it has changed. + if ($columnDiff->hasChanged('default')) { + return true; + } + + // We need to drop an existing default constraint if the column was + // defined with a default value before and the native column type has changed. + return $columnDiff->hasChanged('type') || $columnDiff->hasChanged('fixed'); + } + + /** + * Returns the SQL statement for altering a column comment. + * + * SQL Server does not support native column comments, + * therefore the extended properties functionality is used + * as a workaround to store them. + * The property name used to store column comments is "MS_Description" + * which provides compatibility with SQL Server Management Studio, + * as column comments are stored in the same property there when + * specifying a column's "Description" attribute. + * + * @param string $tableName The quoted table name to which the column belongs. + * @param string $columnName The quoted column name to alter the comment for. + * @param string|null $comment The column's comment. + * + * @return string + */ + protected function getAlterColumnCommentSQL($tableName, $columnName, $comment) + { + if (strpos($tableName, '.') !== false) { + [$schemaSQL, $tableSQL] = explode('.', $tableName); + $schemaSQL = $this->quoteStringLiteral($schemaSQL); + $tableSQL = $this->quoteStringLiteral($tableSQL); + } else { + $schemaSQL = "'dbo'"; + $tableSQL = $this->quoteStringLiteral($tableName); + } + + return $this->getUpdateExtendedPropertySQL( + 'MS_Description', + $comment, + 'SCHEMA', + $schemaSQL, + 'TABLE', + $tableSQL, + 'COLUMN', + $columnName + ); + } + + /** + * Returns the SQL statement for dropping a column comment. + * + * SQL Server does not support native column comments, + * therefore the extended properties functionality is used + * as a workaround to store them. + * The property name used to store column comments is "MS_Description" + * which provides compatibility with SQL Server Management Studio, + * as column comments are stored in the same property there when + * specifying a column's "Description" attribute. + * + * @param string $tableName The quoted table name to which the column belongs. + * @param string $columnName The quoted column name to drop the comment for. + * + * @return string + */ + protected function getDropColumnCommentSQL($tableName, $columnName) + { + if (strpos($tableName, '.') !== false) { + [$schemaSQL, $tableSQL] = explode('.', $tableName); + $schemaSQL = $this->quoteStringLiteral($schemaSQL); + $tableSQL = $this->quoteStringLiteral($tableSQL); + } else { + $schemaSQL = "'dbo'"; + $tableSQL = $this->quoteStringLiteral($tableName); + } + + return $this->getDropExtendedPropertySQL( + 'MS_Description', + 'SCHEMA', + $schemaSQL, + 'TABLE', + $tableSQL, + 'COLUMN', + $columnName + ); + } + + /** + * {@inheritdoc} + */ + protected function getRenameIndexSQL($oldIndexName, Index $index, $tableName) + { + return [sprintf( + "EXEC sp_rename N'%s.%s', N'%s', N'INDEX'", + $tableName, + $oldIndexName, + $index->getQuotedName($this) + ), + ]; + } + + /** + * Returns the SQL statement for adding an extended property to a database object. + * + * @link http://msdn.microsoft.com/en-us/library/ms180047%28v=sql.90%29.aspx + * + * @param string $name The name of the property to add. + * @param string|null $value The value of the property to add. + * @param string|null $level0Type The type of the object at level 0 the property belongs to. + * @param string|null $level0Name The name of the object at level 0 the property belongs to. + * @param string|null $level1Type The type of the object at level 1 the property belongs to. + * @param string|null $level1Name The name of the object at level 1 the property belongs to. + * @param string|null $level2Type The type of the object at level 2 the property belongs to. + * @param string|null $level2Name The name of the object at level 2 the property belongs to. + * + * @return string + */ + public function getAddExtendedPropertySQL( + $name, + $value = null, + $level0Type = null, + $level0Name = null, + $level1Type = null, + $level1Name = null, + $level2Type = null, + $level2Name = null + ) { + return 'EXEC sp_addextendedproperty ' . + 'N' . $this->quoteStringLiteral($name) . ', N' . $this->quoteStringLiteral((string) $value) . ', ' . + 'N' . $this->quoteStringLiteral((string) $level0Type) . ', ' . $level0Name . ', ' . + 'N' . $this->quoteStringLiteral((string) $level1Type) . ', ' . $level1Name . ', ' . + 'N' . $this->quoteStringLiteral((string) $level2Type) . ', ' . $level2Name; + } + + /** + * Returns the SQL statement for dropping an extended property from a database object. + * + * @link http://technet.microsoft.com/en-gb/library/ms178595%28v=sql.90%29.aspx + * + * @param string $name The name of the property to drop. + * @param string|null $level0Type The type of the object at level 0 the property belongs to. + * @param string|null $level0Name The name of the object at level 0 the property belongs to. + * @param string|null $level1Type The type of the object at level 1 the property belongs to. + * @param string|null $level1Name The name of the object at level 1 the property belongs to. + * @param string|null $level2Type The type of the object at level 2 the property belongs to. + * @param string|null $level2Name The name of the object at level 2 the property belongs to. + * + * @return string + */ + public function getDropExtendedPropertySQL( + $name, + $level0Type = null, + $level0Name = null, + $level1Type = null, + $level1Name = null, + $level2Type = null, + $level2Name = null + ) { + return 'EXEC sp_dropextendedproperty ' . + 'N' . $this->quoteStringLiteral($name) . ', ' . + 'N' . $this->quoteStringLiteral((string) $level0Type) . ', ' . $level0Name . ', ' . + 'N' . $this->quoteStringLiteral((string) $level1Type) . ', ' . $level1Name . ', ' . + 'N' . $this->quoteStringLiteral((string) $level2Type) . ', ' . $level2Name; + } + + /** + * Returns the SQL statement for updating an extended property of a database object. + * + * @link http://msdn.microsoft.com/en-us/library/ms186885%28v=sql.90%29.aspx + * + * @param string $name The name of the property to update. + * @param string|null $value The value of the property to update. + * @param string|null $level0Type The type of the object at level 0 the property belongs to. + * @param string|null $level0Name The name of the object at level 0 the property belongs to. + * @param string|null $level1Type The type of the object at level 1 the property belongs to. + * @param string|null $level1Name The name of the object at level 1 the property belongs to. + * @param string|null $level2Type The type of the object at level 2 the property belongs to. + * @param string|null $level2Name The name of the object at level 2 the property belongs to. + * + * @return string + */ + public function getUpdateExtendedPropertySQL( + $name, + $value = null, + $level0Type = null, + $level0Name = null, + $level1Type = null, + $level1Name = null, + $level2Type = null, + $level2Name = null + ) { + return 'EXEC sp_updateextendedproperty ' . + 'N' . $this->quoteStringLiteral($name) . ', N' . $this->quoteStringLiteral((string) $value) . ', ' . + 'N' . $this->quoteStringLiteral((string) $level0Type) . ', ' . $level0Name . ', ' . + 'N' . $this->quoteStringLiteral((string) $level1Type) . ', ' . $level1Name . ', ' . + 'N' . $this->quoteStringLiteral((string) $level2Type) . ', ' . $level2Name; + } + + /** + * {@inheritDoc} + */ + public function getEmptyIdentityInsertSQL($quotedTableName, $quotedIdentifierColumnName) + { + return 'INSERT INTO ' . $quotedTableName . ' DEFAULT VALUES'; + } + + /** + * {@inheritDoc} + */ + public function getListTablesSQL() + { + // "sysdiagrams" table must be ignored as it's internal SQL Server table for Database Diagrams + // Category 2 must be ignored as it is "MS SQL Server 'pseudo-system' object[s]" for replication + return 'SELECT name, SCHEMA_NAME (uid) AS schema_name FROM sysobjects' + . " WHERE type = 'U' AND name != 'sysdiagrams' AND category != 2 ORDER BY name"; + } + + /** + * {@inheritDoc} + */ + public function getListTableColumnsSQL($table, $database = null) + { + return "SELECT col.name, + type.name AS type, + col.max_length AS length, + ~col.is_nullable AS notnull, + def.definition AS [default], + col.scale, + col.precision, + col.is_identity AS autoincrement, + col.collation_name AS collation, + CAST(prop.value AS NVARCHAR(MAX)) AS comment -- CAST avoids driver error for sql_variant type + FROM sys.columns AS col + JOIN sys.types AS type + ON col.user_type_id = type.user_type_id + JOIN sys.objects AS obj + ON col.object_id = obj.object_id + JOIN sys.schemas AS scm + ON obj.schema_id = scm.schema_id + LEFT JOIN sys.default_constraints def + ON col.default_object_id = def.object_id + AND col.object_id = def.parent_object_id + LEFT JOIN sys.extended_properties AS prop + ON obj.object_id = prop.major_id + AND col.column_id = prop.minor_id + AND prop.name = 'MS_Description' + WHERE obj.type = 'U' + AND " . $this->getTableWhereClause($table, 'scm.name', 'obj.name'); + } + + /** + * @param string $table + * @param string|null $database + * + * @return string + */ + public function getListTableForeignKeysSQL($table, $database = null) + { + return 'SELECT f.name AS ForeignKey, + SCHEMA_NAME (f.SCHEMA_ID) AS SchemaName, + OBJECT_NAME (f.parent_object_id) AS TableName, + COL_NAME (fc.parent_object_id,fc.parent_column_id) AS ColumnName, + SCHEMA_NAME (o.SCHEMA_ID) ReferenceSchemaName, + OBJECT_NAME (f.referenced_object_id) AS ReferenceTableName, + COL_NAME(fc.referenced_object_id,fc.referenced_column_id) AS ReferenceColumnName, + f.delete_referential_action_desc, + f.update_referential_action_desc + FROM sys.foreign_keys AS f + INNER JOIN sys.foreign_key_columns AS fc + INNER JOIN sys.objects AS o ON o.OBJECT_ID = fc.referenced_object_id + ON f.OBJECT_ID = fc.constraint_object_id + WHERE ' . + $this->getTableWhereClause($table, 'SCHEMA_NAME (f.schema_id)', 'OBJECT_NAME (f.parent_object_id)'); + } + + /** + * {@inheritDoc} + */ + public function getListTableIndexesSQL($table, $database = null) + { + return "SELECT idx.name AS key_name, + col.name AS column_name, + ~idx.is_unique AS non_unique, + idx.is_primary_key AS [primary], + CASE idx.type + WHEN '1' THEN 'clustered' + WHEN '2' THEN 'nonclustered' + ELSE NULL + END AS flags + FROM sys.tables AS tbl + JOIN sys.schemas AS scm ON tbl.schema_id = scm.schema_id + JOIN sys.indexes AS idx ON tbl.object_id = idx.object_id + JOIN sys.index_columns AS idxcol ON idx.object_id = idxcol.object_id AND idx.index_id = idxcol.index_id + JOIN sys.columns AS col ON idxcol.object_id = col.object_id AND idxcol.column_id = col.column_id + WHERE " . $this->getTableWhereClause($table, 'scm.name', 'tbl.name') . ' + ORDER BY idx.index_id ASC, idxcol.key_ordinal ASC'; + } + + /** + * {@inheritDoc} + */ + public function getCreateViewSQL($name, $sql) + { + return 'CREATE VIEW ' . $name . ' AS ' . $sql; + } + + /** + * {@inheritDoc} + */ + public function getListViewsSQL($database) + { + return "SELECT name FROM sysobjects WHERE type = 'V' ORDER BY name"; + } + + /** + * Returns the where clause to filter schema and table name in a query. + * + * @param string $table The full qualified name of the table. + * @param string $schemaColumn The name of the column to compare the schema to in the where clause. + * @param string $tableColumn The name of the column to compare the table to in the where clause. + * + * @return string + */ + private function getTableWhereClause($table, $schemaColumn, $tableColumn) + { + if (strpos($table, '.') !== false) { + [$schema, $table] = explode('.', $table); + $schema = $this->quoteStringLiteral($schema); + $table = $this->quoteStringLiteral($table); + } else { + $schema = 'SCHEMA_NAME()'; + $table = $this->quoteStringLiteral($table); + } + + return sprintf('(%s = %s AND %s = %s)', $tableColumn, $table, $schemaColumn, $schema); + } + + /** + * {@inheritDoc} + */ + public function getDropViewSQL($name) + { + return 'DROP VIEW ' . $name; + } + + /** + * {@inheritDoc} + */ + public function getLocateExpression($str, $substr, $startPos = false) + { + if ($startPos === false) { + return 'CHARINDEX(' . $substr . ', ' . $str . ')'; + } + + return 'CHARINDEX(' . $substr . ', ' . $str . ', ' . $startPos . ')'; + } + + /** + * {@inheritDoc} + */ + public function getModExpression($expression1, $expression2) + { + return $expression1 . ' % ' . $expression2; + } + + /** + * {@inheritDoc} + */ + public function getTrimExpression($str, $mode = TrimMode::UNSPECIFIED, $char = false) + { + if ($char === false) { + switch ($mode) { + case TrimMode::LEADING: + $trimFn = 'LTRIM'; + break; + + case TrimMode::TRAILING: + $trimFn = 'RTRIM'; + break; + + default: + return 'LTRIM(RTRIM(' . $str . '))'; + } + + return $trimFn . '(' . $str . ')'; + } + + $pattern = "'%[^' + " . $char . " + ']%'"; + + if ($mode === TrimMode::LEADING) { + return 'stuff(' . $str . ', 1, patindex(' . $pattern . ', ' . $str . ') - 1, null)'; + } + + if ($mode === TrimMode::TRAILING) { + return 'reverse(stuff(reverse(' . $str . '), 1, ' + . 'patindex(' . $pattern . ', reverse(' . $str . ')) - 1, null))'; + } + + return 'reverse(stuff(reverse(stuff(' . $str . ', 1, patindex(' . $pattern . ', ' . $str . ') - 1, null)), 1, ' + . 'patindex(' . $pattern . ', reverse(stuff(' . $str . ', 1, patindex(' . $pattern . ', ' . $str + . ') - 1, null))) - 1, null))'; + } + + /** + * {@inheritDoc} + */ + public function getConcatExpression() + { + $args = func_get_args(); + + return '(' . implode(' + ', $args) . ')'; + } + + /** + * {@inheritDoc} + */ + public function getListDatabasesSQL() + { + return 'SELECT * FROM sys.databases'; + } + + /** + * {@inheritDoc} + * + * @deprecated Use {@link SQLServerSchemaManager::listSchemaNames()} instead. + */ + public function getListNamespacesSQL() + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4503', + 'SQLServer2012Platform::getListNamespacesSQL() is deprecated,' + . ' use SQLServerSchemaManager::listSchemaNames() instead.' + ); + + return "SELECT name FROM sys.schemas WHERE name NOT IN('guest', 'INFORMATION_SCHEMA', 'sys')"; + } + + /** + * {@inheritDoc} + */ + public function getSubstringExpression($string, $start, $length = null) + { + if ($length !== null) { + return 'SUBSTRING(' . $string . ', ' . $start . ', ' . $length . ')'; + } + + return 'SUBSTRING(' . $string . ', ' . $start . ', LEN(' . $string . ') - ' . $start . ' + 1)'; + } + + /** + * {@inheritDoc} + */ + public function getLengthExpression($column) + { + return 'LEN(' . $column . ')'; + } + + public function getCurrentDatabaseExpression(): string + { + return 'DB_NAME()'; + } + + /** + * {@inheritDoc} + */ + public function getSetTransactionIsolationSQL($level) + { + return 'SET TRANSACTION ISOLATION LEVEL ' . $this->_getTransactionIsolationLevelSQL($level); + } + + /** + * {@inheritDoc} + */ + public function getIntegerTypeDeclarationSQL(array $column) + { + return 'INT' . $this->_getCommonIntegerTypeDeclarationSQL($column); + } + + /** + * {@inheritDoc} + */ + public function getBigIntTypeDeclarationSQL(array $column) + { + return 'BIGINT' . $this->_getCommonIntegerTypeDeclarationSQL($column); + } + + /** + * {@inheritDoc} + */ + public function getSmallIntTypeDeclarationSQL(array $column) + { + return 'SMALLINT' . $this->_getCommonIntegerTypeDeclarationSQL($column); + } + + /** + * {@inheritDoc} + */ + public function getGuidTypeDeclarationSQL(array $column) + { + return 'UNIQUEIDENTIFIER'; + } + + /** + * {@inheritDoc} + */ + public function getDateTimeTzTypeDeclarationSQL(array $column) + { + return 'DATETIMEOFFSET(6)'; + } + + /** + * {@inheritDoc} + */ + public function getAsciiStringTypeDeclarationSQL(array $column): string + { + $length = $column['length'] ?? null; + + if (! isset($column['fixed'])) { + return sprintf('VARCHAR(%d)', $length ?? 255); + } + + return sprintf('CHAR(%d)', $length ?? 255); + } + + /** + * {@inheritDoc} + */ + protected function getVarcharTypeDeclarationSQLSnippet($length, $fixed) + { + return $fixed + ? ($length > 0 ? 'NCHAR(' . $length . ')' : 'CHAR(255)') + : ($length > 0 ? 'NVARCHAR(' . $length . ')' : 'NVARCHAR(255)'); + } + + /** + * {@inheritdoc} + */ + protected function getBinaryTypeDeclarationSQLSnippet($length, $fixed) + { + return $fixed + ? 'BINARY(' . ($length > 0 ? $length : 255) . ')' + : 'VARBINARY(' . ($length > 0 ? $length : 255) . ')'; + } + + /** + * {@inheritdoc} + */ + public function getBinaryMaxLength() + { + return 8000; + } + + /** + * {@inheritDoc} + */ + public function getClobTypeDeclarationSQL(array $column) + { + return 'VARCHAR(MAX)'; + } + + /** + * {@inheritDoc} + */ + protected function _getCommonIntegerTypeDeclarationSQL(array $column) + { + return ! empty($column['autoincrement']) ? ' IDENTITY' : ''; + } + + /** + * {@inheritDoc} + */ + public function getDateTimeTypeDeclarationSQL(array $column) + { + // 3 - microseconds precision length + // http://msdn.microsoft.com/en-us/library/ms187819.aspx + return 'DATETIME2(6)'; + } + + /** + * {@inheritDoc} + */ + public function getDateTypeDeclarationSQL(array $column) + { + return 'DATE'; + } + + /** + * {@inheritDoc} + */ + public function getTimeTypeDeclarationSQL(array $column) + { + return 'TIME(0)'; + } + + /** + * {@inheritDoc} + */ + public function getBooleanTypeDeclarationSQL(array $column) + { + return 'BIT'; + } + + /** + * {@inheritDoc} + */ + protected function doModifyLimitQuery($query, $limit, $offset) + { + if ($limit === null && $offset <= 0) { + return $query; + } + + if ($this->shouldAddOrderBy($query)) { + if (preg_match('/^SELECT\s+DISTINCT/im', $query) > 0) { + // SQL Server won't let us order by a non-selected column in a DISTINCT query, + // so we have to do this madness. This says, order by the first column in the + // result. SQL Server's docs say that a nonordered query's result order is non- + // deterministic anyway, so this won't do anything that a bunch of update and + // deletes to the table wouldn't do anyway. + $query .= ' ORDER BY 1'; + } else { + // In another DBMS, we could do ORDER BY 0, but SQL Server gets angry if you + // use constant expressions in the order by list. + $query .= ' ORDER BY (SELECT 0)'; + } + } + + // This looks somewhat like MYSQL, but limit/offset are in inverse positions + // Supposedly SQL:2008 core standard. + // Per TSQL spec, FETCH NEXT n ROWS ONLY is not valid without OFFSET n ROWS. + $query .= sprintf(' OFFSET %d ROWS', $offset); + + if ($limit !== null) { + $query .= sprintf(' FETCH NEXT %d ROWS ONLY', $limit); + } + + return $query; + } + + /** + * {@inheritDoc} + */ + public function supportsLimitOffset() + { + return true; + } + + /** + * {@inheritDoc} + */ + public function convertBooleans($item) + { + if (is_array($item)) { + foreach ($item as $key => $value) { + if (! is_bool($value) && ! is_numeric($value)) { + continue; + } + + $item[$key] = (int) (bool) $value; + } + } elseif (is_bool($item) || is_numeric($item)) { + $item = (int) (bool) $item; + } + + return $item; + } + + /** + * {@inheritDoc} + */ + public function getCreateTemporaryTableSnippetSQL() + { + return 'CREATE TABLE'; + } + + /** + * {@inheritDoc} + */ + public function getTemporaryTableName($tableName) + { + return '#' . $tableName; + } + + /** + * {@inheritDoc} + */ + public function getDateTimeFormatString() + { + return 'Y-m-d H:i:s.u'; + } + + /** + * {@inheritDoc} + */ + public function getDateFormatString() + { + return 'Y-m-d'; + } + + /** + * {@inheritDoc} + */ + public function getTimeFormatString() + { + return 'H:i:s'; + } + + /** + * {@inheritDoc} + */ + public function getDateTimeTzFormatString() + { + return 'Y-m-d H:i:s.u P'; + } + + /** + * {@inheritDoc} + */ + public function getName() + { + return 'mssql'; + } + + /** + * {@inheritDoc} + */ + protected function initializeDoctrineTypeMappings() + { + $this->doctrineTypeMapping = [ + 'bigint' => 'bigint', + 'binary' => 'binary', + 'bit' => 'boolean', + 'blob' => 'blob', + 'char' => 'string', + 'date' => 'date', + 'datetime' => 'datetime', + 'datetime2' => 'datetime', + 'datetimeoffset' => 'datetimetz', + 'decimal' => 'decimal', + 'double' => 'float', + 'double precision' => 'float', + 'float' => 'float', + 'image' => 'blob', + 'int' => 'integer', + 'money' => 'integer', + 'nchar' => 'string', + 'ntext' => 'text', + 'numeric' => 'decimal', + 'nvarchar' => 'string', + 'real' => 'float', + 'smalldatetime' => 'datetime', + 'smallint' => 'smallint', + 'smallmoney' => 'integer', + 'text' => 'text', + 'time' => 'time', + 'tinyint' => 'smallint', + 'uniqueidentifier' => 'guid', + 'varbinary' => 'binary', + 'varchar' => 'string', + ]; + } + + /** + * {@inheritDoc} + */ + public function createSavePoint($savepoint) + { + return 'SAVE TRANSACTION ' . $savepoint; + } + + /** + * {@inheritDoc} + */ + public function releaseSavePoint($savepoint) + { + return ''; + } + + /** + * {@inheritDoc} + */ + public function rollbackSavePoint($savepoint) + { + return 'ROLLBACK TRANSACTION ' . $savepoint; + } + + /** + * {@inheritdoc} + */ + public function getForeignKeyReferentialActionSQL($action) + { + // RESTRICT is not supported, therefore falling back to NO ACTION. + if (strtoupper($action) === 'RESTRICT') { + return 'NO ACTION'; + } + + return parent::getForeignKeyReferentialActionSQL($action); + } + + public function appendLockHint(string $fromClause, int $lockMode): string + { + switch ($lockMode) { + case LockMode::NONE: + case LockMode::OPTIMISTIC: + return $fromClause; + + case LockMode::PESSIMISTIC_READ: + return $fromClause . ' WITH (HOLDLOCK, ROWLOCK)'; + + case LockMode::PESSIMISTIC_WRITE: + return $fromClause . ' WITH (UPDLOCK, ROWLOCK)'; + + default: + throw InvalidLockMode::fromLockMode($lockMode); + } + } + + /** + * {@inheritDoc} + */ + public function getForUpdateSQL() + { + return ' '; + } + + /** + * {@inheritDoc} + * + * @deprecated Implement {@link createReservedKeywordsList()} instead. + */ + protected function getReservedKeywordsClass() + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4510', + 'QLServer2012Platform::getReservedKeywordsClass() is deprecated,' + . ' use QLServer2012Platform::createReservedKeywordsList() instead.' + ); + + return Keywords\SQLServer2012Keywords::class; + } + + /** + * {@inheritDoc} + */ + public function quoteSingleIdentifier($str) + { + return '[' . str_replace(']', ']]', $str) . ']'; + } + + /** + * {@inheritDoc} + */ + public function getTruncateTableSQL($tableName, $cascade = false) + { + $tableIdentifier = new Identifier($tableName); + + return 'TRUNCATE TABLE ' . $tableIdentifier->getQuotedName($this); + } + + /** + * {@inheritDoc} + */ + public function getBlobTypeDeclarationSQL(array $column) + { + return 'VARBINARY(MAX)'; + } + + /** + * {@inheritdoc} + * + * Modifies column declaration order as it differs in Microsoft SQL Server. + */ + public function getColumnDeclarationSQL($name, array $column) + { + if (isset($column['columnDefinition'])) { + $columnDef = $this->getCustomTypeDeclarationSQL($column); + } else { + $collation = ! empty($column['collation']) ? + ' ' . $this->getColumnCollationDeclarationSQL($column['collation']) : ''; + + $notnull = ! empty($column['notnull']) ? ' NOT NULL' : ''; + + $unique = ! empty($column['unique']) ? + ' ' . $this->getUniqueFieldDeclarationSQL() : ''; + + $check = ! empty($column['check']) ? + ' ' . $column['check'] : ''; + + $typeDecl = $column['type']->getSQLDeclaration($column, $this); + $columnDef = $typeDecl . $collation . $notnull . $unique . $check; + } + + return $name . ' ' . $columnDef; + } + + protected function getLikeWildcardCharacters(): string + { + return parent::getLikeWildcardCharacters() . '[]^'; + } + + /** + * Returns a unique default constraint name for a table and column. + * + * @param string $table Name of the table to generate the unique default constraint name for. + * @param string $column Name of the column in the table to generate the unique default constraint name for. + * + * @return string + */ + private function generateDefaultConstraintName($table, $column) + { + return 'DF_' . $this->generateIdentifierName($table) . '_' . $this->generateIdentifierName($column); + } + + /** + * Returns a hash value for a given identifier. + * + * @param string $identifier Identifier to generate a hash value for. + * + * @return string + */ + private function generateIdentifierName($identifier) + { + // Always generate name for unquoted identifiers to ensure consistency. + $identifier = new Identifier($identifier); + + return strtoupper(dechex(crc32($identifier->getName()))); + } + + protected function getCommentOnTableSQL(string $tableName, ?string $comment): string + { + return sprintf( + <<<'SQL' + EXEC sys.sp_addextendedproperty @name=N'MS_Description', + @value=N%s, @level0type=N'SCHEMA', @level0name=N'dbo', + @level1type=N'TABLE', @level1name=N%s + SQL + , + $this->quoteStringLiteral((string) $comment), + $this->quoteStringLiteral($tableName) + ); + } + + public function getListTableMetadataSQL(string $table): string + { + return sprintf( + <<<'SQL' + SELECT + p.value AS [table_comment] + FROM + sys.tables AS tbl + INNER JOIN sys.extended_properties AS p ON p.major_id=tbl.object_id AND p.minor_id=0 AND p.class=1 + WHERE + (tbl.name=N%s and SCHEMA_NAME(tbl.schema_id)=N'dbo' and p.name=N'MS_Description') + SQL + , + $this->quoteStringLiteral($table) + ); + } + + /** + * @param string $query + */ + private function shouldAddOrderBy($query): bool + { + // Find the position of the last instance of ORDER BY and ensure it is not within a parenthetical statement + // but can be in a newline + $matches = []; + $matchesCount = preg_match_all('/[\\s]+order\\s+by\\s/im', $query, $matches, PREG_OFFSET_CAPTURE); + if ($matchesCount === 0) { + return true; + } + + // ORDER BY instance may be in a subquery after ORDER BY + // e.g. SELECT col1 FROM test ORDER BY (SELECT col2 from test ORDER BY col2) + // if in the searched query ORDER BY clause was found where + // number of open parentheses after the occurrence of the clause is equal to + // number of closed brackets after the occurrence of the clause, + // it means that ORDER BY is included in the query being checked + while ($matchesCount > 0) { + $orderByPos = $matches[0][--$matchesCount][1]; + $openBracketsCount = substr_count($query, '(', $orderByPos); + $closedBracketsCount = substr_count($query, ')', $orderByPos); + if ($openBracketsCount === $closedBracketsCount) { + return false; + } + } + + return true; + } +} diff --git a/app/vendor/doctrine/dbal/src/Platforms/SqlitePlatform.php b/app/vendor/doctrine/dbal/src/Platforms/SqlitePlatform.php new file mode 100644 index 000000000..5dc1747cc --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Platforms/SqlitePlatform.php @@ -0,0 +1,1317 @@ +_getTransactionIsolationLevelSQL($level); + } + + /** + * {@inheritDoc} + */ + public function prefersIdentityColumns() + { + return true; + } + + /** + * {@inheritDoc} + */ + public function getBooleanTypeDeclarationSQL(array $column) + { + return 'BOOLEAN'; + } + + /** + * {@inheritDoc} + */ + public function getIntegerTypeDeclarationSQL(array $column) + { + return 'INTEGER' . $this->_getCommonIntegerTypeDeclarationSQL($column); + } + + /** + * {@inheritDoc} + */ + public function getBigIntTypeDeclarationSQL(array $column) + { + // SQLite autoincrement is implicit for INTEGER PKs, but not for BIGINT columns + if (! empty($column['autoincrement'])) { + return $this->getIntegerTypeDeclarationSQL($column); + } + + return 'BIGINT' . $this->_getCommonIntegerTypeDeclarationSQL($column); + } + + /** + * @param array $column + * + * @return string + */ + public function getTinyIntTypeDeclarationSQL(array $column) + { + // SQLite autoincrement is implicit for INTEGER PKs, but not for TINYINT columns + if (! empty($column['autoincrement'])) { + return $this->getIntegerTypeDeclarationSQL($column); + } + + return 'TINYINT' . $this->_getCommonIntegerTypeDeclarationSQL($column); + } + + /** + * {@inheritDoc} + */ + public function getSmallIntTypeDeclarationSQL(array $column) + { + // SQLite autoincrement is implicit for INTEGER PKs, but not for SMALLINT columns + if (! empty($column['autoincrement'])) { + return $this->getIntegerTypeDeclarationSQL($column); + } + + return 'SMALLINT' . $this->_getCommonIntegerTypeDeclarationSQL($column); + } + + /** + * @param array $column + * + * @return string + */ + public function getMediumIntTypeDeclarationSQL(array $column) + { + // SQLite autoincrement is implicit for INTEGER PKs, but not for MEDIUMINT columns + if (! empty($column['autoincrement'])) { + return $this->getIntegerTypeDeclarationSQL($column); + } + + return 'MEDIUMINT' . $this->_getCommonIntegerTypeDeclarationSQL($column); + } + + /** + * {@inheritDoc} + */ + public function getDateTimeTypeDeclarationSQL(array $column) + { + return 'DATETIME'; + } + + /** + * {@inheritDoc} + */ + public function getDateTypeDeclarationSQL(array $column) + { + return 'DATE'; + } + + /** + * {@inheritDoc} + */ + public function getTimeTypeDeclarationSQL(array $column) + { + return 'TIME'; + } + + /** + * {@inheritDoc} + */ + protected function _getCommonIntegerTypeDeclarationSQL(array $column) + { + // sqlite autoincrement is only possible for the primary key + if (! empty($column['autoincrement'])) { + return ' PRIMARY KEY AUTOINCREMENT'; + } + + return ! empty($column['unsigned']) ? ' UNSIGNED' : ''; + } + + /** + * {@inheritDoc} + */ + public function getForeignKeyDeclarationSQL(ForeignKeyConstraint $foreignKey) + { + return parent::getForeignKeyDeclarationSQL(new ForeignKeyConstraint( + $foreignKey->getQuotedLocalColumns($this), + str_replace('.', '__', $foreignKey->getQuotedForeignTableName($this)), + $foreignKey->getQuotedForeignColumns($this), + $foreignKey->getName(), + $foreignKey->getOptions() + )); + } + + /** + * {@inheritDoc} + */ + protected function _getCreateTableSQL($name, array $columns, array $options = []) + { + $name = str_replace('.', '__', $name); + $queryFields = $this->getColumnDeclarationListSQL($columns); + + if (isset($options['uniqueConstraints']) && ! empty($options['uniqueConstraints'])) { + foreach ($options['uniqueConstraints'] as $constraintName => $definition) { + $queryFields .= ', ' . $this->getUniqueConstraintDeclarationSQL($constraintName, $definition); + } + } + + $queryFields .= $this->getNonAutoincrementPrimaryKeyDefinition($columns, $options); + + if (isset($options['foreignKeys'])) { + foreach ($options['foreignKeys'] as $foreignKey) { + $queryFields .= ', ' . $this->getForeignKeyDeclarationSQL($foreignKey); + } + } + + $tableComment = ''; + if (isset($options['comment'])) { + $comment = trim($options['comment'], " '"); + + $tableComment = $this->getInlineTableCommentSQL($comment); + } + + $query = ['CREATE TABLE ' . $name . ' ' . $tableComment . '(' . $queryFields . ')']; + + if (isset($options['alter']) && $options['alter'] === true) { + return $query; + } + + if (isset($options['indexes']) && ! empty($options['indexes'])) { + foreach ($options['indexes'] as $indexDef) { + $query[] = $this->getCreateIndexSQL($indexDef, $name); + } + } + + if (isset($options['unique']) && ! empty($options['unique'])) { + foreach ($options['unique'] as $indexDef) { + $query[] = $this->getCreateIndexSQL($indexDef, $name); + } + } + + return $query; + } + + /** + * Generate a PRIMARY KEY definition if no autoincrement value is used + * + * @param mixed[][] $columns + * @param mixed[] $options + */ + private function getNonAutoincrementPrimaryKeyDefinition(array $columns, array $options): string + { + if (empty($options['primary'])) { + return ''; + } + + $keyColumns = array_unique(array_values($options['primary'])); + + foreach ($keyColumns as $keyColumn) { + if (! empty($columns[$keyColumn]['autoincrement'])) { + return ''; + } + } + + return ', PRIMARY KEY(' . implode(', ', $keyColumns) . ')'; + } + + /** + * {@inheritDoc} + */ + protected function getVarcharTypeDeclarationSQLSnippet($length, $fixed) + { + return $fixed ? ($length > 0 ? 'CHAR(' . $length . ')' : 'CHAR(255)') + : ($length > 0 ? 'VARCHAR(' . $length . ')' : 'TEXT'); + } + + /** + * {@inheritdoc} + */ + protected function getBinaryTypeDeclarationSQLSnippet($length, $fixed) + { + return 'BLOB'; + } + + /** + * {@inheritdoc} + */ + public function getBinaryMaxLength() + { + return 0; + } + + /** + * {@inheritdoc} + */ + public function getBinaryDefaultLength() + { + return 0; + } + + /** + * {@inheritDoc} + */ + public function getClobTypeDeclarationSQL(array $column) + { + return 'CLOB'; + } + + /** + * {@inheritDoc} + */ + public function getListTableConstraintsSQL($table) + { + $table = str_replace('.', '__', $table); + + return sprintf( + "SELECT sql FROM sqlite_master WHERE type='index' AND tbl_name = %s AND sql NOT NULL ORDER BY name", + $this->quoteStringLiteral($table) + ); + } + + /** + * {@inheritDoc} + */ + public function getListTableColumnsSQL($table, $database = null) + { + $table = str_replace('.', '__', $table); + + return sprintf('PRAGMA table_info(%s)', $this->quoteStringLiteral($table)); + } + + /** + * {@inheritDoc} + */ + public function getListTableIndexesSQL($table, $database = null) + { + $table = str_replace('.', '__', $table); + + return sprintf('PRAGMA index_list(%s)', $this->quoteStringLiteral($table)); + } + + /** + * {@inheritDoc} + */ + public function getListTablesSQL() + { + return 'SELECT name FROM sqlite_master' + . " WHERE type = 'table'" + . " AND name != 'sqlite_sequence'" + . " AND name != 'geometry_columns'" + . " AND name != 'spatial_ref_sys'" + . ' UNION ALL SELECT name FROM sqlite_temp_master' + . " WHERE type = 'table' ORDER BY name"; + } + + /** + * {@inheritDoc} + */ + public function getListViewsSQL($database) + { + return "SELECT name, sql FROM sqlite_master WHERE type='view' AND sql NOT NULL"; + } + + /** + * {@inheritDoc} + */ + public function getCreateViewSQL($name, $sql) + { + return 'CREATE VIEW ' . $name . ' AS ' . $sql; + } + + /** + * {@inheritDoc} + */ + public function getDropViewSQL($name) + { + return 'DROP VIEW ' . $name; + } + + /** + * {@inheritDoc} + */ + public function getAdvancedForeignKeyOptionsSQL(ForeignKeyConstraint $foreignKey) + { + $query = parent::getAdvancedForeignKeyOptionsSQL($foreignKey); + + if (! $foreignKey->hasOption('deferrable') || $foreignKey->getOption('deferrable') === false) { + $query .= ' NOT'; + } + + $query .= ' DEFERRABLE'; + $query .= ' INITIALLY'; + + if ($foreignKey->hasOption('deferred') && $foreignKey->getOption('deferred') !== false) { + $query .= ' DEFERRED'; + } else { + $query .= ' IMMEDIATE'; + } + + return $query; + } + + /** + * {@inheritDoc} + */ + public function supportsIdentityColumns() + { + return true; + } + + /** + * {@inheritDoc} + */ + public function supportsColumnCollation() + { + return true; + } + + /** + * {@inheritDoc} + */ + public function supportsInlineColumnComments() + { + return true; + } + + /** + * {@inheritDoc} + */ + public function getName() + { + return 'sqlite'; + } + + /** + * {@inheritDoc} + */ + public function getTruncateTableSQL($tableName, $cascade = false) + { + $tableIdentifier = new Identifier($tableName); + $tableName = str_replace('.', '__', $tableIdentifier->getQuotedName($this)); + + return 'DELETE FROM ' . $tableName; + } + + /** + * User-defined function for Sqlite that is used with PDO::sqliteCreateFunction(). + * + * @param int|float $value + * + * @return float + */ + public static function udfSqrt($value) + { + return sqrt($value); + } + + /** + * User-defined function for Sqlite that implements MOD(a, b). + * + * @param int $a + * @param int $b + * + * @return int + */ + public static function udfMod($a, $b) + { + return $a % $b; + } + + /** + * @param string $str + * @param string $substr + * @param int $offset + * + * @return int + */ + public static function udfLocate($str, $substr, $offset = 0) + { + // SQL's LOCATE function works on 1-based positions, while PHP's strpos works on 0-based positions. + // So we have to make them compatible if an offset is given. + if ($offset > 0) { + $offset -= 1; + } + + $pos = strpos($str, $substr, $offset); + + if ($pos !== false) { + return $pos + 1; + } + + return 0; + } + + /** + * {@inheritDoc} + */ + public function getForUpdateSQL() + { + return ''; + } + + /** + * {@inheritDoc} + */ + public function getInlineColumnCommentSQL($comment) + { + return '--' . str_replace("\n", "\n--", $comment) . "\n"; + } + + private function getInlineTableCommentSQL(string $comment): string + { + return $this->getInlineColumnCommentSQL($comment); + } + + /** + * {@inheritDoc} + */ + protected function initializeDoctrineTypeMappings() + { + $this->doctrineTypeMapping = [ + 'bigint' => 'bigint', + 'bigserial' => 'bigint', + 'blob' => 'blob', + 'boolean' => 'boolean', + 'char' => 'string', + 'clob' => 'text', + 'date' => 'date', + 'datetime' => 'datetime', + 'decimal' => 'decimal', + 'double' => 'float', + 'double precision' => 'float', + 'float' => 'float', + 'image' => 'string', + 'int' => 'integer', + 'integer' => 'integer', + 'longtext' => 'text', + 'longvarchar' => 'string', + 'mediumint' => 'integer', + 'mediumtext' => 'text', + 'ntext' => 'string', + 'numeric' => 'decimal', + 'nvarchar' => 'string', + 'real' => 'float', + 'serial' => 'integer', + 'smallint' => 'smallint', + 'text' => 'text', + 'time' => 'time', + 'timestamp' => 'datetime', + 'tinyint' => 'boolean', + 'tinytext' => 'text', + 'varchar' => 'string', + 'varchar2' => 'string', + ]; + } + + /** + * {@inheritDoc} + * + * @deprecated Implement {@link createReservedKeywordsList()} instead. + */ + protected function getReservedKeywordsClass() + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4510', + 'SqlitePlatform::getReservedKeywordsClass() is deprecated,' + . ' use SqlitePlatform::createReservedKeywordsList() instead.' + ); + + return Keywords\SQLiteKeywords::class; + } + + /** + * {@inheritDoc} + */ + protected function getPreAlterTableIndexForeignKeySQL(TableDiff $diff) + { + if (! $diff->fromTable instanceof Table) { + throw new Exception( + 'Sqlite platform requires for alter table the table diff with reference to original table schema' + ); + } + + $sql = []; + foreach ($diff->fromTable->getIndexes() as $index) { + if ($index->isPrimary()) { + continue; + } + + $sql[] = $this->getDropIndexSQL($index, $diff->name); + } + + return $sql; + } + + /** + * {@inheritDoc} + */ + protected function getPostAlterTableIndexForeignKeySQL(TableDiff $diff) + { + $fromTable = $diff->fromTable; + + if (! $fromTable instanceof Table) { + throw new Exception( + 'Sqlite platform requires for alter table the table diff with reference to original table schema' + ); + } + + $sql = []; + $tableName = $diff->getNewName(); + + if ($tableName === false) { + $tableName = $diff->getName($this); + } + + foreach ($this->getIndexesInAlteredTable($diff, $fromTable) as $index) { + if ($index->isPrimary()) { + continue; + } + + $sql[] = $this->getCreateIndexSQL($index, $tableName->getQuotedName($this)); + } + + return $sql; + } + + /** + * {@inheritDoc} + */ + protected function doModifyLimitQuery($query, $limit, $offset) + { + if ($limit === null && $offset > 0) { + return $query . ' LIMIT -1 OFFSET ' . $offset; + } + + return parent::doModifyLimitQuery($query, $limit, $offset); + } + + /** + * {@inheritDoc} + */ + public function getBlobTypeDeclarationSQL(array $column) + { + return 'BLOB'; + } + + /** + * {@inheritDoc} + */ + public function getTemporaryTableName($tableName) + { + $tableName = str_replace('.', '__', $tableName); + + return $tableName; + } + + /** + * {@inheritDoc} + * + * Sqlite Platform emulates schema by underscoring each dot and generating tables + * into the default database. + * + * This hack is implemented to be able to use SQLite as testdriver when + * using schema supporting databases. + */ + public function canEmulateSchemas() + { + return true; + } + + /** + * {@inheritDoc} + */ + public function supportsForeignKeyConstraints() + { + return false; + } + + /** + * {@inheritDoc} + */ + public function getCreatePrimaryKeySQL(Index $index, $table) + { + throw new Exception('Sqlite platform does not support alter primary key.'); + } + + /** + * {@inheritdoc} + */ + public function getCreateForeignKeySQL(ForeignKeyConstraint $foreignKey, $table) + { + throw new Exception('Sqlite platform does not support alter foreign key.'); + } + + /** + * {@inheritdoc} + */ + public function getDropForeignKeySQL($foreignKey, $table) + { + throw new Exception('Sqlite platform does not support alter foreign key.'); + } + + /** + * {@inheritDoc} + */ + public function getCreateConstraintSQL(Constraint $constraint, $table) + { + throw new Exception('Sqlite platform does not support alter constraint.'); + } + + /** + * {@inheritDoc} + * + * @param int|null $createFlags + */ + public function getCreateTableSQL(Table $table, $createFlags = null) + { + $createFlags = $createFlags ?? self::CREATE_INDEXES | self::CREATE_FOREIGNKEYS; + + return parent::getCreateTableSQL($table, $createFlags); + } + + /** + * @param string $table + * @param string|null $database + * + * @return string + */ + public function getListTableForeignKeysSQL($table, $database = null) + { + $table = str_replace('.', '__', $table); + + return sprintf('PRAGMA foreign_key_list(%s)', $this->quoteStringLiteral($table)); + } + + /** + * {@inheritDoc} + */ + public function getAlterTableSQL(TableDiff $diff) + { + $sql = $this->getSimpleAlterTableSQL($diff); + if ($sql !== false) { + return $sql; + } + + $fromTable = $diff->fromTable; + if (! $fromTable instanceof Table) { + throw new Exception( + 'Sqlite platform requires for alter table the table diff with reference to original table schema' + ); + } + + $table = clone $fromTable; + + $columns = []; + $oldColumnNames = []; + $newColumnNames = []; + $columnSql = []; + + foreach ($table->getColumns() as $columnName => $column) { + $columnName = strtolower($columnName); + $columns[$columnName] = $column; + $oldColumnNames[$columnName] = $newColumnNames[$columnName] = $column->getQuotedName($this); + } + + foreach ($diff->removedColumns as $columnName => $column) { + if ($this->onSchemaAlterTableRemoveColumn($column, $diff, $columnSql)) { + continue; + } + + $columnName = strtolower($columnName); + if (! isset($columns[$columnName])) { + continue; + } + + unset( + $columns[$columnName], + $oldColumnNames[$columnName], + $newColumnNames[$columnName] + ); + } + + foreach ($diff->renamedColumns as $oldColumnName => $column) { + if ($this->onSchemaAlterTableRenameColumn($oldColumnName, $column, $diff, $columnSql)) { + continue; + } + + $columns = $this->replaceColumn($diff->name, $columns, $oldColumnName, $column); + + if (! isset($newColumnNames[$oldColumnName])) { + continue; + } + + $newColumnNames[$oldColumnName] = $column->getQuotedName($this); + } + + foreach ($diff->changedColumns as $oldColumnName => $columnDiff) { + if ($this->onSchemaAlterTableChangeColumn($columnDiff, $diff, $columnSql)) { + continue; + } + + $columns = $this->replaceColumn($diff->name, $columns, $oldColumnName, $columnDiff->column); + + if (! isset($newColumnNames[$oldColumnName])) { + continue; + } + + $newColumnNames[$oldColumnName] = $columnDiff->column->getQuotedName($this); + } + + foreach ($diff->addedColumns as $columnName => $column) { + if ($this->onSchemaAlterTableAddColumn($column, $diff, $columnSql)) { + continue; + } + + $columns[strtolower($columnName)] = $column; + } + + $sql = []; + $tableSql = []; + if (! $this->onSchemaAlterTable($diff, $tableSql)) { + $dataTable = new Table('__temp__' . $table->getName()); + + $newTable = new Table( + $table->getQuotedName($this), + $columns, + $this->getPrimaryIndexInAlteredTable($diff, $fromTable), + [], + $this->getForeignKeysInAlteredTable($diff, $fromTable), + $table->getOptions() + ); + $newTable->addOption('alter', true); + + $sql = $this->getPreAlterTableIndexForeignKeySQL($diff); + + $sql[] = sprintf( + 'CREATE TEMPORARY TABLE %s AS SELECT %s FROM %s', + $dataTable->getQuotedName($this), + implode(', ', $oldColumnNames), + $table->getQuotedName($this) + ); + $sql[] = $this->getDropTableSQL($fromTable); + + $sql = array_merge($sql, $this->getCreateTableSQL($newTable)); + $sql[] = sprintf( + 'INSERT INTO %s (%s) SELECT %s FROM %s', + $newTable->getQuotedName($this), + implode(', ', $newColumnNames), + implode(', ', $oldColumnNames), + $dataTable->getQuotedName($this) + ); + $sql[] = $this->getDropTableSQL($dataTable); + + $newName = $diff->getNewName(); + + if ($newName !== false) { + $sql[] = sprintf( + 'ALTER TABLE %s RENAME TO %s', + $newTable->getQuotedName($this), + $newName->getQuotedName($this) + ); + } + + $sql = array_merge($sql, $this->getPostAlterTableIndexForeignKeySQL($diff)); + } + + return array_merge($sql, $tableSql, $columnSql); + } + + /** + * Replace the column with the given name with the new column. + * + * @param string $tableName + * @param array $columns + * @param string $columnName + * + * @return array + * + * @throws Exception + */ + private function replaceColumn($tableName, array $columns, $columnName, Column $column): array + { + $keys = array_keys($columns); + $index = array_search(strtolower($columnName), $keys, true); + + if ($index === false) { + throw SchemaException::columnDoesNotExist($columnName, $tableName); + } + + $values = array_values($columns); + + $keys[$index] = strtolower($column->getName()); + $values[$index] = $column; + + return array_combine($keys, $values); + } + + /** + * @return string[]|false + * + * @throws Exception + */ + private function getSimpleAlterTableSQL(TableDiff $diff) + { + // Suppress changes on integer type autoincrement columns. + foreach ($diff->changedColumns as $oldColumnName => $columnDiff) { + if ( + $columnDiff->fromColumn === null || + ! $columnDiff->column->getAutoincrement() || + ! $columnDiff->column->getType() instanceof Types\IntegerType + ) { + continue; + } + + if (! $columnDiff->hasChanged('type') && $columnDiff->hasChanged('unsigned')) { + unset($diff->changedColumns[$oldColumnName]); + + continue; + } + + $fromColumnType = $columnDiff->fromColumn->getType(); + + if (! ($fromColumnType instanceof Types\SmallIntType) && ! ($fromColumnType instanceof Types\BigIntType)) { + continue; + } + + unset($diff->changedColumns[$oldColumnName]); + } + + if ( + ! empty($diff->renamedColumns) + || ! empty($diff->addedForeignKeys) + || ! empty($diff->addedIndexes) + || ! empty($diff->changedColumns) + || ! empty($diff->changedForeignKeys) + || ! empty($diff->changedIndexes) + || ! empty($diff->removedColumns) + || ! empty($diff->removedForeignKeys) + || ! empty($diff->removedIndexes) + || ! empty($diff->renamedIndexes) + ) { + return false; + } + + $table = new Table($diff->name); + + $sql = []; + $tableSql = []; + $columnSql = []; + + foreach ($diff->addedColumns as $column) { + if ($this->onSchemaAlterTableAddColumn($column, $diff, $columnSql)) { + continue; + } + + $definition = array_merge([ + 'unique' => null, + 'autoincrement' => null, + 'default' => null, + ], $column->toArray()); + + $type = $definition['type']; + + switch (true) { + case isset($definition['columnDefinition']) || $definition['autoincrement'] || $definition['unique']: + case $type instanceof Types\DateTimeType && $definition['default'] === $this->getCurrentTimestampSQL(): + case $type instanceof Types\DateType && $definition['default'] === $this->getCurrentDateSQL(): + case $type instanceof Types\TimeType && $definition['default'] === $this->getCurrentTimeSQL(): + return false; + } + + $definition['name'] = $column->getQuotedName($this); + if ($type instanceof Types\StringType && $definition['length'] === null) { + $definition['length'] = 255; + } + + $sql[] = 'ALTER TABLE ' . $table->getQuotedName($this) . ' ADD COLUMN ' + . $this->getColumnDeclarationSQL($definition['name'], $definition); + } + + if (! $this->onSchemaAlterTable($diff, $tableSql)) { + if ($diff->newName !== false) { + $newTable = new Identifier($diff->newName); + + $sql[] = 'ALTER TABLE ' . $table->getQuotedName($this) . ' RENAME TO ' + . $newTable->getQuotedName($this); + } + } + + return array_merge($sql, $tableSql, $columnSql); + } + + /** + * @return string[] + */ + private function getColumnNamesInAlteredTable(TableDiff $diff, Table $fromTable) + { + $columns = []; + + foreach ($fromTable->getColumns() as $columnName => $column) { + $columns[strtolower($columnName)] = $column->getName(); + } + + foreach ($diff->removedColumns as $columnName => $column) { + $columnName = strtolower($columnName); + if (! isset($columns[$columnName])) { + continue; + } + + unset($columns[$columnName]); + } + + foreach ($diff->renamedColumns as $oldColumnName => $column) { + $columnName = $column->getName(); + $columns[strtolower($oldColumnName)] = $columnName; + $columns[strtolower($columnName)] = $columnName; + } + + foreach ($diff->changedColumns as $oldColumnName => $columnDiff) { + $columnName = $columnDiff->column->getName(); + $columns[strtolower($oldColumnName)] = $columnName; + $columns[strtolower($columnName)] = $columnName; + } + + foreach ($diff->addedColumns as $column) { + $columnName = $column->getName(); + $columns[strtolower($columnName)] = $columnName; + } + + return $columns; + } + + /** + * @return Index[] + */ + private function getIndexesInAlteredTable(TableDiff $diff, Table $fromTable) + { + $indexes = $fromTable->getIndexes(); + $columnNames = $this->getColumnNamesInAlteredTable($diff, $fromTable); + + foreach ($indexes as $key => $index) { + foreach ($diff->renamedIndexes as $oldIndexName => $renamedIndex) { + if (strtolower($key) !== strtolower($oldIndexName)) { + continue; + } + + unset($indexes[$key]); + } + + $changed = false; + $indexColumns = []; + foreach ($index->getColumns() as $columnName) { + $normalizedColumnName = strtolower($columnName); + if (! isset($columnNames[$normalizedColumnName])) { + unset($indexes[$key]); + continue 2; + } + + $indexColumns[] = $columnNames[$normalizedColumnName]; + if ($columnName === $columnNames[$normalizedColumnName]) { + continue; + } + + $changed = true; + } + + if (! $changed) { + continue; + } + + $indexes[$key] = new Index( + $index->getName(), + $indexColumns, + $index->isUnique(), + $index->isPrimary(), + $index->getFlags() + ); + } + + foreach ($diff->removedIndexes as $index) { + $indexName = strtolower($index->getName()); + if (strlen($indexName) === 0 || ! isset($indexes[$indexName])) { + continue; + } + + unset($indexes[$indexName]); + } + + foreach (array_merge($diff->changedIndexes, $diff->addedIndexes, $diff->renamedIndexes) as $index) { + $indexName = strtolower($index->getName()); + if (strlen($indexName) > 0) { + $indexes[$indexName] = $index; + } else { + $indexes[] = $index; + } + } + + return $indexes; + } + + /** + * @return ForeignKeyConstraint[] + */ + private function getForeignKeysInAlteredTable(TableDiff $diff, Table $fromTable) + { + $foreignKeys = $fromTable->getForeignKeys(); + $columnNames = $this->getColumnNamesInAlteredTable($diff, $fromTable); + + foreach ($foreignKeys as $key => $constraint) { + $changed = false; + $localColumns = []; + foreach ($constraint->getLocalColumns() as $columnName) { + $normalizedColumnName = strtolower($columnName); + if (! isset($columnNames[$normalizedColumnName])) { + unset($foreignKeys[$key]); + continue 2; + } + + $localColumns[] = $columnNames[$normalizedColumnName]; + if ($columnName === $columnNames[$normalizedColumnName]) { + continue; + } + + $changed = true; + } + + if (! $changed) { + continue; + } + + $foreignKeys[$key] = new ForeignKeyConstraint( + $localColumns, + $constraint->getForeignTableName(), + $constraint->getForeignColumns(), + $constraint->getName(), + $constraint->getOptions() + ); + } + + foreach ($diff->removedForeignKeys as $constraint) { + if (! $constraint instanceof ForeignKeyConstraint) { + $constraint = new Identifier($constraint); + } + + $constraintName = strtolower($constraint->getName()); + if (strlen($constraintName) === 0 || ! isset($foreignKeys[$constraintName])) { + continue; + } + + unset($foreignKeys[$constraintName]); + } + + foreach (array_merge($diff->changedForeignKeys, $diff->addedForeignKeys) as $constraint) { + $constraintName = strtolower($constraint->getName()); + if (strlen($constraintName) > 0) { + $foreignKeys[$constraintName] = $constraint; + } else { + $foreignKeys[] = $constraint; + } + } + + return $foreignKeys; + } + + /** + * @return Index[] + */ + private function getPrimaryIndexInAlteredTable(TableDiff $diff, Table $fromTable) + { + $primaryIndex = []; + + foreach ($this->getIndexesInAlteredTable($diff, $fromTable) as $index) { + if (! $index->isPrimary()) { + continue; + } + + $primaryIndex = [$index->getName() => $index]; + } + + return $primaryIndex; + } +} diff --git a/app/vendor/doctrine/dbal/src/Platforms/TrimMode.php b/app/vendor/doctrine/dbal/src/Platforms/TrimMode.php new file mode 100644 index 000000000..eb499ee46 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Platforms/TrimMode.php @@ -0,0 +1,23 @@ +connection = $connection; + $this->converter = $converter; + } + + public function prepare(string $sql): DriverStatement + { + return new Statement( + $this->connection->prepare($sql), + $this->converter + ); + } + + public function query(string $sql): DriverResult + { + return new Result( + $this->connection->query($sql), + $this->converter + ); + } + + /** + * {@inheritDoc} + */ + public function quote($value, $type = ParameterType::STRING) + { + return $this->connection->quote($value, $type); + } + + public function exec(string $sql): int + { + return $this->connection->exec($sql); + } + + /** + * {@inheritDoc} + */ + public function lastInsertId($name = null) + { + return $this->connection->lastInsertId($name); + } + + /** + * {@inheritDoc} + */ + public function beginTransaction() + { + return $this->connection->beginTransaction(); + } + + /** + * {@inheritDoc} + */ + public function commit() + { + return $this->connection->commit(); + } + + /** + * {@inheritDoc} + */ + public function rollBack() + { + return $this->connection->rollBack(); + } +} diff --git a/app/vendor/doctrine/dbal/src/Portability/Converter.php b/app/vendor/doctrine/dbal/src/Portability/Converter.php new file mode 100644 index 000000000..5763c2603 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Portability/Converter.php @@ -0,0 +1,292 @@ +createConvertValue($convertEmptyStringToNull, $rightTrimString); + $convertNumeric = $this->createConvertRow($convertValue, null); + $convertAssociative = $this->createConvertRow($convertValue, $case); + + $this->convertNumeric = $this->createConvert($convertNumeric, [self::class, 'id']); + $this->convertAssociative = $this->createConvert($convertAssociative, [self::class, 'id']); + $this->convertOne = $this->createConvert($convertValue, [self::class, 'id']); + + $this->convertAllNumeric = $this->createConvertAll($convertNumeric, [self::class, 'id']); + $this->convertAllAssociative = $this->createConvertAll($convertAssociative, [self::class, 'id']); + $this->convertFirstColumn = $this->createConvertAll($convertValue, [self::class, 'id']); + } + + /** + * @param array|false $row + * + * @return list|false + */ + public function convertNumeric($row) + { + return ($this->convertNumeric)($row); + } + + /** + * @param array|false $row + * + * @return array|false + */ + public function convertAssociative($row) + { + return ($this->convertAssociative)($row); + } + + /** + * @param mixed|false $value + * + * @return mixed|false + */ + public function convertOne($value) + { + return ($this->convertOne)($value); + } + + /** + * @param list> $data + * + * @return list> + */ + public function convertAllNumeric(array $data): array + { + return ($this->convertAllNumeric)($data); + } + + /** + * @param list> $data + * + * @return list> + */ + public function convertAllAssociative(array $data): array + { + return ($this->convertAllAssociative)($data); + } + + /** + * @param list $data + * + * @return list + */ + public function convertFirstColumn(array $data): array + { + return ($this->convertFirstColumn)($data); + } + + /** + * @param T $value + * + * @return T + * + * @template T + */ + private static function id($value) + { + return $value; + } + + /** + * @param T $value + * + * @return T|null + * + * @template T + */ + private static function convertEmptyStringToNull($value) + { + if ($value === '') { + return null; + } + + return $value; + } + + /** + * @param T $value + * + * @return T|string + * @psalm-return (T is string ? string : T) + * + * @template T + */ + private static function rightTrimString($value) + { + if (! is_string($value)) { + return $value; + } + + return rtrim($value); + } + + /** + * Creates a function that will convert each individual value retrieved from the database + * + * @param bool $convertEmptyStringToNull Whether each empty string should be converted to NULL + * @param bool $rightTrimString Whether each string should right-trimmed + * + * @return callable|null The resulting function or NULL if no conversion is needed + */ + private function createConvertValue(bool $convertEmptyStringToNull, bool $rightTrimString): ?callable + { + $functions = []; + + if ($convertEmptyStringToNull) { + $functions[] = [self::class, 'convertEmptyStringToNull']; + } + + if ($rightTrimString) { + $functions[] = [self::class, 'rightTrimString']; + } + + return $this->compose(...$functions); + } + + /** + * Creates a function that will convert each array-row retrieved from the database + * + * @param callable|null $function The function that will convert each value + * @param int|null $case Column name case + * + * @return callable|null The resulting function or NULL if no conversion is needed + */ + private function createConvertRow(?callable $function, ?int $case): ?callable + { + $functions = []; + + if ($function !== null) { + $functions[] = $this->createMapper($function); + } + + if ($case !== null) { + $functions[] = static function (array $row) use ($case): array { + return array_change_key_case($row, $case); + }; + } + + return $this->compose(...$functions); + } + + /** + * Creates a function that will be applied to the return value of Statement::fetch*() + * or an identity function if no conversion is needed + * + * @param callable|null $function The function that will convert each tow + * @param callable $id Identity function + */ + private function createConvert(?callable $function, callable $id): callable + { + if ($function === null) { + return $id; + } + + return /** + * @param T $value + * + * @psalm-return (T is false ? false : T) + * + * @template T + */ + static function ($value) use ($function) { + if ($value === false) { + return false; + } + + return $function($value); + }; + } + + /** + * Creates a function that will be applied to the return value of Statement::fetchAll*() + * or an identity function if no transformation is required + * + * @param callable|null $function The function that will transform each value + * @param callable $id Identity function + */ + private function createConvertAll(?callable $function, callable $id): callable + { + if ($function === null) { + return $id; + } + + return $this->createMapper($function); + } + + /** + * Creates a function that maps each value of the array using the given function + * + * @param callable $function The function that maps each value of the array + */ + private function createMapper(callable $function): callable + { + return static function (array $array) use ($function): array { + return array_map($function, $array); + }; + } + + /** + * Creates a composition of the given set of functions + * + * @param callable(T):T ...$functions The functions to compose + * + * @return callable(T):T|null + * + * @template T + */ + private function compose(callable ...$functions): ?callable + { + return array_reduce($functions, static function (?callable $carry, callable $item): callable { + if ($carry === null) { + return $item; + } + + return /** + * @param T $value + * + * @return T + * + * @template T + */ + static function ($value) use ($carry, $item) { + return $item($carry($value)); + }; + }); + } +} diff --git a/app/vendor/doctrine/dbal/src/Portability/Driver.php b/app/vendor/doctrine/dbal/src/Portability/Driver.php new file mode 100644 index 000000000..5ae410cd0 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Portability/Driver.php @@ -0,0 +1,90 @@ +driver = $driver; + $this->mode = $mode; + $this->case = $case; + } + + /** + * {@inheritDoc} + */ + public function connect(array $params) + { + $connection = $this->driver->connect($params); + + $portability = (new OptimizeFlags())( + $this->getDatabasePlatform(), + $this->mode + ); + + $case = 0; + + if ($this->case !== 0 && ($portability & Connection::PORTABILITY_FIX_CASE) !== 0) { + if ($connection instanceof PDO\Connection) { + // make use of c-level support for case handling + $portability &= ~Connection::PORTABILITY_FIX_CASE; + $connection->getWrappedConnection()->setAttribute(\PDO::ATTR_CASE, $this->case); + } else { + $case = $this->case === ColumnCase::LOWER ? CASE_LOWER : CASE_UPPER; + } + } + + $convertEmptyStringToNull = ($portability & Connection::PORTABILITY_EMPTY_TO_NULL) !== 0; + $rightTrimString = ($portability & Connection::PORTABILITY_RTRIM) !== 0; + + if (! $convertEmptyStringToNull && ! $rightTrimString && $case === 0) { + return $connection; + } + + return new Connection( + $connection, + new Converter($convertEmptyStringToNull, $rightTrimString, $case) + ); + } + + /** + * {@inheritDoc} + */ + public function getDatabasePlatform() + { + return $this->driver->getDatabasePlatform(); + } + + /** + * {@inheritDoc} + */ + public function getSchemaManager(DBALConnection $conn, AbstractPlatform $platform) + { + return $this->driver->getSchemaManager($conn, $platform); + } + + public function getExceptionConverter(): ExceptionConverter + { + return $this->driver->getExceptionConverter(); + } +} diff --git a/app/vendor/doctrine/dbal/src/Portability/Middleware.php b/app/vendor/doctrine/dbal/src/Portability/Middleware.php new file mode 100644 index 000000000..b00147062 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Portability/Middleware.php @@ -0,0 +1,32 @@ +mode = $mode; + $this->case = $case; + } + + public function wrap(DriverInterface $driver): DriverInterface + { + if ($this->mode !== 0) { + return new Driver($driver, $this->mode, $this->case); + } + + return $driver; + } +} diff --git a/app/vendor/doctrine/dbal/src/Portability/OptimizeFlags.php b/app/vendor/doctrine/dbal/src/Portability/OptimizeFlags.php new file mode 100644 index 000000000..742eb93fb --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Portability/OptimizeFlags.php @@ -0,0 +1,42 @@ + + */ + private static $platforms = [ + DB2Platform::class => 0, + OraclePlatform::class => Connection::PORTABILITY_EMPTY_TO_NULL, + PostgreSQL94Platform::class => 0, + SqlitePlatform::class => 0, + SQLServer2012Platform::class => 0, + ]; + + public function __invoke(AbstractPlatform $platform, int $flags): int + { + foreach (self::$platforms as $class => $mask) { + if ($platform instanceof $class) { + $flags &= ~$mask; + + break; + } + } + + return $flags; + } +} diff --git a/app/vendor/doctrine/dbal/src/Portability/Result.php b/app/vendor/doctrine/dbal/src/Portability/Result.php new file mode 100644 index 000000000..1fa91ab48 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Portability/Result.php @@ -0,0 +1,100 @@ +result = $result; + $this->converter = $converter; + } + + /** + * {@inheritDoc} + */ + public function fetchNumeric() + { + return $this->converter->convertNumeric( + $this->result->fetchNumeric() + ); + } + + /** + * {@inheritDoc} + */ + public function fetchAssociative() + { + return $this->converter->convertAssociative( + $this->result->fetchAssociative() + ); + } + + /** + * {@inheritDoc} + */ + public function fetchOne() + { + return $this->converter->convertOne( + $this->result->fetchOne() + ); + } + + /** + * {@inheritDoc} + */ + public function fetchAllNumeric(): array + { + return $this->converter->convertAllNumeric( + $this->result->fetchAllNumeric() + ); + } + + /** + * {@inheritDoc} + */ + public function fetchAllAssociative(): array + { + return $this->converter->convertAllAssociative( + $this->result->fetchAllAssociative() + ); + } + + /** + * {@inheritDoc} + */ + public function fetchFirstColumn(): array + { + return $this->converter->convertFirstColumn( + $this->result->fetchFirstColumn() + ); + } + + public function rowCount(): int + { + return $this->result->rowCount(); + } + + public function columnCount(): int + { + return $this->result->columnCount(); + } + + public function free(): void + { + $this->result->free(); + } +} diff --git a/app/vendor/doctrine/dbal/src/Portability/Statement.php b/app/vendor/doctrine/dbal/src/Portability/Statement.php new file mode 100644 index 000000000..f3f94e413 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Portability/Statement.php @@ -0,0 +1,55 @@ +Statement and applies portability measures. + */ + public function __construct(DriverStatement $stmt, Converter $converter) + { + $this->stmt = $stmt; + $this->converter = $converter; + } + + /** + * {@inheritdoc} + */ + public function bindParam($param, &$variable, $type = ParameterType::STRING, $length = null) + { + return $this->stmt->bindParam($param, $variable, $type, $length); + } + + /** + * {@inheritdoc} + */ + public function bindValue($param, $value, $type = ParameterType::STRING) + { + return $this->stmt->bindValue($param, $value, $type); + } + + /** + * {@inheritdoc} + */ + public function execute($params = null): ResultInterface + { + return new Result( + $this->stmt->execute($params), + $this->converter + ); + } +} diff --git a/app/vendor/doctrine/dbal/src/Query.php b/app/vendor/doctrine/dbal/src/Query.php new file mode 100644 index 000000000..ea6024cd8 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Query.php @@ -0,0 +1,70 @@ + + */ + private $params; + + /** + * The types of the parameters bound to the query. + * + * @var array + */ + private $types; + + /** + * @param array $params + * @param array $types + * + * @psalm-suppress ImpurePropertyAssignment + */ + public function __construct(string $sql, array $params, array $types) + { + $this->sql = $sql; + $this->params = $params; + $this->types = $types; + } + + public function getSQL(): string + { + return $this->sql; + } + + /** + * @return array + */ + public function getParams(): array + { + return $this->params; + } + + /** + * @return array + */ + public function getTypes(): array + { + return $this->types; + } +} diff --git a/app/vendor/doctrine/dbal/src/Query/Expression/CompositeExpression.php b/app/vendor/doctrine/dbal/src/Query/Expression/CompositeExpression.php new file mode 100644 index 000000000..85de9ae93 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Query/Expression/CompositeExpression.php @@ -0,0 +1,182 @@ +type = $type; + + $this->addMultiple($parts); + + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/3864', + 'Do not use CompositeExpression constructor directly, use static and() and or() factory methods.' + ); + } + + /** + * @param self|string $part + * @param self|string ...$parts + */ + public static function and($part, ...$parts): self + { + return new self(self::TYPE_AND, array_merge([$part], $parts)); + } + + /** + * @param self|string $part + * @param self|string ...$parts + */ + public static function or($part, ...$parts): self + { + return new self(self::TYPE_OR, array_merge([$part], $parts)); + } + + /** + * Adds multiple parts to composite expression. + * + * @deprecated This class will be made immutable. Use with() instead. + * + * @param self[]|string[] $parts + * + * @return CompositeExpression + */ + public function addMultiple(array $parts = []) + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/3844', + 'CompositeExpression::addMultiple() is deprecated, use CompositeExpression::with() instead.' + ); + + foreach ($parts as $part) { + $this->add($part); + } + + return $this; + } + + /** + * Adds an expression to composite expression. + * + * @deprecated This class will be made immutable. Use with() instead. + * + * @param mixed $part + * + * @return CompositeExpression + */ + public function add($part) + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/3844', + 'CompositeExpression::add() is deprecated, use CompositeExpression::with() instead.' + ); + + if ($part === null) { + return $this; + } + + if ($part instanceof self && count($part) === 0) { + return $this; + } + + $this->parts[] = $part; + + return $this; + } + + /** + * Returns a new CompositeExpression with the given parts added. + * + * @param self|string $part + * @param self|string ...$parts + */ + public function with($part, ...$parts): self + { + $that = clone $this; + + $that->parts = array_merge($that->parts, [$part], $parts); + + return $that; + } + + /** + * Retrieves the amount of expressions on composite expression. + * + * @return int + */ + #[ReturnTypeWillChange] + public function count() + { + return count($this->parts); + } + + /** + * Retrieves the string representation of this composite expression. + * + * @return string + */ + public function __toString() + { + if ($this->count() === 1) { + return (string) $this->parts[0]; + } + + return '(' . implode(') ' . $this->type . ' (', $this->parts) . ')'; + } + + /** + * Returns the type of this composite expression (AND/OR). + * + * @return string + */ + public function getType() + { + return $this->type; + } +} diff --git a/app/vendor/doctrine/dbal/src/Query/Expression/ExpressionBuilder.php b/app/vendor/doctrine/dbal/src/Query/Expression/ExpressionBuilder.php new file mode 100644 index 000000000..8cb531503 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Query/Expression/ExpressionBuilder.php @@ -0,0 +1,322 @@ +'; + public const LT = '<'; + public const LTE = '<='; + public const GT = '>'; + public const GTE = '>='; + + /** + * The DBAL Connection. + * + * @var Connection + */ + private $connection; + + /** + * Initializes a new ExpressionBuilder. + * + * @param Connection $connection The DBAL Connection. + */ + public function __construct(Connection $connection) + { + $this->connection = $connection; + } + + /** + * Creates a conjunction of the given expressions. + * + * @param string|CompositeExpression $expression + * @param string|CompositeExpression ...$expressions + */ + public function and($expression, ...$expressions): CompositeExpression + { + return CompositeExpression::and($expression, ...$expressions); + } + + /** + * Creates a disjunction of the given expressions. + * + * @param string|CompositeExpression $expression + * @param string|CompositeExpression ...$expressions + */ + public function or($expression, ...$expressions): CompositeExpression + { + return CompositeExpression::or($expression, ...$expressions); + } + + /** + * @deprecated Use `and()` instead. + * + * @param mixed $x Optional clause. Defaults = null, but requires + * at least one defined when converting to string. + * + * @return CompositeExpression + */ + public function andX($x = null) + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/3851', + 'ExpressionBuilder::andX() is deprecated, use ExpressionBuilder::and() instead.' + ); + + return new CompositeExpression(CompositeExpression::TYPE_AND, func_get_args()); + } + + /** + * @deprecated Use `or()` instead. + * + * @param mixed $x Optional clause. Defaults = null, but requires + * at least one defined when converting to string. + * + * @return CompositeExpression + */ + public function orX($x = null) + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/3851', + 'ExpressionBuilder::orX() is deprecated, use ExpressionBuilder::or() instead.' + ); + + return new CompositeExpression(CompositeExpression::TYPE_OR, func_get_args()); + } + + /** + * Creates a comparison expression. + * + * @param mixed $x The left expression. + * @param string $operator One of the ExpressionBuilder::* constants. + * @param mixed $y The right expression. + * + * @return string + */ + public function comparison($x, $operator, $y) + { + return $x . ' ' . $operator . ' ' . $y; + } + + /** + * Creates an equality comparison expression with the given arguments. + * + * First argument is considered the left expression and the second is the right expression. + * When converted to string, it will generated a = . Example: + * + * [php] + * // u.id = ? + * $expr->eq('u.id', '?'); + * + * @param mixed $x The left expression. + * @param mixed $y The right expression. + * + * @return string + */ + public function eq($x, $y) + { + return $this->comparison($x, self::EQ, $y); + } + + /** + * Creates a non equality comparison expression with the given arguments. + * First argument is considered the left expression and the second is the right expression. + * When converted to string, it will generated a <> . Example: + * + * [php] + * // u.id <> 1 + * $q->where($q->expr()->neq('u.id', '1')); + * + * @param mixed $x The left expression. + * @param mixed $y The right expression. + * + * @return string + */ + public function neq($x, $y) + { + return $this->comparison($x, self::NEQ, $y); + } + + /** + * Creates a lower-than comparison expression with the given arguments. + * First argument is considered the left expression and the second is the right expression. + * When converted to string, it will generated a < . Example: + * + * [php] + * // u.id < ? + * $q->where($q->expr()->lt('u.id', '?')); + * + * @param mixed $x The left expression. + * @param mixed $y The right expression. + * + * @return string + */ + public function lt($x, $y) + { + return $this->comparison($x, self::LT, $y); + } + + /** + * Creates a lower-than-equal comparison expression with the given arguments. + * First argument is considered the left expression and the second is the right expression. + * When converted to string, it will generated a <= . Example: + * + * [php] + * // u.id <= ? + * $q->where($q->expr()->lte('u.id', '?')); + * + * @param mixed $x The left expression. + * @param mixed $y The right expression. + * + * @return string + */ + public function lte($x, $y) + { + return $this->comparison($x, self::LTE, $y); + } + + /** + * Creates a greater-than comparison expression with the given arguments. + * First argument is considered the left expression and the second is the right expression. + * When converted to string, it will generated a > . Example: + * + * [php] + * // u.id > ? + * $q->where($q->expr()->gt('u.id', '?')); + * + * @param mixed $x The left expression. + * @param mixed $y The right expression. + * + * @return string + */ + public function gt($x, $y) + { + return $this->comparison($x, self::GT, $y); + } + + /** + * Creates a greater-than-equal comparison expression with the given arguments. + * First argument is considered the left expression and the second is the right expression. + * When converted to string, it will generated a >= . Example: + * + * [php] + * // u.id >= ? + * $q->where($q->expr()->gte('u.id', '?')); + * + * @param mixed $x The left expression. + * @param mixed $y The right expression. + * + * @return string + */ + public function gte($x, $y) + { + return $this->comparison($x, self::GTE, $y); + } + + /** + * Creates an IS NULL expression with the given arguments. + * + * @param string $x The expression to be restricted by IS NULL. + * + * @return string + */ + public function isNull($x) + { + return $x . ' IS NULL'; + } + + /** + * Creates an IS NOT NULL expression with the given arguments. + * + * @param string $x The expression to be restricted by IS NOT NULL. + * + * @return string + */ + public function isNotNull($x) + { + return $x . ' IS NOT NULL'; + } + + /** + * Creates a LIKE() comparison expression with the given arguments. + * + * @param string $x The expression to be inspected by the LIKE comparison + * @param mixed $y The pattern to compare against + * + * @return string + */ + public function like($x, $y/*, ?string $escapeChar = null */) + { + return $this->comparison($x, 'LIKE', $y) . + (func_num_args() >= 3 ? sprintf(' ESCAPE %s', func_get_arg(2)) : ''); + } + + /** + * Creates a NOT LIKE() comparison expression with the given arguments. + * + * @param string $x The expression to be inspected by the NOT LIKE comparison + * @param mixed $y The pattern to compare against + * + * @return string + */ + public function notLike($x, $y/*, ?string $escapeChar = null */) + { + return $this->comparison($x, 'NOT LIKE', $y) . + (func_num_args() >= 3 ? sprintf(' ESCAPE %s', func_get_arg(2)) : ''); + } + + /** + * Creates an IN () comparison expression with the given arguments. + * + * @param string $x The SQL expression to be matched against the set. + * @param string|string[] $y The SQL expression or an array of SQL expressions representing the set. + * + * @return string + */ + public function in($x, $y) + { + return $this->comparison($x, 'IN', '(' . implode(', ', (array) $y) . ')'); + } + + /** + * Creates a NOT IN () comparison expression with the given arguments. + * + * @param string $x The SQL expression to be matched against the set. + * @param string|string[] $y The SQL expression or an array of SQL expressions representing the set. + * + * @return string + */ + public function notIn($x, $y) + { + return $this->comparison($x, 'NOT IN', '(' . implode(', ', (array) $y) . ')'); + } + + /** + * Quotes a given input parameter. + * + * @param mixed $input The parameter to be quoted. + * @param int|null $type The type of the parameter. + * + * @return string + */ + public function literal($input, $type = null) + { + return $this->connection->quote($input, $type); + } +} diff --git a/app/vendor/doctrine/dbal/src/Query/QueryBuilder.php b/app/vendor/doctrine/dbal/src/Query/QueryBuilder.php new file mode 100644 index 000000000..246cde1a6 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Query/QueryBuilder.php @@ -0,0 +1,1580 @@ + [], + 'distinct' => false, + 'from' => [], + 'join' => [], + 'set' => [], + 'where' => null, + 'groupBy' => [], + 'having' => null, + 'orderBy' => [], + 'values' => [], + ]; + + /** + * The array of SQL parts collected. + * + * @var mixed[] + */ + private $sqlParts = self::SQL_PARTS_DEFAULTS; + + /** + * The complete SQL string for this query. + * + * @var string|null + */ + private $sql; + + /** + * The query parameters. + * + * @var list|array + */ + private $params = []; + + /** + * The parameter type map of this query. + * + * @var array|array + */ + private $paramTypes = []; + + /** + * The type of query this is. Can be select, update or delete. + * + * @var int + */ + private $type = self::SELECT; + + /** + * The state of the query object. Can be dirty or clean. + * + * @var int + */ + private $state = self::STATE_CLEAN; + + /** + * The index of the first result to retrieve. + * + * @var int + */ + private $firstResult = 0; + + /** + * The maximum number of results to retrieve or NULL to retrieve all results. + * + * @var int|null + */ + private $maxResults; + + /** + * The counter of bound parameters used with {@see bindValue). + * + * @var int + */ + private $boundCounter = 0; + + /** + * Initializes a new QueryBuilder. + * + * @param Connection $connection The DBAL Connection. + */ + public function __construct(Connection $connection) + { + $this->connection = $connection; + } + + /** + * Gets an ExpressionBuilder used for object-oriented construction of query expressions. + * This producer method is intended for convenient inline usage. Example: + * + * + * $qb = $conn->createQueryBuilder() + * ->select('u') + * ->from('users', 'u') + * ->where($qb->expr()->eq('u.id', 1)); + * + * + * For more complex expression construction, consider storing the expression + * builder object in a local variable. + * + * @return ExpressionBuilder + */ + public function expr() + { + return $this->connection->getExpressionBuilder(); + } + + /** + * Gets the type of the currently built query. + * + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * Gets the associated DBAL Connection for this query builder. + * + * @return Connection + */ + public function getConnection() + { + return $this->connection; + } + + /** + * Gets the state of this query builder instance. + * + * @return int Either QueryBuilder::STATE_DIRTY or QueryBuilder::STATE_CLEAN. + */ + public function getState() + { + return $this->state; + } + + /** + * Prepares and executes an SQL query and returns the first row of the result + * as an associative array. + * + * @return array|false False is returned if no rows are found. + * + * @throws Exception + */ + public function fetchAssociative() + { + return $this->connection->fetchAssociative($this->getSQL(), $this->params, $this->paramTypes); + } + + /** + * Prepares and executes an SQL query and returns the first row of the result + * as a numerically indexed array. + * + * @return array|false False is returned if no rows are found. + * + * @throws Exception + */ + public function fetchNumeric() + { + return $this->connection->fetchNumeric($this->getSQL(), $this->params, $this->paramTypes); + } + + /** + * Prepares and executes an SQL query and returns the value of a single column + * of the first row of the result. + * + * @return mixed|false False is returned if no rows are found. + * + * @throws Exception + */ + public function fetchOne() + { + return $this->connection->fetchOne($this->getSQL(), $this->params, $this->paramTypes); + } + + /** + * Prepares and executes an SQL query and returns the result as an array of numeric arrays. + * + * @return array> + * + * @throws Exception + */ + public function fetchAllNumeric(): array + { + return $this->connection->fetchAllNumeric($this->getSQL(), $this->params, $this->paramTypes); + } + + /** + * Prepares and executes an SQL query and returns the result as an array of associative arrays. + * + * @return array> + * + * @throws Exception + */ + public function fetchAllAssociative(): array + { + return $this->connection->fetchAllAssociative($this->getSQL(), $this->params, $this->paramTypes); + } + + /** + * Prepares and executes an SQL query and returns the result as an associative array with the keys + * mapped to the first column and the values mapped to the second column. + * + * @return array + * + * @throws Exception + */ + public function fetchAllKeyValue(): array + { + return $this->connection->fetchAllKeyValue($this->getSQL(), $this->params, $this->paramTypes); + } + + /** + * Prepares and executes an SQL query and returns the result as an associative array with the keys mapped + * to the first column and the values being an associative array representing the rest of the columns + * and their values. + * + * @return array> + * + * @throws Exception + */ + public function fetchAllAssociativeIndexed(): array + { + return $this->connection->fetchAllAssociativeIndexed($this->getSQL(), $this->params, $this->paramTypes); + } + + /** + * Prepares and executes an SQL query and returns the result as an array of the first column values. + * + * @return array + * + * @throws Exception + */ + public function fetchFirstColumn(): array + { + return $this->connection->fetchFirstColumn($this->getSQL(), $this->params, $this->paramTypes); + } + + /** + * Executes an SQL query (SELECT) and returns a Result. + * + * @throws Exception + */ + public function executeQuery(): Result + { + return $this->connection->executeQuery($this->getSQL(), $this->params, $this->paramTypes); + } + + /** + * Executes an SQL statement and returns the number of affected rows. + * + * Should be used for INSERT, UPDATE and DELETE + * + * @return int The number of affected rows. + * + * @throws Exception + */ + public function executeStatement(): int + { + return $this->connection->executeStatement($this->getSQL(), $this->params, $this->paramTypes); + } + + /** + * Executes this query using the bound parameters and their types. + * + * @deprecated Use {@link executeQuery()} or {@link executeStatement()} instead. + * + * @return Result|int + * + * @throws Exception + */ + public function execute() + { + if ($this->type === self::SELECT) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/4578', + 'QueryBuilder::execute() is deprecated, use QueryBuilder::executeQuery() for SQL queries instead.' + ); + + return $this->connection->executeQuery($this->getSQL(), $this->params, $this->paramTypes); + } + + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/4578', + 'QueryBuilder::execute() is deprecated, use QueryBuilder::executeStatement() for SQL statements instead.' + ); + + return $this->connection->executeStatement($this->getSQL(), $this->params, $this->paramTypes); + } + + /** + * Gets the complete SQL string formed by the current specifications of this QueryBuilder. + * + * + * $qb = $em->createQueryBuilder() + * ->select('u') + * ->from('User', 'u') + * echo $qb->getSQL(); // SELECT u FROM User u + * + * + * @return string The SQL query string. + */ + public function getSQL() + { + if ($this->sql !== null && $this->state === self::STATE_CLEAN) { + return $this->sql; + } + + switch ($this->type) { + case self::INSERT: + $sql = $this->getSQLForInsert(); + break; + + case self::DELETE: + $sql = $this->getSQLForDelete(); + break; + + case self::UPDATE: + $sql = $this->getSQLForUpdate(); + break; + + case self::SELECT: + default: + $sql = $this->getSQLForSelect(); + break; + } + + $this->state = self::STATE_CLEAN; + $this->sql = $sql; + + return $sql; + } + + /** + * Sets a query parameter for the query being constructed. + * + * + * $qb = $conn->createQueryBuilder() + * ->select('u') + * ->from('users', 'u') + * ->where('u.id = :user_id') + * ->setParameter(':user_id', 1); + * + * + * @param int|string $key Parameter position or name + * @param mixed $value Parameter value + * @param int|string|Type|null $type Parameter type + * + * @return $this This QueryBuilder instance. + */ + public function setParameter($key, $value, $type = null) + { + if ($type !== null) { + $this->paramTypes[$key] = $type; + } + + $this->params[$key] = $value; + + return $this; + } + + /** + * Sets a collection of query parameters for the query being constructed. + * + * + * $qb = $conn->createQueryBuilder() + * ->select('u') + * ->from('users', 'u') + * ->where('u.id = :user_id1 OR u.id = :user_id2') + * ->setParameters(array( + * ':user_id1' => 1, + * ':user_id2' => 2 + * )); + * + * + * @param list|array $params Parameters to set + * @param array|array $types Parameter types + * + * @return $this This QueryBuilder instance. + */ + public function setParameters(array $params, array $types = []) + { + $this->paramTypes = $types; + $this->params = $params; + + return $this; + } + + /** + * Gets all defined query parameters for the query being constructed indexed by parameter index or name. + * + * @return list|array The currently defined query parameters + */ + public function getParameters() + { + return $this->params; + } + + /** + * Gets a (previously set) query parameter of the query being constructed. + * + * @param mixed $key The key (index or name) of the bound parameter. + * + * @return mixed The value of the bound parameter. + */ + public function getParameter($key) + { + return $this->params[$key] ?? null; + } + + /** + * Gets all defined query parameter types for the query being constructed indexed by parameter index or name. + * + * @return array|array The currently defined + * query parameter types + */ + public function getParameterTypes() + { + return $this->paramTypes; + } + + /** + * Gets a (previously set) query parameter type of the query being constructed. + * + * @param int|string $key The key of the bound parameter type + * + * @return int|string|Type|null The value of the bound parameter type + */ + public function getParameterType($key) + { + return $this->paramTypes[$key] ?? null; + } + + /** + * Sets the position of the first result to retrieve (the "offset"). + * + * @param int $firstResult The first result to return. + * + * @return $this This QueryBuilder instance. + */ + public function setFirstResult($firstResult) + { + $this->state = self::STATE_DIRTY; + $this->firstResult = $firstResult; + + return $this; + } + + /** + * Gets the position of the first result the query object was set to retrieve (the "offset"). + * + * @return int The position of the first result. + */ + public function getFirstResult() + { + return $this->firstResult; + } + + /** + * Sets the maximum number of results to retrieve (the "limit"). + * + * @param int|null $maxResults The maximum number of results to retrieve or NULL to retrieve all results. + * + * @return $this This QueryBuilder instance. + */ + public function setMaxResults($maxResults) + { + $this->state = self::STATE_DIRTY; + $this->maxResults = $maxResults; + + return $this; + } + + /** + * Gets the maximum number of results the query object was set to retrieve (the "limit"). + * Returns NULL if all results will be returned. + * + * @return int|null The maximum number of results. + */ + public function getMaxResults() + { + return $this->maxResults; + } + + /** + * Either appends to or replaces a single, generic query part. + * + * The available parts are: 'select', 'from', 'set', 'where', + * 'groupBy', 'having' and 'orderBy'. + * + * @param string $sqlPartName + * @param mixed $sqlPart + * @param bool $append + * + * @return $this This QueryBuilder instance. + */ + public function add($sqlPartName, $sqlPart, $append = false) + { + $isArray = is_array($sqlPart); + $isMultiple = is_array($this->sqlParts[$sqlPartName]); + + if ($isMultiple && ! $isArray) { + $sqlPart = [$sqlPart]; + } + + $this->state = self::STATE_DIRTY; + + if ($append) { + if ( + $sqlPartName === 'orderBy' + || $sqlPartName === 'groupBy' + || $sqlPartName === 'select' + || $sqlPartName === 'set' + ) { + foreach ($sqlPart as $part) { + $this->sqlParts[$sqlPartName][] = $part; + } + } elseif ($isArray && is_array($sqlPart[key($sqlPart)])) { + $key = key($sqlPart); + $this->sqlParts[$sqlPartName][$key][] = $sqlPart[$key]; + } elseif ($isMultiple) { + $this->sqlParts[$sqlPartName][] = $sqlPart; + } else { + $this->sqlParts[$sqlPartName] = $sqlPart; + } + + return $this; + } + + $this->sqlParts[$sqlPartName] = $sqlPart; + + return $this; + } + + /** + * Specifies an item that is to be returned in the query result. + * Replaces any previously specified selections, if any. + * + * USING AN ARRAY ARGUMENT IS DEPRECATED. Pass each value as an individual argument. + * + * + * $qb = $conn->createQueryBuilder() + * ->select('u.id', 'p.id') + * ->from('users', 'u') + * ->leftJoin('u', 'phonenumbers', 'p', 'u.id = p.user_id'); + * + * + * @param string|string[]|null $select The selection expression. USING AN ARRAY OR NULL IS DEPRECATED. + * Pass each value as an individual argument. + * + * @return $this This QueryBuilder instance. + */ + public function select($select = null/*, string ...$selects*/) + { + $this->type = self::SELECT; + + if ($select === null) { + return $this; + } + + if (is_array($select)) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/3837', + 'Passing an array for the first argument to QueryBuilder::select() is deprecated, ' . + 'pass each value as an individual variadic argument instead.' + ); + } + + $selects = is_array($select) ? $select : func_get_args(); + + return $this->add('select', $selects); + } + + /** + * Adds DISTINCT to the query. + * + * + * $qb = $conn->createQueryBuilder() + * ->select('u.id') + * ->distinct() + * ->from('users', 'u') + * + * + * @return $this This QueryBuilder instance. + */ + public function distinct(): self + { + $this->sqlParts['distinct'] = true; + + return $this; + } + + /** + * Adds an item that is to be returned in the query result. + * + * USING AN ARRAY ARGUMENT IS DEPRECATED. Pass each value as an individual argument. + * + * + * $qb = $conn->createQueryBuilder() + * ->select('u.id') + * ->addSelect('p.id') + * ->from('users', 'u') + * ->leftJoin('u', 'phonenumbers', 'u.id = p.user_id'); + * + * + * @param string|string[]|null $select The selection expression. USING AN ARRAY OR NULL IS DEPRECATED. + * Pass each value as an individual argument. + * + * @return $this This QueryBuilder instance. + */ + public function addSelect($select = null/*, string ...$selects*/) + { + $this->type = self::SELECT; + + if ($select === null) { + return $this; + } + + if (is_array($select)) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/3837', + 'Passing an array for the first argument to QueryBuilder::addSelect() is deprecated, ' . + 'pass each value as an individual variadic argument instead.' + ); + } + + $selects = is_array($select) ? $select : func_get_args(); + + return $this->add('select', $selects, true); + } + + /** + * Turns the query being built into a bulk delete query that ranges over + * a certain table. + * + * + * $qb = $conn->createQueryBuilder() + * ->delete('users', 'u') + * ->where('u.id = :user_id') + * ->setParameter(':user_id', 1); + * + * + * @param string $delete The table whose rows are subject to the deletion. + * @param string $alias The table alias used in the constructed query. + * + * @return $this This QueryBuilder instance. + */ + public function delete($delete = null, $alias = null) + { + $this->type = self::DELETE; + + if ($delete === null) { + return $this; + } + + return $this->add('from', [ + 'table' => $delete, + 'alias' => $alias, + ]); + } + + /** + * Turns the query being built into a bulk update query that ranges over + * a certain table + * + * + * $qb = $conn->createQueryBuilder() + * ->update('counters', 'c') + * ->set('c.value', 'c.value + 1') + * ->where('c.id = ?'); + * + * + * @param string $update The table whose rows are subject to the update. + * @param string $alias The table alias used in the constructed query. + * + * @return $this This QueryBuilder instance. + */ + public function update($update = null, $alias = null) + { + $this->type = self::UPDATE; + + if ($update === null) { + return $this; + } + + return $this->add('from', [ + 'table' => $update, + 'alias' => $alias, + ]); + } + + /** + * Turns the query being built into an insert query that inserts into + * a certain table + * + * + * $qb = $conn->createQueryBuilder() + * ->insert('users') + * ->values( + * array( + * 'name' => '?', + * 'password' => '?' + * ) + * ); + * + * + * @param string $insert The table into which the rows should be inserted. + * + * @return $this This QueryBuilder instance. + */ + public function insert($insert = null) + { + $this->type = self::INSERT; + + if ($insert === null) { + return $this; + } + + return $this->add('from', ['table' => $insert]); + } + + /** + * Creates and adds a query root corresponding to the table identified by the + * given alias, forming a cartesian product with any existing query roots. + * + * + * $qb = $conn->createQueryBuilder() + * ->select('u.id') + * ->from('users', 'u') + * + * + * @param string $from The table. + * @param string|null $alias The alias of the table. + * + * @return $this This QueryBuilder instance. + */ + public function from($from, $alias = null) + { + return $this->add('from', [ + 'table' => $from, + 'alias' => $alias, + ], true); + } + + /** + * Creates and adds a join to the query. + * + * + * $qb = $conn->createQueryBuilder() + * ->select('u.name') + * ->from('users', 'u') + * ->join('u', 'phonenumbers', 'p', 'p.is_primary = 1'); + * + * + * @param string $fromAlias The alias that points to a from clause. + * @param string $join The table name to join. + * @param string $alias The alias of the join table. + * @param string $condition The condition for the join. + * + * @return $this This QueryBuilder instance. + */ + public function join($fromAlias, $join, $alias, $condition = null) + { + return $this->innerJoin($fromAlias, $join, $alias, $condition); + } + + /** + * Creates and adds a join to the query. + * + * + * $qb = $conn->createQueryBuilder() + * ->select('u.name') + * ->from('users', 'u') + * ->innerJoin('u', 'phonenumbers', 'p', 'p.is_primary = 1'); + * + * + * @param string $fromAlias The alias that points to a from clause. + * @param string $join The table name to join. + * @param string $alias The alias of the join table. + * @param string $condition The condition for the join. + * + * @return $this This QueryBuilder instance. + */ + public function innerJoin($fromAlias, $join, $alias, $condition = null) + { + return $this->add('join', [ + $fromAlias => [ + 'joinType' => 'inner', + 'joinTable' => $join, + 'joinAlias' => $alias, + 'joinCondition' => $condition, + ], + ], true); + } + + /** + * Creates and adds a left join to the query. + * + * + * $qb = $conn->createQueryBuilder() + * ->select('u.name') + * ->from('users', 'u') + * ->leftJoin('u', 'phonenumbers', 'p', 'p.is_primary = 1'); + * + * + * @param string $fromAlias The alias that points to a from clause. + * @param string $join The table name to join. + * @param string $alias The alias of the join table. + * @param string $condition The condition for the join. + * + * @return $this This QueryBuilder instance. + */ + public function leftJoin($fromAlias, $join, $alias, $condition = null) + { + return $this->add('join', [ + $fromAlias => [ + 'joinType' => 'left', + 'joinTable' => $join, + 'joinAlias' => $alias, + 'joinCondition' => $condition, + ], + ], true); + } + + /** + * Creates and adds a right join to the query. + * + * + * $qb = $conn->createQueryBuilder() + * ->select('u.name') + * ->from('users', 'u') + * ->rightJoin('u', 'phonenumbers', 'p', 'p.is_primary = 1'); + * + * + * @param string $fromAlias The alias that points to a from clause. + * @param string $join The table name to join. + * @param string $alias The alias of the join table. + * @param string $condition The condition for the join. + * + * @return $this This QueryBuilder instance. + */ + public function rightJoin($fromAlias, $join, $alias, $condition = null) + { + return $this->add('join', [ + $fromAlias => [ + 'joinType' => 'right', + 'joinTable' => $join, + 'joinAlias' => $alias, + 'joinCondition' => $condition, + ], + ], true); + } + + /** + * Sets a new value for a column in a bulk update query. + * + * + * $qb = $conn->createQueryBuilder() + * ->update('counters', 'c') + * ->set('c.value', 'c.value + 1') + * ->where('c.id = ?'); + * + * + * @param string $key The column to set. + * @param string $value The value, expression, placeholder, etc. + * + * @return $this This QueryBuilder instance. + */ + public function set($key, $value) + { + return $this->add('set', $key . ' = ' . $value, true); + } + + /** + * Specifies one or more restrictions to the query result. + * Replaces any previously specified restrictions, if any. + * + * + * $qb = $conn->createQueryBuilder() + * ->select('c.value') + * ->from('counters', 'c') + * ->where('c.id = ?'); + * + * // You can optionally programatically build and/or expressions + * $qb = $conn->createQueryBuilder(); + * + * $or = $qb->expr()->orx(); + * $or->add($qb->expr()->eq('c.id', 1)); + * $or->add($qb->expr()->eq('c.id', 2)); + * + * $qb->update('counters', 'c') + * ->set('c.value', 'c.value + 1') + * ->where($or); + * + * + * @param mixed $predicates The restriction predicates. + * + * @return $this This QueryBuilder instance. + */ + public function where($predicates) + { + if (! (func_num_args() === 1 && $predicates instanceof CompositeExpression)) { + $predicates = CompositeExpression::and(...func_get_args()); + } + + return $this->add('where', $predicates); + } + + /** + * Adds one or more restrictions to the query results, forming a logical + * conjunction with any previously specified restrictions. + * + * + * $qb = $conn->createQueryBuilder() + * ->select('u') + * ->from('users', 'u') + * ->where('u.username LIKE ?') + * ->andWhere('u.is_active = 1'); + * + * + * @see where() + * + * @param mixed $where The query restrictions. + * + * @return $this This QueryBuilder instance. + */ + public function andWhere($where) + { + $args = func_get_args(); + $where = $this->getQueryPart('where'); + + if ($where instanceof CompositeExpression && $where->getType() === CompositeExpression::TYPE_AND) { + $where = $where->with(...$args); + } else { + array_unshift($args, $where); + $where = CompositeExpression::and(...$args); + } + + return $this->add('where', $where, true); + } + + /** + * Adds one or more restrictions to the query results, forming a logical + * disjunction with any previously specified restrictions. + * + * + * $qb = $em->createQueryBuilder() + * ->select('u.name') + * ->from('users', 'u') + * ->where('u.id = 1') + * ->orWhere('u.id = 2'); + * + * + * @see where() + * + * @param mixed $where The WHERE statement. + * + * @return $this This QueryBuilder instance. + */ + public function orWhere($where) + { + $args = func_get_args(); + $where = $this->getQueryPart('where'); + + if ($where instanceof CompositeExpression && $where->getType() === CompositeExpression::TYPE_OR) { + $where = $where->with(...$args); + } else { + array_unshift($args, $where); + $where = CompositeExpression::or(...$args); + } + + return $this->add('where', $where, true); + } + + /** + * Specifies a grouping over the results of the query. + * Replaces any previously specified groupings, if any. + * + * USING AN ARRAY ARGUMENT IS DEPRECATED. Pass each value as an individual argument. + * + * + * $qb = $conn->createQueryBuilder() + * ->select('u.name') + * ->from('users', 'u') + * ->groupBy('u.id'); + * + * + * @param string|string[] $groupBy The grouping expression. USING AN ARRAY IS DEPRECATED. + * Pass each value as an individual argument. + * + * @return $this This QueryBuilder instance. + */ + public function groupBy($groupBy/*, string ...$groupBys*/) + { + if (is_array($groupBy) && count($groupBy) === 0) { + return $this; + } + + if (is_array($groupBy)) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/3837', + 'Passing an array for the first argument to QueryBuilder::groupBy() is deprecated, ' . + 'pass each value as an individual variadic argument instead.' + ); + } + + $groupBy = is_array($groupBy) ? $groupBy : func_get_args(); + + return $this->add('groupBy', $groupBy, false); + } + + /** + * Adds a grouping expression to the query. + * + * USING AN ARRAY ARGUMENT IS DEPRECATED. Pass each value as an individual argument. + * + * + * $qb = $conn->createQueryBuilder() + * ->select('u.name') + * ->from('users', 'u') + * ->groupBy('u.lastLogin') + * ->addGroupBy('u.createdAt'); + * + * + * @param string|string[] $groupBy The grouping expression. USING AN ARRAY IS DEPRECATED. + * Pass each value as an individual argument. + * + * @return $this This QueryBuilder instance. + */ + public function addGroupBy($groupBy/*, string ...$groupBys*/) + { + if (is_array($groupBy) && count($groupBy) === 0) { + return $this; + } + + if (is_array($groupBy)) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/3837', + 'Passing an array for the first argument to QueryBuilder::addGroupBy() is deprecated, ' . + 'pass each value as an individual variadic argument instead.' + ); + } + + $groupBy = is_array($groupBy) ? $groupBy : func_get_args(); + + return $this->add('groupBy', $groupBy, true); + } + + /** + * Sets a value for a column in an insert query. + * + * + * $qb = $conn->createQueryBuilder() + * ->insert('users') + * ->values( + * array( + * 'name' => '?' + * ) + * ) + * ->setValue('password', '?'); + * + * + * @param string $column The column into which the value should be inserted. + * @param string $value The value that should be inserted into the column. + * + * @return $this This QueryBuilder instance. + */ + public function setValue($column, $value) + { + $this->sqlParts['values'][$column] = $value; + + return $this; + } + + /** + * Specifies values for an insert query indexed by column names. + * Replaces any previous values, if any. + * + * + * $qb = $conn->createQueryBuilder() + * ->insert('users') + * ->values( + * array( + * 'name' => '?', + * 'password' => '?' + * ) + * ); + * + * + * @param mixed[] $values The values to specify for the insert query indexed by column names. + * + * @return $this This QueryBuilder instance. + */ + public function values(array $values) + { + return $this->add('values', $values); + } + + /** + * Specifies a restriction over the groups of the query. + * Replaces any previous having restrictions, if any. + * + * @param mixed $having The restriction over the groups. + * + * @return $this This QueryBuilder instance. + */ + public function having($having) + { + if (! (func_num_args() === 1 && $having instanceof CompositeExpression)) { + $having = CompositeExpression::and(...func_get_args()); + } + + return $this->add('having', $having); + } + + /** + * Adds a restriction over the groups of the query, forming a logical + * conjunction with any existing having restrictions. + * + * @param mixed $having The restriction to append. + * + * @return $this This QueryBuilder instance. + */ + public function andHaving($having) + { + $args = func_get_args(); + $having = $this->getQueryPart('having'); + + if ($having instanceof CompositeExpression && $having->getType() === CompositeExpression::TYPE_AND) { + $having = $having->with(...$args); + } else { + array_unshift($args, $having); + $having = CompositeExpression::and(...$args); + } + + return $this->add('having', $having); + } + + /** + * Adds a restriction over the groups of the query, forming a logical + * disjunction with any existing having restrictions. + * + * @param mixed $having The restriction to add. + * + * @return $this This QueryBuilder instance. + */ + public function orHaving($having) + { + $args = func_get_args(); + $having = $this->getQueryPart('having'); + + if ($having instanceof CompositeExpression && $having->getType() === CompositeExpression::TYPE_OR) { + $having = $having->with(...$args); + } else { + array_unshift($args, $having); + $having = CompositeExpression::or(...$args); + } + + return $this->add('having', $having); + } + + /** + * Specifies an ordering for the query results. + * Replaces any previously specified orderings, if any. + * + * @param string $sort The ordering expression. + * @param string $order The ordering direction. + * + * @return $this This QueryBuilder instance. + */ + public function orderBy($sort, $order = null) + { + return $this->add('orderBy', $sort . ' ' . ($order ?? 'ASC'), false); + } + + /** + * Adds an ordering to the query results. + * + * @param string $sort The ordering expression. + * @param string $order The ordering direction. + * + * @return $this This QueryBuilder instance. + */ + public function addOrderBy($sort, $order = null) + { + return $this->add('orderBy', $sort . ' ' . ($order ?? 'ASC'), true); + } + + /** + * Gets a query part by its name. + * + * @param string $queryPartName + * + * @return mixed + */ + public function getQueryPart($queryPartName) + { + return $this->sqlParts[$queryPartName]; + } + + /** + * Gets all query parts. + * + * @return mixed[] + */ + public function getQueryParts() + { + return $this->sqlParts; + } + + /** + * Resets SQL parts. + * + * @param string[]|null $queryPartNames + * + * @return $this This QueryBuilder instance. + */ + public function resetQueryParts($queryPartNames = null) + { + if ($queryPartNames === null) { + $queryPartNames = array_keys($this->sqlParts); + } + + foreach ($queryPartNames as $queryPartName) { + $this->resetQueryPart($queryPartName); + } + + return $this; + } + + /** + * Resets a single SQL part. + * + * @param string $queryPartName + * + * @return $this This QueryBuilder instance. + */ + public function resetQueryPart($queryPartName) + { + $this->sqlParts[$queryPartName] = self::SQL_PARTS_DEFAULTS[$queryPartName]; + + $this->state = self::STATE_DIRTY; + + return $this; + } + + /** + * @return string + * + * @throws QueryException + */ + private function getSQLForSelect() + { + $query = 'SELECT ' . ($this->sqlParts['distinct'] ? 'DISTINCT ' : '') . + implode(', ', $this->sqlParts['select']); + + $query .= ($this->sqlParts['from'] ? ' FROM ' . implode(', ', $this->getFromClauses()) : '') + . ($this->sqlParts['where'] !== null ? ' WHERE ' . ((string) $this->sqlParts['where']) : '') + . ($this->sqlParts['groupBy'] ? ' GROUP BY ' . implode(', ', $this->sqlParts['groupBy']) : '') + . ($this->sqlParts['having'] !== null ? ' HAVING ' . ((string) $this->sqlParts['having']) : '') + . ($this->sqlParts['orderBy'] ? ' ORDER BY ' . implode(', ', $this->sqlParts['orderBy']) : ''); + + if ($this->isLimitQuery()) { + return $this->connection->getDatabasePlatform()->modifyLimitQuery( + $query, + $this->maxResults, + $this->firstResult + ); + } + + return $query; + } + + /** + * @return string[] + * + * @throws QueryException + */ + private function getFromClauses() + { + $fromClauses = []; + $knownAliases = []; + + // Loop through all FROM clauses + foreach ($this->sqlParts['from'] as $from) { + if ($from['alias'] === null) { + $tableSql = $from['table']; + $tableReference = $from['table']; + } else { + $tableSql = $from['table'] . ' ' . $from['alias']; + $tableReference = $from['alias']; + } + + $knownAliases[$tableReference] = true; + + $fromClauses[$tableReference] = $tableSql . $this->getSQLForJoins($tableReference, $knownAliases); + } + + $this->verifyAllAliasesAreKnown($knownAliases); + + return $fromClauses; + } + + /** + * @param array $knownAliases + * + * @throws QueryException + */ + private function verifyAllAliasesAreKnown(array $knownAliases): void + { + foreach ($this->sqlParts['join'] as $fromAlias => $joins) { + if (! isset($knownAliases[$fromAlias])) { + throw QueryException::unknownAlias($fromAlias, array_keys($knownAliases)); + } + } + } + + /** + * @return bool + */ + private function isLimitQuery() + { + return $this->maxResults !== null || $this->firstResult !== 0; + } + + /** + * Converts this instance into an INSERT string in SQL. + * + * @return string + */ + private function getSQLForInsert() + { + return 'INSERT INTO ' . $this->sqlParts['from']['table'] . + ' (' . implode(', ', array_keys($this->sqlParts['values'])) . ')' . + ' VALUES(' . implode(', ', $this->sqlParts['values']) . ')'; + } + + /** + * Converts this instance into an UPDATE string in SQL. + * + * @return string + */ + private function getSQLForUpdate() + { + $table = $this->sqlParts['from']['table'] + . ($this->sqlParts['from']['alias'] ? ' ' . $this->sqlParts['from']['alias'] : ''); + + return 'UPDATE ' . $table + . ' SET ' . implode(', ', $this->sqlParts['set']) + . ($this->sqlParts['where'] !== null ? ' WHERE ' . ((string) $this->sqlParts['where']) : ''); + } + + /** + * Converts this instance into a DELETE string in SQL. + * + * @return string + */ + private function getSQLForDelete() + { + $table = $this->sqlParts['from']['table'] + . ($this->sqlParts['from']['alias'] ? ' ' . $this->sqlParts['from']['alias'] : ''); + + return 'DELETE FROM ' . $table + . ($this->sqlParts['where'] !== null ? ' WHERE ' . ((string) $this->sqlParts['where']) : ''); + } + + /** + * Gets a string representation of this QueryBuilder which corresponds to + * the final SQL query being constructed. + * + * @return string The string representation of this QueryBuilder. + */ + public function __toString() + { + return $this->getSQL(); + } + + /** + * Creates a new named parameter and bind the value $value to it. + * + * This method provides a shortcut for {@link Statement::bindValue()} + * when using prepared statements. + * + * The parameter $value specifies the value that you want to bind. If + * $placeholder is not provided bindValue() will automatically create a + * placeholder for you. An automatic placeholder will be of the name + * ':dcValue1', ':dcValue2' etc. + * + * Example: + * + * $value = 2; + * $q->eq( 'id', $q->bindValue( $value ) ); + * $stmt = $q->executeQuery(); // executed with 'id = 2' + * + * + * @link http://www.zetacomponents.org + * + * @param mixed $value + * @param int|string|Type|null $type + * @param string $placeHolder The name to bind with. The string must start with a colon ':'. + * + * @return string the placeholder name used. + */ + public function createNamedParameter($value, $type = ParameterType::STRING, $placeHolder = null) + { + if ($placeHolder === null) { + $this->boundCounter++; + $placeHolder = ':dcValue' . $this->boundCounter; + } + + $this->setParameter(substr($placeHolder, 1), $value, $type); + + return $placeHolder; + } + + /** + * Creates a new positional parameter and bind the given value to it. + * + * Attention: If you are using positional parameters with the query builder you have + * to be very careful to bind all parameters in the order they appear in the SQL + * statement , otherwise they get bound in the wrong order which can lead to serious + * bugs in your code. + * + * Example: + * + * $qb = $conn->createQueryBuilder(); + * $qb->select('u.*') + * ->from('users', 'u') + * ->where('u.username = ' . $qb->createPositionalParameter('Foo', ParameterType::STRING)) + * ->orWhere('u.username = ' . $qb->createPositionalParameter('Bar', ParameterType::STRING)) + * + * + * @param mixed $value + * @param int|string|Type|null $type + * + * @return string + */ + public function createPositionalParameter($value, $type = ParameterType::STRING) + { + $this->setParameter($this->boundCounter, $value, $type); + $this->boundCounter++; + + return '?'; + } + + /** + * @param string $fromAlias + * @param array $knownAliases + * + * @return string + * + * @throws QueryException + */ + private function getSQLForJoins($fromAlias, array &$knownAliases) + { + $sql = ''; + + if (isset($this->sqlParts['join'][$fromAlias])) { + foreach ($this->sqlParts['join'][$fromAlias] as $join) { + if (array_key_exists($join['joinAlias'], $knownAliases)) { + throw QueryException::nonUniqueAlias($join['joinAlias'], array_keys($knownAliases)); + } + + $sql .= ' ' . strtoupper($join['joinType']) + . ' JOIN ' . $join['joinTable'] . ' ' . $join['joinAlias']; + if ($join['joinCondition'] !== null) { + $sql .= ' ON ' . $join['joinCondition']; + } + + $knownAliases[$join['joinAlias']] = true; + } + + foreach ($this->sqlParts['join'][$fromAlias] as $join) { + $sql .= $this->getSQLForJoins($join['joinAlias'], $knownAliases); + } + } + + return $sql; + } + + /** + * Deep clone of all expression objects in the SQL parts. + * + * @return void + */ + public function __clone() + { + foreach ($this->sqlParts as $part => $elements) { + if (is_array($this->sqlParts[$part])) { + foreach ($this->sqlParts[$part] as $idx => $element) { + if (! is_object($element)) { + continue; + } + + $this->sqlParts[$part][$idx] = clone $element; + } + } elseif (is_object($elements)) { + $this->sqlParts[$part] = clone $elements; + } + } + + foreach ($this->params as $name => $param) { + if (! is_object($param)) { + continue; + } + + $this->params[$name] = clone $param; + } + } +} diff --git a/app/vendor/doctrine/dbal/src/Query/QueryException.php b/app/vendor/doctrine/dbal/src/Query/QueryException.php new file mode 100644 index 000000000..58e941e98 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Query/QueryException.php @@ -0,0 +1,39 @@ +result = $result; + $this->connection = $connection; + } + + /** + * Returns the next row of the result as a numeric array or FALSE if there are no more rows. + * + * @return list|false + * + * @throws Exception + */ + public function fetchNumeric() + { + try { + return $this->result->fetchNumeric(); + } catch (DriverException $e) { + throw $this->connection->convertException($e); + } + } + + /** + * Returns the next row of the result as an associative array or FALSE if there are no more rows. + * + * @return array|false + * + * @throws Exception + */ + public function fetchAssociative() + { + try { + return $this->result->fetchAssociative(); + } catch (DriverException $e) { + throw $this->connection->convertException($e); + } + } + + /** + * Returns the first value of the next row of the result or FALSE if there are no more rows. + * + * @return mixed|false + * + * @throws Exception + */ + public function fetchOne() + { + try { + return $this->result->fetchOne(); + } catch (DriverException $e) { + throw $this->connection->convertException($e); + } + } + + /** + * Returns an array containing all of the result rows represented as numeric arrays. + * + * @return list> + * + * @throws Exception + */ + public function fetchAllNumeric(): array + { + try { + return $this->result->fetchAllNumeric(); + } catch (DriverException $e) { + throw $this->connection->convertException($e); + } + } + + /** + * Returns an array containing all of the result rows represented as associative arrays. + * + * @return list> + * + * @throws Exception + */ + public function fetchAllAssociative(): array + { + try { + return $this->result->fetchAllAssociative(); + } catch (DriverException $e) { + throw $this->connection->convertException($e); + } + } + + /** + * Returns an array containing the values of the first column of the result. + * + * @return array + * + * @throws Exception + */ + public function fetchAllKeyValue(): array + { + $this->ensureHasKeyValue(); + + $data = []; + + foreach ($this->fetchAllNumeric() as [$key, $value]) { + $data[$key] = $value; + } + + return $data; + } + + /** + * Returns an associative array with the keys mapped to the first column and the values being + * an associative array representing the rest of the columns and their values. + * + * @return array> + * + * @throws Exception + */ + public function fetchAllAssociativeIndexed(): array + { + $data = []; + + foreach ($this->fetchAllAssociative() as $row) { + $data[array_shift($row)] = $row; + } + + return $data; + } + + /** + * @return list + * + * @throws Exception + */ + public function fetchFirstColumn(): array + { + try { + return $this->result->fetchFirstColumn(); + } catch (DriverException $e) { + throw $this->connection->convertException($e); + } + } + + /** + * @return Traversable> + * + * @throws Exception + */ + public function iterateNumeric(): Traversable + { + try { + while (($row = $this->result->fetchNumeric()) !== false) { + yield $row; + } + } catch (DriverException $e) { + throw $this->connection->convertException($e); + } + } + + /** + * @return Traversable> + * + * @throws Exception + */ + public function iterateAssociative(): Traversable + { + try { + while (($row = $this->result->fetchAssociative()) !== false) { + yield $row; + } + } catch (DriverException $e) { + throw $this->connection->convertException($e); + } + } + + /** + * {@inheritDoc} + * + * @throws Exception + */ + public function iterateKeyValue(): Traversable + { + $this->ensureHasKeyValue(); + + foreach ($this->iterateNumeric() as [$key, $value]) { + yield $key => $value; + } + } + + /** + * Returns an iterator over the result set with the keys mapped to the first column and the values being + * an associative array representing the rest of the columns and their values. + * + * @return Traversable> + * + * @throws Exception + */ + public function iterateAssociativeIndexed(): Traversable + { + foreach ($this->iterateAssociative() as $row) { + yield array_shift($row) => $row; + } + } + + /** + * @return Traversable + * + * @throws Exception + */ + public function iterateColumn(): Traversable + { + try { + while (($value = $this->result->fetchOne()) !== false) { + yield $value; + } + } catch (DriverException $e) { + throw $this->connection->convertException($e); + } + } + + /** + * @throws Exception + */ + public function rowCount(): int + { + try { + return $this->result->rowCount(); + } catch (DriverException $e) { + throw $this->connection->convertException($e); + } + } + + /** + * @throws Exception + */ + public function columnCount(): int + { + try { + return $this->result->columnCount(); + } catch (DriverException $e) { + throw $this->connection->convertException($e); + } + } + + public function free(): void + { + $this->result->free(); + } + + /** + * @throws Exception + */ + private function ensureHasKeyValue(): void + { + $columnCount = $this->columnCount(); + + if ($columnCount < 2) { + throw NoKeyValue::fromColumnCount($columnCount); + } + } + + /** + * BC layer for a wide-spread use-case of old DBAL APIs + * + * @deprecated This API is deprecated and will be removed after 2022 + * + * @return mixed + */ + public function fetch(int $mode = FetchMode::ASSOCIATIVE) + { + if (func_num_args() > 1) { + throw new LogicException('Only invocations with one argument are still supported by this legecy API.'); + } + + if ($mode === FetchMode::ASSOCIATIVE) { + return $this->fetchAssociative(); + } + + if ($mode === FetchMode::NUMERIC) { + return $this->fetchNumeric(); + } + + if ($mode === FetchMode::COLUMN) { + return $this->fetchOne(); + } + + throw new LogicException('Only fetch modes declared on Doctrine\DBAL\FetchMode are supported by legacy API.'); + } + + /** + * BC layer for a wide-spread use-case of old DBAL APIs + * + * @deprecated This API is deprecated and will be removed after 2022 + * + * @return list + */ + public function fetchAll(int $mode = FetchMode::ASSOCIATIVE): array + { + if (func_num_args() > 1) { + throw new LogicException('Only invocations with one argument are still supported by this legecy API.'); + } + + if ($mode === FetchMode::ASSOCIATIVE) { + return $this->fetchAllAssociative(); + } + + if ($mode === FetchMode::NUMERIC) { + return $this->fetchAllNumeric(); + } + + if ($mode === FetchMode::COLUMN) { + return $this->fetchFirstColumn(); + } + + throw new LogicException('Only fetch modes declared on Doctrine\DBAL\FetchMode are supported by legacy API.'); + } +} diff --git a/app/vendor/doctrine/dbal/src/SQL/Parser.php b/app/vendor/doctrine/dbal/src/SQL/Parser.php new file mode 100644 index 000000000..32d306ca0 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/SQL/Parser.php @@ -0,0 +1,117 @@ +getMySQLStringLiteralPattern("'"), + $this->getMySQLStringLiteralPattern('"'), + ]; + } else { + $patterns = [ + $this->getAnsiSQLStringLiteralPattern("'"), + $this->getAnsiSQLStringLiteralPattern('"'), + ]; + } + + $patterns = array_merge($patterns, [ + self::BACKTICK_IDENTIFIER, + self::BRACKET_IDENTIFIER, + self::MULTICHAR, + self::ONE_LINE_COMMENT, + self::MULTI_LINE_COMMENT, + self::OTHER, + ]); + + $this->sqlPattern = sprintf('(%s)+', implode('|', $patterns)); + } + + /** + * Parses the given SQL statement + */ + public function parse(string $sql, Visitor $visitor): void + { + /** @var array $patterns */ + $patterns = [ + self::NAMED_PARAMETER => static function (string $sql) use ($visitor): void { + $visitor->acceptNamedParameter($sql); + }, + self::POSITIONAL_PARAMETER => static function (string $sql) use ($visitor): void { + $visitor->acceptPositionalParameter($sql); + }, + $this->sqlPattern => static function (string $sql) use ($visitor): void { + $visitor->acceptOther($sql); + }, + self::SPECIAL => static function (string $sql) use ($visitor): void { + $visitor->acceptOther($sql); + }, + ]; + + $offset = 0; + + while (($handler = current($patterns)) !== false) { + if (preg_match('~\G' . key($patterns) . '~s', $sql, $matches, 0, $offset) === 1) { + $handler($matches[0]); + reset($patterns); + + $offset += strlen($matches[0]); + } else { + next($patterns); + } + } + + assert($offset === strlen($sql)); + } + + private function getMySQLStringLiteralPattern(string $delimiter): string + { + return $delimiter . '((\\\\' . self::ANY . ')|(?![' . $delimiter . '\\\\])' . self::ANY . ')*' . $delimiter; + } + + private function getAnsiSQLStringLiteralPattern(string $delimiter): string + { + return $delimiter . '[^' . $delimiter . ']*' . $delimiter; + } +} diff --git a/app/vendor/doctrine/dbal/src/SQL/Parser/Visitor.php b/app/vendor/doctrine/dbal/src/SQL/Parser/Visitor.php new file mode 100644 index 000000000..574ba1bf1 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/SQL/Parser/Visitor.php @@ -0,0 +1,26 @@ + Table($tableName)); if you want to rename the table, you have to make sure + */ +abstract class AbstractAsset +{ + /** @var string */ + protected $_name = ''; + + /** + * Namespace of the asset. If none isset the default namespace is assumed. + * + * @var string|null + */ + protected $_namespace; + + /** @var bool */ + protected $_quoted = false; + + /** + * Sets the name of this asset. + * + * @param string $name + * + * @return void + */ + protected function _setName($name) + { + if ($this->isIdentifierQuoted($name)) { + $this->_quoted = true; + $name = $this->trimQuotes($name); + } + + if (strpos($name, '.') !== false) { + $parts = explode('.', $name); + $this->_namespace = $parts[0]; + $name = $parts[1]; + } + + $this->_name = $name; + } + + /** + * Is this asset in the default namespace? + * + * @param string $defaultNamespaceName + * + * @return bool + */ + public function isInDefaultNamespace($defaultNamespaceName) + { + return $this->_namespace === $defaultNamespaceName || $this->_namespace === null; + } + + /** + * Gets the namespace name of this asset. + * + * If NULL is returned this means the default namespace is used. + * + * @return string|null + */ + public function getNamespaceName() + { + return $this->_namespace; + } + + /** + * The shortest name is stripped of the default namespace. All other + * namespaced elements are returned as full-qualified names. + * + * @param string|null $defaultNamespaceName + * + * @return string + */ + public function getShortestName($defaultNamespaceName) + { + $shortestName = $this->getName(); + if ($this->_namespace === $defaultNamespaceName) { + $shortestName = $this->_name; + } + + return strtolower($shortestName); + } + + /** + * The normalized name is full-qualified and lower-cased. Lower-casing is + * actually wrong, but we have to do it to keep our sanity. If you are + * using database objects that only differentiate in the casing (FOO vs + * Foo) then you will NOT be able to use Doctrine Schema abstraction. + * + * Every non-namespaced element is prefixed with the default namespace + * name which is passed as argument to this method. + * + * @param string $defaultNamespaceName + * + * @return string + */ + public function getFullQualifiedName($defaultNamespaceName) + { + $name = $this->getName(); + if ($this->_namespace === null) { + $name = $defaultNamespaceName . '.' . $name; + } + + return strtolower($name); + } + + /** + * Checks if this asset's name is quoted. + * + * @return bool + */ + public function isQuoted() + { + return $this->_quoted; + } + + /** + * Checks if this identifier is quoted. + * + * @param string $identifier + * + * @return bool + */ + protected function isIdentifierQuoted($identifier) + { + return isset($identifier[0]) && ($identifier[0] === '`' || $identifier[0] === '"' || $identifier[0] === '['); + } + + /** + * Trim quotes from the identifier. + * + * @param string $identifier + * + * @return string + */ + protected function trimQuotes($identifier) + { + return str_replace(['`', '"', '[', ']'], '', $identifier); + } + + /** + * Returns the name of this schema asset. + * + * @return string + */ + public function getName() + { + if ($this->_namespace !== null) { + return $this->_namespace . '.' . $this->_name; + } + + return $this->_name; + } + + /** + * Gets the quoted representation of this asset but only if it was defined with one. Otherwise + * return the plain unquoted value as inserted. + * + * @return string + */ + public function getQuotedName(AbstractPlatform $platform) + { + $keywords = $platform->getReservedKeywordsList(); + $parts = explode('.', $this->getName()); + foreach ($parts as $k => $v) { + $parts[$k] = $this->_quoted || $keywords->isKeyword($v) ? $platform->quoteIdentifier($v) : $v; + } + + return implode('.', $parts); + } + + /** + * Generates an identifier from a list of column names obeying a certain string length. + * + * This is especially important for Oracle, since it does not allow identifiers larger than 30 chars, + * however building idents automatically for foreign keys, composite keys or such can easily create + * very long names. + * + * @param string[] $columnNames + * @param string $prefix + * @param int $maxSize + * + * @return string + */ + protected function _generateIdentifierName($columnNames, $prefix = '', $maxSize = 30) + { + $hash = implode('', array_map(static function ($column): string { + return dechex(crc32($column)); + }, $columnNames)); + + return strtoupper(substr($prefix . '_' . $hash, 0, $maxSize)); + } +} diff --git a/app/vendor/doctrine/dbal/src/Schema/AbstractSchemaManager.php b/app/vendor/doctrine/dbal/src/Schema/AbstractSchemaManager.php new file mode 100644 index 000000000..50b9facee --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Schema/AbstractSchemaManager.php @@ -0,0 +1,1225 @@ +_conn = $connection; + $this->_platform = $platform; + } + + /** + * Returns the associated platform. + * + * @return AbstractPlatform + */ + public function getDatabasePlatform() + { + return $this->_platform; + } + + /** + * Tries any method on the schema manager. Normally a method throws an + * exception when your DBMS doesn't support it or if an error occurs. + * This method allows you to try and method on your SchemaManager + * instance and will return false if it does not work or is not supported. + * + * + * $result = $sm->tryMethod('dropView', 'view_name'); + * + * + * @return mixed + */ + public function tryMethod() + { + $args = func_get_args(); + $method = $args[0]; + unset($args[0]); + $args = array_values($args); + + $callback = [$this, $method]; + assert(is_callable($callback)); + + try { + return call_user_func_array($callback, $args); + } catch (Throwable $e) { + return false; + } + } + + /** + * Lists the available databases for this connection. + * + * @return string[] + * + * @throws Exception + */ + public function listDatabases() + { + $sql = $this->_platform->getListDatabasesSQL(); + + $databases = $this->_conn->fetchAllAssociative($sql); + + return $this->_getPortableDatabasesList($databases); + } + + /** + * Returns a list of all namespaces in the current database. + * + * @deprecated Use {@link listSchemaNames()} instead. + * + * @return string[] + * + * @throws Exception + */ + public function listNamespaceNames() + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4503', + 'AbstractSchemaManager::listNamespaceNames() is deprecated,' + . ' use AbstractSchemaManager::listSchemaNames() instead.' + ); + + $sql = $this->_platform->getListNamespacesSQL(); + + $namespaces = $this->_conn->fetchAllAssociative($sql); + + return $this->getPortableNamespacesList($namespaces); + } + + /** + * Returns a list of the names of all schemata in the current database. + * + * @return list + * + * @throws Exception + */ + public function listSchemaNames(): array + { + throw Exception::notSupported(__METHOD__); + } + + /** + * Lists the available sequences for this connection. + * + * @param string|null $database + * + * @return Sequence[] + * + * @throws Exception + */ + public function listSequences($database = null) + { + if ($database === null) { + $database = $this->_conn->getDatabase(); + } + + $sql = $this->_platform->getListSequencesSQL($database); + + $sequences = $this->_conn->fetchAllAssociative($sql); + + return $this->filterAssetNames($this->_getPortableSequencesList($sequences)); + } + + /** + * Lists the columns for a given table. + * + * In contrast to other libraries and to the old version of Doctrine, + * this column definition does try to contain the 'primary' column for + * the reason that it is not portable across different RDBMS. Use + * {@see listTableIndexes($tableName)} to retrieve the primary key + * of a table. Where a RDBMS specifies more details, these are held + * in the platformDetails array. + * + * @param string $table The name of the table. + * @param string|null $database + * + * @return Column[] + * + * @throws Exception + */ + public function listTableColumns($table, $database = null) + { + if ($database === null) { + $database = $this->_conn->getDatabase(); + } + + $sql = $this->_platform->getListTableColumnsSQL($table, $database); + + $tableColumns = $this->_conn->fetchAllAssociative($sql); + + return $this->_getPortableTableColumnList($table, $database, $tableColumns); + } + + /** + * Lists the indexes for a given table returning an array of Index instances. + * + * Keys of the portable indexes list are all lower-cased. + * + * @param string $table The name of the table. + * + * @return Index[] + * + * @throws Exception + */ + public function listTableIndexes($table) + { + $sql = $this->_platform->getListTableIndexesSQL($table, $this->_conn->getDatabase()); + + $tableIndexes = $this->_conn->fetchAllAssociative($sql); + + return $this->_getPortableTableIndexesList($tableIndexes, $table); + } + + /** + * Returns true if all the given tables exist. + * + * The usage of a string $tableNames is deprecated. Pass a one-element array instead. + * + * @param string|string[] $names + * + * @return bool + * + * @throws Exception + */ + public function tablesExist($names) + { + if (is_string($names)) { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/3580', + 'The usage of a string $tableNames in AbstractSchemaManager::tablesExist() is deprecated. ' . + 'Pass a one-element array instead.' + ); + } + + $names = array_map('strtolower', (array) $names); + + return count($names) === count(array_intersect($names, array_map('strtolower', $this->listTableNames()))); + } + + /** + * Returns a list of all tables in the current database. + * + * @return string[] + * + * @throws Exception + */ + public function listTableNames() + { + $sql = $this->_platform->getListTablesSQL(); + + $tables = $this->_conn->fetchAllAssociative($sql); + $tableNames = $this->_getPortableTablesList($tables); + + return $this->filterAssetNames($tableNames); + } + + /** + * Filters asset names if they are configured to return only a subset of all + * the found elements. + * + * @param mixed[] $assetNames + * + * @return mixed[] + */ + protected function filterAssetNames($assetNames) + { + $filter = $this->_conn->getConfiguration()->getSchemaAssetsFilter(); + if ($filter === null) { + return $assetNames; + } + + return array_values(array_filter($assetNames, $filter)); + } + + /** + * Lists the tables for this connection. + * + * @return Table[] + * + * @throws Exception + */ + public function listTables() + { + $tableNames = $this->listTableNames(); + + $tables = []; + foreach ($tableNames as $tableName) { + $tables[] = $this->listTableDetails($tableName); + } + + return $tables; + } + + /** + * @param string $name + * + * @return Table + * + * @throws Exception + */ + public function listTableDetails($name) + { + $columns = $this->listTableColumns($name); + $foreignKeys = []; + + if ($this->_platform->supportsForeignKeyConstraints()) { + $foreignKeys = $this->listTableForeignKeys($name); + } + + $indexes = $this->listTableIndexes($name); + + return new Table($name, $columns, $indexes, [], $foreignKeys); + } + + /** + * Lists the views this connection has. + * + * @return View[] + * + * @throws Exception + */ + public function listViews() + { + $database = $this->_conn->getDatabase(); + $sql = $this->_platform->getListViewsSQL($database); + $views = $this->_conn->fetchAllAssociative($sql); + + return $this->_getPortableViewsList($views); + } + + /** + * Lists the foreign keys for the given table. + * + * @param string $table The name of the table. + * @param string|null $database + * + * @return ForeignKeyConstraint[] + * + * @throws Exception + */ + public function listTableForeignKeys($table, $database = null) + { + if ($database === null) { + $database = $this->_conn->getDatabase(); + } + + $sql = $this->_platform->getListTableForeignKeysSQL($table, $database); + $tableForeignKeys = $this->_conn->fetchAllAssociative($sql); + + return $this->_getPortableTableForeignKeysList($tableForeignKeys); + } + + /* drop*() Methods */ + + /** + * Drops a database. + * + * NOTE: You can not drop the database this SchemaManager is currently connected to. + * + * @param string $database The name of the database to drop. + * + * @return void + * + * @throws Exception + */ + public function dropDatabase($database) + { + $this->_execSql($this->_platform->getDropDatabaseSQL($database)); + } + + /** + * Drops a schema. + * + * @throws Exception + */ + public function dropSchema(string $schemaName): void + { + $this->_execSql($this->_platform->getDropSchemaSQL($schemaName)); + } + + /** + * Drops the given table. + * + * @param string $name The name of the table to drop. + * + * @return void + * + * @throws Exception + */ + public function dropTable($name) + { + $this->_execSql($this->_platform->getDropTableSQL($name)); + } + + /** + * Drops the index from the given table. + * + * @param Index|string $index The name of the index. + * @param Table|string $table The name of the table. + * + * @return void + * + * @throws Exception + */ + public function dropIndex($index, $table) + { + if ($index instanceof Index) { + $index = $index->getQuotedName($this->_platform); + } + + $this->_execSql($this->_platform->getDropIndexSQL($index, $table)); + } + + /** + * Drops the constraint from the given table. + * + * @param Table|string $table The name of the table. + * + * @return void + * + * @throws Exception + */ + public function dropConstraint(Constraint $constraint, $table) + { + $this->_execSql($this->_platform->getDropConstraintSQL($constraint, $table)); + } + + /** + * Drops a foreign key from a table. + * + * @param ForeignKeyConstraint|string $foreignKey The name of the foreign key. + * @param Table|string $table The name of the table with the foreign key. + * + * @return void + * + * @throws Exception + */ + public function dropForeignKey($foreignKey, $table) + { + $this->_execSql($this->_platform->getDropForeignKeySQL($foreignKey, $table)); + } + + /** + * Drops a sequence with a given name. + * + * @param string $name The name of the sequence to drop. + * + * @return void + * + * @throws Exception + */ + public function dropSequence($name) + { + $this->_execSql($this->_platform->getDropSequenceSQL($name)); + } + + /** + * Drops a view. + * + * @param string $name The name of the view. + * + * @return void + * + * @throws Exception + */ + public function dropView($name) + { + $this->_execSql($this->_platform->getDropViewSQL($name)); + } + + /* create*() Methods */ + + /** + * Creates a new database. + * + * @param string $database The name of the database to create. + * + * @return void + * + * @throws Exception + */ + public function createDatabase($database) + { + $this->_execSql($this->_platform->getCreateDatabaseSQL($database)); + } + + /** + * Creates a new table. + * + * @return void + * + * @throws Exception + */ + public function createTable(Table $table) + { + $createFlags = AbstractPlatform::CREATE_INDEXES | AbstractPlatform::CREATE_FOREIGNKEYS; + $this->_execSql($this->_platform->getCreateTableSQL($table, $createFlags)); + } + + /** + * Creates a new sequence. + * + * @param Sequence $sequence + * + * @return void + * + * @throws Exception + */ + public function createSequence($sequence) + { + $this->_execSql($this->_platform->getCreateSequenceSQL($sequence)); + } + + /** + * Creates a constraint on a table. + * + * @param Table|string $table + * + * @return void + * + * @throws Exception + */ + public function createConstraint(Constraint $constraint, $table) + { + $this->_execSql($this->_platform->getCreateConstraintSQL($constraint, $table)); + } + + /** + * Creates a new index on a table. + * + * @param Table|string $table The name of the table on which the index is to be created. + * + * @return void + * + * @throws Exception + */ + public function createIndex(Index $index, $table) + { + $this->_execSql($this->_platform->getCreateIndexSQL($index, $table)); + } + + /** + * Creates a new foreign key. + * + * @param ForeignKeyConstraint $foreignKey The ForeignKey instance. + * @param Table|string $table The name of the table on which the foreign key is to be created. + * + * @return void + * + * @throws Exception + */ + public function createForeignKey(ForeignKeyConstraint $foreignKey, $table) + { + $this->_execSql($this->_platform->getCreateForeignKeySQL($foreignKey, $table)); + } + + /** + * Creates a new view. + * + * @return void + * + * @throws Exception + */ + public function createView(View $view) + { + $this->_execSql($this->_platform->getCreateViewSQL($view->getQuotedName($this->_platform), $view->getSql())); + } + + /* dropAndCreate*() Methods */ + + /** + * Drops and creates a constraint. + * + * @see dropConstraint() + * @see createConstraint() + * + * @param Table|string $table + * + * @return void + * + * @throws Exception + */ + public function dropAndCreateConstraint(Constraint $constraint, $table) + { + $this->tryMethod('dropConstraint', $constraint, $table); + $this->createConstraint($constraint, $table); + } + + /** + * Drops and creates a new index on a table. + * + * @param Table|string $table The name of the table on which the index is to be created. + * + * @return void + * + * @throws Exception + */ + public function dropAndCreateIndex(Index $index, $table) + { + $this->tryMethod('dropIndex', $index->getQuotedName($this->_platform), $table); + $this->createIndex($index, $table); + } + + /** + * Drops and creates a new foreign key. + * + * @param ForeignKeyConstraint $foreignKey An associative array that defines properties + * of the foreign key to be created. + * @param Table|string $table The name of the table on which the foreign key is to be created. + * + * @return void + * + * @throws Exception + */ + public function dropAndCreateForeignKey(ForeignKeyConstraint $foreignKey, $table) + { + $this->tryMethod('dropForeignKey', $foreignKey, $table); + $this->createForeignKey($foreignKey, $table); + } + + /** + * Drops and create a new sequence. + * + * @return void + * + * @throws Exception + */ + public function dropAndCreateSequence(Sequence $sequence) + { + $this->tryMethod('dropSequence', $sequence->getQuotedName($this->_platform)); + $this->createSequence($sequence); + } + + /** + * Drops and creates a new table. + * + * @return void + * + * @throws Exception + */ + public function dropAndCreateTable(Table $table) + { + $this->tryMethod('dropTable', $table->getQuotedName($this->_platform)); + $this->createTable($table); + } + + /** + * Drops and creates a new database. + * + * @param string $database The name of the database to create. + * + * @return void + * + * @throws Exception + */ + public function dropAndCreateDatabase($database) + { + $this->tryMethod('dropDatabase', $database); + $this->createDatabase($database); + } + + /** + * Drops and creates a new view. + * + * @return void + * + * @throws Exception + */ + public function dropAndCreateView(View $view) + { + $this->tryMethod('dropView', $view->getQuotedName($this->_platform)); + $this->createView($view); + } + + /* alterTable() Methods */ + + /** + * Alters an existing tables schema. + * + * @return void + * + * @throws Exception + */ + public function alterTable(TableDiff $tableDiff) + { + foreach ($this->_platform->getAlterTableSQL($tableDiff) as $ddlQuery) { + $this->_execSql($ddlQuery); + } + } + + /** + * Renames a given table to another name. + * + * @param string $name The current name of the table. + * @param string $newName The new name of the table. + * + * @return void + * + * @throws Exception + */ + public function renameTable($name, $newName) + { + $tableDiff = new TableDiff($name); + $tableDiff->newName = $newName; + $this->alterTable($tableDiff); + } + + /** + * Methods for filtering return values of list*() methods to convert + * the native DBMS data definition to a portable Doctrine definition + */ + + /** + * @param mixed[] $databases + * + * @return string[] + */ + protected function _getPortableDatabasesList($databases) + { + $list = []; + foreach ($databases as $value) { + $list[] = $this->_getPortableDatabaseDefinition($value); + } + + return $list; + } + + /** + * Converts a list of namespace names from the native DBMS data definition to a portable Doctrine definition. + * + * @deprecated Use {@link listSchemaNames()} instead. + * + * @param array> $namespaces The list of namespace names + * in the native DBMS data definition. + * + * @return string[] + */ + protected function getPortableNamespacesList(array $namespaces) + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4503', + 'AbstractSchemaManager::getPortableNamespacesList() is deprecated,' + . ' use AbstractSchemaManager::listSchemaNames() instead.' + ); + + $namespacesList = []; + + foreach ($namespaces as $namespace) { + $namespacesList[] = $this->getPortableNamespaceDefinition($namespace); + } + + return $namespacesList; + } + + /** + * @param mixed $database + * + * @return mixed + */ + protected function _getPortableDatabaseDefinition($database) + { + return $database; + } + + /** + * Converts a namespace definition from the native DBMS data definition to a portable Doctrine definition. + * + * @deprecated Use {@link listSchemaNames()} instead. + * + * @param array $namespace The native DBMS namespace definition. + * + * @return mixed + */ + protected function getPortableNamespaceDefinition(array $namespace) + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4503', + 'AbstractSchemaManager::getPortableNamespaceDefinition() is deprecated,' + . ' use AbstractSchemaManager::listSchemaNames() instead.' + ); + + return $namespace; + } + + /** + * @param mixed[][] $triggers + * + * @return mixed[][] + */ + protected function _getPortableTriggersList($triggers) + { + $list = []; + foreach ($triggers as $value) { + $value = $this->_getPortableTriggerDefinition($value); + + if (! $value) { + continue; + } + + $list[] = $value; + } + + return $list; + } + + /** + * @param mixed[] $trigger + * + * @return mixed + */ + protected function _getPortableTriggerDefinition($trigger) + { + return $trigger; + } + + /** + * @param mixed[][] $sequences + * + * @return Sequence[] + * + * @throws Exception + */ + protected function _getPortableSequencesList($sequences) + { + $list = []; + + foreach ($sequences as $value) { + $list[] = $this->_getPortableSequenceDefinition($value); + } + + return $list; + } + + /** + * @param mixed[] $sequence + * + * @return Sequence + * + * @throws Exception + */ + protected function _getPortableSequenceDefinition($sequence) + { + throw Exception::notSupported('Sequences'); + } + + /** + * Independent of the database the keys of the column list result are lowercased. + * + * The name of the created column instance however is kept in its case. + * + * @param string $table The name of the table. + * @param string $database + * @param mixed[][] $tableColumns + * + * @return Column[] + * + * @throws Exception + */ + protected function _getPortableTableColumnList($table, $database, $tableColumns) + { + $eventManager = $this->_platform->getEventManager(); + + $list = []; + foreach ($tableColumns as $tableColumn) { + $column = null; + $defaultPrevented = false; + + if ($eventManager !== null && $eventManager->hasListeners(Events::onSchemaColumnDefinition)) { + $eventArgs = new SchemaColumnDefinitionEventArgs($tableColumn, $table, $database, $this->_conn); + $eventManager->dispatchEvent(Events::onSchemaColumnDefinition, $eventArgs); + + $defaultPrevented = $eventArgs->isDefaultPrevented(); + $column = $eventArgs->getColumn(); + } + + if (! $defaultPrevented) { + $column = $this->_getPortableTableColumnDefinition($tableColumn); + } + + if ($column === null) { + continue; + } + + $name = strtolower($column->getQuotedName($this->_platform)); + $list[$name] = $column; + } + + return $list; + } + + /** + * Gets Table Column Definition. + * + * @param mixed[] $tableColumn + * + * @return Column + * + * @throws Exception + */ + abstract protected function _getPortableTableColumnDefinition($tableColumn); + + /** + * Aggregates and groups the index results according to the required data result. + * + * @param mixed[][] $tableIndexes + * @param string|null $tableName + * + * @return Index[] + * + * @throws Exception + */ + protected function _getPortableTableIndexesList($tableIndexes, $tableName = null) + { + $result = []; + foreach ($tableIndexes as $tableIndex) { + $indexName = $keyName = $tableIndex['key_name']; + if ($tableIndex['primary']) { + $keyName = 'primary'; + } + + $keyName = strtolower($keyName); + + if (! isset($result[$keyName])) { + $options = [ + 'lengths' => [], + ]; + + if (isset($tableIndex['where'])) { + $options['where'] = $tableIndex['where']; + } + + $result[$keyName] = [ + 'name' => $indexName, + 'columns' => [], + 'unique' => ! $tableIndex['non_unique'], + 'primary' => $tableIndex['primary'], + 'flags' => $tableIndex['flags'] ?? [], + 'options' => $options, + ]; + } + + $result[$keyName]['columns'][] = $tableIndex['column_name']; + $result[$keyName]['options']['lengths'][] = $tableIndex['length'] ?? null; + } + + $eventManager = $this->_platform->getEventManager(); + + $indexes = []; + foreach ($result as $indexKey => $data) { + $index = null; + $defaultPrevented = false; + + if ($eventManager !== null && $eventManager->hasListeners(Events::onSchemaIndexDefinition)) { + $eventArgs = new SchemaIndexDefinitionEventArgs($data, $tableName, $this->_conn); + $eventManager->dispatchEvent(Events::onSchemaIndexDefinition, $eventArgs); + + $defaultPrevented = $eventArgs->isDefaultPrevented(); + $index = $eventArgs->getIndex(); + } + + if (! $defaultPrevented) { + $index = new Index( + $data['name'], + $data['columns'], + $data['unique'], + $data['primary'], + $data['flags'], + $data['options'] + ); + } + + if ($index === null) { + continue; + } + + $indexes[$indexKey] = $index; + } + + return $indexes; + } + + /** + * @param mixed[][] $tables + * + * @return string[] + */ + protected function _getPortableTablesList($tables) + { + $list = []; + foreach ($tables as $value) { + $list[] = $this->_getPortableTableDefinition($value); + } + + return $list; + } + + /** + * @param mixed $table + * + * @return string + */ + protected function _getPortableTableDefinition($table) + { + return $table; + } + + /** + * @param mixed[][] $users + * + * @return string[][] + */ + protected function _getPortableUsersList($users) + { + $list = []; + foreach ($users as $value) { + $list[] = $this->_getPortableUserDefinition($value); + } + + return $list; + } + + /** + * @param string[] $user + * + * @return string[] + */ + protected function _getPortableUserDefinition($user) + { + return $user; + } + + /** + * @param mixed[][] $views + * + * @return View[] + */ + protected function _getPortableViewsList($views) + { + $list = []; + foreach ($views as $value) { + $view = $this->_getPortableViewDefinition($value); + + if ($view === false) { + continue; + } + + $viewName = strtolower($view->getQuotedName($this->_platform)); + $list[$viewName] = $view; + } + + return $list; + } + + /** + * @param mixed[] $view + * + * @return View|false + */ + protected function _getPortableViewDefinition($view) + { + return false; + } + + /** + * @param mixed[][] $tableForeignKeys + * + * @return ForeignKeyConstraint[] + */ + protected function _getPortableTableForeignKeysList($tableForeignKeys) + { + $list = []; + + foreach ($tableForeignKeys as $value) { + $list[] = $this->_getPortableTableForeignKeyDefinition($value); + } + + return $list; + } + + /** + * @param mixed $tableForeignKey + * + * @return ForeignKeyConstraint + */ + protected function _getPortableTableForeignKeyDefinition($tableForeignKey) + { + return $tableForeignKey; + } + + /** + * @param string[]|string $sql + * + * @return void + * + * @throws Exception + */ + protected function _execSql($sql) + { + foreach ((array) $sql as $query) { + $this->_conn->executeStatement($query); + } + } + + /** + * Creates a schema instance for the current database. + * + * @return Schema + * + * @throws Exception + */ + public function createSchema() + { + $schemaNames = []; + + if ($this->_platform->supportsSchemas()) { + $schemaNames = $this->listNamespaceNames(); + } + + $sequences = []; + + if ($this->_platform->supportsSequences()) { + $sequences = $this->listSequences(); + } + + $tables = $this->listTables(); + + return new Schema($tables, $sequences, $this->createSchemaConfig(), $schemaNames); + } + + /** + * Creates the configuration for this schema. + * + * @return SchemaConfig + * + * @throws Exception + */ + public function createSchemaConfig() + { + $schemaConfig = new SchemaConfig(); + $schemaConfig->setMaxIdentifierLength($this->_platform->getMaxIdentifierLength()); + + $searchPaths = $this->getSchemaSearchPaths(); + if (isset($searchPaths[0])) { + $schemaConfig->setName($searchPaths[0]); + } + + $params = $this->_conn->getParams(); + if (! isset($params['defaultTableOptions'])) { + $params['defaultTableOptions'] = []; + } + + if (! isset($params['defaultTableOptions']['charset']) && isset($params['charset'])) { + $params['defaultTableOptions']['charset'] = $params['charset']; + } + + $schemaConfig->setDefaultTableOptions($params['defaultTableOptions']); + + return $schemaConfig; + } + + /** + * The search path for namespaces in the currently connected database. + * + * The first entry is usually the default namespace in the Schema. All + * further namespaces contain tables/sequences which can also be addressed + * with a short, not full-qualified name. + * + * For databases that don't support subschema/namespaces this method + * returns the name of the currently connected database. + * + * @return string[] + * + * @throws Exception + */ + public function getSchemaSearchPaths() + { + $database = $this->_conn->getDatabase(); + + if ($database !== null) { + return [$database]; + } + + return []; + } + + /** + * Given a table comment this method tries to extract a typehint for Doctrine Type, or returns + * the type given as default. + * + * @param string|null $comment + * @param string $currentType + * + * @return string + */ + public function extractDoctrineTypeFromComment($comment, $currentType) + { + if ($comment !== null && preg_match('(\(DC2Type:(((?!\)).)+)\))', $comment, $match) === 1) { + return $match[1]; + } + + return $currentType; + } + + /** + * @param string|null $comment + * @param string|null $type + * + * @return string|null + */ + public function removeDoctrineTypeFromComment($comment, $type) + { + if ($comment === null) { + return null; + } + + return str_replace('(DC2Type:' . $type . ')', '', $comment); + } +} diff --git a/app/vendor/doctrine/dbal/src/Schema/Column.php b/app/vendor/doctrine/dbal/src/Schema/Column.php new file mode 100644 index 000000000..714bbc428 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Schema/Column.php @@ -0,0 +1,449 @@ +_setName($name); + $this->setType($type); + $this->setOptions($options); + } + + /** + * @param mixed[] $options + * + * @return Column + * + * @throws SchemaException + */ + public function setOptions(array $options) + { + foreach ($options as $name => $value) { + $method = 'set' . $name; + + if (! method_exists($this, $method)) { + throw UnknownColumnOption::new($name); + } + + $this->$method($value); + } + + return $this; + } + + /** + * @return Column + */ + public function setType(Type $type) + { + $this->_type = $type; + + return $this; + } + + /** + * @param int|null $length + * + * @return Column + */ + public function setLength($length) + { + if ($length !== null) { + $this->_length = (int) $length; + } else { + $this->_length = null; + } + + return $this; + } + + /** + * @param int $precision + * + * @return Column + */ + public function setPrecision($precision) + { + if (! is_numeric($precision)) { + $precision = 10; // defaults to 10 when no valid precision is given. + } + + $this->_precision = (int) $precision; + + return $this; + } + + /** + * @param int $scale + * + * @return Column + */ + public function setScale($scale) + { + if (! is_numeric($scale)) { + $scale = 0; + } + + $this->_scale = (int) $scale; + + return $this; + } + + /** + * @param bool $unsigned + * + * @return Column + */ + public function setUnsigned($unsigned) + { + $this->_unsigned = (bool) $unsigned; + + return $this; + } + + /** + * @param bool $fixed + * + * @return Column + */ + public function setFixed($fixed) + { + $this->_fixed = (bool) $fixed; + + return $this; + } + + /** + * @param bool $notnull + * + * @return Column + */ + public function setNotnull($notnull) + { + $this->_notnull = (bool) $notnull; + + return $this; + } + + /** + * @param mixed $default + * + * @return Column + */ + public function setDefault($default) + { + $this->_default = $default; + + return $this; + } + + /** + * @param mixed[] $platformOptions + * + * @return Column + */ + public function setPlatformOptions(array $platformOptions) + { + $this->_platformOptions = $platformOptions; + + return $this; + } + + /** + * @param string $name + * @param mixed $value + * + * @return Column + */ + public function setPlatformOption($name, $value) + { + $this->_platformOptions[$name] = $value; + + return $this; + } + + /** + * @param string $value + * + * @return Column + */ + public function setColumnDefinition($value) + { + $this->_columnDefinition = $value; + + return $this; + } + + /** + * @return Type + */ + public function getType() + { + return $this->_type; + } + + /** + * @return int|null + */ + public function getLength() + { + return $this->_length; + } + + /** + * @return int + */ + public function getPrecision() + { + return $this->_precision; + } + + /** + * @return int + */ + public function getScale() + { + return $this->_scale; + } + + /** + * @return bool + */ + public function getUnsigned() + { + return $this->_unsigned; + } + + /** + * @return bool + */ + public function getFixed() + { + return $this->_fixed; + } + + /** + * @return bool + */ + public function getNotnull() + { + return $this->_notnull; + } + + /** + * @return string|null + */ + public function getDefault() + { + return $this->_default; + } + + /** + * @return mixed[] + */ + public function getPlatformOptions() + { + return $this->_platformOptions; + } + + /** + * @param string $name + * + * @return bool + */ + public function hasPlatformOption($name) + { + return isset($this->_platformOptions[$name]); + } + + /** + * @param string $name + * + * @return mixed + */ + public function getPlatformOption($name) + { + return $this->_platformOptions[$name]; + } + + /** + * @return string|null + */ + public function getColumnDefinition() + { + return $this->_columnDefinition; + } + + /** + * @return bool + */ + public function getAutoincrement() + { + return $this->_autoincrement; + } + + /** + * @param bool $flag + * + * @return Column + */ + public function setAutoincrement($flag) + { + $this->_autoincrement = $flag; + + return $this; + } + + /** + * @param string|null $comment + * + * @return Column + */ + public function setComment($comment) + { + $this->_comment = $comment; + + return $this; + } + + /** + * @return string|null + */ + public function getComment() + { + return $this->_comment; + } + + /** + * @param string $name + * @param mixed $value + * + * @return Column + */ + public function setCustomSchemaOption($name, $value) + { + $this->_customSchemaOptions[$name] = $value; + + return $this; + } + + /** + * @param string $name + * + * @return bool + */ + public function hasCustomSchemaOption($name) + { + return isset($this->_customSchemaOptions[$name]); + } + + /** + * @param string $name + * + * @return mixed + */ + public function getCustomSchemaOption($name) + { + return $this->_customSchemaOptions[$name]; + } + + /** + * @param mixed[] $customSchemaOptions + * + * @return Column + */ + public function setCustomSchemaOptions(array $customSchemaOptions) + { + $this->_customSchemaOptions = $customSchemaOptions; + + return $this; + } + + /** + * @return mixed[] + */ + public function getCustomSchemaOptions() + { + return $this->_customSchemaOptions; + } + + /** + * @return mixed[] + */ + public function toArray() + { + return array_merge([ + 'name' => $this->_name, + 'type' => $this->_type, + 'default' => $this->_default, + 'notnull' => $this->_notnull, + 'length' => $this->_length, + 'precision' => $this->_precision, + 'scale' => $this->_scale, + 'fixed' => $this->_fixed, + 'unsigned' => $this->_unsigned, + 'autoincrement' => $this->_autoincrement, + 'columnDefinition' => $this->_columnDefinition, + 'comment' => $this->_comment, + ], $this->_platformOptions, $this->_customSchemaOptions); + } +} diff --git a/app/vendor/doctrine/dbal/src/Schema/ColumnDiff.php b/app/vendor/doctrine/dbal/src/Schema/ColumnDiff.php new file mode 100644 index 000000000..c9c2a52bc --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Schema/ColumnDiff.php @@ -0,0 +1,59 @@ +oldColumnName = $oldColumnName; + $this->column = $column; + $this->changedProperties = $changedProperties; + $this->fromColumn = $fromColumn; + } + + /** + * @param string $propertyName + * + * @return bool + */ + public function hasChanged($propertyName) + { + return in_array($propertyName, $this->changedProperties, true); + } + + /** + * @return Identifier + */ + public function getOldColumnName() + { + $quote = $this->fromColumn !== null && $this->fromColumn->isQuoted(); + + return new Identifier($this->oldColumnName, $quote); + } +} diff --git a/app/vendor/doctrine/dbal/src/Schema/Comparator.php b/app/vendor/doctrine/dbal/src/Schema/Comparator.php new file mode 100644 index 000000000..7ddf5238d --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Schema/Comparator.php @@ -0,0 +1,538 @@ +compare($fromSchema, $toSchema); + } + + /** + * Returns a SchemaDiff object containing the differences between the schemas $fromSchema and $toSchema. + * + * The returned differences are returned in such a way that they contain the + * operations to change the schema stored in $fromSchema to the schema that is + * stored in $toSchema. + * + * @return SchemaDiff + * + * @throws SchemaException + */ + public function compare(Schema $fromSchema, Schema $toSchema) + { + $diff = new SchemaDiff(); + $diff->fromSchema = $fromSchema; + + $foreignKeysToTable = []; + + foreach ($toSchema->getNamespaces() as $namespace) { + if ($fromSchema->hasNamespace($namespace)) { + continue; + } + + $diff->newNamespaces[$namespace] = $namespace; + } + + foreach ($fromSchema->getNamespaces() as $namespace) { + if ($toSchema->hasNamespace($namespace)) { + continue; + } + + $diff->removedNamespaces[$namespace] = $namespace; + } + + foreach ($toSchema->getTables() as $table) { + $tableName = $table->getShortestName($toSchema->getName()); + if (! $fromSchema->hasTable($tableName)) { + $diff->newTables[$tableName] = $toSchema->getTable($tableName); + } else { + $tableDifferences = $this->diffTable( + $fromSchema->getTable($tableName), + $toSchema->getTable($tableName) + ); + + if ($tableDifferences !== false) { + $diff->changedTables[$tableName] = $tableDifferences; + } + } + } + + /* Check if there are tables removed */ + foreach ($fromSchema->getTables() as $table) { + $tableName = $table->getShortestName($fromSchema->getName()); + + $table = $fromSchema->getTable($tableName); + if (! $toSchema->hasTable($tableName)) { + $diff->removedTables[$tableName] = $table; + } + + // also remember all foreign keys that point to a specific table + foreach ($table->getForeignKeys() as $foreignKey) { + $foreignTable = strtolower($foreignKey->getForeignTableName()); + if (! isset($foreignKeysToTable[$foreignTable])) { + $foreignKeysToTable[$foreignTable] = []; + } + + $foreignKeysToTable[$foreignTable][] = $foreignKey; + } + } + + foreach ($diff->removedTables as $tableName => $table) { + if (! isset($foreignKeysToTable[$tableName])) { + continue; + } + + $diff->orphanedForeignKeys = array_merge($diff->orphanedForeignKeys, $foreignKeysToTable[$tableName]); + + // deleting duplicated foreign keys present on both on the orphanedForeignKey + // and the removedForeignKeys from changedTables + foreach ($foreignKeysToTable[$tableName] as $foreignKey) { + // strtolower the table name to make if compatible with getShortestName + $localTableName = strtolower($foreignKey->getLocalTableName()); + if (! isset($diff->changedTables[$localTableName])) { + continue; + } + + foreach ($diff->changedTables[$localTableName]->removedForeignKeys as $key => $removedForeignKey) { + assert($removedForeignKey instanceof ForeignKeyConstraint); + + // We check if the key is from the removed table if not we skip. + if ($tableName !== strtolower($removedForeignKey->getForeignTableName())) { + continue; + } + + unset($diff->changedTables[$localTableName]->removedForeignKeys[$key]); + } + } + } + + foreach ($toSchema->getSequences() as $sequence) { + $sequenceName = $sequence->getShortestName($toSchema->getName()); + if (! $fromSchema->hasSequence($sequenceName)) { + if (! $this->isAutoIncrementSequenceInSchema($fromSchema, $sequence)) { + $diff->newSequences[] = $sequence; + } + } else { + if ($this->diffSequence($sequence, $fromSchema->getSequence($sequenceName))) { + $diff->changedSequences[] = $toSchema->getSequence($sequenceName); + } + } + } + + foreach ($fromSchema->getSequences() as $sequence) { + if ($this->isAutoIncrementSequenceInSchema($toSchema, $sequence)) { + continue; + } + + $sequenceName = $sequence->getShortestName($fromSchema->getName()); + + if ($toSchema->hasSequence($sequenceName)) { + continue; + } + + $diff->removedSequences[] = $sequence; + } + + return $diff; + } + + /** + * @param Schema $schema + * @param Sequence $sequence + * + * @return bool + */ + private function isAutoIncrementSequenceInSchema($schema, $sequence) + { + foreach ($schema->getTables() as $table) { + if ($sequence->isAutoIncrementsFor($table)) { + return true; + } + } + + return false; + } + + /** + * @return bool + */ + public function diffSequence(Sequence $sequence1, Sequence $sequence2) + { + if ($sequence1->getAllocationSize() !== $sequence2->getAllocationSize()) { + return true; + } + + return $sequence1->getInitialValue() !== $sequence2->getInitialValue(); + } + + /** + * Returns the difference between the tables $fromTable and $toTable. + * + * If there are no differences this method returns the boolean false. + * + * @return TableDiff|false + * + * @throws SchemaException + */ + public function diffTable(Table $fromTable, Table $toTable) + { + $changes = 0; + $tableDifferences = new TableDiff($fromTable->getName()); + $tableDifferences->fromTable = $fromTable; + + $fromTableColumns = $fromTable->getColumns(); + $toTableColumns = $toTable->getColumns(); + + /* See if all the columns in "from" table exist in "to" table */ + foreach ($toTableColumns as $columnName => $column) { + if ($fromTable->hasColumn($columnName)) { + continue; + } + + $tableDifferences->addedColumns[$columnName] = $column; + $changes++; + } + + /* See if there are any removed columns in "to" table */ + foreach ($fromTableColumns as $columnName => $column) { + // See if column is removed in "to" table. + if (! $toTable->hasColumn($columnName)) { + $tableDifferences->removedColumns[$columnName] = $column; + $changes++; + continue; + } + + // See if column has changed properties in "to" table. + $changedProperties = $this->diffColumn($column, $toTable->getColumn($columnName)); + + if (count($changedProperties) === 0) { + continue; + } + + $columnDiff = new ColumnDiff($column->getName(), $toTable->getColumn($columnName), $changedProperties); + + $columnDiff->fromColumn = $column; + $tableDifferences->changedColumns[$column->getName()] = $columnDiff; + $changes++; + } + + $this->detectColumnRenamings($tableDifferences); + + $fromTableIndexes = $fromTable->getIndexes(); + $toTableIndexes = $toTable->getIndexes(); + + /* See if all the indexes in "from" table exist in "to" table */ + foreach ($toTableIndexes as $indexName => $index) { + if (($index->isPrimary() && $fromTable->hasPrimaryKey()) || $fromTable->hasIndex($indexName)) { + continue; + } + + $tableDifferences->addedIndexes[$indexName] = $index; + $changes++; + } + + /* See if there are any removed indexes in "to" table */ + foreach ($fromTableIndexes as $indexName => $index) { + // See if index is removed in "to" table. + if ( + ($index->isPrimary() && ! $toTable->hasPrimaryKey()) || + ! $index->isPrimary() && ! $toTable->hasIndex($indexName) + ) { + $tableDifferences->removedIndexes[$indexName] = $index; + $changes++; + continue; + } + + // See if index has changed in "to" table. + $toTableIndex = $index->isPrimary() ? $toTable->getPrimaryKey() : $toTable->getIndex($indexName); + assert($toTableIndex instanceof Index); + + if (! $this->diffIndex($index, $toTableIndex)) { + continue; + } + + $tableDifferences->changedIndexes[$indexName] = $toTableIndex; + $changes++; + } + + $this->detectIndexRenamings($tableDifferences); + + $fromForeignKeys = $fromTable->getForeignKeys(); + $toForeignKeys = $toTable->getForeignKeys(); + + foreach ($fromForeignKeys as $fromKey => $fromConstraint) { + foreach ($toForeignKeys as $toKey => $toConstraint) { + if ($this->diffForeignKey($fromConstraint, $toConstraint) === false) { + unset($fromForeignKeys[$fromKey], $toForeignKeys[$toKey]); + } else { + if (strtolower($fromConstraint->getName()) === strtolower($toConstraint->getName())) { + $tableDifferences->changedForeignKeys[] = $toConstraint; + $changes++; + unset($fromForeignKeys[$fromKey], $toForeignKeys[$toKey]); + } + } + } + } + + foreach ($fromForeignKeys as $fromConstraint) { + $tableDifferences->removedForeignKeys[] = $fromConstraint; + $changes++; + } + + foreach ($toForeignKeys as $toConstraint) { + $tableDifferences->addedForeignKeys[] = $toConstraint; + $changes++; + } + + return $changes > 0 ? $tableDifferences : false; + } + + /** + * Try to find columns that only changed their name, rename operations maybe cheaper than add/drop + * however ambiguities between different possibilities should not lead to renaming at all. + * + * @return void + */ + private function detectColumnRenamings(TableDiff $tableDifferences) + { + $renameCandidates = []; + foreach ($tableDifferences->addedColumns as $addedColumnName => $addedColumn) { + foreach ($tableDifferences->removedColumns as $removedColumn) { + if (count($this->diffColumn($addedColumn, $removedColumn)) !== 0) { + continue; + } + + $renameCandidates[$addedColumn->getName()][] = [$removedColumn, $addedColumn, $addedColumnName]; + } + } + + foreach ($renameCandidates as $candidateColumns) { + if (count($candidateColumns) !== 1) { + continue; + } + + [$removedColumn, $addedColumn] = $candidateColumns[0]; + $removedColumnName = strtolower($removedColumn->getName()); + $addedColumnName = strtolower($addedColumn->getName()); + + if (isset($tableDifferences->renamedColumns[$removedColumnName])) { + continue; + } + + $tableDifferences->renamedColumns[$removedColumnName] = $addedColumn; + unset( + $tableDifferences->addedColumns[$addedColumnName], + $tableDifferences->removedColumns[$removedColumnName] + ); + } + } + + /** + * Try to find indexes that only changed their name, rename operations maybe cheaper than add/drop + * however ambiguities between different possibilities should not lead to renaming at all. + * + * @return void + */ + private function detectIndexRenamings(TableDiff $tableDifferences) + { + $renameCandidates = []; + + // Gather possible rename candidates by comparing each added and removed index based on semantics. + foreach ($tableDifferences->addedIndexes as $addedIndexName => $addedIndex) { + foreach ($tableDifferences->removedIndexes as $removedIndex) { + if ($this->diffIndex($addedIndex, $removedIndex)) { + continue; + } + + $renameCandidates[$addedIndex->getName()][] = [$removedIndex, $addedIndex, $addedIndexName]; + } + } + + foreach ($renameCandidates as $candidateIndexes) { + // If the current rename candidate contains exactly one semantically equal index, + // we can safely rename it. + // Otherwise it is unclear if a rename action is really intended, + // therefore we let those ambiguous indexes be added/dropped. + if (count($candidateIndexes) !== 1) { + continue; + } + + [$removedIndex, $addedIndex] = $candidateIndexes[0]; + + $removedIndexName = strtolower($removedIndex->getName()); + $addedIndexName = strtolower($addedIndex->getName()); + + if (isset($tableDifferences->renamedIndexes[$removedIndexName])) { + continue; + } + + $tableDifferences->renamedIndexes[$removedIndexName] = $addedIndex; + unset( + $tableDifferences->addedIndexes[$addedIndexName], + $tableDifferences->removedIndexes[$removedIndexName] + ); + } + } + + /** + * @return bool + */ + public function diffForeignKey(ForeignKeyConstraint $key1, ForeignKeyConstraint $key2) + { + if ( + array_map('strtolower', $key1->getUnquotedLocalColumns()) + !== array_map('strtolower', $key2->getUnquotedLocalColumns()) + ) { + return true; + } + + if ( + array_map('strtolower', $key1->getUnquotedForeignColumns()) + !== array_map('strtolower', $key2->getUnquotedForeignColumns()) + ) { + return true; + } + + if ($key1->getUnqualifiedForeignTableName() !== $key2->getUnqualifiedForeignTableName()) { + return true; + } + + if ($key1->onUpdate() !== $key2->onUpdate()) { + return true; + } + + return $key1->onDelete() !== $key2->onDelete(); + } + + /** + * Returns the difference between the columns + * + * If there are differences this method returns $field2, otherwise the + * boolean false. + * + * @return string[] + */ + public function diffColumn(Column $column1, Column $column2) + { + $properties1 = $column1->toArray(); + $properties2 = $column2->toArray(); + + $changedProperties = []; + + if (get_class($properties1['type']) !== get_class($properties2['type'])) { + $changedProperties[] = 'type'; + } + + foreach (['notnull', 'unsigned', 'autoincrement'] as $property) { + if ($properties1[$property] === $properties2[$property]) { + continue; + } + + $changedProperties[] = $property; + } + + // Null values need to be checked additionally as they tell whether to create or drop a default value. + // null != 0, null != false, null != '' etc. This affects platform's table alteration SQL generation. + if ( + ($properties1['default'] === null) !== ($properties2['default'] === null) + || $properties1['default'] != $properties2['default'] + ) { + $changedProperties[] = 'default'; + } + + if ( + ($properties1['type'] instanceof Types\StringType && ! $properties1['type'] instanceof Types\GuidType) || + $properties1['type'] instanceof Types\BinaryType + ) { + // check if value of length is set at all, default value assumed otherwise. + $length1 = $properties1['length'] ?? 255; + $length2 = $properties2['length'] ?? 255; + if ($length1 !== $length2) { + $changedProperties[] = 'length'; + } + + if ($properties1['fixed'] !== $properties2['fixed']) { + $changedProperties[] = 'fixed'; + } + } elseif ($properties1['type'] instanceof Types\DecimalType) { + if (($properties1['precision'] ?? 10) !== ($properties2['precision'] ?? 10)) { + $changedProperties[] = 'precision'; + } + + if ($properties1['scale'] !== $properties2['scale']) { + $changedProperties[] = 'scale'; + } + } + + // A null value and an empty string are actually equal for a comment so they should not trigger a change. + if ( + $properties1['comment'] !== $properties2['comment'] && + ! ($properties1['comment'] === null && $properties2['comment'] === '') && + ! ($properties2['comment'] === null && $properties1['comment'] === '') + ) { + $changedProperties[] = 'comment'; + } + + $customOptions1 = $column1->getCustomSchemaOptions(); + $customOptions2 = $column2->getCustomSchemaOptions(); + + foreach (array_merge(array_keys($customOptions1), array_keys($customOptions2)) as $key) { + if (! array_key_exists($key, $properties1) || ! array_key_exists($key, $properties2)) { + $changedProperties[] = $key; + } elseif ($properties1[$key] !== $properties2[$key]) { + $changedProperties[] = $key; + } + } + + $platformOptions1 = $column1->getPlatformOptions(); + $platformOptions2 = $column2->getPlatformOptions(); + + foreach (array_keys(array_intersect_key($platformOptions1, $platformOptions2)) as $key) { + if ($properties1[$key] === $properties2[$key]) { + continue; + } + + $changedProperties[] = $key; + } + + return array_unique($changedProperties); + } + + /** + * Finds the difference between the indexes $index1 and $index2. + * + * Compares $index1 with $index2 and returns $index2 if there are any + * differences or false in case there are no differences. + * + * @return bool + */ + public function diffIndex(Index $index1, Index $index2) + { + return ! ($index1->isFullfilledBy($index2) && $index2->isFullfilledBy($index1)); + } +} diff --git a/app/vendor/doctrine/dbal/src/Schema/Constraint.php b/app/vendor/doctrine/dbal/src/Schema/Constraint.php new file mode 100644 index 000000000..65e239ec1 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Schema/Constraint.php @@ -0,0 +1,43 @@ +_platform->getListTablesSQL() . ' AND CREATOR = CURRENT_USER'; + + $tables = $this->_conn->fetchAllAssociative($sql); + + return $this->filterAssetNames($this->_getPortableTablesList($tables)); + } + + /** + * {@inheritdoc} + * + * @throws Exception + */ + protected function _getPortableTableColumnDefinition($tableColumn) + { + $tableColumn = array_change_key_case($tableColumn, CASE_LOWER); + + $length = null; + $fixed = null; + $scale = false; + $precision = false; + + $default = null; + + if ($tableColumn['default'] !== null && $tableColumn['default'] !== 'NULL') { + $default = $tableColumn['default']; + + if (preg_match('/^\'(.*)\'$/s', $default, $matches) === 1) { + $default = str_replace("''", "'", $matches[1]); + } + } + + $type = $this->_platform->getDoctrineTypeMapping($tableColumn['typename']); + + if (isset($tableColumn['comment'])) { + $type = $this->extractDoctrineTypeFromComment($tableColumn['comment'], $type); + $tableColumn['comment'] = $this->removeDoctrineTypeFromComment($tableColumn['comment'], $type); + } + + switch (strtolower($tableColumn['typename'])) { + case 'varchar': + if ($tableColumn['codepage'] === 0) { + $type = Types::BINARY; + } + + $length = $tableColumn['length']; + $fixed = false; + break; + + case 'character': + if ($tableColumn['codepage'] === 0) { + $type = Types::BINARY; + } + + $length = $tableColumn['length']; + $fixed = true; + break; + + case 'clob': + $length = $tableColumn['length']; + break; + + case 'decimal': + case 'double': + case 'real': + $scale = $tableColumn['scale']; + $precision = $tableColumn['length']; + break; + } + + $options = [ + 'length' => $length, + 'unsigned' => false, + 'fixed' => (bool) $fixed, + 'default' => $default, + 'autoincrement' => (bool) $tableColumn['autoincrement'], + 'notnull' => $tableColumn['nulls'] === 'N', + 'scale' => null, + 'precision' => null, + 'comment' => isset($tableColumn['comment']) && $tableColumn['comment'] !== '' + ? $tableColumn['comment'] + : null, + 'platformOptions' => [], + ]; + + if ($scale !== null && $precision !== null) { + $options['scale'] = $scale; + $options['precision'] = $precision; + } + + return new Column($tableColumn['colname'], Type::getType($type), $options); + } + + /** + * {@inheritdoc} + */ + protected function _getPortableTablesList($tables) + { + $tableNames = []; + foreach ($tables as $tableRow) { + $tableRow = array_change_key_case($tableRow, CASE_LOWER); + $tableNames[] = $tableRow['name']; + } + + return $tableNames; + } + + /** + * {@inheritdoc} + */ + protected function _getPortableTableIndexesList($tableIndexes, $tableName = null) + { + foreach ($tableIndexes as &$tableIndexRow) { + $tableIndexRow = array_change_key_case($tableIndexRow, CASE_LOWER); + $tableIndexRow['primary'] = (bool) $tableIndexRow['primary']; + } + + return parent::_getPortableTableIndexesList($tableIndexes, $tableName); + } + + /** + * {@inheritdoc} + */ + protected function _getPortableTableForeignKeyDefinition($tableForeignKey) + { + return new ForeignKeyConstraint( + $tableForeignKey['local_columns'], + $tableForeignKey['foreign_table'], + $tableForeignKey['foreign_columns'], + $tableForeignKey['name'], + $tableForeignKey['options'] + ); + } + + /** + * {@inheritdoc} + */ + protected function _getPortableTableForeignKeysList($tableForeignKeys) + { + $foreignKeys = []; + + foreach ($tableForeignKeys as $tableForeignKey) { + $tableForeignKey = array_change_key_case($tableForeignKey, CASE_LOWER); + + if (! isset($foreignKeys[$tableForeignKey['index_name']])) { + $foreignKeys[$tableForeignKey['index_name']] = [ + 'local_columns' => [$tableForeignKey['local_column']], + 'foreign_table' => $tableForeignKey['foreign_table'], + 'foreign_columns' => [$tableForeignKey['foreign_column']], + 'name' => $tableForeignKey['index_name'], + 'options' => [ + 'onUpdate' => $tableForeignKey['on_update'], + 'onDelete' => $tableForeignKey['on_delete'], + ], + ]; + } else { + $foreignKeys[$tableForeignKey['index_name']]['local_columns'][] = $tableForeignKey['local_column']; + $foreignKeys[$tableForeignKey['index_name']]['foreign_columns'][] = $tableForeignKey['foreign_column']; + } + } + + return parent::_getPortableTableForeignKeysList($foreignKeys); + } + + /** + * @param string $def + * + * @return string|null + */ + protected function _getPortableForeignKeyRuleDef($def) + { + if ($def === 'C') { + return 'CASCADE'; + } + + if ($def === 'N') { + return 'SET NULL'; + } + + return null; + } + + /** + * {@inheritdoc} + */ + protected function _getPortableViewDefinition($view) + { + $view = array_change_key_case($view, CASE_LOWER); + + $sql = ''; + $pos = strpos($view['text'], ' AS '); + + if ($pos !== false) { + $sql = substr($view['text'], $pos + 4); + } + + return new View($view['name'], $sql); + } + + /** + * {@inheritdoc} + */ + public function listTableDetails($name): Table + { + $table = parent::listTableDetails($name); + + $platform = $this->_platform; + assert($platform instanceof DB2Platform); + $sql = $platform->getListTableCommentsSQL($name); + + $tableOptions = $this->_conn->fetchAssociative($sql); + + if ($tableOptions !== false) { + $table->addOption('comment', $tableOptions['REMARKS']); + } + + return $table; + } +} diff --git a/app/vendor/doctrine/dbal/src/Schema/Exception/InvalidTableName.php b/app/vendor/doctrine/dbal/src/Schema/Exception/InvalidTableName.php new file mode 100644 index 000000000..440e60785 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Schema/Exception/InvalidTableName.php @@ -0,0 +1,20 @@ + Identifier) + * + * @var Identifier[] + */ + protected $_localColumnNames; + + /** + * Table or asset identifier instance of the referenced table name the foreign key constraint is associated with. + * + * @var Table|Identifier + */ + protected $_foreignTableName; + + /** + * Asset identifier instances of the referenced table column names the foreign key constraint is associated with. + * array($columnName => Identifier) + * + * @var Identifier[] + */ + protected $_foreignColumnNames; + + /** + * Options associated with the foreign key constraint. + * + * @var mixed[] + */ + protected $_options; + + /** + * Initializes the foreign key constraint. + * + * @param string[] $localColumnNames Names of the referencing table columns. + * @param Table|string $foreignTableName Referenced table. + * @param string[] $foreignColumnNames Names of the referenced table columns. + * @param string|null $name Name of the foreign key constraint. + * @param mixed[] $options Options associated with the foreign key constraint. + */ + public function __construct( + array $localColumnNames, + $foreignTableName, + array $foreignColumnNames, + $name = null, + array $options = [] + ) { + if ($name !== null) { + $this->_setName($name); + } + + $this->_localColumnNames = $this->createIdentifierMap($localColumnNames); + + if ($foreignTableName instanceof Table) { + $this->_foreignTableName = $foreignTableName; + } else { + $this->_foreignTableName = new Identifier($foreignTableName); + } + + $this->_foreignColumnNames = $this->createIdentifierMap($foreignColumnNames); + $this->_options = $options; + } + + /** + * @param string[] $names + * + * @return Identifier[] + */ + private function createIdentifierMap(array $names): array + { + $identifiers = []; + + foreach ($names as $name) { + $identifiers[$name] = new Identifier($name); + } + + return $identifiers; + } + + /** + * Returns the name of the referencing table + * the foreign key constraint is associated with. + * + * @return string + */ + public function getLocalTableName() + { + return $this->_localTable->getName(); + } + + /** + * Sets the Table instance of the referencing table + * the foreign key constraint is associated with. + * + * @param Table $table Instance of the referencing table. + * + * @return void + */ + public function setLocalTable(Table $table) + { + $this->_localTable = $table; + } + + /** + * @return Table + */ + public function getLocalTable() + { + return $this->_localTable; + } + + /** + * Returns the names of the referencing table columns + * the foreign key constraint is associated with. + * + * @return string[] + */ + public function getLocalColumns() + { + return array_keys($this->_localColumnNames); + } + + /** + * Returns the quoted representation of the referencing table column names + * the foreign key constraint is associated with. + * + * But only if they were defined with one or the referencing table column name + * is a keyword reserved by the platform. + * Otherwise the plain unquoted value as inserted is returned. + * + * @param AbstractPlatform $platform The platform to use for quotation. + * + * @return string[] + */ + public function getQuotedLocalColumns(AbstractPlatform $platform) + { + $columns = []; + + foreach ($this->_localColumnNames as $column) { + $columns[] = $column->getQuotedName($platform); + } + + return $columns; + } + + /** + * Returns unquoted representation of local table column names for comparison with other FK + * + * @return string[] + */ + public function getUnquotedLocalColumns() + { + return array_map([$this, 'trimQuotes'], $this->getLocalColumns()); + } + + /** + * Returns unquoted representation of foreign table column names for comparison with other FK + * + * @return string[] + */ + public function getUnquotedForeignColumns() + { + return array_map([$this, 'trimQuotes'], $this->getForeignColumns()); + } + + /** + * {@inheritdoc} + * + * @see getLocalColumns + */ + public function getColumns() + { + return $this->getLocalColumns(); + } + + /** + * Returns the quoted representation of the referencing table column names + * the foreign key constraint is associated with. + * + * But only if they were defined with one or the referencing table column name + * is a keyword reserved by the platform. + * Otherwise the plain unquoted value as inserted is returned. + * + * @see getQuotedLocalColumns + * + * @param AbstractPlatform $platform The platform to use for quotation. + * + * @return string[] + */ + public function getQuotedColumns(AbstractPlatform $platform) + { + return $this->getQuotedLocalColumns($platform); + } + + /** + * Returns the name of the referenced table + * the foreign key constraint is associated with. + * + * @return string + */ + public function getForeignTableName() + { + return $this->_foreignTableName->getName(); + } + + /** + * Returns the non-schema qualified foreign table name. + * + * @return string + */ + public function getUnqualifiedForeignTableName() + { + $name = $this->_foreignTableName->getName(); + $position = strrpos($name, '.'); + + if ($position !== false) { + $name = substr($name, $position + 1); + } + + return strtolower($name); + } + + /** + * Returns the quoted representation of the referenced table name + * the foreign key constraint is associated with. + * + * But only if it was defined with one or the referenced table name + * is a keyword reserved by the platform. + * Otherwise the plain unquoted value as inserted is returned. + * + * @param AbstractPlatform $platform The platform to use for quotation. + * + * @return string + */ + public function getQuotedForeignTableName(AbstractPlatform $platform) + { + return $this->_foreignTableName->getQuotedName($platform); + } + + /** + * Returns the names of the referenced table columns + * the foreign key constraint is associated with. + * + * @return string[] + */ + public function getForeignColumns() + { + return array_keys($this->_foreignColumnNames); + } + + /** + * Returns the quoted representation of the referenced table column names + * the foreign key constraint is associated with. + * + * But only if they were defined with one or the referenced table column name + * is a keyword reserved by the platform. + * Otherwise the plain unquoted value as inserted is returned. + * + * @param AbstractPlatform $platform The platform to use for quotation. + * + * @return string[] + */ + public function getQuotedForeignColumns(AbstractPlatform $platform) + { + $columns = []; + + foreach ($this->_foreignColumnNames as $column) { + $columns[] = $column->getQuotedName($platform); + } + + return $columns; + } + + /** + * Returns whether or not a given option + * is associated with the foreign key constraint. + * + * @param string $name Name of the option to check. + * + * @return bool + */ + public function hasOption($name) + { + return isset($this->_options[$name]); + } + + /** + * Returns an option associated with the foreign key constraint. + * + * @param string $name Name of the option the foreign key constraint is associated with. + * + * @return mixed + */ + public function getOption($name) + { + return $this->_options[$name]; + } + + /** + * Returns the options associated with the foreign key constraint. + * + * @return mixed[] + */ + public function getOptions() + { + return $this->_options; + } + + /** + * Returns the referential action for UPDATE operations + * on the referenced table the foreign key constraint is associated with. + * + * @return string|null + */ + public function onUpdate() + { + return $this->onEvent('onUpdate'); + } + + /** + * Returns the referential action for DELETE operations + * on the referenced table the foreign key constraint is associated with. + * + * @return string|null + */ + public function onDelete() + { + return $this->onEvent('onDelete'); + } + + /** + * Returns the referential action for a given database operation + * on the referenced table the foreign key constraint is associated with. + * + * @param string $event Name of the database operation/event to return the referential action for. + * + * @return string|null + */ + private function onEvent($event) + { + if (isset($this->_options[$event])) { + $onEvent = strtoupper($this->_options[$event]); + + if ($onEvent !== 'NO ACTION' && $onEvent !== 'RESTRICT') { + return $onEvent; + } + } + + return null; + } + + /** + * Checks whether this foreign key constraint intersects the given index columns. + * + * Returns `true` if at least one of this foreign key's local columns + * matches one of the given index's columns, `false` otherwise. + * + * @param Index $index The index to be checked against. + * + * @return bool + */ + public function intersectsIndexColumns(Index $index) + { + foreach ($index->getColumns() as $indexColumn) { + foreach ($this->_localColumnNames as $localColumn) { + if (strtolower($indexColumn) === strtolower($localColumn->getName())) { + return true; + } + } + } + + return false; + } +} diff --git a/app/vendor/doctrine/dbal/src/Schema/Identifier.php b/app/vendor/doctrine/dbal/src/Schema/Identifier.php new file mode 100644 index 000000000..f34465e9e --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Schema/Identifier.php @@ -0,0 +1,27 @@ +_setName($identifier); + + if (! $quote || $this->_quoted) { + return; + } + + $this->_setName('"' . $this->getName() . '"'); + } +} diff --git a/app/vendor/doctrine/dbal/src/Schema/Index.php b/app/vendor/doctrine/dbal/src/Schema/Index.php new file mode 100644 index 000000000..508aa4031 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Schema/Index.php @@ -0,0 +1,367 @@ + Identifier) + * + * @var Identifier[] + */ + protected $_columns = []; + + /** @var bool */ + protected $_isUnique = false; + + /** @var bool */ + protected $_isPrimary = false; + + /** + * Platform specific flags for indexes. + * array($flagName => true) + * + * @var true[] + */ + protected $_flags = []; + + /** + * Platform specific options + * + * @todo $_flags should eventually be refactored into options + * @var mixed[] + */ + private $options; + + /** + * @param string $name + * @param string[] $columns + * @param bool $isUnique + * @param bool $isPrimary + * @param string[] $flags + * @param mixed[] $options + */ + public function __construct( + $name, + array $columns, + $isUnique = false, + $isPrimary = false, + array $flags = [], + array $options = [] + ) { + $isUnique = $isUnique || $isPrimary; + + $this->_setName($name); + $this->_isUnique = $isUnique; + $this->_isPrimary = $isPrimary; + $this->options = $options; + + foreach ($columns as $column) { + $this->_addColumn($column); + } + + foreach ($flags as $flag) { + $this->addFlag($flag); + } + } + + /** + * @throws InvalidArgumentException + */ + protected function _addColumn(string $column): void + { + $this->_columns[$column] = new Identifier($column); + } + + /** + * {@inheritdoc} + */ + public function getColumns() + { + return array_keys($this->_columns); + } + + /** + * {@inheritdoc} + */ + public function getQuotedColumns(AbstractPlatform $platform) + { + $subParts = $platform->supportsColumnLengthIndexes() && $this->hasOption('lengths') + ? $this->getOption('lengths') : []; + + $columns = []; + + foreach ($this->_columns as $column) { + $length = array_shift($subParts); + + $quotedColumn = $column->getQuotedName($platform); + + if ($length !== null) { + $quotedColumn .= '(' . $length . ')'; + } + + $columns[] = $quotedColumn; + } + + return $columns; + } + + /** + * @return string[] + */ + public function getUnquotedColumns() + { + return array_map([$this, 'trimQuotes'], $this->getColumns()); + } + + /** + * Is the index neither unique nor primary key? + * + * @return bool + */ + public function isSimpleIndex() + { + return ! $this->_isPrimary && ! $this->_isUnique; + } + + /** + * @return bool + */ + public function isUnique() + { + return $this->_isUnique; + } + + /** + * @return bool + */ + public function isPrimary() + { + return $this->_isPrimary; + } + + /** + * @param string $name + * @param int $pos + * + * @return bool + */ + public function hasColumnAtPosition($name, $pos = 0) + { + $name = $this->trimQuotes(strtolower($name)); + $indexColumns = array_map('strtolower', $this->getUnquotedColumns()); + + return array_search($name, $indexColumns, true) === $pos; + } + + /** + * Checks if this index exactly spans the given column names in the correct order. + * + * @param string[] $columnNames + * + * @return bool + */ + public function spansColumns(array $columnNames) + { + $columns = $this->getColumns(); + $numberOfColumns = count($columns); + $sameColumns = true; + + for ($i = 0; $i < $numberOfColumns; $i++) { + if ( + isset($columnNames[$i]) + && $this->trimQuotes(strtolower($columns[$i])) === $this->trimQuotes(strtolower($columnNames[$i])) + ) { + continue; + } + + $sameColumns = false; + } + + return $sameColumns; + } + + /** + * Checks if the other index already fulfills all the indexing and constraint needs of the current one. + * + * @return bool + */ + public function isFullfilledBy(Index $other) + { + // allow the other index to be equally large only. It being larger is an option + // but it creates a problem with scenarios of the kind PRIMARY KEY(foo,bar) UNIQUE(foo) + if (count($other->getColumns()) !== count($this->getColumns())) { + return false; + } + + // Check if columns are the same, and even in the same order + $sameColumns = $this->spansColumns($other->getColumns()); + + if ($sameColumns) { + if (! $this->samePartialIndex($other)) { + return false; + } + + if (! $this->hasSameColumnLengths($other)) { + return false; + } + + if (! $this->isUnique() && ! $this->isPrimary()) { + // this is a special case: If the current key is neither primary or unique, any unique or + // primary key will always have the same effect for the index and there cannot be any constraint + // overlaps. This means a primary or unique index can always fulfill the requirements of just an + // index that has no constraints. + return true; + } + + if ($other->isPrimary() !== $this->isPrimary()) { + return false; + } + + return $other->isUnique() === $this->isUnique(); + } + + return false; + } + + /** + * Detects if the other index is a non-unique, non primary index that can be overwritten by this one. + * + * @return bool + */ + public function overrules(Index $other) + { + if ($other->isPrimary()) { + return false; + } + + if ($this->isSimpleIndex() && $other->isUnique()) { + return false; + } + + return $this->spansColumns($other->getColumns()) + && ($this->isPrimary() || $this->isUnique()) + && $this->samePartialIndex($other); + } + + /** + * Returns platform specific flags for indexes. + * + * @return string[] + */ + public function getFlags() + { + return array_keys($this->_flags); + } + + /** + * Adds Flag for an index that translates to platform specific handling. + * + * @param string $flag + * + * @return Index + * + * @example $index->addFlag('CLUSTERED') + */ + public function addFlag($flag) + { + $this->_flags[strtolower($flag)] = true; + + return $this; + } + + /** + * Does this index have a specific flag? + * + * @param string $flag + * + * @return bool + */ + public function hasFlag($flag) + { + return isset($this->_flags[strtolower($flag)]); + } + + /** + * Removes a flag. + * + * @param string $flag + * + * @return void + */ + public function removeFlag($flag) + { + unset($this->_flags[strtolower($flag)]); + } + + /** + * @param string $name + * + * @return bool + */ + public function hasOption($name) + { + return isset($this->options[strtolower($name)]); + } + + /** + * @param string $name + * + * @return mixed + */ + public function getOption($name) + { + return $this->options[strtolower($name)]; + } + + /** + * @return mixed[] + */ + public function getOptions() + { + return $this->options; + } + + /** + * Return whether the two indexes have the same partial index + * + * @return bool + */ + private function samePartialIndex(Index $other) + { + if ( + $this->hasOption('where') + && $other->hasOption('where') + && $this->getOption('where') === $other->getOption('where') + ) { + return true; + } + + return ! $this->hasOption('where') && ! $other->hasOption('where'); + } + + /** + * Returns whether the index has the same column lengths as the other + */ + private function hasSameColumnLengths(self $other): bool + { + $filter = static function (?int $length): bool { + return $length !== null; + }; + + return array_filter($this->options['lengths'] ?? [], $filter) + === array_filter($other->options['lengths'] ?? [], $filter); + } +} diff --git a/app/vendor/doctrine/dbal/src/Schema/MySQLSchemaManager.php b/app/vendor/doctrine/dbal/src/Schema/MySQLSchemaManager.php new file mode 100644 index 000000000..4d54f7159 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Schema/MySQLSchemaManager.php @@ -0,0 +1,381 @@ + "\0", + "\\'" => "'", + '\\"' => '"', + '\\b' => "\b", + '\\n' => "\n", + '\\r' => "\r", + '\\t' => "\t", + '\\Z' => "\x1a", + '\\\\' => '\\', + '\\%' => '%', + '\\_' => '_', + + // Internally, MariaDB escapes single quotes using the standard syntax + "''" => "'", + ]; + + /** + * {@inheritdoc} + */ + protected function _getPortableViewDefinition($view) + { + return new View($view['TABLE_NAME'], $view['VIEW_DEFINITION']); + } + + /** + * {@inheritdoc} + */ + protected function _getPortableTableDefinition($table) + { + return array_shift($table); + } + + /** + * {@inheritdoc} + */ + protected function _getPortableUserDefinition($user) + { + return [ + 'user' => $user['User'], + 'password' => $user['Password'], + ]; + } + + /** + * {@inheritdoc} + */ + protected function _getPortableTableIndexesList($tableIndexes, $tableName = null) + { + foreach ($tableIndexes as $k => $v) { + $v = array_change_key_case($v, CASE_LOWER); + if ($v['key_name'] === 'PRIMARY') { + $v['primary'] = true; + } else { + $v['primary'] = false; + } + + if (strpos($v['index_type'], 'FULLTEXT') !== false) { + $v['flags'] = ['FULLTEXT']; + } elseif (strpos($v['index_type'], 'SPATIAL') !== false) { + $v['flags'] = ['SPATIAL']; + } + + // Ignore prohibited prefix `length` for spatial index + if (strpos($v['index_type'], 'SPATIAL') === false) { + $v['length'] = isset($v['sub_part']) ? (int) $v['sub_part'] : null; + } + + $tableIndexes[$k] = $v; + } + + return parent::_getPortableTableIndexesList($tableIndexes, $tableName); + } + + /** + * {@inheritdoc} + */ + protected function _getPortableDatabaseDefinition($database) + { + return $database['Database']; + } + + /** + * {@inheritdoc} + */ + protected function _getPortableTableColumnDefinition($tableColumn) + { + $tableColumn = array_change_key_case($tableColumn, CASE_LOWER); + + $dbType = strtolower($tableColumn['type']); + $dbType = strtok($dbType, '(), '); + assert(is_string($dbType)); + + $length = $tableColumn['length'] ?? strtok('(), '); + + $fixed = null; + + if (! isset($tableColumn['name'])) { + $tableColumn['name'] = ''; + } + + $scale = null; + $precision = null; + + $type = $this->_platform->getDoctrineTypeMapping($dbType); + + // In cases where not connected to a database DESCRIBE $table does not return 'Comment' + if (isset($tableColumn['comment'])) { + $type = $this->extractDoctrineTypeFromComment($tableColumn['comment'], $type); + $tableColumn['comment'] = $this->removeDoctrineTypeFromComment($tableColumn['comment'], $type); + } + + switch ($dbType) { + case 'char': + case 'binary': + $fixed = true; + break; + + case 'float': + case 'double': + case 'real': + case 'numeric': + case 'decimal': + if ( + preg_match( + '([A-Za-z]+\(([0-9]+),([0-9]+)\))', + $tableColumn['type'], + $match + ) === 1 + ) { + $precision = $match[1]; + $scale = $match[2]; + $length = null; + } + + break; + + case 'tinytext': + $length = MySQLPlatform::LENGTH_LIMIT_TINYTEXT; + break; + + case 'text': + $length = MySQLPlatform::LENGTH_LIMIT_TEXT; + break; + + case 'mediumtext': + $length = MySQLPlatform::LENGTH_LIMIT_MEDIUMTEXT; + break; + + case 'tinyblob': + $length = MySQLPlatform::LENGTH_LIMIT_TINYBLOB; + break; + + case 'blob': + $length = MySQLPlatform::LENGTH_LIMIT_BLOB; + break; + + case 'mediumblob': + $length = MySQLPlatform::LENGTH_LIMIT_MEDIUMBLOB; + break; + + case 'tinyint': + case 'smallint': + case 'mediumint': + case 'int': + case 'integer': + case 'bigint': + case 'year': + $length = null; + break; + } + + if ($this->_platform instanceof MariaDb1027Platform) { + $columnDefault = $this->getMariaDb1027ColumnDefault($this->_platform, $tableColumn['default']); + } else { + $columnDefault = $tableColumn['default']; + } + + $options = [ + 'length' => $length !== null ? (int) $length : null, + 'unsigned' => strpos($tableColumn['type'], 'unsigned') !== false, + 'fixed' => (bool) $fixed, + 'default' => $columnDefault, + 'notnull' => $tableColumn['null'] !== 'YES', + 'scale' => null, + 'precision' => null, + 'autoincrement' => strpos($tableColumn['extra'], 'auto_increment') !== false, + 'comment' => isset($tableColumn['comment']) && $tableColumn['comment'] !== '' + ? $tableColumn['comment'] + : null, + ]; + + if ($scale !== null && $precision !== null) { + $options['scale'] = (int) $scale; + $options['precision'] = (int) $precision; + } + + $column = new Column($tableColumn['field'], Type::getType($type), $options); + + if (isset($tableColumn['characterset'])) { + $column->setPlatformOption('charset', $tableColumn['characterset']); + } + + if (isset($tableColumn['collation'])) { + $column->setPlatformOption('collation', $tableColumn['collation']); + } + + return $column; + } + + /** + * Return Doctrine/Mysql-compatible column default values for MariaDB 10.2.7+ servers. + * + * - Since MariaDb 10.2.7 column defaults stored in information_schema are now quoted + * to distinguish them from expressions (see MDEV-10134). + * - CURRENT_TIMESTAMP, CURRENT_TIME, CURRENT_DATE are stored in information_schema + * as current_timestamp(), currdate(), currtime() + * - Quoted 'NULL' is not enforced by Maria, it is technically possible to have + * null in some circumstances (see https://jira.mariadb.org/browse/MDEV-14053) + * - \' is always stored as '' in information_schema (normalized) + * + * @link https://mariadb.com/kb/en/library/information-schema-columns-table/ + * @link https://jira.mariadb.org/browse/MDEV-13132 + * + * @param string|null $columnDefault default value as stored in information_schema for MariaDB >= 10.2.7 + */ + private function getMariaDb1027ColumnDefault(MariaDb1027Platform $platform, ?string $columnDefault): ?string + { + if ($columnDefault === 'NULL' || $columnDefault === null) { + return null; + } + + if (preg_match('/^\'(.*)\'$/', $columnDefault, $matches) === 1) { + return strtr($matches[1], self::MARIADB_ESCAPE_SEQUENCES); + } + + switch ($columnDefault) { + case 'current_timestamp()': + return $platform->getCurrentTimestampSQL(); + + case 'curdate()': + return $platform->getCurrentDateSQL(); + + case 'curtime()': + return $platform->getCurrentTimeSQL(); + } + + return $columnDefault; + } + + /** + * {@inheritdoc} + */ + protected function _getPortableTableForeignKeysList($tableForeignKeys) + { + $list = []; + foreach ($tableForeignKeys as $value) { + $value = array_change_key_case($value, CASE_LOWER); + if (! isset($list[$value['constraint_name']])) { + if (! isset($value['delete_rule']) || $value['delete_rule'] === 'RESTRICT') { + $value['delete_rule'] = null; + } + + if (! isset($value['update_rule']) || $value['update_rule'] === 'RESTRICT') { + $value['update_rule'] = null; + } + + $list[$value['constraint_name']] = [ + 'name' => $value['constraint_name'], + 'local' => [], + 'foreign' => [], + 'foreignTable' => $value['referenced_table_name'], + 'onDelete' => $value['delete_rule'], + 'onUpdate' => $value['update_rule'], + ]; + } + + $list[$value['constraint_name']]['local'][] = $value['column_name']; + $list[$value['constraint_name']]['foreign'][] = $value['referenced_column_name']; + } + + $result = []; + foreach ($list as $constraint) { + $result[] = new ForeignKeyConstraint( + array_values($constraint['local']), + $constraint['foreignTable'], + array_values($constraint['foreign']), + $constraint['name'], + [ + 'onDelete' => $constraint['onDelete'], + 'onUpdate' => $constraint['onUpdate'], + ] + ); + } + + return $result; + } + + /** + * {@inheritdoc} + */ + public function listTableDetails($name) + { + $table = parent::listTableDetails($name); + + $platform = $this->_platform; + assert($platform instanceof MySQLPlatform); + $sql = $platform->getListTableMetadataSQL($name); + + $tableOptions = $this->_conn->fetchAssociative($sql); + + if ($tableOptions === false) { + return $table; + } + + $table->addOption('engine', $tableOptions['ENGINE']); + + if ($tableOptions['TABLE_COLLATION'] !== null) { + $table->addOption('collation', $tableOptions['TABLE_COLLATION']); + } + + if ($tableOptions['AUTO_INCREMENT'] !== null) { + $table->addOption('autoincrement', $tableOptions['AUTO_INCREMENT']); + } + + $table->addOption('comment', $tableOptions['TABLE_COMMENT']); + $table->addOption('create_options', $this->parseCreateOptions($tableOptions['CREATE_OPTIONS'])); + + return $table; + } + + /** + * @return string[]|true[] + */ + private function parseCreateOptions(?string $string): array + { + $options = []; + + if ($string === null || $string === '') { + return $options; + } + + foreach (explode(' ', $string) as $pair) { + $parts = explode('=', $pair, 2); + + $options[$parts[0]] = $parts[1] ?? true; + } + + return $options; + } +} diff --git a/app/vendor/doctrine/dbal/src/Schema/OracleSchemaManager.php b/app/vendor/doctrine/dbal/src/Schema/OracleSchemaManager.php new file mode 100644 index 000000000..e24f79ffb --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Schema/OracleSchemaManager.php @@ -0,0 +1,340 @@ +getQuotedIdentifierName($view['view_name']), $view['text']); + } + + /** + * {@inheritdoc} + */ + protected function _getPortableUserDefinition($user) + { + $user = array_change_key_case($user, CASE_LOWER); + + return [ + 'user' => $user['username'], + ]; + } + + /** + * {@inheritdoc} + */ + protected function _getPortableTableDefinition($table) + { + $table = array_change_key_case($table, CASE_LOWER); + + return $this->getQuotedIdentifierName($table['table_name']); + } + + /** + * {@inheritdoc} + * + * @link http://ezcomponents.org/docs/api/trunk/DatabaseSchema/ezcDbSchemaPgsqlReader.html + */ + protected function _getPortableTableIndexesList($tableIndexes, $tableName = null) + { + $indexBuffer = []; + foreach ($tableIndexes as $tableIndex) { + $tableIndex = array_change_key_case($tableIndex, CASE_LOWER); + + $keyName = strtolower($tableIndex['name']); + $buffer = []; + + if (strtolower($tableIndex['is_primary']) === 'p') { + $keyName = 'primary'; + $buffer['primary'] = true; + $buffer['non_unique'] = false; + } else { + $buffer['primary'] = false; + $buffer['non_unique'] = ! $tableIndex['is_unique']; + } + + $buffer['key_name'] = $keyName; + $buffer['column_name'] = $this->getQuotedIdentifierName($tableIndex['column_name']); + $indexBuffer[] = $buffer; + } + + return parent::_getPortableTableIndexesList($indexBuffer, $tableName); + } + + /** + * {@inheritdoc} + */ + protected function _getPortableTableColumnDefinition($tableColumn) + { + $tableColumn = array_change_key_case($tableColumn, CASE_LOWER); + + $dbType = strtolower($tableColumn['data_type']); + if (strpos($dbType, 'timestamp(') === 0) { + if (strpos($dbType, 'with time zone') !== false) { + $dbType = 'timestamptz'; + } else { + $dbType = 'timestamp'; + } + } + + $unsigned = $fixed = $precision = $scale = $length = null; + + if (! isset($tableColumn['column_name'])) { + $tableColumn['column_name'] = ''; + } + + // Default values returned from database sometimes have trailing spaces. + $tableColumn['data_default'] = trim($tableColumn['data_default']); + + if ($tableColumn['data_default'] === '' || $tableColumn['data_default'] === 'NULL') { + $tableColumn['data_default'] = null; + } + + if ($tableColumn['data_default'] !== null) { + // Default values returned from database are represented as literal expressions + if (preg_match('/^\'(.*)\'$/s', $tableColumn['data_default'], $matches) === 1) { + $tableColumn['data_default'] = str_replace("''", "'", $matches[1]); + } + } + + if ($tableColumn['data_precision'] !== null) { + $precision = (int) $tableColumn['data_precision']; + } + + if ($tableColumn['data_scale'] !== null) { + $scale = (int) $tableColumn['data_scale']; + } + + $type = $this->_platform->getDoctrineTypeMapping($dbType); + $type = $this->extractDoctrineTypeFromComment($tableColumn['comments'], $type); + $tableColumn['comments'] = $this->removeDoctrineTypeFromComment($tableColumn['comments'], $type); + + switch ($dbType) { + case 'number': + if ($precision === 20 && $scale === 0) { + $type = 'bigint'; + } elseif ($precision === 5 && $scale === 0) { + $type = 'smallint'; + } elseif ($precision === 1 && $scale === 0) { + $type = 'boolean'; + } elseif ($scale > 0) { + $type = 'decimal'; + } + + break; + + case 'varchar': + case 'varchar2': + case 'nvarchar2': + $length = $tableColumn['char_length']; + $fixed = false; + break; + + case 'raw': + $length = $tableColumn['data_length']; + $fixed = true; + break; + + case 'char': + case 'nchar': + $length = $tableColumn['char_length']; + $fixed = true; + break; + } + + $options = [ + 'notnull' => $tableColumn['nullable'] === 'N', + 'fixed' => (bool) $fixed, + 'unsigned' => (bool) $unsigned, + 'default' => $tableColumn['data_default'], + 'length' => $length, + 'precision' => $precision, + 'scale' => $scale, + 'comment' => isset($tableColumn['comments']) && $tableColumn['comments'] !== '' + ? $tableColumn['comments'] + : null, + ]; + + return new Column($this->getQuotedIdentifierName($tableColumn['column_name']), Type::getType($type), $options); + } + + /** + * {@inheritdoc} + */ + protected function _getPortableTableForeignKeysList($tableForeignKeys) + { + $list = []; + foreach ($tableForeignKeys as $value) { + $value = array_change_key_case($value, CASE_LOWER); + if (! isset($list[$value['constraint_name']])) { + if ($value['delete_rule'] === 'NO ACTION') { + $value['delete_rule'] = null; + } + + $list[$value['constraint_name']] = [ + 'name' => $this->getQuotedIdentifierName($value['constraint_name']), + 'local' => [], + 'foreign' => [], + 'foreignTable' => $value['references_table'], + 'onDelete' => $value['delete_rule'], + ]; + } + + $localColumn = $this->getQuotedIdentifierName($value['local_column']); + $foreignColumn = $this->getQuotedIdentifierName($value['foreign_column']); + + $list[$value['constraint_name']]['local'][$value['position']] = $localColumn; + $list[$value['constraint_name']]['foreign'][$value['position']] = $foreignColumn; + } + + $result = []; + foreach ($list as $constraint) { + $result[] = new ForeignKeyConstraint( + array_values($constraint['local']), + $this->getQuotedIdentifierName($constraint['foreignTable']), + array_values($constraint['foreign']), + $this->getQuotedIdentifierName($constraint['name']), + ['onDelete' => $constraint['onDelete']] + ); + } + + return $result; + } + + /** + * {@inheritdoc} + */ + protected function _getPortableSequenceDefinition($sequence) + { + $sequence = array_change_key_case($sequence, CASE_LOWER); + + return new Sequence( + $this->getQuotedIdentifierName($sequence['sequence_name']), + (int) $sequence['increment_by'], + (int) $sequence['min_value'] + ); + } + + /** + * {@inheritdoc} + */ + protected function _getPortableDatabaseDefinition($database) + { + $database = array_change_key_case($database, CASE_LOWER); + + return $database['username']; + } + + /** + * {@inheritdoc} + */ + public function createDatabase($database) + { + $statement = 'CREATE USER ' . $database; + + $params = $this->_conn->getParams(); + + if (isset($params['password'])) { + $statement .= ' IDENTIFIED BY ' . $params['password']; + } + + $this->_conn->executeStatement($statement); + + $statement = 'GRANT DBA TO ' . $database; + $this->_conn->executeStatement($statement); + } + + /** + * @internal The method should be only used from within the OracleSchemaManager class hierarchy. + * + * @param string $table + * + * @return bool + * + * @throws Exception + */ + public function dropAutoincrement($table) + { + assert($this->_platform instanceof OraclePlatform); + + $sql = $this->_platform->getDropAutoincrementSql($table); + foreach ($sql as $query) { + $this->_conn->executeStatement($query); + } + + return true; + } + + /** + * {@inheritdoc} + */ + public function dropTable($name) + { + $this->tryMethod('dropAutoincrement', $name); + + parent::dropTable($name); + } + + /** + * Returns the quoted representation of the given identifier name. + * + * Quotes non-uppercase identifiers explicitly to preserve case + * and thus make references to the particular identifier work. + * + * @param string $identifier The identifier to quote. + * + * @return string The quoted identifier. + */ + private function getQuotedIdentifierName($identifier) + { + if (preg_match('/[a-z]/', $identifier) === 1) { + return $this->_platform->quoteIdentifier($identifier); + } + + return $identifier; + } + + /** + * {@inheritdoc} + */ + public function listTableDetails($name): Table + { + $table = parent::listTableDetails($name); + + $platform = $this->_platform; + assert($platform instanceof OraclePlatform); + $sql = $platform->getListTableCommentsSQL($name); + + $tableOptions = $this->_conn->fetchAssociative($sql); + + if ($tableOptions !== false) { + $table->addOption('comment', $tableOptions['COMMENTS']); + } + + return $table; + } +} diff --git a/app/vendor/doctrine/dbal/src/Schema/PostgreSQLSchemaManager.php b/app/vendor/doctrine/dbal/src/Schema/PostgreSQLSchemaManager.php new file mode 100644 index 000000000..e353b53e6 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Schema/PostgreSQLSchemaManager.php @@ -0,0 +1,559 @@ +listNamespaceNames(); + } + + /** + * {@inheritDoc} + */ + public function listSchemaNames(): array + { + return $this->_conn->fetchFirstColumn( + <<<'SQL' +SELECT schema_name +FROM information_schema.schemata +WHERE schema_name NOT LIKE 'pg\_%' +AND schema_name != 'information_schema' +SQL + ); + } + + /** + * {@inheritDoc} + */ + public function getSchemaSearchPaths() + { + $params = $this->_conn->getParams(); + + $searchPaths = $this->_conn->fetchOne('SHOW search_path'); + assert($searchPaths !== false); + + $schema = explode(',', $searchPaths); + + if (isset($params['user'])) { + $schema = str_replace('"$user"', $params['user'], $schema); + } + + return array_map('trim', $schema); + } + + /** + * Gets names of all existing schemas in the current users search path. + * + * This is a PostgreSQL only function. + * + * @internal The method should be only used from within the PostgreSQLSchemaManager class hierarchy. + * + * @return string[] + */ + public function getExistingSchemaSearchPaths() + { + if ($this->existingSchemaPaths === null) { + $this->determineExistingSchemaSearchPaths(); + } + + return $this->existingSchemaPaths; + } + + /** + * Sets or resets the order of the existing schemas in the current search path of the user. + * + * This is a PostgreSQL only function. + * + * @internal The method should be only used from within the PostgreSQLSchemaManager class hierarchy. + * + * @return void + */ + public function determineExistingSchemaSearchPaths() + { + $names = $this->listSchemaNames(); + $paths = $this->getSchemaSearchPaths(); + + $this->existingSchemaPaths = array_filter($paths, static function ($v) use ($names): bool { + return in_array($v, $names, true); + }); + } + + /** + * {@inheritdoc} + */ + protected function _getPortableTableForeignKeyDefinition($tableForeignKey) + { + $onUpdate = null; + $onDelete = null; + + if ( + preg_match( + '(ON UPDATE ([a-zA-Z0-9]+( (NULL|ACTION|DEFAULT))?))', + $tableForeignKey['condef'], + $match + ) === 1 + ) { + $onUpdate = $match[1]; + } + + if ( + preg_match( + '(ON DELETE ([a-zA-Z0-9]+( (NULL|ACTION|DEFAULT))?))', + $tableForeignKey['condef'], + $match + ) === 1 + ) { + $onDelete = $match[1]; + } + + $result = preg_match('/FOREIGN KEY \((.+)\) REFERENCES (.+)\((.+)\)/', $tableForeignKey['condef'], $values); + assert($result === 1); + + // PostgreSQL returns identifiers that are keywords with quotes, we need them later, don't get + // the idea to trim them here. + $localColumns = array_map('trim', explode(',', $values[1])); + $foreignColumns = array_map('trim', explode(',', $values[3])); + $foreignTable = $values[2]; + + return new ForeignKeyConstraint( + $localColumns, + $foreignTable, + $foreignColumns, + $tableForeignKey['conname'], + ['onUpdate' => $onUpdate, 'onDelete' => $onDelete] + ); + } + + /** + * {@inheritdoc} + */ + protected function _getPortableTriggerDefinition($trigger) + { + return $trigger['trigger_name']; + } + + /** + * {@inheritdoc} + */ + protected function _getPortableViewDefinition($view) + { + return new View($view['schemaname'] . '.' . $view['viewname'], $view['definition']); + } + + /** + * {@inheritdoc} + */ + protected function _getPortableUserDefinition($user) + { + return [ + 'user' => $user['usename'], + 'password' => $user['passwd'], + ]; + } + + /** + * {@inheritdoc} + */ + protected function _getPortableTableDefinition($table) + { + $schemas = $this->getExistingSchemaSearchPaths(); + $firstSchema = array_shift($schemas); + + if ($table['schema_name'] === $firstSchema) { + return $table['table_name']; + } + + return $table['schema_name'] . '.' . $table['table_name']; + } + + /** + * {@inheritdoc} + * + * @link http://ezcomponents.org/docs/api/trunk/DatabaseSchema/ezcDbSchemaPgsqlReader.html + */ + protected function _getPortableTableIndexesList($tableIndexes, $tableName = null) + { + $buffer = []; + foreach ($tableIndexes as $row) { + $colNumbers = array_map('intval', explode(' ', $row['indkey'])); + $columnNameSql = sprintf( + 'SELECT attnum, attname FROM pg_attribute WHERE attrelid=%d AND attnum IN (%s) ORDER BY attnum ASC', + $row['indrelid'], + implode(' ,', $colNumbers) + ); + + $indexColumns = $this->_conn->fetchAllAssociative($columnNameSql); + + // required for getting the order of the columns right. + foreach ($colNumbers as $colNum) { + foreach ($indexColumns as $colRow) { + if ($colNum !== $colRow['attnum']) { + continue; + } + + $buffer[] = [ + 'key_name' => $row['relname'], + 'column_name' => trim($colRow['attname']), + 'non_unique' => ! $row['indisunique'], + 'primary' => $row['indisprimary'], + 'where' => $row['where'], + ]; + } + } + } + + return parent::_getPortableTableIndexesList($buffer, $tableName); + } + + /** + * {@inheritdoc} + */ + protected function _getPortableDatabaseDefinition($database) + { + return $database['datname']; + } + + /** + * {@inheritdoc} + */ + protected function _getPortableSequencesList($sequences) + { + $sequenceDefinitions = []; + + foreach ($sequences as $sequence) { + if ($sequence['schemaname'] !== 'public') { + $sequenceName = $sequence['schemaname'] . '.' . $sequence['relname']; + } else { + $sequenceName = $sequence['relname']; + } + + $sequenceDefinitions[$sequenceName] = $sequence; + } + + $list = []; + + foreach ($this->filterAssetNames(array_keys($sequenceDefinitions)) as $sequenceName) { + $list[] = $this->_getPortableSequenceDefinition($sequenceDefinitions[$sequenceName]); + } + + return $list; + } + + /** + * {@inheritdoc} + * + * @deprecated Use {@link listSchemaNames()} instead. + */ + protected function getPortableNamespaceDefinition(array $namespace) + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4503', + 'PostgreSQLSchemaManager::getPortableNamespaceDefinition() is deprecated,' + . ' use PostgreSQLSchemaManager::listSchemaNames() instead.' + ); + + return $namespace['nspname']; + } + + /** + * {@inheritdoc} + */ + protected function _getPortableSequenceDefinition($sequence) + { + if ($sequence['schemaname'] !== 'public') { + $sequenceName = $sequence['schemaname'] . '.' . $sequence['relname']; + } else { + $sequenceName = $sequence['relname']; + } + + if (! isset($sequence['increment_by'], $sequence['min_value'])) { + /** @var string[] $data */ + $data = $this->_conn->fetchAssociative( + 'SELECT min_value, increment_by FROM ' . $this->_platform->quoteIdentifier($sequenceName) + ); + + $sequence += $data; + } + + return new Sequence($sequenceName, (int) $sequence['increment_by'], (int) $sequence['min_value']); + } + + /** + * {@inheritdoc} + */ + protected function _getPortableTableColumnDefinition($tableColumn) + { + $tableColumn = array_change_key_case($tableColumn, CASE_LOWER); + + if (strtolower($tableColumn['type']) === 'varchar' || strtolower($tableColumn['type']) === 'bpchar') { + // get length from varchar definition + $length = preg_replace('~.*\(([0-9]*)\).*~', '$1', $tableColumn['complete_type']); + $tableColumn['length'] = $length; + } + + $matches = []; + + $autoincrement = false; + if (preg_match("/^nextval\('(.*)'(::.*)?\)$/", $tableColumn['default'], $matches) === 1) { + $tableColumn['sequence'] = $matches[1]; + $tableColumn['default'] = null; + $autoincrement = true; + } + + if (preg_match("/^['(](.*)[')]::/", $tableColumn['default'], $matches) === 1) { + $tableColumn['default'] = $matches[1]; + } elseif (preg_match('/^NULL::/', $tableColumn['default']) === 1) { + $tableColumn['default'] = null; + } + + $length = $tableColumn['length'] ?? null; + if ($length === '-1' && isset($tableColumn['atttypmod'])) { + $length = $tableColumn['atttypmod'] - 4; + } + + if ((int) $length <= 0) { + $length = null; + } + + $fixed = null; + + if (! isset($tableColumn['name'])) { + $tableColumn['name'] = ''; + } + + $precision = null; + $scale = null; + $jsonb = null; + + $dbType = strtolower($tableColumn['type']); + if ( + strlen($tableColumn['domain_type']) > 0 + && ! $this->_platform->hasDoctrineTypeMappingFor($tableColumn['type']) + ) { + $dbType = strtolower($tableColumn['domain_type']); + $tableColumn['complete_type'] = $tableColumn['domain_complete_type']; + } + + $type = $this->_platform->getDoctrineTypeMapping($dbType); + $type = $this->extractDoctrineTypeFromComment($tableColumn['comment'], $type); + $tableColumn['comment'] = $this->removeDoctrineTypeFromComment($tableColumn['comment'], $type); + + switch ($dbType) { + case 'smallint': + case 'int2': + $tableColumn['default'] = $this->fixVersion94NegativeNumericDefaultValue($tableColumn['default']); + $length = null; + break; + + case 'int': + case 'int4': + case 'integer': + $tableColumn['default'] = $this->fixVersion94NegativeNumericDefaultValue($tableColumn['default']); + $length = null; + break; + + case 'bigint': + case 'int8': + $tableColumn['default'] = $this->fixVersion94NegativeNumericDefaultValue($tableColumn['default']); + $length = null; + break; + + case 'bool': + case 'boolean': + if ($tableColumn['default'] === 'true') { + $tableColumn['default'] = true; + } + + if ($tableColumn['default'] === 'false') { + $tableColumn['default'] = false; + } + + $length = null; + break; + + case 'text': + case '_varchar': + case 'varchar': + $tableColumn['default'] = $this->parseDefaultExpression($tableColumn['default']); + $fixed = false; + break; + case 'interval': + $fixed = false; + break; + + case 'char': + case 'bpchar': + $fixed = true; + break; + + case 'float': + case 'float4': + case 'float8': + case 'double': + case 'double precision': + case 'real': + case 'decimal': + case 'money': + case 'numeric': + $tableColumn['default'] = $this->fixVersion94NegativeNumericDefaultValue($tableColumn['default']); + + if ( + preg_match( + '([A-Za-z]+\(([0-9]+)\,([0-9]+)\))', + $tableColumn['complete_type'], + $match + ) === 1 + ) { + $precision = $match[1]; + $scale = $match[2]; + $length = null; + } + + break; + + case 'year': + $length = null; + break; + + // PostgreSQL 9.4+ only + case 'jsonb': + $jsonb = true; + break; + } + + if ( + $tableColumn['default'] !== null && preg_match( + "('([^']+)'::)", + $tableColumn['default'], + $match + ) === 1 + ) { + $tableColumn['default'] = $match[1]; + } + + $options = [ + 'length' => $length, + 'notnull' => (bool) $tableColumn['isnotnull'], + 'default' => $tableColumn['default'], + 'precision' => $precision, + 'scale' => $scale, + 'fixed' => $fixed, + 'unsigned' => false, + 'autoincrement' => $autoincrement, + 'comment' => isset($tableColumn['comment']) && $tableColumn['comment'] !== '' + ? $tableColumn['comment'] + : null, + ]; + + $column = new Column($tableColumn['field'], Type::getType($type), $options); + + if (isset($tableColumn['collation']) && ! empty($tableColumn['collation'])) { + $column->setPlatformOption('collation', $tableColumn['collation']); + } + + if ($column->getType()->getName() === Types::JSON) { + $column->setPlatformOption('jsonb', $jsonb); + } + + return $column; + } + + /** + * PostgreSQL 9.4 puts parentheses around negative numeric default values that need to be stripped eventually. + * + * @param mixed $defaultValue + * + * @return mixed + */ + private function fixVersion94NegativeNumericDefaultValue($defaultValue) + { + if (strpos($defaultValue, '(') === 0) { + return trim($defaultValue, '()'); + } + + return $defaultValue; + } + + /** + * Parses a default value expression as given by PostgreSQL + */ + private function parseDefaultExpression(?string $default): ?string + { + if ($default === null) { + return $default; + } + + return str_replace("''", "'", $default); + } + + /** + * {@inheritdoc} + */ + public function listTableDetails($name): Table + { + $table = parent::listTableDetails($name); + + $platform = $this->_platform; + assert($platform instanceof PostgreSQL94Platform); + $sql = $platform->getListTableMetadataSQL($name); + + $tableOptions = $this->_conn->fetchAssociative($sql); + + if ($tableOptions !== false) { + $table->addOption('comment', $tableOptions['table_comment']); + } + + return $table; + } +} diff --git a/app/vendor/doctrine/dbal/src/Schema/SQLServerSchemaManager.php b/app/vendor/doctrine/dbal/src/Schema/SQLServerSchemaManager.php new file mode 100644 index 000000000..a448dd147 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Schema/SQLServerSchemaManager.php @@ -0,0 +1,337 @@ +_conn->fetchFirstColumn( + <<<'SQL' +SELECT name +FROM sys.schemas +WHERE name NOT IN('guest', 'INFORMATION_SCHEMA', 'sys') +SQL + ); + } + + /** + * {@inheritdoc} + */ + protected function _getPortableSequenceDefinition($sequence) + { + return new Sequence($sequence['name'], (int) $sequence['increment'], (int) $sequence['start_value']); + } + + /** + * {@inheritdoc} + */ + protected function _getPortableTableColumnDefinition($tableColumn) + { + $dbType = strtok($tableColumn['type'], '(), '); + assert(is_string($dbType)); + + $fixed = null; + $length = (int) $tableColumn['length']; + $default = $tableColumn['default']; + + if (! isset($tableColumn['name'])) { + $tableColumn['name'] = ''; + } + + if ($default !== null) { + $default = $this->parseDefaultExpression($default); + } + + switch ($dbType) { + case 'nchar': + case 'nvarchar': + case 'ntext': + // Unicode data requires 2 bytes per character + $length /= 2; + break; + + case 'varchar': + // TEXT type is returned as VARCHAR(MAX) with a length of -1 + if ($length === -1) { + $dbType = 'text'; + } + + break; + + case 'varbinary': + if ($length === -1) { + $dbType = 'blob'; + } + + break; + } + + if ($dbType === 'char' || $dbType === 'nchar' || $dbType === 'binary') { + $fixed = true; + } + + $type = $this->_platform->getDoctrineTypeMapping($dbType); + $type = $this->extractDoctrineTypeFromComment($tableColumn['comment'], $type); + $tableColumn['comment'] = $this->removeDoctrineTypeFromComment($tableColumn['comment'], $type); + + $options = [ + 'unsigned' => false, + 'fixed' => (bool) $fixed, + 'default' => $default, + 'notnull' => (bool) $tableColumn['notnull'], + 'scale' => $tableColumn['scale'], + 'precision' => $tableColumn['precision'], + 'autoincrement' => (bool) $tableColumn['autoincrement'], + 'comment' => $tableColumn['comment'] !== '' ? $tableColumn['comment'] : null, + ]; + + if ($length !== 0 && ($type === 'text' || $type === 'string' || $type === 'binary')) { + $options['length'] = $length; + } + + $column = new Column($tableColumn['name'], Type::getType($type), $options); + + if (isset($tableColumn['collation']) && $tableColumn['collation'] !== 'NULL') { + $column->setPlatformOption('collation', $tableColumn['collation']); + } + + return $column; + } + + private function parseDefaultExpression(string $value): ?string + { + while (preg_match('/^\((.*)\)$/s', $value, $matches)) { + $value = $matches[1]; + } + + if ($value === 'NULL') { + return null; + } + + if (preg_match('/^\'(.*)\'$/s', $value, $matches) === 1) { + $value = str_replace("''", "'", $matches[1]); + } + + if ($value === 'getdate()') { + return $this->_platform->getCurrentTimestampSQL(); + } + + return $value; + } + + /** + * {@inheritdoc} + */ + protected function _getPortableTableForeignKeysList($tableForeignKeys) + { + $foreignKeys = []; + + foreach ($tableForeignKeys as $tableForeignKey) { + $name = $tableForeignKey['ForeignKey']; + + if (! isset($foreignKeys[$name])) { + $foreignKeys[$name] = [ + 'local_columns' => [$tableForeignKey['ColumnName']], + 'foreign_table' => $tableForeignKey['ReferenceTableName'], + 'foreign_columns' => [$tableForeignKey['ReferenceColumnName']], + 'name' => $name, + 'options' => [ + 'onUpdate' => str_replace('_', ' ', $tableForeignKey['update_referential_action_desc']), + 'onDelete' => str_replace('_', ' ', $tableForeignKey['delete_referential_action_desc']), + ], + ]; + } else { + $foreignKeys[$name]['local_columns'][] = $tableForeignKey['ColumnName']; + $foreignKeys[$name]['foreign_columns'][] = $tableForeignKey['ReferenceColumnName']; + } + } + + return parent::_getPortableTableForeignKeysList($foreignKeys); + } + + /** + * {@inheritdoc} + */ + protected function _getPortableTableIndexesList($tableIndexes, $tableName = null) + { + foreach ($tableIndexes as &$tableIndex) { + $tableIndex['non_unique'] = (bool) $tableIndex['non_unique']; + $tableIndex['primary'] = (bool) $tableIndex['primary']; + $tableIndex['flags'] = $tableIndex['flags'] ? [$tableIndex['flags']] : null; + } + + return parent::_getPortableTableIndexesList($tableIndexes, $tableName); + } + + /** + * {@inheritdoc} + */ + protected function _getPortableTableForeignKeyDefinition($tableForeignKey) + { + return new ForeignKeyConstraint( + $tableForeignKey['local_columns'], + $tableForeignKey['foreign_table'], + $tableForeignKey['foreign_columns'], + $tableForeignKey['name'], + $tableForeignKey['options'] + ); + } + + /** + * {@inheritdoc} + */ + protected function _getPortableTableDefinition($table) + { + if (isset($table['schema_name']) && $table['schema_name'] !== 'dbo') { + return $table['schema_name'] . '.' . $table['name']; + } + + return $table['name']; + } + + /** + * {@inheritdoc} + */ + protected function _getPortableDatabaseDefinition($database) + { + return $database['name']; + } + + /** + * {@inheritdoc} + * + * @deprecated Use {@link listSchemaNames()} instead. + */ + protected function getPortableNamespaceDefinition(array $namespace) + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4503', + 'SQLServerSchemaManager::getPortableNamespaceDefinition() is deprecated,' + . ' use SQLServerSchemaManager::listSchemaNames() instead.' + ); + + return $namespace['name']; + } + + /** + * {@inheritdoc} + */ + protected function _getPortableViewDefinition($view) + { + // @todo + return new View($view['name'], ''); + } + + /** + * {@inheritdoc} + */ + public function listTableIndexes($table) + { + $sql = $this->_platform->getListTableIndexesSQL($table, $this->_conn->getDatabase()); + + try { + $tableIndexes = $this->_conn->fetchAllAssociative($sql); + } catch (PDOException $e) { + if ($e->getCode() === 'IMSSP') { + return []; + } + + throw $e; + } catch (Exception $e) { + if (strpos($e->getMessage(), 'SQLSTATE [01000, 15472]') === 0) { + return []; + } + + throw $e; + } + + return $this->_getPortableTableIndexesList($tableIndexes, $table); + } + + /** + * {@inheritdoc} + */ + public function alterTable(TableDiff $tableDiff) + { + if (count($tableDiff->removedColumns) > 0) { + foreach ($tableDiff->removedColumns as $col) { + $columnConstraintSql = $this->getColumnConstraintSQL($tableDiff->name, $col->getName()); + foreach ($this->_conn->fetchAllAssociative($columnConstraintSql) as $constraint) { + $this->_conn->executeStatement( + sprintf( + 'ALTER TABLE %s DROP CONSTRAINT %s', + $tableDiff->name, + $constraint['Name'] + ) + ); + } + } + } + + parent::alterTable($tableDiff); + } + + /** + * Returns the SQL to retrieve the constraints for a given column. + * + * @param string $table + * @param string $column + * + * @return string + */ + private function getColumnConstraintSQL($table, $column) + { + return "SELECT sysobjects.[Name] + FROM sysobjects INNER JOIN (SELECT [Name],[ID] FROM sysobjects WHERE XType = 'U') AS Tab + ON Tab.[ID] = sysobjects.[Parent_Obj] + INNER JOIN sys.default_constraints DefCons ON DefCons.[object_id] = sysobjects.[ID] + INNER JOIN syscolumns Col ON Col.[ColID] = DefCons.[parent_column_id] AND Col.[ID] = Tab.[ID] + WHERE Col.[Name] = " . $this->_conn->quote($column) . ' AND Tab.[Name] = ' . $this->_conn->quote($table) . ' + ORDER BY Col.[Name]'; + } + + /** + * @param string $name + * + * @throws Exception + */ + public function listTableDetails($name): Table + { + $table = parent::listTableDetails($name); + + $platform = $this->_platform; + assert($platform instanceof SQLServer2012Platform); + $sql = $platform->getListTableMetadataSQL($name); + + $tableOptions = $this->_conn->fetchAssociative($sql); + + if ($tableOptions !== false) { + $table->addOption('comment', $tableOptions['table_comment']); + } + + return $table; + } +} diff --git a/app/vendor/doctrine/dbal/src/Schema/Schema.php b/app/vendor/doctrine/dbal/src/Schema/Schema.php new file mode 100644 index 000000000..08eb26833 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Schema/Schema.php @@ -0,0 +1,496 @@ +_schemaConfig = $schemaConfig; + $this->_setName($schemaConfig->getName() ?? 'public'); + + foreach ($namespaces as $namespace) { + $this->createNamespace($namespace); + } + + foreach ($tables as $table) { + $this->_addTable($table); + } + + foreach ($sequences as $sequence) { + $this->_addSequence($sequence); + } + } + + /** + * @return bool + */ + public function hasExplicitForeignKeyIndexes() + { + return $this->_schemaConfig->hasExplicitForeignKeyIndexes(); + } + + /** + * @return void + * + * @throws SchemaException + */ + protected function _addTable(Table $table) + { + $namespaceName = $table->getNamespaceName(); + $tableName = $table->getFullQualifiedName($this->getName()); + + if (isset($this->_tables[$tableName])) { + throw SchemaException::tableAlreadyExists($tableName); + } + + if ( + $namespaceName !== null + && ! $table->isInDefaultNamespace($this->getName()) + && ! $this->hasNamespace($namespaceName) + ) { + $this->createNamespace($namespaceName); + } + + $this->_tables[$tableName] = $table; + $table->setSchemaConfig($this->_schemaConfig); + } + + /** + * @return void + * + * @throws SchemaException + */ + protected function _addSequence(Sequence $sequence) + { + $namespaceName = $sequence->getNamespaceName(); + $seqName = $sequence->getFullQualifiedName($this->getName()); + + if (isset($this->_sequences[$seqName])) { + throw SchemaException::sequenceAlreadyExists($seqName); + } + + if ( + $namespaceName !== null + && ! $sequence->isInDefaultNamespace($this->getName()) + && ! $this->hasNamespace($namespaceName) + ) { + $this->createNamespace($namespaceName); + } + + $this->_sequences[$seqName] = $sequence; + } + + /** + * Returns the namespaces of this schema. + * + * @return string[] A list of namespace names. + */ + public function getNamespaces() + { + return $this->namespaces; + } + + /** + * Gets all tables of this schema. + * + * @return Table[] + */ + public function getTables() + { + return $this->_tables; + } + + /** + * @param string $name + * + * @return Table + * + * @throws SchemaException + */ + public function getTable($name) + { + $name = $this->getFullQualifiedAssetName($name); + if (! isset($this->_tables[$name])) { + throw SchemaException::tableDoesNotExist($name); + } + + return $this->_tables[$name]; + } + + /** + * @param string $name + * + * @return string + */ + private function getFullQualifiedAssetName($name) + { + $name = $this->getUnquotedAssetName($name); + + if (strpos($name, '.') === false) { + $name = $this->getName() . '.' . $name; + } + + return strtolower($name); + } + + /** + * Returns the unquoted representation of a given asset name. + * + * @param string $assetName Quoted or unquoted representation of an asset name. + * + * @return string + */ + private function getUnquotedAssetName($assetName) + { + if ($this->isIdentifierQuoted($assetName)) { + return $this->trimQuotes($assetName); + } + + return $assetName; + } + + /** + * Does this schema have a namespace with the given name? + * + * @param string $name + * + * @return bool + */ + public function hasNamespace($name) + { + $name = strtolower($this->getUnquotedAssetName($name)); + + return isset($this->namespaces[$name]); + } + + /** + * Does this schema have a table with the given name? + * + * @param string $name + * + * @return bool + */ + public function hasTable($name) + { + $name = $this->getFullQualifiedAssetName($name); + + return isset($this->_tables[$name]); + } + + /** + * Gets all table names, prefixed with a schema name, even the default one if present. + * + * @return string[] + */ + public function getTableNames() + { + return array_keys($this->_tables); + } + + /** + * @param string $name + * + * @return bool + */ + public function hasSequence($name) + { + $name = $this->getFullQualifiedAssetName($name); + + return isset($this->_sequences[$name]); + } + + /** + * @param string $name + * + * @return Sequence + * + * @throws SchemaException + */ + public function getSequence($name) + { + $name = $this->getFullQualifiedAssetName($name); + if (! $this->hasSequence($name)) { + throw SchemaException::sequenceDoesNotExist($name); + } + + return $this->_sequences[$name]; + } + + /** + * @return Sequence[] + */ + public function getSequences() + { + return $this->_sequences; + } + + /** + * Creates a new namespace. + * + * @param string $name The name of the namespace to create. + * + * @return Schema This schema instance. + * + * @throws SchemaException + */ + public function createNamespace($name) + { + $unquotedName = strtolower($this->getUnquotedAssetName($name)); + + if (isset($this->namespaces[$unquotedName])) { + throw SchemaException::namespaceAlreadyExists($unquotedName); + } + + $this->namespaces[$unquotedName] = $name; + + return $this; + } + + /** + * Creates a new table. + * + * @param string $name + * + * @return Table + * + * @throws SchemaException + */ + public function createTable($name) + { + $table = new Table($name); + $this->_addTable($table); + + foreach ($this->_schemaConfig->getDefaultTableOptions() as $option => $value) { + $table->addOption($option, $value); + } + + return $table; + } + + /** + * Renames a table. + * + * @param string $oldName + * @param string $newName + * + * @return Schema + * + * @throws SchemaException + */ + public function renameTable($oldName, $newName) + { + $table = $this->getTable($oldName); + $table->_setName($newName); + + $this->dropTable($oldName); + $this->_addTable($table); + + return $this; + } + + /** + * Drops a table from the schema. + * + * @param string $name + * + * @return Schema + * + * @throws SchemaException + */ + public function dropTable($name) + { + $name = $this->getFullQualifiedAssetName($name); + $this->getTable($name); + unset($this->_tables[$name]); + + return $this; + } + + /** + * Creates a new sequence. + * + * @param string $name + * @param int $allocationSize + * @param int $initialValue + * + * @return Sequence + * + * @throws SchemaException + */ + public function createSequence($name, $allocationSize = 1, $initialValue = 1) + { + $seq = new Sequence($name, $allocationSize, $initialValue); + $this->_addSequence($seq); + + return $seq; + } + + /** + * @param string $name + * + * @return Schema + */ + public function dropSequence($name) + { + $name = $this->getFullQualifiedAssetName($name); + unset($this->_sequences[$name]); + + return $this; + } + + /** + * Returns an array of necessary SQL queries to create the schema on the given platform. + * + * @return string[] + */ + public function toSql(AbstractPlatform $platform) + { + $sqlCollector = new CreateSchemaSqlCollector($platform); + $this->visit($sqlCollector); + + return $sqlCollector->getQueries(); + } + + /** + * Return an array of necessary SQL queries to drop the schema on the given platform. + * + * @return string[] + */ + public function toDropSql(AbstractPlatform $platform) + { + $dropSqlCollector = new DropSchemaSqlCollector($platform); + $this->visit($dropSqlCollector); + + return $dropSqlCollector->getQueries(); + } + + /** + * @return string[] + * + * @throws SchemaException + */ + public function getMigrateToSql(Schema $toSchema, AbstractPlatform $platform) + { + $comparator = new Comparator(); + $schemaDiff = $comparator->compare($this, $toSchema); + + return $schemaDiff->toSql($platform); + } + + /** + * @return string[] + * + * @throws SchemaException + */ + public function getMigrateFromSql(Schema $fromSchema, AbstractPlatform $platform) + { + $comparator = new Comparator(); + $schemaDiff = $comparator->compare($fromSchema, $this); + + return $schemaDiff->toSql($platform); + } + + /** + * @return void + */ + public function visit(Visitor $visitor) + { + $visitor->acceptSchema($this); + + if ($visitor instanceof NamespaceVisitor) { + foreach ($this->namespaces as $namespace) { + $visitor->acceptNamespace($namespace); + } + } + + foreach ($this->_tables as $table) { + $table->visit($visitor); + } + + foreach ($this->_sequences as $sequence) { + $sequence->visit($visitor); + } + } + + /** + * Cloning a Schema triggers a deep clone of all related assets. + * + * @return void + */ + public function __clone() + { + foreach ($this->_tables as $k => $table) { + $this->_tables[$k] = clone $table; + } + + foreach ($this->_sequences as $k => $sequence) { + $this->_sequences[$k] = clone $sequence; + } + } +} diff --git a/app/vendor/doctrine/dbal/src/Schema/SchemaConfig.php b/app/vendor/doctrine/dbal/src/Schema/SchemaConfig.php new file mode 100644 index 000000000..56d49c4a7 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Schema/SchemaConfig.php @@ -0,0 +1,100 @@ +hasExplicitForeignKeyIndexes; + } + + /** + * @param bool $flag + * + * @return void + */ + public function setExplicitForeignKeyIndexes($flag) + { + $this->hasExplicitForeignKeyIndexes = (bool) $flag; + } + + /** + * @param int $length + * + * @return void + */ + public function setMaxIdentifierLength($length) + { + $this->maxIdentifierLength = (int) $length; + } + + /** + * @return int + */ + public function getMaxIdentifierLength() + { + return $this->maxIdentifierLength; + } + + /** + * Gets the default namespace of schema objects. + * + * @return string|null + */ + public function getName() + { + return $this->name; + } + + /** + * Sets the default namespace name of schema objects. + * + * @param string $name The value to set. + * + * @return void + */ + public function setName($name) + { + $this->name = $name; + } + + /** + * Gets the default options that are passed to Table instances created with + * Schema#createTable(). + * + * @return mixed[] + */ + public function getDefaultTableOptions() + { + return $this->defaultTableOptions; + } + + /** + * @param mixed[] $defaultTableOptions + * + * @return void + */ + public function setDefaultTableOptions(array $defaultTableOptions) + { + $this->defaultTableOptions = $defaultTableOptions; + } +} diff --git a/app/vendor/doctrine/dbal/src/Schema/SchemaDiff.php b/app/vendor/doctrine/dbal/src/Schema/SchemaDiff.php new file mode 100644 index 000000000..67fb9bb9d --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Schema/SchemaDiff.php @@ -0,0 +1,170 @@ +newTables = $newTables; + $this->changedTables = $changedTables; + $this->removedTables = $removedTables; + $this->fromSchema = $fromSchema; + } + + /** + * The to save sql mode ensures that the following things don't happen: + * + * 1. Tables are deleted + * 2. Sequences are deleted + * 3. Foreign Keys which reference tables that would otherwise be deleted. + * + * This way it is ensured that assets are deleted which might not be relevant to the metadata schema at all. + * + * @return string[] + */ + public function toSaveSql(AbstractPlatform $platform) + { + return $this->_toSql($platform, true); + } + + /** + * @return string[] + */ + public function toSql(AbstractPlatform $platform) + { + return $this->_toSql($platform, false); + } + + /** + * @param bool $saveMode + * + * @return string[] + */ + protected function _toSql(AbstractPlatform $platform, $saveMode = false) + { + $sql = []; + + if ($platform->supportsSchemas()) { + foreach ($this->newNamespaces as $newNamespace) { + $sql[] = $platform->getCreateSchemaSQL($newNamespace); + } + } + + if ($platform->supportsForeignKeyConstraints() && $saveMode === false) { + foreach ($this->orphanedForeignKeys as $orphanedForeignKey) { + $sql[] = $platform->getDropForeignKeySQL($orphanedForeignKey, $orphanedForeignKey->getLocalTable()); + } + } + + if ($platform->supportsSequences() === true) { + foreach ($this->changedSequences as $sequence) { + $sql[] = $platform->getAlterSequenceSQL($sequence); + } + + if ($saveMode === false) { + foreach ($this->removedSequences as $sequence) { + $sql[] = $platform->getDropSequenceSQL($sequence); + } + } + + foreach ($this->newSequences as $sequence) { + $sql[] = $platform->getCreateSequenceSQL($sequence); + } + } + + $foreignKeySql = []; + foreach ($this->newTables as $table) { + $sql = array_merge( + $sql, + $platform->getCreateTableSQL($table, AbstractPlatform::CREATE_INDEXES) + ); + + if (! $platform->supportsForeignKeyConstraints()) { + continue; + } + + foreach ($table->getForeignKeys() as $foreignKey) { + $foreignKeySql[] = $platform->getCreateForeignKeySQL($foreignKey, $table); + } + } + + $sql = array_merge($sql, $foreignKeySql); + + if ($saveMode === false) { + foreach ($this->removedTables as $table) { + $sql[] = $platform->getDropTableSQL($table); + } + } + + foreach ($this->changedTables as $tableDiff) { + $sql = array_merge($sql, $platform->getAlterTableSQL($tableDiff)); + } + + return $sql; + } +} diff --git a/app/vendor/doctrine/dbal/src/Schema/SchemaException.php b/app/vendor/doctrine/dbal/src/Schema/SchemaException.php new file mode 100644 index 000000000..d4e22380e --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Schema/SchemaException.php @@ -0,0 +1,202 @@ +getName() . ' requires a named foreign key, ' . + 'but the given foreign key from (' . implode(', ', $foreignKey->getColumns()) . ') onto foreign table ' . + "'" . $foreignKey->getForeignTableName() . "' (" . implode(', ', $foreignKey->getForeignColumns()) . ')' . + ' is currently unnamed.' + ); + } + + /** + * @param string $changeName + * + * @return SchemaException + */ + public static function alterTableChangeNotSupported($changeName) + { + return new self( + sprintf("Alter table change not supported, given '%s'", $changeName) + ); + } +} diff --git a/app/vendor/doctrine/dbal/src/Schema/Sequence.php b/app/vendor/doctrine/dbal/src/Schema/Sequence.php new file mode 100644 index 000000000..a634e84fa --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Schema/Sequence.php @@ -0,0 +1,148 @@ +_setName($name); + $this->setAllocationSize($allocationSize); + $this->setInitialValue($initialValue); + $this->cache = $cache; + } + + /** + * @return int + */ + public function getAllocationSize() + { + return $this->allocationSize; + } + + /** + * @return int + */ + public function getInitialValue() + { + return $this->initialValue; + } + + /** + * @return int|null + */ + public function getCache() + { + return $this->cache; + } + + /** + * @param int $allocationSize + * + * @return Sequence + */ + public function setAllocationSize($allocationSize) + { + if ($allocationSize > 0) { + $this->allocationSize = $allocationSize; + } else { + $this->allocationSize = 1; + } + + return $this; + } + + /** + * @param int $initialValue + * + * @return Sequence + */ + public function setInitialValue($initialValue) + { + if ($initialValue > 0) { + $this->initialValue = $initialValue; + } else { + $this->initialValue = 1; + } + + return $this; + } + + /** + * @param int $cache + * + * @return Sequence + */ + public function setCache($cache) + { + $this->cache = $cache; + + return $this; + } + + /** + * Checks if this sequence is an autoincrement sequence for a given table. + * + * This is used inside the comparator to not report sequences as missing, + * when the "from" schema implicitly creates the sequences. + * + * @return bool + */ + public function isAutoIncrementsFor(Table $table) + { + $primaryKey = $table->getPrimaryKey(); + + if ($primaryKey === null) { + return false; + } + + $pkColumns = $primaryKey->getColumns(); + + if (count($pkColumns) !== 1) { + return false; + } + + $column = $table->getColumn($pkColumns[0]); + + if (! $column->getAutoincrement()) { + return false; + } + + $sequenceName = $this->getShortestName($table->getNamespaceName()); + $tableName = $table->getShortestName($table->getNamespaceName()); + $tableSequenceName = sprintf('%s_%s_seq', $tableName, $column->getShortestName($table->getNamespaceName())); + + return $tableSequenceName === $sequenceName; + } + + /** + * @return void + */ + public function visit(Visitor $visitor) + { + $visitor->acceptSequence($this); + } +} diff --git a/app/vendor/doctrine/dbal/src/Schema/SqliteSchemaManager.php b/app/vendor/doctrine/dbal/src/Schema/SqliteSchemaManager.php new file mode 100644 index 000000000..140ebb3c0 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Schema/SqliteSchemaManager.php @@ -0,0 +1,580 @@ +_conn->getParams(); + + $params['path'] = $database; + unset($params['memory']); + + $conn = DriverManager::getConnection($params); + $conn->connect(); + $conn->close(); + } + + /** + * {@inheritdoc} + */ + public function renameTable($name, $newName) + { + $tableDiff = new TableDiff($name); + $tableDiff->fromTable = $this->listTableDetails($name); + $tableDiff->newName = $newName; + $this->alterTable($tableDiff); + } + + /** + * {@inheritdoc} + */ + public function createForeignKey(ForeignKeyConstraint $foreignKey, $table) + { + $tableDiff = $this->getTableDiffForAlterForeignKey($table); + $tableDiff->addedForeignKeys[] = $foreignKey; + + $this->alterTable($tableDiff); + } + + /** + * {@inheritdoc} + */ + public function dropAndCreateForeignKey(ForeignKeyConstraint $foreignKey, $table) + { + $tableDiff = $this->getTableDiffForAlterForeignKey($table); + $tableDiff->changedForeignKeys[] = $foreignKey; + + $this->alterTable($tableDiff); + } + + /** + * {@inheritdoc} + */ + public function dropForeignKey($foreignKey, $table) + { + $tableDiff = $this->getTableDiffForAlterForeignKey($table); + $tableDiff->removedForeignKeys[] = $foreignKey; + + $this->alterTable($tableDiff); + } + + /** + * {@inheritdoc} + */ + public function listTableForeignKeys($table, $database = null) + { + if ($database === null) { + $database = $this->_conn->getDatabase(); + } + + $sql = $this->_platform->getListTableForeignKeysSQL($table, $database); + $tableForeignKeys = $this->_conn->fetchAllAssociative($sql); + + if (! empty($tableForeignKeys)) { + $createSql = $this->getCreateTableSQL($table); + + if ( + preg_match_all( + '# + (?:CONSTRAINT\s+([^\s]+)\s+)? + (?:FOREIGN\s+KEY[^\)]+\)\s*)? + REFERENCES\s+[^\s]+\s+(?:\([^\)]+\))? + (?: + [^,]*? + (NOT\s+DEFERRABLE|DEFERRABLE) + (?:\s+INITIALLY\s+(DEFERRED|IMMEDIATE))? + )?#isx', + $createSql, + $match + ) > 0 + ) { + $names = array_reverse($match[1]); + $deferrable = array_reverse($match[2]); + $deferred = array_reverse($match[3]); + } else { + $names = $deferrable = $deferred = []; + } + + foreach ($tableForeignKeys as $key => $value) { + $id = $value['id']; + + $tableForeignKeys[$key] = array_merge($tableForeignKeys[$key], [ + 'constraint_name' => isset($names[$id]) && $names[$id] !== '' ? $names[$id] : $id, + 'deferrable' => isset($deferrable[$id]) && strtolower($deferrable[$id]) === 'deferrable', + 'deferred' => isset($deferred[$id]) && strtolower($deferred[$id]) === 'deferred', + ]); + } + } + + return $this->_getPortableTableForeignKeysList($tableForeignKeys); + } + + /** + * {@inheritdoc} + */ + protected function _getPortableTableDefinition($table) + { + return $table['name']; + } + + /** + * {@inheritdoc} + * + * @link http://ezcomponents.org/docs/api/trunk/DatabaseSchema/ezcDbSchemaPgsqlReader.html + */ + protected function _getPortableTableIndexesList($tableIndexes, $tableName = null) + { + $indexBuffer = []; + + // fetch primary + $indexArray = $this->_conn->fetchAllAssociative(sprintf( + 'PRAGMA TABLE_INFO (%s)', + $this->_conn->quote($tableName) + )); + + usort( + $indexArray, + /** + * @param array $a + * @param array $b + */ + static function (array $a, array $b): int { + if ($a['pk'] === $b['pk']) { + return $a['cid'] - $b['cid']; + } + + return $a['pk'] - $b['pk']; + } + ); + + foreach ($indexArray as $indexColumnRow) { + if ($indexColumnRow['pk'] === 0 || $indexColumnRow['pk'] === '0') { + continue; + } + + $indexBuffer[] = [ + 'key_name' => 'primary', + 'primary' => true, + 'non_unique' => false, + 'column_name' => $indexColumnRow['name'], + ]; + } + + // fetch regular indexes + foreach ($tableIndexes as $tableIndex) { + // Ignore indexes with reserved names, e.g. autoindexes + if (strpos($tableIndex['name'], 'sqlite_') === 0) { + continue; + } + + $keyName = $tableIndex['name']; + $idx = []; + $idx['key_name'] = $keyName; + $idx['primary'] = false; + $idx['non_unique'] = ! $tableIndex['unique']; + + $indexArray = $this->_conn->fetchAllAssociative(sprintf( + 'PRAGMA INDEX_INFO (%s)', + $this->_conn->quote($keyName) + )); + + foreach ($indexArray as $indexColumnRow) { + $idx['column_name'] = $indexColumnRow['name']; + $indexBuffer[] = $idx; + } + } + + return parent::_getPortableTableIndexesList($indexBuffer, $tableName); + } + + /** + * {@inheritdoc} + */ + protected function _getPortableTableColumnList($table, $database, $tableColumns) + { + $list = parent::_getPortableTableColumnList($table, $database, $tableColumns); + + // find column with autoincrement + $autoincrementColumn = null; + $autoincrementCount = 0; + + foreach ($tableColumns as $tableColumn) { + if ($tableColumn['pk'] === 0 || $tableColumn['pk'] === '0') { + continue; + } + + $autoincrementCount++; + if ($autoincrementColumn !== null || strtolower($tableColumn['type']) !== 'integer') { + continue; + } + + $autoincrementColumn = $tableColumn['name']; + } + + if ($autoincrementCount === 1 && $autoincrementColumn !== null) { + foreach ($list as $column) { + if ($autoincrementColumn !== $column->getName()) { + continue; + } + + $column->setAutoincrement(true); + } + } + + // inspect column collation and comments + $createSql = $this->getCreateTableSQL($table); + + foreach ($list as $columnName => $column) { + $type = $column->getType(); + + if ($type instanceof StringType || $type instanceof TextType) { + $column->setPlatformOption( + 'collation', + $this->parseColumnCollationFromSQL($columnName, $createSql) ?? 'BINARY' + ); + } + + $comment = $this->parseColumnCommentFromSQL($columnName, $createSql); + + if ($comment === null) { + continue; + } + + $type = $this->extractDoctrineTypeFromComment($comment, ''); + + if ($type !== '') { + $column->setType(Type::getType($type)); + + $comment = $this->removeDoctrineTypeFromComment($comment, $type); + } + + $column->setComment($comment); + } + + return $list; + } + + /** + * {@inheritdoc} + */ + protected function _getPortableTableColumnDefinition($tableColumn) + { + $parts = explode('(', $tableColumn['type']); + $tableColumn['type'] = trim($parts[0]); + if (isset($parts[1])) { + $length = trim($parts[1], ')'); + $tableColumn['length'] = $length; + } + + $dbType = strtolower($tableColumn['type']); + $length = $tableColumn['length'] ?? null; + $unsigned = false; + + if (strpos($dbType, ' unsigned') !== false) { + $dbType = str_replace(' unsigned', '', $dbType); + $unsigned = true; + } + + $fixed = false; + $type = $this->_platform->getDoctrineTypeMapping($dbType); + $default = $tableColumn['dflt_value']; + if ($default === 'NULL') { + $default = null; + } + + if ($default !== null) { + // SQLite returns the default value as a literal expression, so we need to parse it + if (preg_match('/^\'(.*)\'$/s', $default, $matches) === 1) { + $default = str_replace("''", "'", $matches[1]); + } + } + + $notnull = (bool) $tableColumn['notnull']; + + if (! isset($tableColumn['name'])) { + $tableColumn['name'] = ''; + } + + $precision = null; + $scale = null; + + switch ($dbType) { + case 'char': + $fixed = true; + break; + case 'float': + case 'double': + case 'real': + case 'decimal': + case 'numeric': + if (isset($tableColumn['length'])) { + if (strpos($tableColumn['length'], ',') === false) { + $tableColumn['length'] .= ',0'; + } + + [$precision, $scale] = array_map('trim', explode(',', $tableColumn['length'])); + } + + $length = null; + break; + } + + $options = [ + 'length' => $length, + 'unsigned' => $unsigned, + 'fixed' => $fixed, + 'notnull' => $notnull, + 'default' => $default, + 'precision' => $precision, + 'scale' => $scale, + 'autoincrement' => false, + ]; + + return new Column($tableColumn['name'], Type::getType($type), $options); + } + + /** + * {@inheritdoc} + */ + protected function _getPortableViewDefinition($view) + { + return new View($view['name'], $view['sql']); + } + + /** + * {@inheritdoc} + */ + protected function _getPortableTableForeignKeysList($tableForeignKeys) + { + $list = []; + foreach ($tableForeignKeys as $value) { + $value = array_change_key_case($value, CASE_LOWER); + $name = $value['constraint_name']; + if (! isset($list[$name])) { + if (! isset($value['on_delete']) || $value['on_delete'] === 'RESTRICT') { + $value['on_delete'] = null; + } + + if (! isset($value['on_update']) || $value['on_update'] === 'RESTRICT') { + $value['on_update'] = null; + } + + $list[$name] = [ + 'name' => $name, + 'local' => [], + 'foreign' => [], + 'foreignTable' => $value['table'], + 'onDelete' => $value['on_delete'], + 'onUpdate' => $value['on_update'], + 'deferrable' => $value['deferrable'], + 'deferred' => $value['deferred'], + ]; + } + + $list[$name]['local'][] = $value['from']; + + if ($value['to'] === null) { + continue; + } + + $list[$name]['foreign'][] = $value['to']; + } + + $result = []; + foreach ($list as $constraint) { + $result[] = new ForeignKeyConstraint( + array_values($constraint['local']), + $constraint['foreignTable'], + array_values($constraint['foreign']), + $constraint['name'], + [ + 'onDelete' => $constraint['onDelete'], + 'onUpdate' => $constraint['onUpdate'], + 'deferrable' => $constraint['deferrable'], + 'deferred' => $constraint['deferred'], + ] + ); + } + + return $result; + } + + /** + * @param Table|string $table + * + * @return TableDiff + * + * @throws Exception + */ + private function getTableDiffForAlterForeignKey($table) + { + if (! $table instanceof Table) { + $tableDetails = $this->tryMethod('listTableDetails', $table); + + if ($tableDetails === false) { + throw new Exception( + sprintf('Sqlite schema manager requires to modify foreign keys table definition "%s".', $table) + ); + } + + $table = $tableDetails; + } + + $tableDiff = new TableDiff($table->getName()); + $tableDiff->fromTable = $table; + + return $tableDiff; + } + + private function parseColumnCollationFromSQL(string $column, string $sql): ?string + { + $pattern = '{(?:\W' . preg_quote($column) . '\W|\W' + . preg_quote($this->_platform->quoteSingleIdentifier($column)) + . '\W)[^,(]+(?:\([^()]+\)[^,]*)?(?:(?:DEFAULT|CHECK)\s*(?:\(.*?\))?[^,]*)*COLLATE\s+["\']?([^\s,"\')]+)}is'; + + if (preg_match($pattern, $sql, $match) !== 1) { + return null; + } + + return $match[1]; + } + + private function parseTableCommentFromSQL(string $table, string $sql): ?string + { + $pattern = '/\s* # Allow whitespace characters at start of line +CREATE\sTABLE # Match "CREATE TABLE" +(?:\W"' . preg_quote($this->_platform->quoteSingleIdentifier($table), '/') . '"\W|\W' . preg_quote($table, '/') + . '\W) # Match table name (quoted and unquoted) +( # Start capture + (?:\s*--[^\n]*\n?)+ # Capture anything that starts with whitespaces followed by -- until the end of the line(s) +)/ix'; + + if (preg_match($pattern, $sql, $match) !== 1) { + return null; + } + + $comment = preg_replace('{^\s*--}m', '', rtrim($match[1], "\n")); + + return $comment === '' ? null : $comment; + } + + private function parseColumnCommentFromSQL(string $column, string $sql): ?string + { + $pattern = '{[\s(,](?:\W' . preg_quote($this->_platform->quoteSingleIdentifier($column)) + . '\W|\W' . preg_quote($column) . '\W)(?:\([^)]*?\)|[^,(])*?,?((?:(?!\n))(?:\s*--[^\n]*\n?)+)}i'; + + if (preg_match($pattern, $sql, $match) !== 1) { + return null; + } + + $comment = preg_replace('{^\s*--}m', '', rtrim($match[1], "\n")); + + return $comment === '' ? null : $comment; + } + + /** + * @throws Exception + */ + private function getCreateTableSQL(string $table): string + { + $sql = $this->_conn->fetchOne( + <<<'SQL' +SELECT sql + FROM ( + SELECT * + FROM sqlite_master + UNION ALL + SELECT * + FROM sqlite_temp_master + ) +WHERE type = 'table' +AND name = ? +SQL + , + [$table] + ); + + if ($sql !== false) { + return $sql; + } + + return ''; + } + + /** + * {@inheritDoc} + * + * @param string $name + */ + public function listTableDetails($name): Table + { + $table = parent::listTableDetails($name); + + $tableCreateSql = $this->getCreateTableSQL($name); + + $comment = $this->parseTableCommentFromSQL($name, $tableCreateSql); + + if ($comment !== null) { + $table->addOption('comment', $comment); + } + + return $table; + } + + /** + * {@inheritDoc} + */ + public function getSchemaSearchPaths() + { + // SQLite does not support schemas or databases + return []; + } +} diff --git a/app/vendor/doctrine/dbal/src/Schema/Table.php b/app/vendor/doctrine/dbal/src/Schema/Table.php new file mode 100644 index 000000000..d330d03f4 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Schema/Table.php @@ -0,0 +1,1005 @@ + [], + ]; + + /** @var SchemaConfig|null */ + protected $_schemaConfig; + + /** @var Index[] */ + private $implicitIndexes = []; + + /** + * @param Column[] $columns + * @param Index[] $indexes + * @param UniqueConstraint[] $uniqueConstraints + * @param ForeignKeyConstraint[] $fkConstraints + * @param mixed[] $options + * + * @throws SchemaException + * @throws Exception + */ + public function __construct( + string $name, + array $columns = [], + array $indexes = [], + array $uniqueConstraints = [], + array $fkConstraints = [], + array $options = [] + ) { + if ($name === '') { + throw InvalidTableName::new($name); + } + + $this->_setName($name); + + foreach ($columns as $column) { + $this->_addColumn($column); + } + + foreach ($indexes as $idx) { + $this->_addIndex($idx); + } + + foreach ($uniqueConstraints as $uniqueConstraint) { + $this->_addUniqueConstraint($uniqueConstraint); + } + + foreach ($fkConstraints as $constraint) { + $this->_addForeignKeyConstraint($constraint); + } + + $this->_options = array_merge($this->_options, $options); + } + + /** + * @return void + */ + public function setSchemaConfig(SchemaConfig $schemaConfig) + { + $this->_schemaConfig = $schemaConfig; + } + + /** + * @return int + */ + protected function _getMaxIdentifierLength() + { + if ($this->_schemaConfig instanceof SchemaConfig) { + return $this->_schemaConfig->getMaxIdentifierLength(); + } + + return 63; + } + + /** + * Sets the Primary Key. + * + * @param string[] $columnNames + * @param string|false $indexName + * + * @return self + * + * @throws SchemaException + */ + public function setPrimaryKey(array $columnNames, $indexName = false) + { + if ($indexName === false) { + $indexName = 'primary'; + } + + $this->_addIndex($this->_createIndex($columnNames, $indexName, true, true)); + + foreach ($columnNames as $columnName) { + $column = $this->getColumn($columnName); + $column->setNotnull(true); + } + + return $this; + } + + /** + * @param string[] $columnNames + * @param string[] $flags + * @param mixed[] $options + * + * @return self + * + * @throws SchemaException + */ + public function addIndex(array $columnNames, ?string $indexName = null, array $flags = [], array $options = []) + { + if ($indexName === null) { + $indexName = $this->_generateIdentifierName( + array_merge([$this->getName()], $columnNames), + 'idx', + $this->_getMaxIdentifierLength() + ); + } + + return $this->_addIndex($this->_createIndex($columnNames, $indexName, false, false, $flags, $options)); + } + + /** + * @param string[] $columnNames + * @param string[] $flags + * @param mixed[] $options + * + * @return self + */ + public function addUniqueConstraint( + array $columnNames, + ?string $indexName = null, + array $flags = [], + array $options = [] + ): Table { + if ($indexName === null) { + $indexName = $this->_generateIdentifierName( + array_merge([$this->getName()], $columnNames), + 'uniq', + $this->_getMaxIdentifierLength() + ); + } + + return $this->_addUniqueConstraint($this->_createUniqueConstraint($columnNames, $indexName, $flags, $options)); + } + + /** + * Drops the primary key from this table. + * + * @return void + * + * @throws SchemaException + */ + public function dropPrimaryKey() + { + if ($this->_primaryKeyName === null) { + return; + } + + $this->dropIndex($this->_primaryKeyName); + $this->_primaryKeyName = null; + } + + /** + * Drops an index from this table. + * + * @param string $name The index name. + * + * @return void + * + * @throws SchemaException If the index does not exist. + */ + public function dropIndex($name) + { + $name = $this->normalizeIdentifier($name); + + if (! $this->hasIndex($name)) { + throw SchemaException::indexDoesNotExist($name, $this->_name); + } + + unset($this->_indexes[$name]); + } + + /** + * @param string[] $columnNames + * @param string|null $indexName + * @param mixed[] $options + * + * @return self + * + * @throws SchemaException + */ + public function addUniqueIndex(array $columnNames, $indexName = null, array $options = []) + { + if ($indexName === null) { + $indexName = $this->_generateIdentifierName( + array_merge([$this->getName()], $columnNames), + 'uniq', + $this->_getMaxIdentifierLength() + ); + } + + return $this->_addIndex($this->_createIndex($columnNames, $indexName, true, false, [], $options)); + } + + /** + * Renames an index. + * + * @param string $oldName The name of the index to rename from. + * @param string|null $newName The name of the index to rename to. + * If null is given, the index name will be auto-generated. + * + * @return self This table instance. + * + * @throws SchemaException If no index exists for the given current name + * or if an index with the given new name already exists on this table. + */ + public function renameIndex($oldName, $newName = null) + { + $oldName = $this->normalizeIdentifier($oldName); + $normalizedNewName = $this->normalizeIdentifier($newName); + + if ($oldName === $normalizedNewName) { + return $this; + } + + if (! $this->hasIndex($oldName)) { + throw SchemaException::indexDoesNotExist($oldName, $this->_name); + } + + if ($this->hasIndex($normalizedNewName)) { + throw SchemaException::indexAlreadyExists($normalizedNewName, $this->_name); + } + + $oldIndex = $this->_indexes[$oldName]; + + if ($oldIndex->isPrimary()) { + $this->dropPrimaryKey(); + + return $this->setPrimaryKey($oldIndex->getColumns(), $newName ?? false); + } + + unset($this->_indexes[$oldName]); + + if ($oldIndex->isUnique()) { + return $this->addUniqueIndex($oldIndex->getColumns(), $newName, $oldIndex->getOptions()); + } + + return $this->addIndex($oldIndex->getColumns(), $newName, $oldIndex->getFlags(), $oldIndex->getOptions()); + } + + /** + * Checks if an index begins in the order of the given columns. + * + * @param string[] $columnNames + * + * @return bool + */ + public function columnsAreIndexed(array $columnNames) + { + foreach ($this->getIndexes() as $index) { + if ($index->spansColumns($columnNames)) { + return true; + } + } + + return false; + } + + /** + * @param string[] $columnNames + * @param string $indexName + * @param bool $isUnique + * @param bool $isPrimary + * @param string[] $flags + * @param mixed[] $options + * + * @return Index + * + * @throws SchemaException + */ + private function _createIndex( + array $columnNames, + $indexName, + $isUnique, + $isPrimary, + array $flags = [], + array $options = [] + ) { + if (preg_match('(([^a-zA-Z0-9_]+))', $this->normalizeIdentifier($indexName)) === 1) { + throw SchemaException::indexNameInvalid($indexName); + } + + foreach ($columnNames as $columnName) { + if (! $this->hasColumn($columnName)) { + throw SchemaException::columnDoesNotExist($columnName, $this->_name); + } + } + + return new Index($indexName, $columnNames, $isUnique, $isPrimary, $flags, $options); + } + + /** + * @param string $name + * @param string $typeName + * @param mixed[] $options + * + * @return Column + * + * @throws SchemaException + */ + public function addColumn($name, $typeName, array $options = []) + { + $column = new Column($name, Type::getType($typeName), $options); + + $this->_addColumn($column); + + return $column; + } + + /** + * Change Column Details. + * + * @param string $name + * @param mixed[] $options + * + * @return self + * + * @throws SchemaException + */ + public function changeColumn($name, array $options) + { + $column = $this->getColumn($name); + $column->setOptions($options); + + return $this; + } + + /** + * Drops a Column from the Table. + * + * @param string $name + * + * @return self + */ + public function dropColumn($name) + { + $name = $this->normalizeIdentifier($name); + + unset($this->_columns[$name]); + + return $this; + } + + /** + * Adds a foreign key constraint. + * + * Name is inferred from the local columns. + * + * @param Table|string $foreignTable Table schema instance or table name + * @param string[] $localColumnNames + * @param string[] $foreignColumnNames + * @param mixed[] $options + * @param string|null $name + * + * @return self + * + * @throws SchemaException + */ + public function addForeignKeyConstraint( + $foreignTable, + array $localColumnNames, + array $foreignColumnNames, + array $options = [], + $name = null + ) { + if ($name === null) { + $name = $this->_generateIdentifierName( + array_merge((array) $this->getName(), $localColumnNames), + 'fk', + $this->_getMaxIdentifierLength() + ); + } + + if ($foreignTable instanceof Table) { + foreach ($foreignColumnNames as $columnName) { + if (! $foreignTable->hasColumn($columnName)) { + throw SchemaException::columnDoesNotExist($columnName, $foreignTable->getName()); + } + } + } + + foreach ($localColumnNames as $columnName) { + if (! $this->hasColumn($columnName)) { + throw SchemaException::columnDoesNotExist($columnName, $this->_name); + } + } + + $constraint = new ForeignKeyConstraint( + $localColumnNames, + $foreignTable, + $foreignColumnNames, + $name, + $options + ); + + return $this->_addForeignKeyConstraint($constraint); + } + + /** + * @param string $name + * @param mixed $value + * + * @return self + */ + public function addOption($name, $value) + { + $this->_options[$name] = $value; + + return $this; + } + + /** + * @return void + * + * @throws SchemaException + */ + protected function _addColumn(Column $column) + { + $columnName = $column->getName(); + $columnName = $this->normalizeIdentifier($columnName); + + if (isset($this->_columns[$columnName])) { + throw SchemaException::columnAlreadyExists($this->getName(), $columnName); + } + + $this->_columns[$columnName] = $column; + } + + /** + * Adds an index to the table. + * + * @return self + * + * @throws SchemaException + */ + protected function _addIndex(Index $indexCandidate) + { + $indexName = $indexCandidate->getName(); + $indexName = $this->normalizeIdentifier($indexName); + $replacedImplicitIndexes = []; + + foreach ($this->implicitIndexes as $name => $implicitIndex) { + if (! $implicitIndex->isFullfilledBy($indexCandidate) || ! isset($this->_indexes[$name])) { + continue; + } + + $replacedImplicitIndexes[] = $name; + } + + if ( + (isset($this->_indexes[$indexName]) && ! in_array($indexName, $replacedImplicitIndexes, true)) || + ($this->_primaryKeyName !== null && $indexCandidate->isPrimary()) + ) { + throw SchemaException::indexAlreadyExists($indexName, $this->_name); + } + + foreach ($replacedImplicitIndexes as $name) { + unset($this->_indexes[$name], $this->implicitIndexes[$name]); + } + + if ($indexCandidate->isPrimary()) { + $this->_primaryKeyName = $indexName; + } + + $this->_indexes[$indexName] = $indexCandidate; + + return $this; + } + + /** + * @return self + */ + protected function _addUniqueConstraint(UniqueConstraint $constraint): Table + { + $mergedNames = array_merge([$this->getName()], $constraint->getColumns()); + $name = strlen($constraint->getName()) > 0 + ? $constraint->getName() + : $this->_generateIdentifierName($mergedNames, 'fk', $this->_getMaxIdentifierLength()); + + $name = $this->normalizeIdentifier($name); + + $this->uniqueConstraints[$name] = $constraint; + + // If there is already an index that fulfills this requirements drop the request. In the case of __construct + // calling this method during hydration from schema-details all the explicitly added indexes lead to duplicates. + // This creates computation overhead in this case, however no duplicate indexes are ever added (column based). + $indexName = $this->_generateIdentifierName($mergedNames, 'idx', $this->_getMaxIdentifierLength()); + + $indexCandidate = $this->_createIndex($constraint->getColumns(), $indexName, true, false); + + foreach ($this->_indexes as $existingIndex) { + if ($indexCandidate->isFullfilledBy($existingIndex)) { + return $this; + } + } + + $this->implicitIndexes[$this->normalizeIdentifier($indexName)] = $indexCandidate; + + return $this; + } + + /** + * @return self + */ + protected function _addForeignKeyConstraint(ForeignKeyConstraint $constraint) + { + $constraint->setLocalTable($this); + + if (strlen($constraint->getName()) > 0) { + $name = $constraint->getName(); + } else { + $name = $this->_generateIdentifierName( + array_merge([$this->getName()], $constraint->getLocalColumns()), + 'fk', + $this->_getMaxIdentifierLength() + ); + } + + $name = $this->normalizeIdentifier($name); + + $this->_fkConstraints[$name] = $constraint; + + /* Add an implicit index (defined by the DBAL) on the foreign key + columns. If there is already a user-defined index that fulfills these + requirements drop the request. In the case of __construct() calling + this method during hydration from schema-details, all the explicitly + added indexes lead to duplicates. This creates computation overhead in + this case, however no duplicate indexes are ever added (based on + columns). */ + $indexName = $this->_generateIdentifierName( + array_merge([$this->getName()], $constraint->getColumns()), + 'idx', + $this->_getMaxIdentifierLength() + ); + + $indexCandidate = $this->_createIndex($constraint->getColumns(), $indexName, false, false); + + foreach ($this->_indexes as $existingIndex) { + if ($indexCandidate->isFullfilledBy($existingIndex)) { + return $this; + } + } + + $this->_addIndex($indexCandidate); + $this->implicitIndexes[$this->normalizeIdentifier($indexName)] = $indexCandidate; + + return $this; + } + + /** + * Returns whether this table has a foreign key constraint with the given name. + * + * @param string $name + * + * @return bool + */ + public function hasForeignKey($name) + { + $name = $this->normalizeIdentifier($name); + + return isset($this->_fkConstraints[$name]); + } + + /** + * Returns the foreign key constraint with the given name. + * + * @param string $name The constraint name. + * + * @return ForeignKeyConstraint + * + * @throws SchemaException If the foreign key does not exist. + */ + public function getForeignKey($name) + { + $name = $this->normalizeIdentifier($name); + + if (! $this->hasForeignKey($name)) { + throw SchemaException::foreignKeyDoesNotExist($name, $this->_name); + } + + return $this->_fkConstraints[$name]; + } + + /** + * Removes the foreign key constraint with the given name. + * + * @param string $name The constraint name. + * + * @return void + * + * @throws SchemaException + */ + public function removeForeignKey($name) + { + $name = $this->normalizeIdentifier($name); + + if (! $this->hasForeignKey($name)) { + throw SchemaException::foreignKeyDoesNotExist($name, $this->_name); + } + + unset($this->_fkConstraints[$name]); + } + + /** + * Returns whether this table has a unique constraint with the given name. + */ + public function hasUniqueConstraint(string $name): bool + { + $name = $this->normalizeIdentifier($name); + + return isset($this->uniqueConstraints[$name]); + } + + /** + * Returns the unique constraint with the given name. + * + * @throws SchemaException If the unique constraint does not exist. + */ + public function getUniqueConstraint(string $name): UniqueConstraint + { + $name = $this->normalizeIdentifier($name); + + if (! $this->hasUniqueConstraint($name)) { + throw SchemaException::uniqueConstraintDoesNotExist($name, $this->_name); + } + + return $this->uniqueConstraints[$name]; + } + + /** + * Removes the unique constraint with the given name. + * + * @throws SchemaException If the unique constraint does not exist. + */ + public function removeUniqueConstraint(string $name): void + { + $name = $this->normalizeIdentifier($name); + + if (! $this->hasUniqueConstraint($name)) { + throw SchemaException::uniqueConstraintDoesNotExist($name, $this->_name); + } + + unset($this->uniqueConstraints[$name]); + } + + /** + * Returns ordered list of columns (primary keys are first, then foreign keys, then the rest) + * + * @return Column[] + */ + public function getColumns() + { + $primaryKeyColumns = $this->hasPrimaryKey() ? $this->getPrimaryKeyColumns() : []; + $foreignKeyColumns = $this->getForeignKeyColumns(); + $remainderColumns = $this->filterColumns( + array_merge(array_keys($primaryKeyColumns), array_keys($foreignKeyColumns)), + true + ); + + return array_merge($primaryKeyColumns, $foreignKeyColumns, $remainderColumns); + } + + /** + * Returns the foreign key columns + * + * @return Column[] + */ + public function getForeignKeyColumns() + { + $foreignKeyColumns = []; + + foreach ($this->getForeignKeys() as $foreignKey) { + $foreignKeyColumns = array_merge($foreignKeyColumns, $foreignKey->getLocalColumns()); + } + + return $this->filterColumns($foreignKeyColumns); + } + + /** + * Returns only columns that have specified names + * + * @param string[] $columnNames + * + * @return Column[] + */ + private function filterColumns(array $columnNames, bool $reverse = false): array + { + return array_filter($this->_columns, static function (string $columnName) use ($columnNames, $reverse): bool { + return in_array($columnName, $columnNames, true) !== $reverse; + }, ARRAY_FILTER_USE_KEY); + } + + /** + * Returns whether this table has a Column with the given name. + * + * @param string $name The column name. + * + * @return bool + */ + public function hasColumn($name) + { + $name = $this->normalizeIdentifier($name); + + return isset($this->_columns[$name]); + } + + /** + * Returns the Column with the given name. + * + * @param string $name The column name. + * + * @return Column + * + * @throws SchemaException If the column does not exist. + */ + public function getColumn($name) + { + $name = $this->normalizeIdentifier($name); + + if (! $this->hasColumn($name)) { + throw SchemaException::columnDoesNotExist($name, $this->_name); + } + + return $this->_columns[$name]; + } + + /** + * Returns the primary key. + * + * @return Index|null The primary key, or null if this Table has no primary key. + */ + public function getPrimaryKey() + { + if ($this->_primaryKeyName !== null) { + return $this->getIndex($this->_primaryKeyName); + } + + return null; + } + + /** + * Returns the primary key columns. + * + * @return Column[] + * + * @throws Exception + */ + public function getPrimaryKeyColumns() + { + $primaryKey = $this->getPrimaryKey(); + + if ($primaryKey === null) { + throw new Exception('Table ' . $this->getName() . ' has no primary key.'); + } + + return $this->filterColumns($primaryKey->getColumns()); + } + + /** + * Returns whether this table has a primary key. + * + * @return bool + */ + public function hasPrimaryKey() + { + return $this->_primaryKeyName !== null && $this->hasIndex($this->_primaryKeyName); + } + + /** + * Returns whether this table has an Index with the given name. + * + * @param string $name The index name. + * + * @return bool + */ + public function hasIndex($name) + { + $name = $this->normalizeIdentifier($name); + + return isset($this->_indexes[$name]); + } + + /** + * Returns the Index with the given name. + * + * @param string $name The index name. + * + * @return Index + * + * @throws SchemaException If the index does not exist. + */ + public function getIndex($name) + { + $name = $this->normalizeIdentifier($name); + if (! $this->hasIndex($name)) { + throw SchemaException::indexDoesNotExist($name, $this->_name); + } + + return $this->_indexes[$name]; + } + + /** + * @return Index[] + */ + public function getIndexes() + { + return $this->_indexes; + } + + /** + * Returns the unique constraints. + * + * @return UniqueConstraint[] + */ + public function getUniqueConstraints(): array + { + return $this->uniqueConstraints; + } + + /** + * Returns the foreign key constraints. + * + * @return ForeignKeyConstraint[] + */ + public function getForeignKeys() + { + return $this->_fkConstraints; + } + + /** + * @param string $name + * + * @return bool + */ + public function hasOption($name) + { + return isset($this->_options[$name]); + } + + /** + * @param string $name + * + * @return mixed + */ + public function getOption($name) + { + return $this->_options[$name]; + } + + /** + * @return mixed[] + */ + public function getOptions() + { + return $this->_options; + } + + /** + * @return void + * + * @throws SchemaException + */ + public function visit(Visitor $visitor) + { + $visitor->acceptTable($this); + + foreach ($this->getColumns() as $column) { + $visitor->acceptColumn($this, $column); + } + + foreach ($this->getIndexes() as $index) { + $visitor->acceptIndex($this, $index); + } + + foreach ($this->getForeignKeys() as $constraint) { + $visitor->acceptForeignKey($this, $constraint); + } + } + + /** + * Clone of a Table triggers a deep clone of all affected assets. + * + * @return void + */ + public function __clone() + { + foreach ($this->_columns as $k => $column) { + $this->_columns[$k] = clone $column; + } + + foreach ($this->_indexes as $k => $index) { + $this->_indexes[$k] = clone $index; + } + + foreach ($this->_fkConstraints as $k => $fk) { + $this->_fkConstraints[$k] = clone $fk; + $this->_fkConstraints[$k]->setLocalTable($this); + } + } + + /** + * @param string[] $columnNames + * @param string[] $flags + * @param mixed[] $options + * + * @throws SchemaException + */ + private function _createUniqueConstraint( + array $columnNames, + string $indexName, + array $flags = [], + array $options = [] + ): UniqueConstraint { + if (preg_match('(([^a-zA-Z0-9_]+))', $this->normalizeIdentifier($indexName)) === 1) { + throw SchemaException::indexNameInvalid($indexName); + } + + foreach ($columnNames as $columnName) { + if (! $this->hasColumn($columnName)) { + throw SchemaException::columnDoesNotExist($columnName, $this->_name); + } + } + + return new UniqueConstraint($indexName, $columnNames, $flags, $options); + } + + /** + * Normalizes a given identifier. + * + * Trims quotes and lowercases the given identifier. + * + * @return string The normalized identifier. + */ + private function normalizeIdentifier(?string $identifier): string + { + if ($identifier === null) { + return ''; + } + + return $this->trimQuotes(strtolower($identifier)); + } + + public function setComment(?string $comment): self + { + // For keeping backward compatibility with MySQL in previous releases, table comments are stored as options. + $this->addOption('comment', $comment); + + return $this; + } + + public function getComment(): ?string + { + return $this->_options['comment'] ?? null; + } +} diff --git a/app/vendor/doctrine/dbal/src/Schema/TableDiff.php b/app/vendor/doctrine/dbal/src/Schema/TableDiff.php new file mode 100644 index 000000000..82c912f71 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Schema/TableDiff.php @@ -0,0 +1,152 @@ +name = $tableName; + $this->addedColumns = $addedColumns; + $this->changedColumns = $changedColumns; + $this->removedColumns = $removedColumns; + $this->addedIndexes = $addedIndexes; + $this->changedIndexes = $changedIndexes; + $this->removedIndexes = $removedIndexes; + $this->fromTable = $fromTable; + } + + /** + * @param AbstractPlatform $platform The platform to use for retrieving this table diff's name. + * + * @return Identifier + */ + public function getName(AbstractPlatform $platform) + { + return new Identifier( + $this->fromTable instanceof Table ? $this->fromTable->getQuotedName($platform) : $this->name + ); + } + + /** + * @return Identifier|false + */ + public function getNewName() + { + if ($this->newName === false) { + return false; + } + + return new Identifier($this->newName); + } +} diff --git a/app/vendor/doctrine/dbal/src/Schema/UniqueConstraint.php b/app/vendor/doctrine/dbal/src/Schema/UniqueConstraint.php new file mode 100644 index 000000000..cb91becb2 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Schema/UniqueConstraint.php @@ -0,0 +1,160 @@ + Identifier) + * + * @var Identifier[] + */ + protected $columns = []; + + /** + * Platform specific flags. + * array($flagName => true) + * + * @var true[] + */ + protected $flags = []; + + /** + * Platform specific options. + * + * @var mixed[] + */ + private $options; + + /** + * @param string[] $columns + * @param string[] $flags + * @param mixed[] $options + */ + public function __construct(string $name, array $columns, array $flags = [], array $options = []) + { + $this->_setName($name); + + $this->options = $options; + + foreach ($columns as $column) { + $this->addColumn($column); + } + + foreach ($flags as $flag) { + $this->addFlag($flag); + } + } + + /** + * {@inheritdoc} + */ + public function getColumns() + { + return array_keys($this->columns); + } + + /** + * {@inheritdoc} + */ + public function getQuotedColumns(AbstractPlatform $platform) + { + $columns = []; + + foreach ($this->columns as $column) { + $columns[] = $column->getQuotedName($platform); + } + + return $columns; + } + + /** + * @return string[] + */ + public function getUnquotedColumns(): array + { + return array_map([$this, 'trimQuotes'], $this->getColumns()); + } + + /** + * Returns platform specific flags for unique constraint. + * + * @return string[] + */ + public function getFlags(): array + { + return array_keys($this->flags); + } + + /** + * Adds flag for a unique constraint that translates to platform specific handling. + * + * @return $this + * + * @example $uniqueConstraint->addFlag('CLUSTERED') + */ + public function addFlag(string $flag): UniqueConstraint + { + $this->flags[strtolower($flag)] = true; + + return $this; + } + + /** + * Does this unique constraint have a specific flag? + */ + public function hasFlag(string $flag): bool + { + return isset($this->flags[strtolower($flag)]); + } + + /** + * Removes a flag. + */ + public function removeFlag(string $flag): void + { + unset($this->flags[strtolower($flag)]); + } + + /** + * Does this unique constraint have a specific option? + */ + public function hasOption(string $name): bool + { + return isset($this->options[strtolower($name)]); + } + + /** + * @return mixed + */ + public function getOption(string $name) + { + return $this->options[strtolower($name)]; + } + + /** + * @return mixed[] + */ + public function getOptions(): array + { + return $this->options; + } + + /** + * Adds a new column to the unique constraint. + */ + protected function addColumn(string $column): void + { + $this->columns[$column] = new Identifier($column); + } +} diff --git a/app/vendor/doctrine/dbal/src/Schema/View.php b/app/vendor/doctrine/dbal/src/Schema/View.php new file mode 100644 index 000000000..ac8d6cb5c --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Schema/View.php @@ -0,0 +1,30 @@ +_setName($name); + $this->sql = $sql; + } + + /** + * @return string + */ + public function getSql() + { + return $this->sql; + } +} diff --git a/app/vendor/doctrine/dbal/src/Schema/Visitor/AbstractVisitor.php b/app/vendor/doctrine/dbal/src/Schema/Visitor/AbstractVisitor.php new file mode 100644 index 000000000..471690442 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Schema/Visitor/AbstractVisitor.php @@ -0,0 +1,47 @@ +platform = $platform; + } + + /** + * {@inheritdoc} + */ + public function acceptNamespace($namespaceName) + { + if (! $this->platform->supportsSchemas()) { + return; + } + + $this->createNamespaceQueries[] = $this->platform->getCreateSchemaSQL($namespaceName); + } + + /** + * {@inheritdoc} + */ + public function acceptTable(Table $table) + { + $this->createTableQueries = array_merge($this->createTableQueries, $this->platform->getCreateTableSQL($table)); + } + + /** + * {@inheritdoc} + */ + public function acceptForeignKey(Table $localTable, ForeignKeyConstraint $fkConstraint) + { + if (! $this->platform->supportsForeignKeyConstraints()) { + return; + } + + $this->createFkConstraintQueries[] = $this->platform->getCreateForeignKeySQL($fkConstraint, $localTable); + } + + /** + * {@inheritdoc} + */ + public function acceptSequence(Sequence $sequence) + { + $this->createSequenceQueries[] = $this->platform->getCreateSequenceSQL($sequence); + } + + /** + * @return void + */ + public function resetQueries() + { + $this->createNamespaceQueries = []; + $this->createTableQueries = []; + $this->createSequenceQueries = []; + $this->createFkConstraintQueries = []; + } + + /** + * Gets all queries collected so far. + * + * @return string[] + */ + public function getQueries() + { + return array_merge( + $this->createNamespaceQueries, + $this->createTableQueries, + $this->createSequenceQueries, + $this->createFkConstraintQueries + ); + } +} diff --git a/app/vendor/doctrine/dbal/src/Schema/Visitor/DropSchemaSqlCollector.php b/app/vendor/doctrine/dbal/src/Schema/Visitor/DropSchemaSqlCollector.php new file mode 100644 index 000000000..1b77268b4 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Schema/Visitor/DropSchemaSqlCollector.php @@ -0,0 +1,106 @@ +platform = $platform; + $this->initializeQueries(); + } + + /** + * {@inheritdoc} + */ + public function acceptTable(Table $table) + { + $this->tables->attach($table); + } + + /** + * {@inheritdoc} + */ + public function acceptForeignKey(Table $localTable, ForeignKeyConstraint $fkConstraint) + { + if (strlen($fkConstraint->getName()) === 0) { + throw SchemaException::namedForeignKeyRequired($localTable, $fkConstraint); + } + + $this->constraints->attach($fkConstraint, $localTable); + } + + /** + * {@inheritdoc} + */ + public function acceptSequence(Sequence $sequence) + { + $this->sequences->attach($sequence); + } + + /** + * @return void + */ + public function clearQueries() + { + $this->initializeQueries(); + } + + /** + * @return string[] + */ + public function getQueries() + { + $sql = []; + + foreach ($this->constraints as $fkConstraint) { + assert($fkConstraint instanceof ForeignKeyConstraint); + $localTable = $this->constraints[$fkConstraint]; + $sql[] = $this->platform->getDropForeignKeySQL($fkConstraint, $localTable); + } + + foreach ($this->sequences as $sequence) { + assert($sequence instanceof Sequence); + $sql[] = $this->platform->getDropSequenceSQL($sequence); + } + + foreach ($this->tables as $table) { + assert($table instanceof Table); + $sql[] = $this->platform->getDropTableSQL($table); + } + + return $sql; + } + + private function initializeQueries(): void + { + $this->constraints = new SplObjectStorage(); + $this->sequences = new SplObjectStorage(); + $this->tables = new SplObjectStorage(); + } +} diff --git a/app/vendor/doctrine/dbal/src/Schema/Visitor/Graphviz.php b/app/vendor/doctrine/dbal/src/Schema/Visitor/Graphviz.php new file mode 100644 index 000000000..299ff0e7f --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Schema/Visitor/Graphviz.php @@ -0,0 +1,170 @@ +output .= $this->createNodeRelation( + $fkConstraint->getLocalTableName() . ':col' . current($fkConstraint->getLocalColumns()) . ':se', + $fkConstraint->getForeignTableName() . ':col' . current($fkConstraint->getForeignColumns()) . ':se', + [ + 'dir' => 'back', + 'arrowtail' => 'dot', + 'arrowhead' => 'normal', + ] + ); + } + + /** + * {@inheritdoc} + */ + public function acceptSchema(Schema $schema) + { + $this->output = 'digraph "' . $schema->getName() . '" {' . "\n"; + $this->output .= 'splines = true;' . "\n"; + $this->output .= 'overlap = false;' . "\n"; + $this->output .= 'outputorder=edgesfirst;' . "\n"; + $this->output .= 'mindist = 0.6;' . "\n"; + $this->output .= 'sep = .2;' . "\n"; + } + + /** + * {@inheritdoc} + */ + public function acceptTable(Table $table) + { + $this->output .= $this->createNode( + $table->getName(), + [ + 'label' => $this->createTableLabel($table), + 'shape' => 'plaintext', + ] + ); + } + + /** + * @return string + */ + private function createTableLabel(Table $table) + { + // Start the table + $label = '<'; + + // The title + $label .= ''; + + // The attributes block + foreach ($table->getColumns() as $column) { + $columnLabel = $column->getName(); + + $label .= '' + . '' + . '' + . ''; + } + + // End the table + $label .= '
' + . '' . $table->getName() . '
' + . '' . $columnLabel . '' + . '' + . '' + . strtolower($column->getType()->getName()) + . '' + . ''; + + $primaryKey = $table->getPrimaryKey(); + + if ($primaryKey !== null && in_array($column->getName(), $primaryKey->getColumns(), true)) { + $label .= "\xe2\x9c\xb7"; + } + + $label .= '
>'; + + return $label; + } + + /** + * @param string $name + * @param string[] $options + * + * @return string + */ + private function createNode($name, $options) + { + $node = $name . ' ['; + foreach ($options as $key => $value) { + $node .= $key . '=' . $value . ' '; + } + + $node .= "]\n"; + + return $node; + } + + /** + * @param string $node1 + * @param string $node2 + * @param string[] $options + * + * @return string + */ + private function createNodeRelation($node1, $node2, $options) + { + $relation = $node1 . ' -> ' . $node2 . ' ['; + foreach ($options as $key => $value) { + $relation .= $key . '=' . $value . ' '; + } + + $relation .= "]\n"; + + return $relation; + } + + /** + * Get Graphviz Output + * + * @return string + */ + public function getOutput() + { + return $this->output . '}'; + } + + /** + * Writes dot language output to a file. This should usually be a *.dot file. + * + * You have to convert the output into a viewable format. For example use "neato" on linux systems + * and execute: + * + * neato -Tpng -o er.png er.dot + * + * @param string $filename + * + * @return void + */ + public function write($filename) + { + file_put_contents($filename, $this->getOutput()); + } +} diff --git a/app/vendor/doctrine/dbal/src/Schema/Visitor/NamespaceVisitor.php b/app/vendor/doctrine/dbal/src/Schema/Visitor/NamespaceVisitor.php new file mode 100644 index 000000000..b0548d606 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Schema/Visitor/NamespaceVisitor.php @@ -0,0 +1,18 @@ +schema = $schema; + } + + /** + * {@inheritdoc} + */ + public function acceptTable(Table $table) + { + if ($this->schema === null) { + return; + } + + if ($table->isInDefaultNamespace($this->schema->getName())) { + return; + } + + $this->schema->dropTable($table->getName()); + } + + /** + * {@inheritdoc} + */ + public function acceptSequence(Sequence $sequence) + { + if ($this->schema === null) { + return; + } + + if ($sequence->isInDefaultNamespace($this->schema->getName())) { + return; + } + + $this->schema->dropSequence($sequence->getName()); + } + + /** + * {@inheritdoc} + */ + public function acceptForeignKey(Table $localTable, ForeignKeyConstraint $fkConstraint) + { + if ($this->schema === null) { + return; + } + + // The table may already be deleted in a previous + // RemoveNamespacedAssets#acceptTable call. Removing Foreign keys that + // point to nowhere. + if (! $this->schema->hasTable($fkConstraint->getForeignTableName())) { + $localTable->removeForeignKey($fkConstraint->getName()); + + return; + } + + $foreignTable = $this->schema->getTable($fkConstraint->getForeignTableName()); + if ($foreignTable->isInDefaultNamespace($this->schema->getName())) { + return; + } + + $localTable->removeForeignKey($fkConstraint->getName()); + } +} diff --git a/app/vendor/doctrine/dbal/src/Schema/Visitor/SchemaDiffVisitor.php b/app/vendor/doctrine/dbal/src/Schema/Visitor/SchemaDiffVisitor.php new file mode 100644 index 000000000..040b59f55 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Schema/Visitor/SchemaDiffVisitor.php @@ -0,0 +1,50 @@ +Statement for the given SQL and Connection. + * + * @internal The statement can be only instantiated by {@link Connection}. + * + * @param string $sql The SQL of the statement. + * @param Connection $conn The connection on which the statement should be executed. + * + * @throws Exception + */ + public function __construct($sql, Connection $conn) + { + $driverConnection = $conn->getWrappedConnection(); + + try { + $stmt = $driverConnection->prepare($sql); + } catch (Exception $ex) { + throw $conn->convertExceptionDuringQuery($ex, $sql); + } + + $this->sql = $sql; + $this->stmt = $stmt; + $this->conn = $conn; + $this->platform = $conn->getDatabasePlatform(); + } + + /** + * Binds a parameter value to the statement. + * + * The value can optionally be bound with a DBAL mapping type. + * If bound with a DBAL mapping type, the binding type is derived from the mapping + * type and the value undergoes the conversion routines of the mapping type before + * being bound. + * + * @param string|int $param The name or position of the parameter. + * @param mixed $value The value of the parameter. + * @param mixed $type Either a PDO binding type or a DBAL mapping type name or instance. + * + * @return bool TRUE on success, FALSE on failure. + * + * @throws Exception + */ + public function bindValue($param, $value, $type = ParameterType::STRING) + { + $this->params[$param] = $value; + $this->types[$param] = $type; + + $bindingType = ParameterType::STRING; + + if ($type !== null) { + if (is_string($type)) { + $type = Type::getType($type); + } + + $bindingType = $type; + + if ($type instanceof Type) { + $value = $type->convertToDatabaseValue($value, $this->platform); + $bindingType = $type->getBindingType(); + } + } + + try { + return $this->stmt->bindValue($param, $value, $bindingType); + } catch (Exception $e) { + throw $this->conn->convertException($e); + } + } + + /** + * Binds a parameter to a value by reference. + * + * Binding a parameter by reference does not support DBAL mapping types. + * + * @param string|int $param The name or position of the parameter. + * @param mixed $variable The reference to the variable to bind. + * @param int $type The binding type. + * @param int|null $length Must be specified when using an OUT bind + * so that PHP allocates enough memory to hold the returned value. + * + * @return bool TRUE on success, FALSE on failure. + * + * @throws Exception + */ + public function bindParam($param, &$variable, $type = ParameterType::STRING, $length = null) + { + $this->params[$param] = $variable; + $this->types[$param] = $type; + + try { + if (func_num_args() > 3) { + return $this->stmt->bindParam($param, $variable, $type, $length); + } + + return $this->stmt->bindParam($param, $variable, $type); + } catch (Exception $e) { + throw $this->conn->convertException($e); + } + } + + /** + * Executes the statement with the currently bound parameters. + * + * @deprecated Statement::execute() is deprecated, use Statement::executeQuery() or executeStatement() instead + * + * @param mixed[]|null $params + * + * @throws Exception + */ + public function execute($params = null): Result + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/4580', + 'Statement::execute() is deprecated, use Statement::executeQuery() or Statement::executeStatement() instead' + ); + + if ($params !== null) { + $this->params = $params; + } + + $logger = $this->conn->getConfiguration()->getSQLLogger(); + if ($logger !== null) { + $logger->startQuery($this->sql, $this->params, $this->types); + } + + try { + return new Result( + $this->stmt->execute($params), + $this->conn + ); + } catch (Exception $ex) { + throw $this->conn->convertExceptionDuringQuery($ex, $this->sql, $this->params, $this->types); + } finally { + if ($logger !== null) { + $logger->stopQuery(); + } + } + } + + /** + * Executes the statement with the currently bound parameters and return result. + * + * @param mixed[] $params + * + * @throws Exception + */ + public function executeQuery(array $params = []): Result + { + if ($params === []) { + $params = null; // Workaround as long execute() exists and used internally. + } + + return $this->execute($params); + } + + /** + * Executes the statement with the currently bound parameters and return affected rows. + * + * @param mixed[] $params + * + * @throws Exception + */ + public function executeStatement(array $params = []): int + { + if ($params === []) { + $params = null; // Workaround as long execute() exists and used internally. + } + + return $this->execute($params)->rowCount(); + } + + /** + * Gets the wrapped driver statement. + * + * @return DriverStatement + */ + public function getWrappedStatement() + { + return $this->stmt; + } +} diff --git a/app/vendor/doctrine/dbal/src/Tools/Console/Command/ReservedWordsCommand.php b/app/vendor/doctrine/dbal/src/Tools/Console/Command/ReservedWordsCommand.php new file mode 100644 index 000000000..8cff50f95 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Tools/Console/Command/ReservedWordsCommand.php @@ -0,0 +1,206 @@ + */ + private $keywordLists; + + /** @var ConnectionProvider */ + private $connectionProvider; + + public function __construct(ConnectionProvider $connectionProvider) + { + parent::__construct(); + $this->connectionProvider = $connectionProvider; + + $this->keywordLists = [ + 'db2' => new DB2Keywords(), + 'mariadb102' => new MariaDb102Keywords(), + 'mysql' => new MySQLKeywords(), + 'mysql57' => new MySQL57Keywords(), + 'mysql80' => new MySQL80Keywords(), + 'oracle' => new OracleKeywords(), + 'pgsql' => new PostgreSQL94Keywords(), + 'pgsql100' => new PostgreSQL100Keywords(), + 'sqlite' => new SQLiteKeywords(), + 'sqlserver' => new SQLServer2012Keywords(), + ]; + } + + /** + * Add or replace a keyword list. + */ + public function setKeywordList(string $name, KeywordList $keywordList): void + { + $this->keywordLists[$name] = $keywordList; + } + + /** + * If you want to add or replace a keywords list use this command. + * + * @param string $name + * @param class-string $class + * + * @return void + */ + public function setKeywordListClass($name, $class) + { + Deprecation::trigger( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/issues/4510', + 'ReservedWordsCommand::setKeywordListClass() is deprecated,' + . ' use ReservedWordsCommand::setKeywordList() instead.' + ); + + $this->keywordLists[$name] = new $class(); + } + + /** @return void */ + protected function configure() + { + $this + ->setName('dbal:reserved-words') + ->setDescription('Checks if the current database contains identifiers that are reserved.') + ->setDefinition([ + new InputOption('connection', null, InputOption::VALUE_REQUIRED, 'The named database connection'), + new InputOption( + 'list', + 'l', + InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, + 'Keyword-List name.' + ), + ]) + ->setHelp(<<%command.full_name% + +If you want to check against specific dialects you can +pass them to the command: + + %command.full_name% -l mysql -l pgsql + +The following keyword lists are currently shipped with Doctrine: + + * db2 + * mariadb102 + * mysql + * mysql57 + * mysql80 + * oracle + * pgsql + * pgsql100 + * sqlite + * sqlserver +EOT + ); + } + + /** + * {@inheritdoc} + * + * @throws Exception + */ + protected function execute(InputInterface $input, OutputInterface $output) + { + $conn = $this->getConnection($input); + + $keywordLists = $input->getOption('list'); + + if (is_string($keywordLists)) { + $keywordLists = [$keywordLists]; + } elseif (! is_array($keywordLists)) { + $keywordLists = []; + } + + if (count($keywordLists) === 0) { + $keywordLists = array_keys($this->keywordLists); + } + + $keywords = []; + foreach ($keywordLists as $keywordList) { + if (! isset($this->keywordLists[$keywordList])) { + throw new InvalidArgumentException( + "There exists no keyword list with name '" . $keywordList . "'. " . + 'Known lists: ' . implode(', ', array_keys($this->keywordLists)) + ); + } + + $keywords[] = $this->keywordLists[$keywordList]; + } + + $output->write( + 'Checking keyword violations for ' . implode(', ', $keywordLists) . '...', + true + ); + + $schema = $conn->getSchemaManager()->createSchema(); + $visitor = new ReservedKeywordsValidator($keywords); + $schema->visit($visitor); + + $violations = $visitor->getViolations(); + if (count($violations) !== 0) { + $output->write( + 'There are ' . count($violations) . ' reserved keyword violations' + . ' in your database schema:', + true + ); + + foreach ($violations as $violation) { + $output->write(' - ' . $violation, true); + } + + return 1; + } + + $output->write('No reserved keywords violations have been found!', true); + + return 0; + } + + private function getConnection(InputInterface $input): Connection + { + $connectionName = $input->getOption('connection'); + assert(is_string($connectionName) || $connectionName === null); + + if ($connectionName !== null) { + return $this->connectionProvider->getConnection($connectionName); + } + + return $this->connectionProvider->getDefaultConnection(); + } +} diff --git a/app/vendor/doctrine/dbal/src/Tools/Console/Command/RunSqlCommand.php b/app/vendor/doctrine/dbal/src/Tools/Console/Command/RunSqlCommand.php new file mode 100644 index 000000000..4ccb32605 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Tools/Console/Command/RunSqlCommand.php @@ -0,0 +1,107 @@ +connectionProvider = $connectionProvider; + } + + /** @return void */ + protected function configure() + { + $this + ->setName('dbal:run-sql') + ->setDescription('Executes arbitrary SQL directly from the command line.') + ->setDefinition([ + new InputOption('connection', null, InputOption::VALUE_REQUIRED, 'The named database connection'), + new InputArgument('sql', InputArgument::REQUIRED, 'The SQL statement to execute.'), + new InputOption('depth', null, InputOption::VALUE_REQUIRED, 'Dumping depth of result set.', '7'), + new InputOption('force-fetch', null, InputOption::VALUE_NONE, 'Forces fetching the result.'), + ]) + ->setHelp(<<%command.name% command executes the given SQL query and +outputs the results: + +php %command.full_name% "SELECT * FROM users" +EOT + ); + } + + /** + * {@inheritdoc} + * + * @throws Exception + */ + protected function execute(InputInterface $input, OutputInterface $output) + { + $conn = $this->getConnection($input); + + $sql = $input->getArgument('sql'); + + if ($sql === null) { + throw new RuntimeException("Argument 'SQL' is required in order to execute this command correctly."); + } + + assert(is_string($sql)); + + $depth = $input->getOption('depth'); + + if (! is_numeric($depth)) { + throw new LogicException("Option 'depth' must contains an integer value"); + } + + $forceFetch = $input->getOption('force-fetch'); + assert(is_bool($forceFetch)); + + if (stripos($sql, 'select') === 0 || $forceFetch) { + $resultSet = $conn->fetchAllAssociative($sql); + } else { + $resultSet = $conn->executeStatement($sql); + } + + $output->write(Dumper::dump($resultSet, (int) $depth)); + + return 0; + } + + private function getConnection(InputInterface $input): Connection + { + $connectionName = $input->getOption('connection'); + assert(is_string($connectionName) || $connectionName === null); + + if ($connectionName !== null) { + return $this->connectionProvider->getConnection($connectionName); + } + + return $this->connectionProvider->getDefaultConnection(); + } +} diff --git a/app/vendor/doctrine/dbal/src/Tools/Console/ConnectionNotFound.php b/app/vendor/doctrine/dbal/src/Tools/Console/ConnectionNotFound.php new file mode 100644 index 000000000..81ca4182a --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Tools/Console/ConnectionNotFound.php @@ -0,0 +1,9 @@ +connection = $connection; + $this->defaultConnectionName = $defaultConnectionName; + } + + public function getDefaultConnection(): Connection + { + return $this->connection; + } + + public function getConnection(string $name): Connection + { + if ($name !== $this->defaultConnectionName) { + throw new ConnectionNotFound(sprintf('Connection with name "%s" does not exist.', $name)); + } + + return $this->connection; + } +} diff --git a/app/vendor/doctrine/dbal/src/Tools/Console/ConsoleRunner.php b/app/vendor/doctrine/dbal/src/Tools/Console/ConsoleRunner.php new file mode 100644 index 000000000..1cc315dee --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Tools/Console/ConsoleRunner.php @@ -0,0 +1,74 @@ +setCatchExceptions(true); + self::addCommands($cli, $connectionProvider); + $cli->addCommands($commands); + $cli->run(); + } + + /** + * @return void + */ + public static function addCommands(Application $cli, ConnectionProvider $connectionProvider) + { + $cli->addCommands([ + new RunSqlCommand($connectionProvider), + new ReservedWordsCommand($connectionProvider), + ]); + } + + /** + * Prints the instructions to create a configuration file + * + * @return void + */ + public static function printCliConfigTemplate() + { + echo <<<'HELP' +You are missing a "cli-config.php" or "config/cli-config.php" file in your +project, which is required to get the Doctrine-DBAL Console working. You can use the +following sample as a template: + +toArray(); + } + + if ($maxDepth === 0) { + return is_object($var) ? get_class($var) + : (is_array($var) ? 'Array(' . count($var) . ')' : $var); + } + + if (is_array($var)) { + $return = []; + + foreach ($var as $k => $v) { + $return[$k] = self::export($v, $maxDepth - 1); + } + + return $return; + } + + if (! $isObj) { + return $var; + } + + $return = new stdClass(); + if ($var instanceof DateTimeInterface) { + $return->__CLASS__ = get_class($var); + $return->date = $var->format('c'); + $return->timezone = $var->getTimezone()->getName(); + + return $return; + } + + $return->__CLASS__ = self::getClass($var); + + if ($var instanceof Proxy) { + $return->__IS_PROXY__ = true; + $return->__PROXY_INITIALIZED__ = $var->__isInitialized(); + } + + if ($var instanceof ArrayObject || $var instanceof ArrayIterator) { + $return->__STORAGE__ = self::export($var->getArrayCopy(), $maxDepth - 1); + } + + return self::fillReturnWithClassAttributes($var, $return, $maxDepth); + } + + /** + * Fill the $return variable with class attributes + * Based on obj2array function from {@see https://secure.php.net/manual/en/function.get-object-vars.php#47075} + * + * @param object $var + * + * @return mixed + */ + private static function fillReturnWithClassAttributes($var, stdClass $return, int $maxDepth) + { + $clone = (array) $var; + + foreach (array_keys($clone) as $key) { + $aux = explode("\0", $key); + $name = end($aux); + if ($aux[0] === '') { + $name .= ':' . ($aux[1] === '*' ? 'protected' : $aux[1] . ':private'); + } + + $return->$name = self::export($clone[$key], $maxDepth - 1); + } + + return $return; + } + + /** + * @param object $object + */ + private static function getClass($object): string + { + $class = get_class($object); + + if (! class_exists(Proxy::class)) { + return $class; + } + + $pos = strrpos($class, '\\' . Proxy::MARKER . '\\'); + + if ($pos === false) { + return $class; + } + + return substr($class, $pos + strlen(Proxy::MARKER) + 2); + } +} diff --git a/app/vendor/doctrine/dbal/src/TransactionIsolationLevel.php b/app/vendor/doctrine/dbal/src/TransactionIsolationLevel.php new file mode 100644 index 000000000..e8dc5d918 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/TransactionIsolationLevel.php @@ -0,0 +1,35 @@ +getClobTypeDeclarationSQL($column); + } + + /** + * {@inheritdoc} + */ + public function convertToDatabaseValue($value, AbstractPlatform $platform) + { + // @todo 3.0 - $value === null check to save real NULL in database + return serialize($value); + } + + /** + * {@inheritdoc} + */ + public function convertToPHPValue($value, AbstractPlatform $platform) + { + if ($value === null) { + return null; + } + + $value = is_resource($value) ? stream_get_contents($value) : $value; + + set_error_handler(function (int $code, string $message): bool { + throw ConversionException::conversionFailedUnserialization($this->getName(), $message); + }); + + try { + return unserialize($value); + } finally { + restore_error_handler(); + } + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return Types::ARRAY; + } + + /** + * {@inheritdoc} + */ + public function requiresSQLCommentHint(AbstractPlatform $platform) + { + return true; + } +} diff --git a/app/vendor/doctrine/dbal/src/Types/AsciiStringType.php b/app/vendor/doctrine/dbal/src/Types/AsciiStringType.php new file mode 100644 index 000000000..e79757486 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Types/AsciiStringType.php @@ -0,0 +1,32 @@ +getAsciiStringTypeDeclarationSQL($column); + } + + /** + * {@inheritdoc} + */ + public function getBindingType() + { + return ParameterType::ASCII; + } + + public function getName(): string + { + return Types::ASCII_STRING; + } +} diff --git a/app/vendor/doctrine/dbal/src/Types/BigIntType.php b/app/vendor/doctrine/dbal/src/Types/BigIntType.php new file mode 100644 index 000000000..e5d6dcbbf --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Types/BigIntType.php @@ -0,0 +1,44 @@ +getBigIntTypeDeclarationSQL($column); + } + + /** + * {@inheritdoc} + */ + public function getBindingType() + { + return ParameterType::STRING; + } + + /** + * {@inheritdoc} + */ + public function convertToPHPValue($value, AbstractPlatform $platform) + { + return $value === null ? null : (string) $value; + } +} diff --git a/app/vendor/doctrine/dbal/src/Types/BinaryType.php b/app/vendor/doctrine/dbal/src/Types/BinaryType.php new file mode 100644 index 000000000..e030f1660 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Types/BinaryType.php @@ -0,0 +1,67 @@ +getBinaryTypeDeclarationSQL($column); + } + + /** + * {@inheritdoc} + */ + public function convertToPHPValue($value, AbstractPlatform $platform) + { + if ($value === null) { + return null; + } + + if (is_string($value)) { + $fp = fopen('php://temp', 'rb+'); + assert(is_resource($fp)); + fwrite($fp, $value); + fseek($fp, 0); + $value = $fp; + } + + if (! is_resource($value)) { + throw ConversionException::conversionFailed($value, Types::BINARY); + } + + return $value; + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return Types::BINARY; + } + + /** + * {@inheritdoc} + */ + public function getBindingType() + { + return ParameterType::BINARY; + } +} diff --git a/app/vendor/doctrine/dbal/src/Types/BlobType.php b/app/vendor/doctrine/dbal/src/Types/BlobType.php new file mode 100644 index 000000000..b71e7255e --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Types/BlobType.php @@ -0,0 +1,67 @@ +getBlobTypeDeclarationSQL($column); + } + + /** + * {@inheritdoc} + */ + public function convertToPHPValue($value, AbstractPlatform $platform) + { + if ($value === null) { + return null; + } + + if (is_string($value)) { + $fp = fopen('php://temp', 'rb+'); + assert(is_resource($fp)); + fwrite($fp, $value); + fseek($fp, 0); + $value = $fp; + } + + if (! is_resource($value)) { + throw ConversionException::conversionFailed($value, Types::BLOB); + } + + return $value; + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return Types::BLOB; + } + + /** + * {@inheritdoc} + */ + public function getBindingType() + { + return ParameterType::LARGE_OBJECT; + } +} diff --git a/app/vendor/doctrine/dbal/src/Types/BooleanType.php b/app/vendor/doctrine/dbal/src/Types/BooleanType.php new file mode 100644 index 000000000..f6e4df3b2 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Types/BooleanType.php @@ -0,0 +1,52 @@ +getBooleanTypeDeclarationSQL($column); + } + + /** + * {@inheritdoc} + */ + public function convertToDatabaseValue($value, AbstractPlatform $platform) + { + return $platform->convertBooleansToDatabaseValue($value); + } + + /** + * {@inheritdoc} + */ + public function convertToPHPValue($value, AbstractPlatform $platform) + { + return $platform->convertFromBoolean($value); + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return Types::BOOLEAN; + } + + /** + * {@inheritdoc} + */ + public function getBindingType() + { + return ParameterType::BOOLEAN; + } +} diff --git a/app/vendor/doctrine/dbal/src/Types/ConversionException.php b/app/vendor/doctrine/dbal/src/Types/ConversionException.php new file mode 100644 index 000000000..f1a18742e --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Types/ConversionException.php @@ -0,0 +1,121 @@ + 32 ? substr($value, 0, 20) . '...' : $value; + + return new self('Could not convert database value "' . $value . '" to Doctrine Type ' . $toType, 0, $previous); + } + + /** + * Thrown when a Database to Doctrine Type Conversion fails and we can make a statement + * about the expected format. + * + * @param string $value + * @param string $toType + * @param string $expectedFormat + * + * @return ConversionException + */ + public static function conversionFailedFormat($value, $toType, $expectedFormat, ?Throwable $previous = null) + { + $value = strlen($value) > 32 ? substr($value, 0, 20) . '...' : $value; + + return new self( + 'Could not convert database value "' . $value . '" to Doctrine Type ' . + $toType . '. Expected format: ' . $expectedFormat, + 0, + $previous + ); + } + + /** + * Thrown when the PHP value passed to the converter was not of the expected type. + * + * @param mixed $value + * @param string $toType + * @param string[] $possibleTypes + * + * @return ConversionException + */ + public static function conversionFailedInvalidType( + $value, + $toType, + array $possibleTypes, + ?Throwable $previous = null + ) { + if (is_scalar($value) || $value === null) { + return new self(sprintf( + 'Could not convert PHP value %s to type %s. Expected one of the following types: %s', + var_export($value, true), + $toType, + implode(', ', $possibleTypes) + ), 0, $previous); + } + + return new self(sprintf( + 'Could not convert PHP value of type %s to type %s. Expected one of the following types: %s', + is_object($value) ? get_class($value) : gettype($value), + $toType, + implode(', ', $possibleTypes) + ), 0, $previous); + } + + /** + * @param mixed $value + * @param string $format + * @param string $error + * + * @return ConversionException + */ + public static function conversionFailedSerialization($value, $format, $error) + { + $actualType = is_object($value) ? get_class($value) : gettype($value); + + return new self(sprintf( + "Could not convert PHP type '%s' to '%s', as an '%s' error was triggered by the serialization", + $actualType, + $format, + $error + )); + } + + public static function conversionFailedUnserialization(string $format, string $error): self + { + return new self(sprintf( + "Could not convert database value to '%s' as an error was triggered by the unserialization: '%s'", + $format, + $error + )); + } +} diff --git a/app/vendor/doctrine/dbal/src/Types/DateImmutableType.php b/app/vendor/doctrine/dbal/src/Types/DateImmutableType.php new file mode 100644 index 000000000..4fbe6a472 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Types/DateImmutableType.php @@ -0,0 +1,70 @@ +format($platform->getDateFormatString()); + } + + throw ConversionException::conversionFailedInvalidType( + $value, + $this->getName(), + ['null', DateTimeImmutable::class] + ); + } + + /** + * {@inheritdoc} + */ + public function convertToPHPValue($value, AbstractPlatform $platform) + { + if ($value === null || $value instanceof DateTimeImmutable) { + return $value; + } + + $dateTime = DateTimeImmutable::createFromFormat('!' . $platform->getDateFormatString(), $value); + + if ($dateTime === false) { + throw ConversionException::conversionFailedFormat( + $value, + $this->getName(), + $platform->getDateFormatString() + ); + } + + return $dateTime; + } + + /** + * {@inheritdoc} + */ + public function requiresSQLCommentHint(AbstractPlatform $platform) + { + return true; + } +} diff --git a/app/vendor/doctrine/dbal/src/Types/DateIntervalType.php b/app/vendor/doctrine/dbal/src/Types/DateIntervalType.php new file mode 100644 index 000000000..6ecd4989c --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Types/DateIntervalType.php @@ -0,0 +1,88 @@ +getVarcharTypeDeclarationSQL($column); + } + + /** + * {@inheritdoc} + */ + public function convertToDatabaseValue($value, AbstractPlatform $platform) + { + if ($value === null) { + return null; + } + + if ($value instanceof DateInterval) { + return $value->format(self::FORMAT); + } + + throw ConversionException::conversionFailedInvalidType($value, $this->getName(), ['null', 'DateInterval']); + } + + /** + * {@inheritdoc} + */ + public function convertToPHPValue($value, AbstractPlatform $platform) + { + if ($value === null || $value instanceof DateInterval) { + return $value; + } + + $negative = false; + + if (isset($value[0]) && ($value[0] === '+' || $value[0] === '-')) { + $negative = $value[0] === '-'; + $value = substr($value, 1); + } + + try { + $interval = new DateInterval($value); + + if ($negative) { + $interval->invert = 1; + } + + return $interval; + } catch (Throwable $exception) { + throw ConversionException::conversionFailedFormat($value, $this->getName(), self::FORMAT, $exception); + } + } + + /** + * {@inheritdoc} + */ + public function requiresSQLCommentHint(AbstractPlatform $platform) + { + return true; + } +} diff --git a/app/vendor/doctrine/dbal/src/Types/DateTimeImmutableType.php b/app/vendor/doctrine/dbal/src/Types/DateTimeImmutableType.php new file mode 100644 index 000000000..fd7751977 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Types/DateTimeImmutableType.php @@ -0,0 +1,76 @@ +format($platform->getDateTimeFormatString()); + } + + throw ConversionException::conversionFailedInvalidType( + $value, + $this->getName(), + ['null', DateTimeImmutable::class] + ); + } + + /** + * {@inheritdoc} + */ + public function convertToPHPValue($value, AbstractPlatform $platform) + { + if ($value === null || $value instanceof DateTimeImmutable) { + return $value; + } + + $dateTime = DateTimeImmutable::createFromFormat($platform->getDateTimeFormatString(), $value); + + if ($dateTime === false) { + $dateTime = date_create_immutable($value); + } + + if ($dateTime === false) { + throw ConversionException::conversionFailedFormat( + $value, + $this->getName(), + $platform->getDateTimeFormatString() + ); + } + + return $dateTime; + } + + /** + * {@inheritdoc} + */ + public function requiresSQLCommentHint(AbstractPlatform $platform) + { + return true; + } +} diff --git a/app/vendor/doctrine/dbal/src/Types/DateTimeType.php b/app/vendor/doctrine/dbal/src/Types/DateTimeType.php new file mode 100644 index 000000000..454295d71 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Types/DateTimeType.php @@ -0,0 +1,73 @@ +getDateTimeTypeDeclarationSQL($column); + } + + /** + * {@inheritdoc} + */ + public function convertToDatabaseValue($value, AbstractPlatform $platform) + { + if ($value === null) { + return $value; + } + + if ($value instanceof DateTimeInterface) { + return $value->format($platform->getDateTimeFormatString()); + } + + throw ConversionException::conversionFailedInvalidType($value, $this->getName(), ['null', 'DateTime']); + } + + /** + * {@inheritdoc} + */ + public function convertToPHPValue($value, AbstractPlatform $platform) + { + if ($value === null || $value instanceof DateTimeInterface) { + return $value; + } + + $val = DateTime::createFromFormat($platform->getDateTimeFormatString(), $value); + + if ($val === false) { + $val = date_create($value); + } + + if ($val === false) { + throw ConversionException::conversionFailedFormat( + $value, + $this->getName(), + $platform->getDateTimeFormatString() + ); + } + + return $val; + } +} diff --git a/app/vendor/doctrine/dbal/src/Types/DateTimeTzImmutableType.php b/app/vendor/doctrine/dbal/src/Types/DateTimeTzImmutableType.php new file mode 100644 index 000000000..6e707e065 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Types/DateTimeTzImmutableType.php @@ -0,0 +1,70 @@ +format($platform->getDateTimeTzFormatString()); + } + + throw ConversionException::conversionFailedInvalidType( + $value, + $this->getName(), + ['null', DateTimeImmutable::class] + ); + } + + /** + * {@inheritdoc} + */ + public function convertToPHPValue($value, AbstractPlatform $platform) + { + if ($value === null || $value instanceof DateTimeImmutable) { + return $value; + } + + $dateTime = DateTimeImmutable::createFromFormat($platform->getDateTimeTzFormatString(), $value); + + if ($dateTime === false) { + throw ConversionException::conversionFailedFormat( + $value, + $this->getName(), + $platform->getDateTimeTzFormatString() + ); + } + + return $dateTime; + } + + /** + * {@inheritdoc} + */ + public function requiresSQLCommentHint(AbstractPlatform $platform) + { + return true; + } +} diff --git a/app/vendor/doctrine/dbal/src/Types/DateTimeTzType.php b/app/vendor/doctrine/dbal/src/Types/DateTimeTzType.php new file mode 100644 index 000000000..29672397f --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Types/DateTimeTzType.php @@ -0,0 +1,83 @@ +getDateTimeTzTypeDeclarationSQL($column); + } + + /** + * {@inheritdoc} + */ + public function convertToDatabaseValue($value, AbstractPlatform $platform) + { + if ($value === null) { + return $value; + } + + if ($value instanceof DateTimeInterface) { + return $value->format($platform->getDateTimeTzFormatString()); + } + + throw ConversionException::conversionFailedInvalidType( + $value, + $this->getName(), + ['null', 'DateTime'] + ); + } + + /** + * {@inheritdoc} + */ + public function convertToPHPValue($value, AbstractPlatform $platform) + { + if ($value === null || $value instanceof DateTimeInterface) { + return $value; + } + + $val = DateTime::createFromFormat($platform->getDateTimeTzFormatString(), $value); + if ($val === false) { + throw ConversionException::conversionFailedFormat( + $value, + $this->getName(), + $platform->getDateTimeTzFormatString() + ); + } + + return $val; + } +} diff --git a/app/vendor/doctrine/dbal/src/Types/DateType.php b/app/vendor/doctrine/dbal/src/Types/DateType.php new file mode 100644 index 000000000..6f86f5436 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Types/DateType.php @@ -0,0 +1,66 @@ +getDateTypeDeclarationSQL($column); + } + + /** + * {@inheritdoc} + */ + public function convertToDatabaseValue($value, AbstractPlatform $platform) + { + if ($value === null) { + return $value; + } + + if ($value instanceof DateTimeInterface) { + return $value->format($platform->getDateFormatString()); + } + + throw ConversionException::conversionFailedInvalidType($value, $this->getName(), ['null', 'DateTime']); + } + + /** + * {@inheritdoc} + */ + public function convertToPHPValue($value, AbstractPlatform $platform) + { + if ($value === null || $value instanceof DateTimeInterface) { + return $value; + } + + $val = DateTime::createFromFormat('!' . $platform->getDateFormatString(), $value); + if ($val === false) { + throw ConversionException::conversionFailedFormat( + $value, + $this->getName(), + $platform->getDateFormatString() + ); + } + + return $val; + } +} diff --git a/app/vendor/doctrine/dbal/src/Types/DecimalType.php b/app/vendor/doctrine/dbal/src/Types/DecimalType.php new file mode 100644 index 000000000..f75d3db2c --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Types/DecimalType.php @@ -0,0 +1,45 @@ +getDecimalTypeDeclarationSQL($column); + } + + /** + * {@inheritdoc} + */ + public function convertToPHPValue($value, AbstractPlatform $platform) + { + // Some drivers starting from PHP 8.1 can represent decimals as float + // See also: https://github.com/doctrine/dbal/pull/4818 + if (PHP_VERSION_ID >= 80100 && is_float($value)) { + return (string) $value; + } + + return $value; + } +} diff --git a/app/vendor/doctrine/dbal/src/Types/FloatType.php b/app/vendor/doctrine/dbal/src/Types/FloatType.php new file mode 100644 index 000000000..98ead4a9d --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Types/FloatType.php @@ -0,0 +1,32 @@ +getFloatDeclarationSQL($column); + } + + /** + * {@inheritdoc} + */ + public function convertToPHPValue($value, AbstractPlatform $platform) + { + return $value === null ? null : (float) $value; + } +} diff --git a/app/vendor/doctrine/dbal/src/Types/GuidType.php b/app/vendor/doctrine/dbal/src/Types/GuidType.php new file mode 100644 index 000000000..a4974f9d0 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Types/GuidType.php @@ -0,0 +1,35 @@ +getGuidTypeDeclarationSQL($column); + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return Types::GUID; + } + + /** + * {@inheritdoc} + */ + public function requiresSQLCommentHint(AbstractPlatform $platform) + { + return ! $platform->hasNativeGuidType(); + } +} diff --git a/app/vendor/doctrine/dbal/src/Types/IntegerType.php b/app/vendor/doctrine/dbal/src/Types/IntegerType.php new file mode 100644 index 000000000..0df606e29 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Types/IntegerType.php @@ -0,0 +1,44 @@ +getIntegerTypeDeclarationSQL($column); + } + + /** + * {@inheritdoc} + */ + public function convertToPHPValue($value, AbstractPlatform $platform) + { + return $value === null ? null : (int) $value; + } + + /** + * {@inheritdoc} + */ + public function getBindingType() + { + return ParameterType::INTEGER; + } +} diff --git a/app/vendor/doctrine/dbal/src/Types/JsonType.php b/app/vendor/doctrine/dbal/src/Types/JsonType.php new file mode 100644 index 000000000..d17b7f51e --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Types/JsonType.php @@ -0,0 +1,84 @@ +getJsonTypeDeclarationSQL($column); + } + + /** + * {@inheritdoc} + */ + public function convertToDatabaseValue($value, AbstractPlatform $platform) + { + if ($value === null) { + return null; + } + + $encoded = json_encode($value); + + if (json_last_error() !== JSON_ERROR_NONE) { + throw ConversionException::conversionFailedSerialization($value, 'json', json_last_error_msg()); + } + + return $encoded; + } + + /** + * {@inheritdoc} + */ + public function convertToPHPValue($value, AbstractPlatform $platform) + { + if ($value === null || $value === '') { + return null; + } + + if (is_resource($value)) { + $value = stream_get_contents($value); + } + + $val = json_decode($value, true); + + if (json_last_error() !== JSON_ERROR_NONE) { + throw ConversionException::conversionFailed($value, $this->getName()); + } + + return $val; + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return Types::JSON; + } + + /** + * {@inheritdoc} + */ + public function requiresSQLCommentHint(AbstractPlatform $platform) + { + return ! $platform->hasNativeJsonType(); + } +} diff --git a/app/vendor/doctrine/dbal/src/Types/ObjectType.php b/app/vendor/doctrine/dbal/src/Types/ObjectType.php new file mode 100644 index 000000000..49042c1bf --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Types/ObjectType.php @@ -0,0 +1,72 @@ +getClobTypeDeclarationSQL($column); + } + + /** + * {@inheritdoc} + */ + public function convertToDatabaseValue($value, AbstractPlatform $platform) + { + return serialize($value); + } + + /** + * {@inheritdoc} + */ + public function convertToPHPValue($value, AbstractPlatform $platform) + { + if ($value === null) { + return null; + } + + $value = is_resource($value) ? stream_get_contents($value) : $value; + + set_error_handler(function (int $code, string $message): bool { + throw ConversionException::conversionFailedUnserialization($this->getName(), $message); + }); + + try { + return unserialize($value); + } finally { + restore_error_handler(); + } + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return Types::OBJECT; + } + + /** + * {@inheritdoc} + */ + public function requiresSQLCommentHint(AbstractPlatform $platform) + { + return true; + } +} diff --git a/app/vendor/doctrine/dbal/src/Types/PhpDateTimeMappingType.php b/app/vendor/doctrine/dbal/src/Types/PhpDateTimeMappingType.php new file mode 100644 index 000000000..456585053 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Types/PhpDateTimeMappingType.php @@ -0,0 +1,12 @@ +getClobTypeDeclarationSQL($column); + } + + /** + * {@inheritdoc} + */ + public function convertToDatabaseValue($value, AbstractPlatform $platform) + { + if (! is_array($value) || count($value) === 0) { + return null; + } + + return implode(',', $value); + } + + /** + * {@inheritdoc} + */ + public function convertToPHPValue($value, AbstractPlatform $platform) + { + if ($value === null) { + return []; + } + + $value = is_resource($value) ? stream_get_contents($value) : $value; + + return explode(',', $value); + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return Types::SIMPLE_ARRAY; + } + + /** + * {@inheritdoc} + */ + public function requiresSQLCommentHint(AbstractPlatform $platform) + { + return true; + } +} diff --git a/app/vendor/doctrine/dbal/src/Types/SmallIntType.php b/app/vendor/doctrine/dbal/src/Types/SmallIntType.php new file mode 100644 index 000000000..90e634951 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Types/SmallIntType.php @@ -0,0 +1,44 @@ +getSmallIntTypeDeclarationSQL($column); + } + + /** + * {@inheritdoc} + */ + public function convertToPHPValue($value, AbstractPlatform $platform) + { + return $value === null ? null : (int) $value; + } + + /** + * {@inheritdoc} + */ + public function getBindingType() + { + return ParameterType::INTEGER; + } +} diff --git a/app/vendor/doctrine/dbal/src/Types/StringType.php b/app/vendor/doctrine/dbal/src/Types/StringType.php new file mode 100644 index 000000000..4e7bd55d0 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Types/StringType.php @@ -0,0 +1,27 @@ +getVarcharTypeDeclarationSQL($column); + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return Types::STRING; + } +} diff --git a/app/vendor/doctrine/dbal/src/Types/TextType.php b/app/vendor/doctrine/dbal/src/Types/TextType.php new file mode 100644 index 000000000..b1e640b69 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Types/TextType.php @@ -0,0 +1,38 @@ +getClobTypeDeclarationSQL($column); + } + + /** + * {@inheritdoc} + */ + public function convertToPHPValue($value, AbstractPlatform $platform) + { + return is_resource($value) ? stream_get_contents($value) : $value; + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return Types::TEXT; + } +} diff --git a/app/vendor/doctrine/dbal/src/Types/TimeImmutableType.php b/app/vendor/doctrine/dbal/src/Types/TimeImmutableType.php new file mode 100644 index 000000000..8d2c1517c --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Types/TimeImmutableType.php @@ -0,0 +1,70 @@ +format($platform->getTimeFormatString()); + } + + throw ConversionException::conversionFailedInvalidType( + $value, + $this->getName(), + ['null', DateTimeImmutable::class] + ); + } + + /** + * {@inheritdoc} + */ + public function convertToPHPValue($value, AbstractPlatform $platform) + { + if ($value === null || $value instanceof DateTimeImmutable) { + return $value; + } + + $dateTime = DateTimeImmutable::createFromFormat('!' . $platform->getTimeFormatString(), $value); + + if ($dateTime === false) { + throw ConversionException::conversionFailedFormat( + $value, + $this->getName(), + $platform->getTimeFormatString() + ); + } + + return $dateTime; + } + + /** + * {@inheritdoc} + */ + public function requiresSQLCommentHint(AbstractPlatform $platform) + { + return true; + } +} diff --git a/app/vendor/doctrine/dbal/src/Types/TimeType.php b/app/vendor/doctrine/dbal/src/Types/TimeType.php new file mode 100644 index 000000000..4f2c8c631 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Types/TimeType.php @@ -0,0 +1,66 @@ +getTimeTypeDeclarationSQL($column); + } + + /** + * {@inheritdoc} + */ + public function convertToDatabaseValue($value, AbstractPlatform $platform) + { + if ($value === null) { + return $value; + } + + if ($value instanceof DateTimeInterface) { + return $value->format($platform->getTimeFormatString()); + } + + throw ConversionException::conversionFailedInvalidType($value, $this->getName(), ['null', 'DateTime']); + } + + /** + * {@inheritdoc} + */ + public function convertToPHPValue($value, AbstractPlatform $platform) + { + if ($value === null || $value instanceof DateTimeInterface) { + return $value; + } + + $val = DateTime::createFromFormat('!' . $platform->getTimeFormatString(), $value); + if ($val === false) { + throw ConversionException::conversionFailedFormat( + $value, + $this->getName(), + $platform->getTimeFormatString() + ); + } + + return $val; + } +} diff --git a/app/vendor/doctrine/dbal/src/Types/Type.php b/app/vendor/doctrine/dbal/src/Types/Type.php new file mode 100644 index 000000000..03e5b8248 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Types/Type.php @@ -0,0 +1,279 @@ + ArrayType::class, + Types::ASCII_STRING => AsciiStringType::class, + Types::BIGINT => BigIntType::class, + Types::BINARY => BinaryType::class, + Types::BLOB => BlobType::class, + Types::BOOLEAN => BooleanType::class, + Types::DATE_MUTABLE => DateType::class, + Types::DATE_IMMUTABLE => DateImmutableType::class, + Types::DATEINTERVAL => DateIntervalType::class, + Types::DATETIME_MUTABLE => DateTimeType::class, + Types::DATETIME_IMMUTABLE => DateTimeImmutableType::class, + Types::DATETIMETZ_MUTABLE => DateTimeTzType::class, + Types::DATETIMETZ_IMMUTABLE => DateTimeTzImmutableType::class, + Types::DECIMAL => DecimalType::class, + Types::FLOAT => FloatType::class, + Types::GUID => GuidType::class, + Types::INTEGER => IntegerType::class, + Types::JSON => JsonType::class, + Types::OBJECT => ObjectType::class, + Types::SIMPLE_ARRAY => SimpleArrayType::class, + Types::SMALLINT => SmallIntType::class, + Types::STRING => StringType::class, + Types::TEXT => TextType::class, + Types::TIME_MUTABLE => TimeType::class, + Types::TIME_IMMUTABLE => TimeImmutableType::class, + ]; + + /** @var TypeRegistry|null */ + private static $typeRegistry; + + /** + * @internal Do not instantiate directly - use {@see Type::addType()} method instead. + */ + final public function __construct() + { + } + + /** + * Converts a value from its PHP representation to its database representation + * of this type. + * + * @param mixed $value The value to convert. + * @param AbstractPlatform $platform The currently used database platform. + * + * @return mixed The database representation of the value. + * + * @throws ConversionException + */ + public function convertToDatabaseValue($value, AbstractPlatform $platform) + { + return $value; + } + + /** + * Converts a value from its database representation to its PHP representation + * of this type. + * + * @param mixed $value The value to convert. + * @param AbstractPlatform $platform The currently used database platform. + * + * @return mixed The PHP representation of the value. + * + * @throws ConversionException + */ + public function convertToPHPValue($value, AbstractPlatform $platform) + { + return $value; + } + + /** + * Gets the SQL declaration snippet for a column of this type. + * + * @param mixed[] $column The column definition + * @param AbstractPlatform $platform The currently used database platform. + * + * @return string + */ + abstract public function getSQLDeclaration(array $column, AbstractPlatform $platform); + + /** + * Gets the name of this type. + * + * @return string + * + * @todo Needed? + */ + abstract public function getName(); + + final public static function getTypeRegistry(): TypeRegistry + { + if (self::$typeRegistry === null) { + self::$typeRegistry = self::createTypeRegistry(); + } + + return self::$typeRegistry; + } + + private static function createTypeRegistry(): TypeRegistry + { + $instances = []; + + foreach (self::BUILTIN_TYPES_MAP as $name => $class) { + $instances[$name] = new $class(); + } + + return new TypeRegistry($instances); + } + + /** + * Factory method to create type instances. + * Type instances are implemented as flyweights. + * + * @param string $name The name of the type (as returned by getName()). + * + * @return Type + * + * @throws Exception + */ + public static function getType($name) + { + return self::getTypeRegistry()->get($name); + } + + /** + * Adds a custom type to the type map. + * + * @param string $name The name of the type. This should correspond to what getName() returns. + * @param class-string $className The class name of the custom type. + * + * @return void + * + * @throws Exception + */ + public static function addType($name, $className) + { + self::getTypeRegistry()->register($name, new $className()); + } + + /** + * Checks if exists support for a type. + * + * @param string $name The name of the type. + * + * @return bool TRUE if type is supported; FALSE otherwise. + */ + public static function hasType($name) + { + return self::getTypeRegistry()->has($name); + } + + /** + * Overrides an already defined type to use a different implementation. + * + * @param string $name + * @param class-string $className + * + * @return void + * + * @throws Exception + */ + public static function overrideType($name, $className) + { + self::getTypeRegistry()->override($name, new $className()); + } + + /** + * Gets the (preferred) binding type for values of this type that + * can be used when binding parameters to prepared statements. + * + * This method should return one of the {@link ParameterType} constants. + * + * @return int + */ + public function getBindingType() + { + return ParameterType::STRING; + } + + /** + * Gets the types array map which holds all registered types and the corresponding + * type class + * + * @return string[] + */ + public static function getTypesMap() + { + return array_map( + static function (Type $type): string { + return get_class($type); + }, + self::getTypeRegistry()->getMap() + ); + } + + /** + * Does working with this column require SQL conversion functions? + * + * This is a metadata function that is required for example in the ORM. + * Usage of {@link convertToDatabaseValueSQL} and + * {@link convertToPHPValueSQL} works for any type and mostly + * does nothing. This method can additionally be used for optimization purposes. + * + * @return bool + */ + public function canRequireSQLConversion() + { + return false; + } + + /** + * Modifies the SQL expression (identifier, parameter) to convert to a database value. + * + * @param string $sqlExpr + * + * @return string + */ + public function convertToDatabaseValueSQL($sqlExpr, AbstractPlatform $platform) + { + return $sqlExpr; + } + + /** + * Modifies the SQL expression (identifier, parameter) to convert to a PHP value. + * + * @param string $sqlExpr + * @param AbstractPlatform $platform + * + * @return string + */ + public function convertToPHPValueSQL($sqlExpr, $platform) + { + return $sqlExpr; + } + + /** + * Gets an array of database types that map to this Doctrine type. + * + * @return string[] + */ + public function getMappedDatabaseTypes(AbstractPlatform $platform) + { + return []; + } + + /** + * If this Doctrine Type maps to an already mapped database type, + * reverse schema engineering can't tell them apart. You need to mark + * one of those types as commented, which will have Doctrine use an SQL + * comment to typehint the actual Doctrine Type. + * + * @return bool + */ + public function requiresSQLCommentHint(AbstractPlatform $platform) + { + return false; + } +} diff --git a/app/vendor/doctrine/dbal/src/Types/TypeRegistry.php b/app/vendor/doctrine/dbal/src/Types/TypeRegistry.php new file mode 100644 index 000000000..ce33b951a --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Types/TypeRegistry.php @@ -0,0 +1,125 @@ + Map of type names and their corresponding flyweight objects. */ + private $instances; + + /** + * @param array $instances + */ + public function __construct(array $instances = []) + { + $this->instances = $instances; + } + + /** + * Finds a type by the given name. + * + * @throws Exception + */ + public function get(string $name): Type + { + if (! isset($this->instances[$name])) { + throw Exception::unknownColumnType($name); + } + + return $this->instances[$name]; + } + + /** + * Finds a name for the given type. + * + * @throws Exception + */ + public function lookupName(Type $type): string + { + $name = $this->findTypeName($type); + + if ($name === null) { + throw Exception::typeNotRegistered($type); + } + + return $name; + } + + /** + * Checks if there is a type of the given name. + */ + public function has(string $name): bool + { + return isset($this->instances[$name]); + } + + /** + * Registers a custom type to the type map. + * + * @throws Exception + */ + public function register(string $name, Type $type): void + { + if (isset($this->instances[$name])) { + throw Exception::typeExists($name); + } + + if ($this->findTypeName($type) !== null) { + throw Exception::typeAlreadyRegistered($type); + } + + $this->instances[$name] = $type; + } + + /** + * Overrides an already defined type to use a different implementation. + * + * @throws Exception + */ + public function override(string $name, Type $type): void + { + if (! isset($this->instances[$name])) { + throw Exception::typeNotFound($name); + } + + if (! in_array($this->findTypeName($type), [$name, null], true)) { + throw Exception::typeAlreadyRegistered($type); + } + + $this->instances[$name] = $type; + } + + /** + * Gets the map of all registered types and their corresponding type instances. + * + * @internal + * + * @return array + */ + public function getMap(): array + { + return $this->instances; + } + + private function findTypeName(Type $type): ?string + { + $name = array_search($type, $this->instances, true); + + if ($name === false) { + return null; + } + + return $name; + } +} diff --git a/app/vendor/doctrine/dbal/src/Types/Types.php b/app/vendor/doctrine/dbal/src/Types/Types.php new file mode 100644 index 000000000..56bf3f51c --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Types/Types.php @@ -0,0 +1,44 @@ +format($platform->getDateTimeFormatString()); + } + + throw ConversionException::conversionFailedInvalidType( + $value, + $this->getName(), + ['null', DateTimeImmutable::class] + ); + } + + /** + * {@inheritdoc} + */ + public function convertToPHPValue($value, AbstractPlatform $platform) + { + if ($value === null || $value instanceof DateTimeImmutable) { + return $value; + } + + $dateTime = date_create_immutable($value); + + if ($dateTime === false) { + throw ConversionException::conversionFailed($value, $this->getName()); + } + + return $dateTime; + } + + /** + * {@inheritdoc} + */ + public function requiresSQLCommentHint(AbstractPlatform $platform) + { + return true; + } +} diff --git a/app/vendor/doctrine/dbal/src/Types/VarDateTimeType.php b/app/vendor/doctrine/dbal/src/Types/VarDateTimeType.php new file mode 100644 index 000000000..b11ef2871 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/Types/VarDateTimeType.php @@ -0,0 +1,35 @@ + 0 it is necessary to use this type. + */ +class VarDateTimeType extends DateTimeType +{ + /** + * {@inheritdoc} + */ + public function convertToPHPValue($value, AbstractPlatform $platform) + { + if ($value === null || $value instanceof DateTime) { + return $value; + } + + $val = date_create($value); + if ($val === false) { + throw ConversionException::conversionFailed($value, $this->getName()); + } + + return $val; + } +} diff --git a/app/vendor/doctrine/dbal/src/VersionAwarePlatformDriver.php b/app/vendor/doctrine/dbal/src/VersionAwarePlatformDriver.php new file mode 100644 index 000000000..b3ec8b843 --- /dev/null +++ b/app/vendor/doctrine/dbal/src/VersionAwarePlatformDriver.php @@ -0,0 +1,28 @@ + MyConnection::class, + ]); +} diff --git a/app/vendor/doctrine/deprecations/.github/workflows/ci.yml b/app/vendor/doctrine/deprecations/.github/workflows/ci.yml new file mode 100644 index 000000000..c5696f3b4 --- /dev/null +++ b/app/vendor/doctrine/deprecations/.github/workflows/ci.yml @@ -0,0 +1,60 @@ +name: "Continuous Integration" + +on: + pull_request: + +jobs: + + coding-standards: + name: "Coding Standards" + runs-on: "ubuntu-latest" + + strategy: + matrix: + php-version: + - "7.4" + + steps: + - name: "Checkout" + uses: "actions/checkout@v2" + + - name: "Install PHP" + uses: "shivammathur/setup-php@v2" + with: + coverage: "none" + php-version: "${{ matrix.php-version }}" + tools: "cs2pr" + + - name: "Cache dependencies installed with composer" + uses: "actions/cache@v1" + with: + path: "~/.composer/cache" + key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}" + restore-keys: "php-${{ matrix.php-version }}-composer-locked-" + + - name: "Install dependencies with composer" + run: "composer install --no-interaction --no-progress --no-suggest" + + - name: "Run squizlabs/php_codesniffer" + run: "vendor/bin/phpcs -q --no-colors --report=checkstyle | cs2pr" + + phpunit: + name: PHPUnit + runs-on: ubuntu-latest + strategy: + matrix: + php-version: ['7.1', '7.2', '7.3', '7.4'] + steps: + - name: "Checkout" + uses: "actions/checkout@v2" + + - name: Setup PHP + uses: shivammathur/setup-php@v1 + with: + php-version: ${{ matrix.php-version }} + + - name: "Install dependencies with composer" + run: "composer install --no-interaction --no-progress --no-suggest" + + - name: PHPUnit + run: "vendor/bin/phpunit" diff --git a/app/vendor/doctrine/deprecations/.gitignore b/app/vendor/doctrine/deprecations/.gitignore new file mode 100644 index 000000000..2ee7dedc1 --- /dev/null +++ b/app/vendor/doctrine/deprecations/.gitignore @@ -0,0 +1,3 @@ +vendor +.phpcs-cache +composer.lock diff --git a/app/vendor/doctrine/deprecations/README.md b/app/vendor/doctrine/deprecations/README.md new file mode 100644 index 000000000..d66822214 --- /dev/null +++ b/app/vendor/doctrine/deprecations/README.md @@ -0,0 +1,147 @@ +# Doctrine Deprecations + +A small (side-effect free by default) layer on top of +`trigger_error(E_USER_DEPRECATED)` or PSR-3 logging. + +- no side-effects by default, making it a perfect fit for libraries that don't know how the error handler works they operate under +- options to avoid having to rely on error handlers global state by using PSR-3 logging +- deduplicate deprecation messages to avoid excessive triggering and reduce overhead + +We recommend to collect Deprecations using a PSR logger instead of relying on +the global error handler. + +## Usage from consumer perspective: + +Enable Doctrine deprecations to be sent to a PSR3 logger: + +```php +\Doctrine\Deprecations\Deprecation::enableWithPsrLogger($logger); +``` + +Enable Doctrine deprecations to be sent as `@trigger_error($message, E_USER_DEPRECATED)` +messages. + +```php +\Doctrine\Deprecations\Deprecation::enableWithTriggerError(); +``` + +If you only want to enable deprecation tracking, without logging or calling `trigger_error` then call: + +```php +\Doctrine\Deprecations\Deprecation::enableTrackingDeprecations(); +``` + +Tracking is enabled with all three modes and provides access to all triggered +deprecations and their individual count: + +```php +$deprecations = \Doctrine\Deprecations\Deprecation::getTriggeredDeprecations(); + +foreach ($deprecations as $identifier => $count) { + echo $identifier . " was triggered " . $count . " times\n"; +} +``` + +### Suppressing Specific Deprecations + +Disable triggering about specific deprecations: + +```php +\Doctrine\Deprecations\Deprecation::ignoreDeprecations("https://link/to/deprecations-description-identifier"); +``` + +Disable all deprecations from a package + +```php +\Doctrine\Deprecations\Deprecation::ignorePackage("doctrine/orm"); +``` + +### Other Operations + +When used within PHPUnit or other tools that could collect multiple instances of the same deprecations +the deduplication can be disabled: + +```php +\Doctrine\Deprecations\Deprecation::withoutDeduplication(); +``` + +Disable deprecation tracking again: + +```php +\Doctrine\Deprecations\Deprecation::disable(); +``` + +## Usage from a library/producer perspective: + +When you want to unconditionally trigger a deprecation even when called +from the library itself then the `trigger` method is the way to go: + +```php +\Doctrine\Deprecations\Deprecation::trigger( + "doctrine/orm", + "https://link/to/deprecations-description", + "message" +); +``` + +If variable arguments are provided at the end, they are used with `sprintf` on +the message. + +```php +\Doctrine\Deprecations\Deprecation::trigger( + "doctrine/orm", + "https://github.com/doctrine/orm/issue/1234", + "message %s %d", + "foo", + 1234 +); +``` + +When you want to trigger a deprecation only when it is called by a function +outside of the current package, but not trigger when the package itself is the cause, +then use: + +```php +\Doctrine\Deprecations\Deprecation::triggerIfCalledFromOutside( + "doctrine/orm", + "https://link/to/deprecations-description", + "message" +); +``` + +Based on the issue link each deprecation message is only triggered once per +request. + +A limited stacktrace is included in the deprecation message to find the +offending location. + +Note: A producer/library should never call `Deprecation::enableWith` methods +and leave the decision how to handle deprecations to application and +frameworks. + +## Usage in PHPUnit tests + +There is a `VerifyDeprecations` trait that you can use to make assertions on +the occurrence of deprecations within a test. + +```php +use Doctrine\Deprecations\PHPUnit\VerifyDeprecations; + +class MyTest extends TestCase +{ + use VerifyDeprecations; + + public function testSomethingDeprecation() + { + $this->expectDeprecationWithIdentifier('https://github.com/doctrine/orm/issue/1234'); + + triggerTheCodeWithDeprecation(); + } +} +``` + +## What is a deprecation identifier? + +An identifier for deprecations is just a link to any resource, most often a +Github Issue or Pull Request explaining the deprecation and potentially its +alternative. diff --git a/app/vendor/doctrine/deprecations/composer.json b/app/vendor/doctrine/deprecations/composer.json new file mode 100644 index 000000000..5cc7ac13d --- /dev/null +++ b/app/vendor/doctrine/deprecations/composer.json @@ -0,0 +1,27 @@ +{ + "name": "doctrine/deprecations", + "type": "library", + "description": "A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.", + "homepage": "https://www.doctrine-project.org/", + "license": "MIT", + "require": { + "php": "^7.1|^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^7.0|^8.0|^9.0", + "psr/log": "^1.0", + "doctrine/coding-standard": "^6.0|^7.0|^8.0" + }, + "suggest": { + "psr/log": "Allows logging deprecations via PSR-3 logger implementation" + }, + "autoload": { + "psr-4": {"Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations"} + }, + "autoload-dev": { + "psr-4": { + "DeprecationTests\\": "test_fixtures/src", + "Doctrine\\Foo\\": "test_fixtures/vendor/doctrine/foo" + } + } +} diff --git a/app/vendor/doctrine/deprecations/lib/Doctrine/Deprecations/Deprecation.php b/app/vendor/doctrine/deprecations/lib/Doctrine/Deprecations/Deprecation.php new file mode 100644 index 000000000..1029372fa --- /dev/null +++ b/app/vendor/doctrine/deprecations/lib/Doctrine/Deprecations/Deprecation.php @@ -0,0 +1,266 @@ + */ + private static $ignoredPackages = []; + + /** @var array */ + private static $ignoredLinks = []; + + /** @var bool */ + private static $deduplication = true; + + /** + * Trigger a deprecation for the given package and identfier. + * + * The link should point to a Github issue or Wiki entry detailing the + * deprecation. It is additionally used to de-duplicate the trigger of the + * same deprecation during a request. + * + * @param mixed $args + */ + public static function trigger(string $package, string $link, string $message, ...$args): void + { + if (self::$type === self::TYPE_NONE) { + return; + } + + if (array_key_exists($link, self::$ignoredLinks)) { + self::$ignoredLinks[$link]++; + } else { + self::$ignoredLinks[$link] = 1; + } + + if (self::$deduplication === true && self::$ignoredLinks[$link] > 1) { + return; + } + + if (isset(self::$ignoredPackages[$package])) { + return; + } + + $backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2); + + $message = sprintf($message, ...$args); + + self::delegateTriggerToBackend($message, $backtrace, $link, $package); + } + + /** + * Trigger a deprecation for the given package and identifier when called from outside. + * + * "Outside" means we assume that $package is currently installed as a + * dependency and the caller is not a file in that package. When $package + * is installed as a root package then deprecations triggered from the + * tests folder are also considered "outside". + * + * This deprecation method assumes that you are using Composer to install + * the dependency and are using the default /vendor/ folder and not a + * Composer plugin to change the install location. The assumption is also + * that $package is the exact composer packge name. + * + * Compared to {@link trigger()} this method causes some overhead when + * deprecation tracking is enabled even during deduplication, because it + * needs to call {@link debug_backtrace()} + * + * @param mixed $args + */ + public static function triggerIfCalledFromOutside(string $package, string $link, string $message, ...$args): void + { + if (self::$type === self::TYPE_NONE) { + return; + } + + $backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2); + + // first check that the caller is not from a tests folder, in which case we always let deprecations pass + if (strpos($backtrace[1]['file'], DIRECTORY_SEPARATOR . 'tests' . DIRECTORY_SEPARATOR) === false) { + $path = DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . $package . DIRECTORY_SEPARATOR; + + if (strpos($backtrace[0]['file'], $path) === false) { + return; + } + + if (strpos($backtrace[1]['file'], $path) !== false) { + return; + } + } + + if (array_key_exists($link, self::$ignoredLinks)) { + self::$ignoredLinks[$link]++; + } else { + self::$ignoredLinks[$link] = 1; + } + + if (self::$deduplication === true && self::$ignoredLinks[$link] > 1) { + return; + } + + if (isset(self::$ignoredPackages[$package])) { + return; + } + + $message = sprintf($message, ...$args); + + self::delegateTriggerToBackend($message, $backtrace, $link, $package); + } + + /** + * @param array $backtrace + */ + private static function delegateTriggerToBackend(string $message, array $backtrace, string $link, string $package): void + { + if ((self::$type & self::TYPE_PSR_LOGGER) > 0) { + $context = [ + 'file' => $backtrace[0]['file'], + 'line' => $backtrace[0]['line'], + 'package' => $package, + 'link' => $link, + ]; + + self::$logger->notice($message, $context); + } + + if (! ((self::$type & self::TYPE_TRIGGER_ERROR) > 0)) { + return; + } + + $message .= sprintf( + ' (%s:%d called by %s:%d, %s, package %s)', + self::basename($backtrace[0]['file']), + $backtrace[0]['line'], + self::basename($backtrace[1]['file']), + $backtrace[1]['line'], + $link, + $package + ); + + @trigger_error($message, E_USER_DEPRECATED); + } + + /** + * A non-local-aware version of PHPs basename function. + */ + private static function basename(string $filename): string + { + $pos = strrpos($filename, DIRECTORY_SEPARATOR); + + if ($pos === false) { + return $filename; + } + + return substr($filename, $pos + 1); + } + + public static function enableTrackingDeprecations(): void + { + self::$type |= self::TYPE_TRACK_DEPRECATIONS; + } + + public static function enableWithTriggerError(): void + { + self::$type |= self::TYPE_TRIGGER_ERROR; + } + + public static function enableWithPsrLogger(LoggerInterface $logger): void + { + self::$type |= self::TYPE_PSR_LOGGER; + self::$logger = $logger; + } + + public static function withoutDeduplication(): void + { + self::$deduplication = false; + } + + public static function disable(): void + { + self::$type = self::TYPE_NONE; + self::$logger = null; + self::$deduplication = true; + + foreach (self::$ignoredLinks as $link => $count) { + self::$ignoredLinks[$link] = 0; + } + } + + public static function ignorePackage(string $packageName): void + { + self::$ignoredPackages[$packageName] = true; + } + + public static function ignoreDeprecations(string ...$links): void + { + foreach ($links as $link) { + self::$ignoredLinks[$link] = 0; + } + } + + public static function getUniqueTriggeredDeprecationsCount(): int + { + return array_reduce(self::$ignoredLinks, static function (int $carry, int $count) { + return $carry + $count; + }, 0); + } + + /** + * Returns each triggered deprecation link identifier and the amount of occurrences. + * + * @return array + */ + public static function getTriggeredDeprecations(): array + { + return self::$ignoredLinks; + } +} diff --git a/app/vendor/doctrine/deprecations/lib/Doctrine/Deprecations/PHPUnit/VerifyDeprecations.php b/app/vendor/doctrine/deprecations/lib/Doctrine/Deprecations/PHPUnit/VerifyDeprecations.php new file mode 100644 index 000000000..4c3366a97 --- /dev/null +++ b/app/vendor/doctrine/deprecations/lib/Doctrine/Deprecations/PHPUnit/VerifyDeprecations.php @@ -0,0 +1,66 @@ + */ + private $doctrineDeprecationsExpectations = []; + + /** @var array */ + private $doctrineNoDeprecationsExpectations = []; + + public function expectDeprecationWithIdentifier(string $identifier): void + { + $this->doctrineDeprecationsExpectations[$identifier] = Deprecation::getTriggeredDeprecations()[$identifier] ?? 0; + } + + public function expectNoDeprecationWithIdentifier(string $identifier): void + { + $this->doctrineNoDeprecationsExpectations[$identifier] = Deprecation::getTriggeredDeprecations()[$identifier] ?? 0; + } + + /** + * @before + */ + public function enableDeprecationTracking(): void + { + Deprecation::enableTrackingDeprecations(); + } + + /** + * @after + */ + public function verifyDeprecationsAreTriggered(): void + { + foreach ($this->doctrineDeprecationsExpectations as $identifier => $expectation) { + $actualCount = Deprecation::getTriggeredDeprecations()[$identifier] ?? 0; + + $this->assertTrue( + $actualCount > $expectation, + sprintf( + "Expected deprecation with identifier '%s' was not triggered by code executed in test.", + $identifier + ) + ); + } + + foreach ($this->doctrineNoDeprecationsExpectations as $identifier => $expectation) { + $actualCount = Deprecation::getTriggeredDeprecations()[$identifier] ?? 0; + + $this->assertTrue( + $actualCount === $expectation, + sprintf( + "Expected deprecation with identifier '%s' was triggered by code executed in test, but expected not to.", + $identifier + ) + ); + } + } +} diff --git a/app/vendor/doctrine/deprecations/phpcs.xml b/app/vendor/doctrine/deprecations/phpcs.xml new file mode 100644 index 000000000..4e0cc21fd --- /dev/null +++ b/app/vendor/doctrine/deprecations/phpcs.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + lib + tests + + + + + + diff --git a/app/vendor/doctrine/deprecations/phpunit.xml.dist b/app/vendor/doctrine/deprecations/phpunit.xml.dist new file mode 100644 index 000000000..4740c0604 --- /dev/null +++ b/app/vendor/doctrine/deprecations/phpunit.xml.dist @@ -0,0 +1,8 @@ + + + + + tests + + + diff --git a/app/vendor/doctrine/deprecations/test_fixtures/src/Foo.php b/app/vendor/doctrine/deprecations/test_fixtures/src/Foo.php new file mode 100644 index 000000000..c4b8ebece --- /dev/null +++ b/app/vendor/doctrine/deprecations/test_fixtures/src/Foo.php @@ -0,0 +1,22 @@ +oldFunc(); + } + + public static function triggerDependencyWithDeprecationFromInside(): void + { + $bar = new Bar(); + $bar->newFunc(); + } +} diff --git a/app/vendor/doctrine/deprecations/test_fixtures/src/RootDeprecation.php b/app/vendor/doctrine/deprecations/test_fixtures/src/RootDeprecation.php new file mode 100644 index 000000000..feccd4865 --- /dev/null +++ b/app/vendor/doctrine/deprecations/test_fixtures/src/RootDeprecation.php @@ -0,0 +1,20 @@ +setAccessible(true); + $reflectionProperty->setValue([]); + + $reflectionProperty = new ReflectionProperty(Deprecation::class, 'ignoredLinks'); + $reflectionProperty->setAccessible(true); + $reflectionProperty->setValue([]); + + Deprecation::enableTrackingDeprecations(); + } + + public function expectDeprecation(): void + { + if (method_exists(TestCase::class, 'expectDeprecation')) { + parent::expectDeprecation(); + } else { + parent::expectException(Deprecated::class); + } + } + + public function expectDeprecationMessage(string $message): void + { + if (method_exists(TestCase::class, 'expectDeprecationMessage')) { + parent::expectDeprecationMessage($message); + } else { + parent::expectExceptionMessage($message); + } + } + + public function expectErrorHandler(string $expectedMessage, string $identifier, int $times = 1): void + { + set_error_handler(function ($type, $message) use ($expectedMessage, $identifier, $times): void { + $this->assertStringMatchesFormat( + $expectedMessage, + $message + ); + $this->assertEquals([$identifier => $times], Deprecation::getTriggeredDeprecations()); + }); + } + + public function testDeprecation(): void + { + Deprecation::enableWithTriggerError(); + + $this->expectDeprecationWithIdentifier('https://github.com/doctrine/deprecations/1234'); + + $this->expectErrorHandler( + 'this is deprecated foo 1234 (DeprecationTest.php:%d called by TestCase.php:%d, https://github.com/doctrine/deprecations/1234, package doctrine/orm)', + 'https://github.com/doctrine/deprecations/1234' + ); + + Deprecation::trigger( + 'doctrine/orm', + 'https://github.com/doctrine/deprecations/1234', + 'this is deprecated %s %d', + 'foo', + 1234 + ); + + $this->assertEquals(1, Deprecation::getUniqueTriggeredDeprecationsCount()); + + Deprecation::trigger( + 'doctrine/orm', + 'https://github.com/doctrine/deprecations/1234', + 'this is deprecated %s %d', + 'foo', + 1234 + ); + + $this->assertEquals(2, Deprecation::getUniqueTriggeredDeprecationsCount()); + } + + public function testDeprecationWithoutDeduplication(): void + { + Deprecation::enableWithTriggerError(); + Deprecation::withoutDeduplication(); + + $this->expectErrorHandler( + 'this is deprecated foo 2222 (DeprecationTest.php:%d called by TestCase.php:%d, https://github.com/doctrine/deprecations/2222, package doctrine/orm)', + 'https://github.com/doctrine/deprecations/2222' + ); + + Deprecation::trigger( + 'doctrine/orm', + 'https://github.com/doctrine/deprecations/2222', + 'this is deprecated %s %d', + 'foo', + 2222 + ); + + $this->assertEquals(1, Deprecation::getUniqueTriggeredDeprecationsCount()); + + $this->expectErrorHandler( + 'this is deprecated foo 2222 (DeprecationTest.php:%d called by TestCase.php:%d, https://github.com/doctrine/deprecations/2222, package doctrine/orm)', + 'https://github.com/doctrine/deprecations/2222', + 2 + ); + + Deprecation::trigger( + 'doctrine/orm', + 'https://github.com/doctrine/deprecations/2222', + 'this is deprecated %s %d', + 'foo', + 2222 + ); + + $this->assertEquals(2, Deprecation::getUniqueTriggeredDeprecationsCount()); + } + + public function testDeprecationResetsCounts(): void + { + try { + Deprecation::trigger( + 'doctrine/orm', + 'https://github.com/doctrine/deprecations/1234', + 'this is deprecated %s %d', + 'foo', + 1234 + ); + } catch (Throwable $e) { + Deprecation::disable(); + + $this->assertEquals(0, Deprecation::getUniqueTriggeredDeprecationsCount()); + $this->assertEquals(['https://github.com/doctrine/deprecations/1234' => 0], Deprecation::getTriggeredDeprecations()); + } + } + + public function expectDeprecationMock(string $message, string $identifier, string $package): MockObject + { + $mock = $this->createMock(LoggerInterface::class); + $mock->method('notice')->with($message, $this->callback(function ($context) use ($identifier, $package) { + $this->assertEquals($package, $context['package']); + $this->assertEquals($identifier, $context['link']); + + return true; + })); + + return $mock; + } + + public function testDeprecationWithPsrLogger(): void + { + $this->expectDeprecationWithIdentifier('https://github.com/doctrine/deprecations/2222'); + + $mock = $this->expectDeprecationMock( + 'this is deprecated foo 1234', + 'https://github.com/doctrine/deprecations/2222', + 'doctrine/orm' + ); + Deprecation::enableWithPsrLogger($mock); + + Deprecation::trigger( + 'doctrine/orm', + 'https://github.com/doctrine/deprecations/2222', + 'this is deprecated %s %d', + 'foo', + 1234 + ); + } + + public function testDeprecationWithIgnoredPackage(): void + { + Deprecation::enableWithTriggerError(); + Deprecation::ignorePackage('doctrine/orm'); + + Deprecation::trigger( + 'doctrine/orm', + 'https://github.com/doctrine/orm/issue/1234', + 'this is deprecated %s %d', + 'foo', + 1234 + ); + + $this->assertEquals(1, Deprecation::getUniqueTriggeredDeprecationsCount()); + $this->assertEquals(['https://github.com/doctrine/orm/issue/1234' => 1], Deprecation::getTriggeredDeprecations()); + } + + public function testDeprecationIfCalledFromOutside(): void + { + Deprecation::enableWithTriggerError(); + + $this->expectErrorHandler( + 'Bar::oldFunc() is deprecated, use Bar::newFunc() instead. (Bar.php:16 called by Foo.php:14, https://github.com/doctrine/foo, package doctrine/foo)', + 'https://github.com/doctrine/foo' + ); + + Foo::triggerDependencyWithDeprecation(); + } + + public function testDeprecationIfCalledFromOutsideNotTriggeringFromInside(): void + { + Deprecation::enableWithTriggerError(); + + Foo::triggerDependencyWithDeprecationFromInside(); + + $this->assertEquals(0, Deprecation::getUniqueTriggeredDeprecationsCount()); + } + + public function testDeprecationIfCalledFromOutsideNotTriggeringFromInsideClass(): void + { + Deprecation::enableWithTriggerError(); + + $baz = new Baz(); + $baz->usingOldFunc(); + + $this->assertEquals(0, Deprecation::getUniqueTriggeredDeprecationsCount()); + } + + public function testDeprecationCalledFromOutsideInRoot(): void + { + Deprecation::enableWithTriggerError(); + + $this->expectDeprecationWithIdentifier('https://github.com/doctrine/deprecations/4444'); + + $this->expectErrorHandler( + 'this is deprecated foo 1234 (RootDeprecation.php:%d called by DeprecationTest.php:%d, https://github.com/doctrine/deprecations/4444, package doctrine/orm)', + 'https://github.com/doctrine/deprecations/4444' + ); + + RootDeprecation::run(); + + $this->assertEquals(1, Deprecation::getUniqueTriggeredDeprecationsCount()); + } +} diff --git a/app/vendor/doctrine/deprecations/tests/Doctrine/Deprecations/VerifyDeprecationsTest.php b/app/vendor/doctrine/deprecations/tests/Doctrine/Deprecations/VerifyDeprecationsTest.php new file mode 100644 index 000000000..8681f7d69 --- /dev/null +++ b/app/vendor/doctrine/deprecations/tests/Doctrine/Deprecations/VerifyDeprecationsTest.php @@ -0,0 +1,35 @@ +expectDeprecationWithIdentifier('http://example.com'); + + Deprecation::trigger('doctrine/dbal', 'http://example.com', 'message'); + } + + public function testExpectNoDeprecationWithIdentifier(): void + { + $this->expectNoDeprecationWithIdentifier('http://example.com'); + + Deprecation::trigger('doctrine/dbal', 'http://otherexample.com', 'message'); + } +} diff --git a/app/vendor/doctrine/event-manager/.doctrine-project.json b/app/vendor/doctrine/event-manager/.doctrine-project.json new file mode 100644 index 000000000..f6feb43c4 --- /dev/null +++ b/app/vendor/doctrine/event-manager/.doctrine-project.json @@ -0,0 +1,18 @@ +{ + "active": true, + "name": "Event Manager", + "slug": "event-manager", + "docsSlug": "doctrine-event-manager", + "versions": [ + { + "name": "1.0", + "branchName": "master", + "slug": "latest", + "current": true, + "aliases": [ + "current", + "stable" + ] + } + ] +} diff --git a/app/vendor/doctrine/event-manager/LICENSE b/app/vendor/doctrine/event-manager/LICENSE new file mode 100644 index 000000000..8c38cc1bc --- /dev/null +++ b/app/vendor/doctrine/event-manager/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2006-2015 Doctrine Project + +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/app/vendor/doctrine/event-manager/README.md b/app/vendor/doctrine/event-manager/README.md new file mode 100644 index 000000000..3aee6b6f0 --- /dev/null +++ b/app/vendor/doctrine/event-manager/README.md @@ -0,0 +1,13 @@ +# Doctrine Event Manager + +[![Build Status](https://travis-ci.org/doctrine/event-manager.svg)](https://travis-ci.org/doctrine/event-manager) +[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/doctrine/event-manager/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/doctrine/event-manager/?branch=master) +[![Code Coverage](https://scrutinizer-ci.com/g/doctrine/event-manager/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/doctrine/event-manager/?branch=master) + +The Doctrine Event Manager is a library that provides a simple event system. + +## More resources: + +* [Website](https://www.doctrine-project.org/) +* [Documentation](https://www.doctrine-project.org/projects/doctrine-event-manager/en/latest/) +* [Downloads](https://github.com/doctrine/event-manager/releases) diff --git a/app/vendor/doctrine/event-manager/composer.json b/app/vendor/doctrine/event-manager/composer.json new file mode 100644 index 000000000..3f026fe8b --- /dev/null +++ b/app/vendor/doctrine/event-manager/composer.json @@ -0,0 +1,50 @@ +{ + "name": "doctrine/event-manager", + "type": "library", + "description": "The Doctrine Event Manager is a simple PHP event system that was built to be used with the various Doctrine projects.", + "keywords": [ + "events", + "event", + "event dispatcher", + "event manager", + "event system" + ], + "homepage": "https://www.doctrine-project.org/projects/event-manager.html", + "license": "MIT", + "authors": [ + {"name": "Guilherme Blanco", "email": "guilhermeblanco@gmail.com"}, + {"name": "Roman Borschel", "email": "roman@code-factory.org"}, + {"name": "Benjamin Eberlei", "email": "kontakt@beberlei.de"}, + {"name": "Jonathan Wage", "email": "jonwage@gmail.com"}, + {"name": "Johannes Schmitt", "email": "schmittjoh@gmail.com"}, + {"name": "Marco Pivetta", "email": "ocramius@gmail.com"} + ], + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^6.0", + "phpunit/phpunit": "^7.0" + }, + "conflict": { + "doctrine/common": "<2.9@dev" + }, + "config": { + "sort-packages": true + }, + "autoload": { + "psr-4": { + "Doctrine\\Common\\": "lib/Doctrine/Common" + } + }, + "autoload-dev": { + "psr-4": { + "Doctrine\\Tests\\": "tests/Doctrine/Tests" + } + }, + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + } +} diff --git a/app/vendor/doctrine/event-manager/lib/Doctrine/Common/EventArgs.php b/app/vendor/doctrine/event-manager/lib/Doctrine/Common/EventArgs.php new file mode 100644 index 000000000..9b9cc0565 --- /dev/null +++ b/app/vendor/doctrine/event-manager/lib/Doctrine/Common/EventArgs.php @@ -0,0 +1,45 @@ + => + * + * @var object[][] + */ + private $_listeners = []; + + /** + * Dispatches an event to all registered listeners. + * + * @param string $eventName The name of the event to dispatch. The name of the event is + * the name of the method that is invoked on listeners. + * @param EventArgs|null $eventArgs The event arguments to pass to the event handlers/listeners. + * If not supplied, the single empty EventArgs instance is used. + * + * @return void + */ + public function dispatchEvent($eventName, ?EventArgs $eventArgs = null) + { + if (! isset($this->_listeners[$eventName])) { + return; + } + + $eventArgs = $eventArgs ?? EventArgs::getEmptyInstance(); + + foreach ($this->_listeners[$eventName] as $listener) { + $listener->$eventName($eventArgs); + } + } + + /** + * Gets the listeners of a specific event or all listeners. + * + * @param string|null $event The name of the event. + * + * @return object[]|object[][] The event listeners for the specified event, or all event listeners. + */ + public function getListeners($event = null) + { + return $event ? $this->_listeners[$event] : $this->_listeners; + } + + /** + * Checks whether an event has any registered listeners. + * + * @param string $event + * + * @return bool TRUE if the specified event has any listeners, FALSE otherwise. + */ + public function hasListeners($event) + { + return ! empty($this->_listeners[$event]); + } + + /** + * Adds an event listener that listens on the specified events. + * + * @param string|string[] $events The event(s) to listen on. + * @param object $listener The listener object. + * + * @return void + */ + public function addEventListener($events, $listener) + { + // Picks the hash code related to that listener + $hash = spl_object_hash($listener); + + foreach ((array) $events as $event) { + // Overrides listener if a previous one was associated already + // Prevents duplicate listeners on same event (same instance only) + $this->_listeners[$event][$hash] = $listener; + } + } + + /** + * Removes an event listener from the specified events. + * + * @param string|string[] $events + * @param object $listener + * + * @return void + */ + public function removeEventListener($events, $listener) + { + // Picks the hash code related to that listener + $hash = spl_object_hash($listener); + + foreach ((array) $events as $event) { + unset($this->_listeners[$event][$hash]); + } + } + + /** + * Adds an EventSubscriber. The subscriber is asked for all the events it is + * interested in and added as a listener for these events. + * + * @param EventSubscriber $subscriber The subscriber. + * + * @return void + */ + public function addEventSubscriber(EventSubscriber $subscriber) + { + $this->addEventListener($subscriber->getSubscribedEvents(), $subscriber); + } + + /** + * Removes an EventSubscriber. The subscriber is asked for all the events it is + * interested in and removed as a listener for these events. + * + * @param EventSubscriber $subscriber The subscriber. + * + * @return void + */ + public function removeEventSubscriber(EventSubscriber $subscriber) + { + $this->removeEventListener($subscriber->getSubscribedEvents(), $subscriber); + } +} diff --git a/app/vendor/doctrine/event-manager/lib/Doctrine/Common/EventSubscriber.php b/app/vendor/doctrine/event-manager/lib/Doctrine/Common/EventSubscriber.php new file mode 100644 index 000000000..7d5e2ea3f --- /dev/null +++ b/app/vendor/doctrine/event-manager/lib/Doctrine/Common/EventSubscriber.php @@ -0,0 +1,21 @@ + false, 'yoda_style' => false, 'phpdoc_types_order' => array('null_adjustment' => 'none', 'sort_algorithm' => 'none'), + 'no_superfluous_phpdoc_tags' => false, )) ->setFinder($finder) ; diff --git a/app/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Constraint.php b/app/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Constraint.php index a53130df1..c61b89ad2 100644 --- a/app/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Constraint.php +++ b/app/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Constraint.php @@ -42,10 +42,15 @@ abstract class Constraint extends BaseConstraint implements ConstraintInterface protected function incrementPath(JsonPointer $path = null, $i) { $path = $path ?: new JsonPointer(''); + + if ($i === null || $i === '') { + return $path; + } + $path = $path->withPropertyPaths( array_merge( $path->getPropertyPaths(), - array_filter(array($i), 'strlen') + array($i) ) ); diff --git a/app/vendor/laminas/laminas-diactoros/.laminas-ci.json b/app/vendor/laminas/laminas-diactoros/.laminas-ci.json index d409bafea..e50b00a1c 100644 --- a/app/vendor/laminas/laminas-diactoros/.laminas-ci.json +++ b/app/vendor/laminas/laminas-diactoros/.laminas-ci.json @@ -1,5 +1,8 @@ { "extensions": [ "gd" - ] -} \ No newline at end of file + ], + "ignore_php_platform_requirements": { + "8.1": true + } +} diff --git a/app/vendor/laminas/laminas-diactoros/README.md b/app/vendor/laminas/laminas-diactoros/README.md index 727873817..9d34c9deb 100644 --- a/app/vendor/laminas/laminas-diactoros/README.md +++ b/app/vendor/laminas/laminas-diactoros/README.md @@ -1,6 +1,6 @@ # laminas-diactoros -[![Build Status](https://github.com/laminas/laminas-diactoros/workflows/continuous-integration.yml/badge.svg)](https://github.com/laminas/laminas-diactoros/actions/workflows/continuous-integration.yml) +[![Build Status](https://github.com/laminas/laminas-diactoros/workflows/Continuous%20Integration/badge.svg)](https://github.com/laminas/laminas-diactoros/actions/workflows/continuous-integration.yml) > Diactoros (pronunciation: `/dɪʌktɒrɒs/`): an epithet for Hermes, meaning literally, "the messenger." @@ -10,8 +10,8 @@ This package supercedes and replaces [phly/http](https://github.com/phly/http). [PSR-7 HTTP message interfaces](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-7-http-message.md) and [PSR-17 HTTP message factory interfaces](https://www.php-fig.org/psr/psr-17). -* File issues at https://github.com/laminas/laminas-diactoros/issues -* Issue patches to https://github.com/laminas/laminas-diactoros/pulls +- File issues at https://github.com/laminas/laminas-diactoros/issues +- Issue patches to https://github.com/laminas/laminas-diactoros/pulls ## Documentation @@ -20,3 +20,11 @@ Documentation is available at: - https://docs.laminas.dev/laminas-diactoros/ Source files for documentation are [in the docs/ tree](docs/). + +----- + +## Contributing and Support + +- If you need support with the project, read [the support documentation](https://github.com/laminas/.github/blob/main/SUPPORT.md). +- If you wish to contribute to the project, read the [contributing guidelines](https://github.com/laminas/.github/blob/main/CONTRIBUTING.md) as well as the [Code of Conduct](https://github.com/laminas/.github/blob/main/CODE_OF_CONDUCT.md). +- For reporting security issues, please review our [security policy](https://github.com/laminas/.github/blob/main/SECURITY.md). diff --git a/app/vendor/laminas/laminas-diactoros/composer.json b/app/vendor/laminas/laminas-diactoros/composer.json index 313ba9446..99b4b8c77 100644 --- a/app/vendor/laminas/laminas-diactoros/composer.json +++ b/app/vendor/laminas/laminas-diactoros/composer.json @@ -28,8 +28,7 @@ } }, "require": { - "php": "^7.3 || ~8.0.0", - "laminas/laminas-zendframework-bridge": "^1.0", + "php": "^7.3 || ~8.0.0 || ~8.1.0", "psr/http-factory": "^1.0", "psr/http-message": "^1.0" }, @@ -51,7 +50,8 @@ "psr/http-message-implementation": "1.0" }, "conflict": { - "phpspec/prophecy": "<1.9.0" + "phpspec/prophecy": "<1.9.0", + "zendframework/zend-diactoros": "*" }, "autoload": { "files": [ @@ -91,8 +91,5 @@ "test": "phpunit --colors=always", "test-coverage": "phpunit --colors=always --coverage-clover clover.xml", "static-analysis": "psalm --shepherd --stats" - }, - "replace": { - "zendframework/zend-diactoros": "^2.2.1" } } diff --git a/app/vendor/laminas/laminas-diactoros/composer.lock b/app/vendor/laminas/laminas-diactoros/composer.lock index 522828482..22491b5c1 100644 --- a/app/vendor/laminas/laminas-diactoros/composer.lock +++ b/app/vendor/laminas/laminas-diactoros/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "c2bdcdc067ad6faa9fd0dfc5a71b9be6", + "content-hash": "9efeef15f9861d48857dd22552aee390", "packages": [ { "name": "laminas/laminas-zendframework-bridge", @@ -2957,6 +2957,7 @@ "type": "github" } ], + "abandoned": true, "time": "2020-09-28T06:45:17+00:00" }, { @@ -4166,7 +4167,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": "^7.3 || ~8.0.0" + "php": "^7.3 || ~8.0.0 || ~8.1.0" }, "platform-dev": { "ext-curl": "*", @@ -4174,5 +4175,5 @@ "ext-gd": "*", "ext-libxml": "*" }, - "plugin-api-version": "2.0.0" + "plugin-api-version": "2.1.0" } diff --git a/app/vendor/laminas/laminas-diactoros/psalm-baseline.xml b/app/vendor/laminas/laminas-diactoros/psalm-baseline.xml index cfa7df05b..1c9bade42 100644 --- a/app/vendor/laminas/laminas-diactoros/psalm-baseline.xml +++ b/app/vendor/laminas/laminas-diactoros/psalm-baseline.xml @@ -1,5 +1,5 @@ - + $contents @@ -515,60 +515,7 @@ - - $name - $name - $value - $value - $value - $value - $value - $value - $value - $value - $version - - - headersWithInjectionVectors - invalidArrayHeaderValues - invalidGeneralHeaderValues - invalidHeaderValueTypes - invalidHeaderValues - invalidProtocolVersionProvider - numericHeaderValuesProvider - testAddHeaderAppendsToExistingHeader - testBodyMutatorReturnsCloneWithChanges - testCanRemoveHeaders - testDoesNotAllowCRLFInjectionWhenCallingWithAddedHeader - testDoesNotAllowCRLFInjectionWhenCallingWithHeader - testGetHeaderLineReturnsEmptyStringWhenHeaderDoesNotExist - testGetHeaderLineReturnsHeaderValueAsCommaConcatenatedString - testGetHeaderReturnsAnEmptyArrayWhenHeaderDoesNotExist - testGetHeaderReturnsHeaderValueAsArray - testGetHeadersKeepsHeaderCaseSensitivity - testGetHeadersReturnsCaseWithWhichHeaderFirstRegistered - testHasHeaderReturnsFalseIfHeaderIsNotPresent - testHasHeaderReturnsTrueIfHeaderIsPresent - testHeaderRemovalIsCaseInsensitive - testHeadersInitialization - testProtocolHasAcceptableDefault - testProtocolMutatorReturnsCloneWithChanges - testUsesStreamProvidedInConstructorAsBody - testWithAddedHeaderAllowsHeaderContinuations - testWithAddedHeaderRaisesExceptionForNonStringNonArrayValue - testWithHeaderAllowsHeaderContinuations - testWithHeaderRaisesExceptionForInvalidNestedHeaderValue - testWithHeaderRaisesExceptionForInvalidValueType - testWithHeaderReplacesDifferentCapitalization - testWithHeaderShouldAllowIntegersAndFloats - testWithHeaderShouldRaiseExceptionForInvalidHeaderScalarValues - testWithHeaderShouldRaiseExceptionForInvalidHeaderValuesInArrays - testWithProtocolVersionRaisesExceptionForInvalidVersion - testWithoutHeaderDoesNothingIfHeaderDoesNotExist - - - $name - $name + $value $value $value @@ -577,17 +524,11 @@ $value $version - + [ $value ] [ $value ] [ $value ] - - $values['array'] - - - $values - diff --git a/app/vendor/laminas/laminas-diactoros/src/MessageTrait.php b/app/vendor/laminas/laminas-diactoros/src/MessageTrait.php index e490bd3ea..1c240d10a 100644 --- a/app/vendor/laminas/laminas-diactoros/src/MessageTrait.php +++ b/app/vendor/laminas/laminas-diactoros/src/MessageTrait.php @@ -370,7 +370,7 @@ private function validateProtocolVersion($version) : void // HTTP/1 uses a "." numbering scheme to indicate // versions of the protocol, while HTTP/2 does not. - if (! preg_match('#^(1\.[01]|2)$#', $version)) { + if (! preg_match('#^(1\.[01]|2(\.0)?)$#', $version)) { throw new Exception\InvalidArgumentException(sprintf( 'Unsupported HTTP protocol version "%s" provided', $version diff --git a/app/vendor/laminas/laminas-diactoros/src/UploadedFile.php b/app/vendor/laminas/laminas-diactoros/src/UploadedFile.php index f2d1e3b55..fe857f4f5 100644 --- a/app/vendor/laminas/laminas-diactoros/src/UploadedFile.php +++ b/app/vendor/laminas/laminas-diactoros/src/UploadedFile.php @@ -80,7 +80,7 @@ class UploadedFile implements UploadedFileInterface private $stream; /** - * @param string|resource $streamOrFile + * @param string|resource|StreamInterface $streamOrFile * @param int $size * @param int $errorStatus * @param string|null $clientFilename diff --git a/app/vendor/laminas/laminas-httphandlerrunner/CHANGELOG.md b/app/vendor/laminas/laminas-httphandlerrunner/CHANGELOG.md index ebdf9eeec..1f09be2a4 100644 --- a/app/vendor/laminas/laminas-httphandlerrunner/CHANGELOG.md +++ b/app/vendor/laminas/laminas-httphandlerrunner/CHANGELOG.md @@ -2,6 +2,25 @@ All notable changes to this project will be documented in this file, in reverse chronological order by release. +## 1.5.0 - 2021-09-22 + + +----- + +### Release Notes for [1.5.0](https://github.com/laminas/laminas-httphandlerrunner/milestone/6) + +Feature release (minor) + +### 1.5.0 + +- Total issues resolved: **0** +- Total pull requests resolved: **1** +- Total contributors: **1** + +#### Enhancement + + - [24: Support PHP 8.1](https://github.com/laminas/laminas-httphandlerrunner/pull/24) thanks to @Ocramius + ## 1.4.0 - 2021-04-08 diff --git a/app/vendor/laminas/laminas-httphandlerrunner/composer.json b/app/vendor/laminas/laminas-httphandlerrunner/composer.json index 067bc8892..d85d92b79 100644 --- a/app/vendor/laminas/laminas-httphandlerrunner/composer.json +++ b/app/vendor/laminas/laminas-httphandlerrunner/composer.json @@ -27,7 +27,7 @@ } }, "require": { - "php": "^7.3 || ~8.0.0", + "php": "^7.3 || ~8.0.0 || ~8.1.0", "laminas/laminas-zendframework-bridge": "^1.0", "psr/http-message": "^1.0", "psr/http-message-implementation": "^1.0", @@ -35,10 +35,10 @@ }, "require-dev": { "laminas/laminas-coding-standard": "~1.0.0", - "laminas/laminas-diactoros": "^2.1.1", - "phpunit/phpunit": "^9.3", - "psalm/plugin-phpunit": "^0.15.1", - "vimeo/psalm": "^4.6" + "laminas/laminas-diactoros": "^2.8.0", + "phpunit/phpunit": "^9.5.9", + "psalm/plugin-phpunit": "^0.16.1", + "vimeo/psalm": "^4.10.0" }, "autoload": { "psr-4": { diff --git a/app/vendor/laminas/laminas-httphandlerrunner/psalm-baseline.xml b/app/vendor/laminas/laminas-httphandlerrunner/psalm-baseline.xml index cd2cee06b..6889aafd4 100644 --- a/app/vendor/laminas/laminas-httphandlerrunner/psalm-baseline.xml +++ b/app/vendor/laminas/laminas-httphandlerrunner/psalm-baseline.xml @@ -1,5 +1,5 @@ - + $index @@ -10,6 +10,11 @@ emit + + ReturnTypeWillChange + ReturnTypeWillChange + ReturnTypeWillChange + InvalidArgumentException InvalidArgumentException @@ -20,9 +25,6 @@ headers_sent() - - assertNoPreviousOutput - $header @@ -34,19 +36,19 @@ $length $remaining - + $length $remaining + $remaining $last $remaining - - - - $emitter - + + $length + $unit + @@ -66,44 +68,7 @@ $serverRequestFactory() - - - testInvocationReturnsArray - testReturnedArrayContainsDependencies - - - ($this->provider)() - - - $this->provider - - - $this->provider - - - - - testDoesNotInjectContentLengthHeaderIfStreamSizeIsUnknown - testDoesNotLetResponseCodeBeOverriddenByPHP - testEmitsMessageBody - testEmitsResponseHeaders - testMultipleSetCookieHeadersAreNotReplaced - - - - nonEmitterValues - testCannotPushNonEmitterToStack - testCannotSetNonEmitterToSpecificIndex - testCannotUnshiftNonEmitterToStack - testEmitLoopsThroughEmittersUntilOneReturnsTrueValue - testEmitReturnsFalseIfLastEmmitterReturnsFalse - testEmitReturnsFalseIfNoEmittersAreComposed - testIsAnEmitterImplementation - testIsAnSplStack - testOffsetSetReplacesExistingValue - testUnshiftAddsNewEmitter - $value $value @@ -166,6 +131,10 @@ $first $last + + $length + $unit + @@ -182,40 +151,23 @@ function (Throwable $e) use ($response) { function (Throwable $e) { - - testRaisesTypeErrorIfServerErrorResponseGeneratorFactoryDoesNotReturnAResponse - testRaisesTypeErrorIfServerRequestFactoryDoesNotReturnARequestInstance - testRunPassesRequestGeneratedByRequestFactoryToHandleWhenNoRequestPassedToRun - testUsesErrorResponseGeneratorToGenerateResponseWhenRequestFactoryRaisesException - - - - - push - reset - + + $e + - - $contents - $data $remainingContents - + $data $remainingContents - $this->contents - - string - string + string - - $data - $remainingContents + is_callable($this->contents) ? ($this->contents)(0) : $this->contents diff --git a/app/vendor/laminas/laminas-httphandlerrunner/src/Emitter/EmitterStack.php b/app/vendor/laminas/laminas-httphandlerrunner/src/Emitter/EmitterStack.php index 3c0d85fbe..5fddede04 100644 --- a/app/vendor/laminas/laminas-httphandlerrunner/src/Emitter/EmitterStack.php +++ b/app/vendor/laminas/laminas-httphandlerrunner/src/Emitter/EmitterStack.php @@ -12,6 +12,7 @@ use Laminas\HttpHandlerRunner\Exception; use Psr\Http\Message\ResponseInterface; +use ReturnTypeWillChange; use SplStack; /** @@ -53,6 +54,7 @@ public function emit(ResponseInterface $response) : bool * @return void * @throws InvalidArgumentException if not an EmitterInterface instance */ + #[ReturnTypeWillChange] public function offsetSet($index, $emitter) { $this->validateEmitter($emitter); @@ -66,6 +68,7 @@ public function offsetSet($index, $emitter) * @return void * @throws InvalidArgumentException if not an EmitterInterface instance */ + #[ReturnTypeWillChange] public function push($emitter) { $this->validateEmitter($emitter); @@ -79,6 +82,7 @@ public function push($emitter) * @return void * @throws InvalidArgumentException if not an EmitterInterface instance */ + #[ReturnTypeWillChange] public function unshift($emitter) { $this->validateEmitter($emitter); diff --git a/app/vendor/laminas/laminas-zendframework-bridge/.github/workflows/release-on-milestone-closed.yml b/app/vendor/laminas/laminas-zendframework-bridge/.github/workflows/release-on-milestone-closed.yml index 6066f8b20..2d88c9476 100644 --- a/app/vendor/laminas/laminas-zendframework-bridge/.github/workflows/release-on-milestone-closed.yml +++ b/app/vendor/laminas/laminas-zendframework-bridge/.github/workflows/release-on-milestone-closed.yml @@ -50,16 +50,6 @@ jobs: "GIT_AUTHOR_NAME": ${{ secrets.GIT_AUTHOR_NAME }} "GIT_AUTHOR_EMAIL": ${{ secrets.GIT_AUTHOR_EMAIL }} - - name: "Bump Changelog Version On Originating Release Branch" - uses: "laminas/automatic-releases@v1" - with: - command-name: "laminas:automatic-releases:bump-changelog" - env: - "GITHUB_TOKEN": ${{ secrets.GITHUB_TOKEN }} - "SIGNING_SECRET_KEY": ${{ secrets.SIGNING_SECRET_KEY }} - "GIT_AUTHOR_NAME": ${{ secrets.GIT_AUTHOR_NAME }} - "GIT_AUTHOR_EMAIL": ${{ secrets.GIT_AUTHOR_EMAIL }} - - name: "Create new milestones" uses: "laminas/automatic-releases@v1" with: diff --git a/app/vendor/laminas/laminas-zendframework-bridge/.laminas-ci.json b/app/vendor/laminas/laminas-zendframework-bridge/.laminas-ci.json new file mode 100644 index 000000000..bce3fa21b --- /dev/null +++ b/app/vendor/laminas/laminas-zendframework-bridge/.laminas-ci.json @@ -0,0 +1,5 @@ +{ + "ignore_php_platform_requirements": { + "8.1": true + } +} diff --git a/app/vendor/laminas/laminas-zendframework-bridge/CHANGELOG.md b/app/vendor/laminas/laminas-zendframework-bridge/CHANGELOG.md deleted file mode 100644 index 646828a65..000000000 --- a/app/vendor/laminas/laminas-zendframework-bridge/CHANGELOG.md +++ /dev/null @@ -1,734 +0,0 @@ -# Changelog - -All notable changes to this project will be documented in this file, in reverse chronological order by release. - -## 1.2.1 - TBD - -### Added - -- Nothing. - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- Nothing. - -## 1.2.0 - 2021-02-25 - - ------ - -### Release Notes for [1.2.0](https://github.com/laminas/laminas-zendframework-bridge/milestone/7) - -Feature release (minor) - -## Added - -- Added Psalm support - -## Removed - -- Dropped support for PHP prior 7.3 - -### 1.2.0 - -- Total issues resolved: **1** -- Total pull requests resolved: **2** -- Total contributors: **3** - -#### Enhancement - - - [78: GitHub Actions & Psalm](https://github.com/laminas/laminas-zendframework-bridge/pull/78) thanks to @gsteel and @boesing - -#### Bug - - - [72: Merge release 1.1.1 into 1.2.x](https://github.com/laminas/laminas-zendframework-bridge/pull/72) thanks to @github-actions[bot] - -## 1.1.1 - 2020-09-14 - -### Fixed - -- [#71](https://github.com/laminas/laminas-zendframework-bridge/pull/71) fixes detection of the vendor directory when the `COMPOSER_VENDOR_DIR` env variable is missing or empty. Previously, this could lead to scenarios where a non-existent path was used for finding the bridge autoloader. - ------ - -### Release Notes for [1.1.1](https://github.com/laminas/laminas-zendframework-bridge/milestone/5) - -- Total issues resolved: **0** -- Total pull requests resolved: **1** -- Total contributors: **1** - -#### Bug - - - [71: Verify `COMPOSER_VENDOR_DIR` in conditional](https://github.com/laminas/laminas-zendframework-bridge/pull/71) thanks to @aaronbushnell - -## 1.1.0 - 2020-08-18 - -### Added - -- [#68](https://github.com/laminas/laminas-zendframework-bridge/pull/68) adds support for the upcoming PHP 8.0 release. - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- [#67](https://github.com/laminas/laminas-zendframework-bridge/pull/67) fixes how the Composer autoload file is found, looking first in the `COMPOSER_VENDOR_DIR` before trying to resolve relative to where the package is installed. - -## 1.0.4 - 2020-05-20 - -### Added - -- Nothing. - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- [#66](https://github.com/laminas/laminas-zendframework-bridge/pull/66) ensures that references to BjyAuthorize templates are not rewritten, so that they can be resolved during runtime. - -## 1.0.3 - 2020-04-03 - -### Added - -- Nothing. - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- [#63](https://github.com/laminas/laminas-zendframework-bridge/pull/63) fixes handling of dependency configuration to ensure each of delegators, initializers, and abstract factories are properly handled during configuration post processing. The new approach should allow delegators to work post-migration to Laminas or Mezzio. - -- [#61](https://github.com/laminas/laminas-zendframework-bridge/pull/61) ensures configuration for delegator factories gets rewritten; the functionality broke in version 1.0.1. - -## 1.0.2 - 2020-03-26 - -### Added - -- Nothing. - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- [#55](https://github.com/laminas/laminas-zendframework-bridge/pull/55) adds provisions to ensure that references to legacy classes/interfaces in dependency configuration always create aliases from the legacy to the new classes. Previously, we did straight replacements in the configuration, which could lead to the legacy service no longer being available. Now it will remain available. - -- [#59](https://github.com/laminas/laminas-zendframework-bridge/pull/59) fixes the replacement rules such as to avoid replacing references to API Skeletons packages, classes, or configuration keys. - -- [#57](https://github.com/laminas/laminas-zendframework-bridge/pull/57) fixes how references to the "zf-apigility" key are replaced. Previously, they were rewritten to "laminas-api-tools", but the correct replacement is "api-tools". - -- [#56](https://github.com/laminas/laminas-zendframework-bridge/pull/56) provides a mechanism to add additional maps with multiple levels of namespace separator escaping, in order to ensure that all various known permutations are matched. The escaping is applied to both the original and target, to ensure that rewrites conform to the original escaping. - -- [#56](https://github.com/laminas/laminas-zendframework-bridge/pull/56) makes changes to the replacement rules to ensure we do not replace references to "Zend" or "ZF" if they occur as subnamespaces OR as class names (formerly, we only enforced subnamespaces). Additional rules were provided for cases where one or both occur within our own packages. - -- [#52](https://github.com/laminas/laminas-zendframework-bridge/pull/52) fixes a scenario whereby factory _values_ were not being rewritten during configuration post processing. - -- [#52](https://github.com/laminas/laminas-zendframework-bridge/pull/52) fixes an issue that occurs with the configuration post processor. Previously, when a service name used as a factory or invokable was encountered that referenced a legacy class, it would get rewritten. This would cause issues if the service was not exposed in the original legacy package, however, as there would now be no alias of the legacy service to the new one. This patch modifies the configuration post processor such that it now tests to see if a service name it will rename exists as an alias; if not, it also creates the alias. - -## 1.0.1 - 2020-01-07 - -### Added - -- Nothing. - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- [#47](https://github.com/laminas/laminas-zendframework-bridge/pull/47) adds entries for rewriting the various `::*Zend()` methods exposed in the psr7bridge to `::*Laminas()` during migrations. - -- [#46](https://github.com/laminas/laminas-zendframework-bridge/pull/46) adds a rule to rewrite the config key `use_zend_loader` to `use_laminas_loader`. - -- [#45](https://github.com/laminas/laminas-zendframework-bridge/pull/45) adds a rule to exclude rewriting of view paths provided by the various Doctrine modules targeting the developer tools. - -## 1.0.0 - 2019-12-31 - -### Added - -- First stable release. - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- Nothing. - -## 0.4.5 - 2019-12-23 - -### Added - -- Nothing. - -### Changed - -- [#42](https://github.com/laminas/laminas-zendframework-bridge/pull/42) modifies the replacement rules to no longer rewrite zf-deploy; the package will not be coming to the new organizations. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- Nothing. - -## 0.4.4 - 2019-12-18 - -### Added - -- Nothing. - -### Changed - -- [#40](https://github.com/laminas/laminas-zendframework-bridge/pull/40) adds exclusion rules for subnamespaces that reference Zend, ZF, ZendService, or ZendOAuth to ensure they are not rewritten. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- [#40](https://github.com/laminas/laminas-zendframework-bridge/pull/40) adds exclusions for classes referencing Zend Server product features to ensure they are not rewritten (e.g., `ZendServerDisk`, `ZendServerShm`, `ZendMonitor`). - -## 0.4.3 - 2019-12-17 - -### Added - -- Nothing. - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- [#39](https://github.com/laminas/laminas-zendframework-bridge/pull/39) fixes an issue when using the Auryn DI container. The class `Northwoods\Container\Zend\Config` was incorrectly being renamed to `Northwoods\Container\Laminas\Config` (which should not happen, as it is not a class under our control). - -## 0.4.2 - 2019-12-16 - -### Added - -- Nothing. - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- [#36](https://github.com/laminas/laminas-zendframework-bridge/pull/36) adds some cases for classes that contain the verbiage "Expressive" and "Apigility" ot ensure they are rewritten correctly. - -## 0.4.1 - 2019-12-10 - -### Added - -- Nothing. - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- [#35](https://github.com/laminas/laminas-zendframework-bridge/pull/35) removes zend-debug from the replacement list, as it is not being brought over to Laminas. - -## 0.4.0 - 2019-11-27 - -### Added - -- Nothing. - -### Changed - -- [#32](https://github.com/laminas/laminas-zendframework-bridge/pull/32) changes all references to Expressive to instead reference Mezzio. - -- [#32](https://github.com/laminas/laminas-zendframework-bridge/pull/32) changes all references to Apigility to instead reference Laminas API Tools. The vendor becomes laminas-api-tools, the URL becomes api-tools.getlaminas.org, packages and repos are prefixed with api-tools, and namespaces become `Laminas\ApiTools`. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- Nothing. - -## 0.3.8 - 2019-11-14 - -### Added - -- [#29](https://github.com/laminas/laminas-zendframework-bridge/pull/29) adds entries to translate `ZendDeveloperTools` to `Laminas\DeveloperTools`, and vice-versa. - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- Nothing. - -## 0.3.7 - 2019-11-12 - -### Added - -- Nothing. - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- [#28](https://github.com/laminas/laminas-zendframework-bridge/pull/28) updates the `zenddevelopertools` string to rewrite to `laminas-developer-tools` instead of `laminasdevelopertools`. - -## 0.3.6 - 2019-11-07 - -### Added - -- Nothing. - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- [#27](https://github.com/laminas/laminas-zendframework-bridge/pull/27) adds a rewrite rule for zend-framework.flf => laminas-project.flf. - -## 0.3.5 - 2019-11-06 - -### Added - -- Nothing. - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- [#25](https://github.com/laminas/laminas-zendframework-bridge/pull/25) adds entries for ZendHttp and ZendModule, which are file name segments in files from the zend-feed and zend-config-aggregator-module packages, respectively. - -## 0.3.4 - 2019-11-06 - -### Added - -- Nothing. - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- [#24](https://github.com/laminas/laminas-zendframework-bridge/pull/24) adds a rule to never rewrite the string `Doctrine\Zend`. - -- [#23](https://github.com/laminas/laminas-zendframework-bridge/pull/23) adds a missing map for each of ZendAcl and ZendRbac, which occur in the zend-expressive-authorization-acl and zend-expressive-authorization-rbac packages, respectively. - -## 0.3.3 - 2019-11-06 - -### Added - -- [#22](https://github.com/laminas/laminas-zendframework-bridge/pull/22) adds configuration post-processing features, exposed both as a laminas-config-aggregator post processor (for use with Expressive applications) and as a laminas-modulemanager `EVENT_MERGE_CONFIG` listener (for use with MVC applications). When registered, it will post-process the configuration, replacing known Zend Framework-specific strings with their Laminas replacements. A ruleset is provided that ensures dependency configuration is rewritten in a safe manner, routing configuration is skipped, and certain top-level configuration keys are matched exactly (instead of potentially as substrings or word stems). A later release of laminas-migration will auto-register these tools in applications when possible. - -### Changed - -- [#22](https://github.com/laminas/laminas-zendframework-bridge/pull/22) removes support for PHP versions prior to PHP 5.6. We have decided to only support supported PHP versions, whether that support is via php.net or commercial. The lowest supported PHP version we have found is 5.6. Users wishing to migrate to Laminas must at least update to PHP 5.6 before doing so. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- Nothing. - -## 0.3.2 - 2019-10-30 - -### Added - -- Nothing. - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- [#21](https://github.com/laminas/laminas-zendframework-bridge/pull/21) removes rewriting of the Amazon library, as it is not moving to Laminas. - -- [#21](https://github.com/laminas/laminas-zendframework-bridge/pull/21) removes rewriting of the GCM and APNS libraries, as they are not moving to Laminas. - -### Fixed - -- [#21](https://github.com/laminas/laminas-zendframework-bridge/pull/21) fixes how the recaptcha and twitter library package and namespaces are rewritten. - -## 0.3.1 - 2019-04-25 - -### Added - -- [#20](https://github.com/laminas/laminas-zendframework-bridge/pull/20) provides an additional autoloader that is _prepended_ to the autoloader - stack. This new autoloader will create class aliases for interfaces, classes, - and traits referenced in type hints and class declarations, ensuring PHP is - able to resolve them correctly during class_alias operations. - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- Nothing. - -## 0.3.0 - 2019-04-12 - -### Added - -- Nothing. - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- [#16](https://github.com/laminas/laminas-zendframework-bridge/pull/16) removes the `RewriteRules::classRewrite()` method, as it is no longer - needed due to internal refactoring. - -### Fixed - -- [#16](https://github.com/laminas/laminas-zendframework-bridge/pull/16) fixes how the rewrite rules detect the word `Zend` in subnamespaces and - class names to be both more robust and simpler. - -## 0.2.5 - 2019-04-11 - -### Added - -- [#12](https://github.com/laminas/laminas-zendframework-bridge/pull/12) adds functionality for ensuring we alias namespaces and classes that - include the word `Zend` in them; e.g., `Zend\Expressive\ZendView\ZendViewRendererFactory` - will now alias to `Expressive\LaminasView\LaminasViewRendererFactory`. - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- Nothing. - -## 0.2.4 - 2019-04-11 - -### Added - -- [#11](https://github.com/laminas/laminas-zendframework-bridge/pull/11) adds maps for the Expressive router adapter packages. - -- [#10](https://github.com/laminas/laminas-zendframework-bridge/pull/10) adds a map for the Psr7Bridge package, as it used `Zend` within a subnamespace. - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- Nothing. - -## 0.2.3 - 2019-04-10 - -### Added - -- Nothing. - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- [#9](https://github.com/laminas/laminas-zendframework-bridge/pull/9) fixes the mapping for the Problem Details package. - -## 0.2.2 - 2019-04-10 - -### Added - -- Nothing. - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- Added a check that the discovered alias exists as a class, interface, or trait - before attempting to call `class_alias()`. - -## 0.2.1 - 2019-04-10 - -### Added - -- Nothing. - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- [#8](https://github.com/laminas/laminas-zendframework-bridge/pull/8) fixes mappings for each of zend-expressive-authentication-zendauthentication, - zend-expressive-zendrouter, and zend-expressive-zendviewrenderer. - -## 0.2.0 - 2019-04-01 - -### Added - -- Nothing. - -### Changed - -- [#4](https://github.com/laminas/laminas-zendframework-bridge/pull/4) rewrites the autoloader to be class-based, via the class - `Laminas\ZendFrameworkBridge\Autoloader`. Additionally, the new approach - provides a performance boost by using a balanced tree algorithm, ensuring - matches occur faster. - -### Deprecated - -- Nothing. - -### Removed - -- [#4](https://github.com/laminas/laminas-zendframework-bridge/pull/4) removes function aliasing. Function aliasing will move to the packages that - provide functions. - -### Fixed - -- Nothing. - -## 0.1.0 - 2019-03-27 - -### Added - -- Adds an autoloader file that registers with `spl_autoload_register` a routine - for aliasing legacy ZF class/interface/trait names to Laminas Project - equivalents. - -- Adds autoloader files for aliasing legacy ZF package functions to Laminas - Project equivalents. - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- Nothing. \ No newline at end of file diff --git a/app/vendor/laminas/laminas-zendframework-bridge/composer.json b/app/vendor/laminas/laminas-zendframework-bridge/composer.json index d025ba0e1..3f7af1134 100644 --- a/app/vendor/laminas/laminas-zendframework-bridge/composer.json +++ b/app/vendor/laminas/laminas-zendframework-bridge/composer.json @@ -15,10 +15,10 @@ "forum": "https://discourse.laminas.dev/" }, "require": { - "php": "^7.3 || ^8.0" + "php": "^7.3 || ~8.0.0 || ~8.1.0" }, "require-dev": { - "phpunit/phpunit": "^5.7 || ^6.5 || ^7.5 || ^8.1 || ^9.3", + "phpunit/phpunit": "^9.3", "psalm/plugin-phpunit": "^0.15.1", "squizlabs/php_codesniffer": "^3.5", "vimeo/psalm": "^4.6" diff --git a/app/vendor/laminas/laminas-zendframework-bridge/composer.lock b/app/vendor/laminas/laminas-zendframework-bridge/composer.lock new file mode 100644 index 000000000..9bcac18b2 --- /dev/null +++ b/app/vendor/laminas/laminas-zendframework-bridge/composer.lock @@ -0,0 +1,3841 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "83af626bc1168baa0d5a1e19cb1b5807", + "packages": [], + "packages-dev": [ + { + "name": "amphp/amp", + "version": "v2.6.0", + "source": { + "type": "git", + "url": "https://github.com/amphp/amp.git", + "reference": "caa95edeb1ca1bf7532e9118ede4a3c3126408cc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/amphp/amp/zipball/caa95edeb1ca1bf7532e9118ede4a3c3126408cc", + "reference": "caa95edeb1ca1bf7532e9118ede4a3c3126408cc", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "require-dev": { + "amphp/php-cs-fixer-config": "dev-master", + "amphp/phpunit-util": "^1", + "ext-json": "*", + "jetbrains/phpstorm-stubs": "^2019.3", + "phpunit/phpunit": "^7 | ^8 | ^9", + "psalm/phar": "^3.11@dev", + "react/promise": "^2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Amp\\": "lib" + }, + "files": [ + "lib/functions.php", + "lib/Internal/functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Daniel Lowrey", + "email": "rdlowrey@php.net" + }, + { + "name": "Aaron Piotrowski", + "email": "aaron@trowski.com" + }, + { + "name": "Bob Weinand", + "email": "bobwei9@hotmail.com" + }, + { + "name": "Niklas Keller", + "email": "me@kelunik.com" + } + ], + "description": "A non-blocking concurrency framework for PHP applications.", + "homepage": "http://amphp.org/amp", + "keywords": [ + "async", + "asynchronous", + "awaitable", + "concurrency", + "event", + "event-loop", + "future", + "non-blocking", + "promise" + ], + "support": { + "irc": "irc://irc.freenode.org/amphp", + "issues": "https://github.com/amphp/amp/issues", + "source": "https://github.com/amphp/amp/tree/v2.6.0" + }, + "funding": [ + { + "url": "https://github.com/amphp", + "type": "github" + } + ], + "time": "2021-07-16T20:06:06+00:00" + }, + { + "name": "amphp/byte-stream", + "version": "v1.8.1", + "source": { + "type": "git", + "url": "https://github.com/amphp/byte-stream.git", + "reference": "acbd8002b3536485c997c4e019206b3f10ca15bd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/amphp/byte-stream/zipball/acbd8002b3536485c997c4e019206b3f10ca15bd", + "reference": "acbd8002b3536485c997c4e019206b3f10ca15bd", + "shasum": "" + }, + "require": { + "amphp/amp": "^2", + "php": ">=7.1" + }, + "require-dev": { + "amphp/php-cs-fixer-config": "dev-master", + "amphp/phpunit-util": "^1.4", + "friendsofphp/php-cs-fixer": "^2.3", + "jetbrains/phpstorm-stubs": "^2019.3", + "phpunit/phpunit": "^6 || ^7 || ^8", + "psalm/phar": "^3.11.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Amp\\ByteStream\\": "lib" + }, + "files": [ + "lib/functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Aaron Piotrowski", + "email": "aaron@trowski.com" + }, + { + "name": "Niklas Keller", + "email": "me@kelunik.com" + } + ], + "description": "A stream abstraction to make working with non-blocking I/O simple.", + "homepage": "http://amphp.org/byte-stream", + "keywords": [ + "amp", + "amphp", + "async", + "io", + "non-blocking", + "stream" + ], + "support": { + "irc": "irc://irc.freenode.org/amphp", + "issues": "https://github.com/amphp/byte-stream/issues", + "source": "https://github.com/amphp/byte-stream/tree/v1.8.1" + }, + "funding": [ + { + "url": "https://github.com/amphp", + "type": "github" + } + ], + "time": "2021-03-30T17:13:30+00:00" + }, + { + "name": "composer/package-versions-deprecated", + "version": "1.11.99.3", + "source": { + "type": "git", + "url": "https://github.com/composer/package-versions-deprecated.git", + "reference": "fff576ac850c045158a250e7e27666e146e78d18" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/package-versions-deprecated/zipball/fff576ac850c045158a250e7e27666e146e78d18", + "reference": "fff576ac850c045158a250e7e27666e146e78d18", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.1.0 || ^2.0", + "php": "^7 || ^8" + }, + "replace": { + "ocramius/package-versions": "1.11.99" + }, + "require-dev": { + "composer/composer": "^1.9.3 || ^2.0@dev", + "ext-zip": "^1.13", + "phpunit/phpunit": "^6.5 || ^7" + }, + "type": "composer-plugin", + "extra": { + "class": "PackageVersions\\Installer", + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "PackageVersions\\": "src/PackageVersions" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be" + } + ], + "description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)", + "support": { + "issues": "https://github.com/composer/package-versions-deprecated/issues", + "source": "https://github.com/composer/package-versions-deprecated/tree/1.11.99.3" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2021-08-17T13:49:14+00:00" + }, + { + "name": "composer/semver", + "version": "3.2.5", + "source": { + "type": "git", + "url": "https://github.com/composer/semver.git", + "reference": "31f3ea725711245195f62e54ffa402d8ef2fdba9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/semver/zipball/31f3ea725711245195f62e54ffa402d8ef2fdba9", + "reference": "31f3ea725711245195f62e54ffa402d8ef2fdba9", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^0.12.54", + "symfony/phpunit-bridge": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Semver\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + }, + { + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" + } + ], + "description": "Semver library that offers utilities, version constraint parsing and validation.", + "keywords": [ + "semantic", + "semver", + "validation", + "versioning" + ], + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/semver/issues", + "source": "https://github.com/composer/semver/tree/3.2.5" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2021-05-24T12:41:47+00:00" + }, + { + "name": "composer/xdebug-handler", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/composer/xdebug-handler.git", + "reference": "84674dd3a7575ba617f5a76d7e9e29a7d3891339" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/84674dd3a7575ba617f5a76d7e9e29a7d3891339", + "reference": "84674dd3a7575ba617f5a76d7e9e29a7d3891339", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0 || ^8.0", + "psr/log": "^1 || ^2 || ^3" + }, + "require-dev": { + "phpstan/phpstan": "^0.12.55", + "symfony/phpunit-bridge": "^4.2 || ^5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Composer\\XdebugHandler\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "John Stevenson", + "email": "john-stevenson@blueyonder.co.uk" + } + ], + "description": "Restarts a process without Xdebug.", + "keywords": [ + "Xdebug", + "performance" + ], + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/xdebug-handler/issues", + "source": "https://github.com/composer/xdebug-handler/tree/2.0.2" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2021-07-31T17:03:58+00:00" + }, + { + "name": "dnoegel/php-xdg-base-dir", + "version": "v0.1.1", + "source": { + "type": "git", + "url": "https://github.com/dnoegel/php-xdg-base-dir.git", + "reference": "8f8a6e48c5ecb0f991c2fdcf5f154a47d85f9ffd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dnoegel/php-xdg-base-dir/zipball/8f8a6e48c5ecb0f991c2fdcf5f154a47d85f9ffd", + "reference": "8f8a6e48c5ecb0f991c2fdcf5f154a47d85f9ffd", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "require-dev": { + "phpunit/phpunit": "~7.0|~6.0|~5.0|~4.8.35" + }, + "type": "library", + "autoload": { + "psr-4": { + "XdgBaseDir\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "implementation of xdg base directory specification for php", + "support": { + "issues": "https://github.com/dnoegel/php-xdg-base-dir/issues", + "source": "https://github.com/dnoegel/php-xdg-base-dir/tree/v0.1.1" + }, + "time": "2019-12-04T15:06:13+00:00" + }, + { + "name": "doctrine/instantiator", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/d56bf6102915de5702778fe20f2de3b2fe570b5b", + "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^8.0", + "ext-pdo": "*", + "ext-phar": "*", + "phpbench/phpbench": "^0.13 || 1.0.0-alpha2", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-phpunit": "^0.12", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "https://ocramius.github.io/" + } + ], + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://www.doctrine-project.org/projects/instantiator.html", + "keywords": [ + "constructor", + "instantiate" + ], + "support": { + "issues": "https://github.com/doctrine/instantiator/issues", + "source": "https://github.com/doctrine/instantiator/tree/1.4.0" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", + "type": "tidelift" + } + ], + "time": "2020-11-10T18:47:58+00:00" + }, + { + "name": "felixfbecker/advanced-json-rpc", + "version": "v3.2.1", + "source": { + "type": "git", + "url": "https://github.com/felixfbecker/php-advanced-json-rpc.git", + "reference": "b5f37dbff9a8ad360ca341f3240dc1c168b45447" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/felixfbecker/php-advanced-json-rpc/zipball/b5f37dbff9a8ad360ca341f3240dc1c168b45447", + "reference": "b5f37dbff9a8ad360ca341f3240dc1c168b45447", + "shasum": "" + }, + "require": { + "netresearch/jsonmapper": "^1.0 || ^2.0 || ^3.0 || ^4.0", + "php": "^7.1 || ^8.0", + "phpdocumentor/reflection-docblock": "^4.3.4 || ^5.0.0" + }, + "require-dev": { + "phpunit/phpunit": "^7.0 || ^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "AdvancedJsonRpc\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "ISC" + ], + "authors": [ + { + "name": "Felix Becker", + "email": "felix.b@outlook.com" + } + ], + "description": "A more advanced JSONRPC implementation", + "support": { + "issues": "https://github.com/felixfbecker/php-advanced-json-rpc/issues", + "source": "https://github.com/felixfbecker/php-advanced-json-rpc/tree/v3.2.1" + }, + "time": "2021-06-11T22:34:44+00:00" + }, + { + "name": "felixfbecker/language-server-protocol", + "version": "1.5.1", + "source": { + "type": "git", + "url": "https://github.com/felixfbecker/php-language-server-protocol.git", + "reference": "9d846d1f5cf101deee7a61c8ba7caa0a975cd730" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/felixfbecker/php-language-server-protocol/zipball/9d846d1f5cf101deee7a61c8ba7caa0a975cd730", + "reference": "9d846d1f5cf101deee7a61c8ba7caa0a975cd730", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "require-dev": { + "phpstan/phpstan": "*", + "squizlabs/php_codesniffer": "^3.1", + "vimeo/psalm": "^4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "LanguageServerProtocol\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "ISC" + ], + "authors": [ + { + "name": "Felix Becker", + "email": "felix.b@outlook.com" + } + ], + "description": "PHP classes for the Language Server Protocol", + "keywords": [ + "language", + "microsoft", + "php", + "server" + ], + "support": { + "issues": "https://github.com/felixfbecker/php-language-server-protocol/issues", + "source": "https://github.com/felixfbecker/php-language-server-protocol/tree/1.5.1" + }, + "time": "2021-02-22T14:02:09+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.10.2", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/776f831124e9c62e1a2c601ecc52e776d8bb7220", + "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "replace": { + "myclabs/deep-copy": "self.version" + }, + "require-dev": { + "doctrine/collections": "^1.0", + "doctrine/common": "^2.6", + "phpunit/phpunit": "^7.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + }, + "files": [ + "src/DeepCopy/deep_copy.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "support": { + "issues": "https://github.com/myclabs/DeepCopy/issues", + "source": "https://github.com/myclabs/DeepCopy/tree/1.10.2" + }, + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", + "type": "tidelift" + } + ], + "time": "2020-11-13T09:40:50+00:00" + }, + { + "name": "netresearch/jsonmapper", + "version": "v4.0.0", + "source": { + "type": "git", + "url": "https://github.com/cweiske/jsonmapper.git", + "reference": "8bbc021a8edb2e4a7ea2f8ad4fa9ec9dce2fcb8d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/8bbc021a8edb2e4a7ea2f8ad4fa9ec9dce2fcb8d", + "reference": "8bbc021a8edb2e4a7ea2f8ad4fa9ec9dce2fcb8d", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-pcre": "*", + "ext-reflection": "*", + "ext-spl": "*", + "php": ">=7.1" + }, + "require-dev": { + "phpunit/phpunit": "~7.5 || ~8.0 || ~9.0", + "squizlabs/php_codesniffer": "~3.5" + }, + "type": "library", + "autoload": { + "psr-0": { + "JsonMapper": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "OSL-3.0" + ], + "authors": [ + { + "name": "Christian Weiske", + "email": "cweiske@cweiske.de", + "homepage": "http://github.com/cweiske/jsonmapper/", + "role": "Developer" + } + ], + "description": "Map nested JSON structures onto PHP classes", + "support": { + "email": "cweiske@cweiske.de", + "issues": "https://github.com/cweiske/jsonmapper/issues", + "source": "https://github.com/cweiske/jsonmapper/tree/v4.0.0" + }, + "time": "2020-12-01T19:48:11+00:00" + }, + { + "name": "nikic/php-parser", + "version": "v4.12.0", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "6608f01670c3cc5079e18c1dab1104e002579143" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/6608f01670c3cc5079e18c1dab1104e002579143", + "reference": "6608f01670c3cc5079e18c1dab1104e002579143", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=7.0" + }, + "require-dev": { + "ircmaxell/php-yacc": "^0.0.7", + "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.9-dev" + } + }, + "autoload": { + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "support": { + "issues": "https://github.com/nikic/PHP-Parser/issues", + "source": "https://github.com/nikic/PHP-Parser/tree/v4.12.0" + }, + "time": "2021-07-21T10:44:31+00:00" + }, + { + "name": "openlss/lib-array2xml", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/nullivex/lib-array2xml.git", + "reference": "a91f18a8dfc69ffabe5f9b068bc39bb202c81d90" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nullivex/lib-array2xml/zipball/a91f18a8dfc69ffabe5f9b068bc39bb202c81d90", + "reference": "a91f18a8dfc69ffabe5f9b068bc39bb202c81d90", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "type": "library", + "autoload": { + "psr-0": { + "LSS": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Bryan Tong", + "email": "bryan@nullivex.com", + "homepage": "https://www.nullivex.com" + }, + { + "name": "Tony Butler", + "email": "spudz76@gmail.com", + "homepage": "https://www.nullivex.com" + } + ], + "description": "Array2XML conversion library credit to lalit.org", + "homepage": "https://www.nullivex.com", + "keywords": [ + "array", + "array conversion", + "xml", + "xml conversion" + ], + "support": { + "issues": "https://github.com/nullivex/lib-array2xml/issues", + "source": "https://github.com/nullivex/lib-array2xml/tree/master" + }, + "time": "2019-03-29T20:06:56+00:00" + }, + { + "name": "phar-io/manifest", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "97803eca37d319dfa7826cc2437fc020857acb53" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", + "reference": "97803eca37d319dfa7826cc2437fc020857acb53", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-phar": "*", + "ext-xmlwriter": "*", + "phar-io/version": "^3.0.1", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "support": { + "issues": "https://github.com/phar-io/manifest/issues", + "source": "https://github.com/phar-io/manifest/tree/2.0.3" + }, + "time": "2021-07-20T11:28:43+00:00" + }, + { + "name": "phar-io/version", + "version": "3.1.0", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "bae7c545bef187884426f042434e561ab1ddb182" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/bae7c545bef187884426f042434e561ab1ddb182", + "reference": "bae7c545bef187884426f042434e561ab1ddb182", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Library for handling version information and constraints", + "support": { + "issues": "https://github.com/phar-io/version/issues", + "source": "https://github.com/phar-io/version/tree/3.1.0" + }, + "time": "2021-02-23T14:00:09+00:00" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "2.2.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-2.x": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" + } + ], + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "FQSEN", + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" + ], + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", + "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x" + }, + "time": "2020-06-27T09:03:43+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "5.2.2", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "069a785b2141f5bcf49f3e353548dc1cce6df556" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/069a785b2141f5bcf49f3e353548dc1cce6df556", + "reference": "069a785b2141f5bcf49f3e353548dc1cce6df556", + "shasum": "" + }, + "require": { + "ext-filter": "*", + "php": "^7.2 || ^8.0", + "phpdocumentor/reflection-common": "^2.2", + "phpdocumentor/type-resolver": "^1.3", + "webmozart/assert": "^1.9.1" + }, + "require-dev": { + "mockery/mockery": "~1.3.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + }, + { + "name": "Jaap van Otterdijk", + "email": "account@ijaap.nl" + } + ], + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/master" + }, + "time": "2020-09-03T19:13:55+00:00" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0", + "reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0", + "phpdocumentor/reflection-common": "^2.0" + }, + "require-dev": { + "ext-tokenizer": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-1.x": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", + "support": { + "issues": "https://github.com/phpDocumentor/TypeResolver/issues", + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.4.0" + }, + "time": "2020-09-17T18:55:26+00:00" + }, + { + "name": "phpspec/prophecy", + "version": "1.13.0", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "be1996ed8adc35c3fd795488a653f4b518be70ea" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/be1996ed8adc35c3fd795488a653f4b518be70ea", + "reference": "be1996ed8adc35c3fd795488a653f4b518be70ea", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.2", + "php": "^7.2 || ~8.0, <8.1", + "phpdocumentor/reflection-docblock": "^5.2", + "sebastian/comparator": "^3.0 || ^4.0", + "sebastian/recursion-context": "^3.0 || ^4.0" + }, + "require-dev": { + "phpspec/phpspec": "^6.0", + "phpunit/phpunit": "^8.0 || ^9.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.11.x-dev" + } + }, + "autoload": { + "psr-4": { + "Prophecy\\": "src/Prophecy" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + }, + { + "name": "Marcello Duarte", + "email": "marcello.duarte@gmail.com" + } + ], + "description": "Highly opinionated mocking framework for PHP 5.3+", + "homepage": "https://github.com/phpspec/prophecy", + "keywords": [ + "Double", + "Dummy", + "fake", + "mock", + "spy", + "stub" + ], + "support": { + "issues": "https://github.com/phpspec/prophecy/issues", + "source": "https://github.com/phpspec/prophecy/tree/1.13.0" + }, + "time": "2021-03-17T13:42:18+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "9.2.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "f6293e1b30a2354e8428e004689671b83871edde" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/f6293e1b30a2354e8428e004689671b83871edde", + "reference": "f6293e1b30a2354e8428e004689671b83871edde", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-libxml": "*", + "ext-xmlwriter": "*", + "nikic/php-parser": "^4.10.2", + "php": ">=7.3", + "phpunit/php-file-iterator": "^3.0.3", + "phpunit/php-text-template": "^2.0.2", + "sebastian/code-unit-reverse-lookup": "^2.0.2", + "sebastian/complexity": "^2.0", + "sebastian/environment": "^5.1.2", + "sebastian/lines-of-code": "^1.0.3", + "sebastian/version": "^3.0.1", + "theseer/tokenizer": "^1.2.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-pcov": "*", + "ext-xdebug": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "9.2-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.6" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-03-28T07:26:59+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "3.0.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "aa4be8575f26070b100fccb67faabb28f21f66f8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/aa4be8575f26070b100fccb67faabb28f21f66f8", + "reference": "aa4be8575f26070b100fccb67faabb28f21f66f8", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.5" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:57:25+00:00" + }, + { + "name": "phpunit/php-invoker", + "version": "3.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-invoker.git", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "ext-pcntl": "*", + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-pcntl": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Invoke callables with a timeout", + "homepage": "https://github.com/sebastianbergmann/php-invoker/", + "keywords": [ + "process" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-invoker/issues", + "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:58:55+00:00" + }, + { + "name": "phpunit/php-text-template", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-text-template/issues", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T05:33:50+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "5.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-timer/issues", + "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:16:10+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "9.5.9", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "ea8c2dfb1065eb35a79b3681eee6e6fb0a6f273b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/ea8c2dfb1065eb35a79b3681eee6e6fb0a6f273b", + "reference": "ea8c2dfb1065eb35a79b3681eee6e6fb0a6f273b", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.3.1", + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "ext-xmlwriter": "*", + "myclabs/deep-copy": "^1.10.1", + "phar-io/manifest": "^2.0.3", + "phar-io/version": "^3.0.2", + "php": ">=7.3", + "phpspec/prophecy": "^1.12.1", + "phpunit/php-code-coverage": "^9.2.3", + "phpunit/php-file-iterator": "^3.0.5", + "phpunit/php-invoker": "^3.1.1", + "phpunit/php-text-template": "^2.0.3", + "phpunit/php-timer": "^5.0.2", + "sebastian/cli-parser": "^1.0.1", + "sebastian/code-unit": "^1.0.6", + "sebastian/comparator": "^4.0.5", + "sebastian/diff": "^4.0.3", + "sebastian/environment": "^5.1.3", + "sebastian/exporter": "^4.0.3", + "sebastian/global-state": "^5.0.1", + "sebastian/object-enumerator": "^4.0.3", + "sebastian/resource-operations": "^3.0.3", + "sebastian/type": "^2.3.4", + "sebastian/version": "^3.0.2" + }, + "require-dev": { + "ext-pdo": "*", + "phpspec/prophecy-phpunit": "^2.0.1" + }, + "suggest": { + "ext-soap": "*", + "ext-xdebug": "*" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "9.5-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ], + "files": [ + "src/Framework/Assert/Functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/phpunit/issues", + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.9" + }, + "funding": [ + { + "url": "https://phpunit.de/donate.html", + "type": "custom" + }, + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-08-31T06:47:40+00:00" + }, + { + "name": "psalm/plugin-phpunit", + "version": "0.15.2", + "source": { + "type": "git", + "url": "https://github.com/psalm/psalm-plugin-phpunit.git", + "reference": "31d15bbc0169a3c454e495e03fd8a6ccb663661b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/psalm/psalm-plugin-phpunit/zipball/31d15bbc0169a3c454e495e03fd8a6ccb663661b", + "reference": "31d15bbc0169a3c454e495e03fd8a6ccb663661b", + "shasum": "" + }, + "require": { + "composer/package-versions-deprecated": "^1.10", + "composer/semver": "^1.4 || ^2.0 || ^3.0", + "ext-simplexml": "*", + "php": "^7.1 || ^8.0", + "vimeo/psalm": "dev-master || dev-4.x || ^4.0" + }, + "conflict": { + "phpunit/phpunit": "<7.5" + }, + "require-dev": { + "codeception/codeception": "^4.0.3", + "php": "^7.3 || ^8.0", + "phpunit/phpunit": "^7.5 || ^8.0 || ^9.0", + "squizlabs/php_codesniffer": "^3.3.1", + "weirdan/codeception-psalm-module": "^0.11.0", + "weirdan/prophecy-shim": "^1.0 || ^2.0" + }, + "type": "psalm-plugin", + "extra": { + "psalm": { + "pluginClass": "Psalm\\PhpUnitPlugin\\Plugin" + } + }, + "autoload": { + "psr-4": { + "Psalm\\PhpUnitPlugin\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matt Brown", + "email": "github@muglug.com" + } + ], + "description": "Psalm plugin for PHPUnit", + "support": { + "issues": "https://github.com/psalm/psalm-plugin-phpunit/issues", + "source": "https://github.com/psalm/psalm-plugin-phpunit/tree/0.15.2" + }, + "time": "2021-05-29T19:11:38+00:00" + }, + { + "name": "psr/container", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/8622567409010282b7aeebe4bb841fe98b58dcaf", + "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf", + "shasum": "" + }, + "require": { + "php": ">=7.2.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/1.1.1" + }, + "time": "2021-03-05T17:36:06+00:00" + }, + { + "name": "psr/log", + "version": "1.1.4", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "d49695b909c3b7628b6289db5479a1c204601f11" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", + "reference": "d49695b909c3b7628b6289db5479a1c204601f11", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "support": { + "source": "https://github.com/php-fig/log/tree/1.1.4" + }, + "time": "2021-05-03T11:20:27+00:00" + }, + { + "name": "sebastian/cli-parser", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/cli-parser.git", + "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for parsing CLI options", + "homepage": "https://github.com/sebastianbergmann/cli-parser", + "support": { + "issues": "https://github.com/sebastianbergmann/cli-parser/issues", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:08:49+00:00" + }, + { + "name": "sebastian/code-unit", + "version": "1.0.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit.git", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the PHP code units", + "homepage": "https://github.com/sebastianbergmann/code-unit", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit/issues", + "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:08:54+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:30:19+00:00" + }, + { + "name": "sebastian/comparator", + "version": "4.0.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "55f4261989e546dc112258c7a75935a81a7ce382" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/55f4261989e546dc112258c7a75935a81a7ce382", + "reference": "55f4261989e546dc112258c7a75935a81a7ce382", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/diff": "^4.0", + "sebastian/exporter": "^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "https://github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/comparator/issues", + "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.6" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T15:49:45+00:00" + }, + { + "name": "sebastian/complexity", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/complexity.git", + "reference": "739b35e53379900cc9ac327b2147867b8b6efd88" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/739b35e53379900cc9ac327b2147867b8b6efd88", + "reference": "739b35e53379900cc9ac327b2147867b8b6efd88", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.7", + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for calculating the complexity of PHP code units", + "homepage": "https://github.com/sebastianbergmann/complexity", + "support": { + "issues": "https://github.com/sebastianbergmann/complexity/issues", + "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T15:52:27+00:00" + }, + { + "name": "sebastian/diff", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/3461e3fccc7cfdfc2720be910d3bd73c69be590d", + "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3", + "symfony/process": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff", + "udiff", + "unidiff", + "unified diff" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/diff/issues", + "source": "https://github.com/sebastianbergmann/diff/tree/4.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:10:38+00:00" + }, + { + "name": "sebastian/environment", + "version": "5.1.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "388b6ced16caa751030f6a69e588299fa09200ac" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/388b6ced16caa751030f6a69e588299fa09200ac", + "reference": "388b6ced16caa751030f6a69e588299fa09200ac", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-posix": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/environment/issues", + "source": "https://github.com/sebastianbergmann/environment/tree/5.1.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:52:38+00:00" + }, + { + "name": "sebastian/exporter", + "version": "4.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "d89cc98761b8cb5a1a235a6b703ae50d34080e65" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/d89cc98761b8cb5a1a235a6b703ae50d34080e65", + "reference": "d89cc98761b8cb5a1a235a6b703ae50d34080e65", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "http://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/exporter/issues", + "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:24:23+00:00" + }, + { + "name": "sebastian/global-state", + "version": "5.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "23bd5951f7ff26f12d4e3242864df3e08dec4e49" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/23bd5951f7ff26f12d4e3242864df3e08dec4e49", + "reference": "23bd5951f7ff26f12d4e3242864df3e08dec4e49", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "ext-dom": "*", + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-uopz": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/global-state/issues", + "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-06-11T13:31:12+00:00" + }, + { + "name": "sebastian/lines-of-code", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/lines-of-code.git", + "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/c1c2e997aa3146983ed888ad08b15470a2e22ecc", + "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.6", + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for counting the lines of code in PHP source code", + "homepage": "https://github.com/sebastianbergmann/lines-of-code", + "support": { + "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-11-28T06:42:11+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:12:34+00:00" + }, + { + "name": "sebastian/object-reflector", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-reflector/issues", + "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:14:26+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/cd9d8cf3c5804de4341c283ed787f099f5506172", + "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "support": { + "issues": "https://github.com/sebastianbergmann/recursion-context/issues", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:17:30+00:00" + }, + { + "name": "sebastian/resource-operations", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", + "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "support": { + "issues": "https://github.com/sebastianbergmann/resource-operations/issues", + "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:45:17+00:00" + }, + { + "name": "sebastian/type", + "version": "2.3.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "b8cd8a1c753c90bc1a0f5372170e3e489136f914" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/b8cd8a1c753c90bc1a0f5372170e3e489136f914", + "reference": "b8cd8a1c753c90bc1a0f5372170e3e489136f914", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the types of the PHP type system", + "homepage": "https://github.com/sebastianbergmann/type", + "support": { + "issues": "https://github.com/sebastianbergmann/type/issues", + "source": "https://github.com/sebastianbergmann/type/tree/2.3.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-06-15T12:49:02+00:00" + }, + { + "name": "sebastian/version", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "c6c1022351a901512170118436c764e473f6de8c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", + "reference": "c6c1022351a901512170118436c764e473f6de8c", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "support": { + "issues": "https://github.com/sebastianbergmann/version/issues", + "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:39:44+00:00" + }, + { + "name": "squizlabs/php_codesniffer", + "version": "3.6.0", + "source": { + "type": "git", + "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", + "reference": "ffced0d2c8fa8e6cdc4d695a743271fab6c38625" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/ffced0d2c8fa8e6cdc4d695a743271fab6c38625", + "reference": "ffced0d2c8fa8e6cdc4d695a743271fab6c38625", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" + }, + "bin": [ + "bin/phpcs", + "bin/phpcbf" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Greg Sherwood", + "role": "lead" + } + ], + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", + "keywords": [ + "phpcs", + "standards" + ], + "support": { + "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", + "source": "https://github.com/squizlabs/PHP_CodeSniffer", + "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" + }, + "time": "2021-04-09T00:54:41+00:00" + }, + { + "name": "symfony/console", + "version": "v5.3.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "8b1008344647462ae6ec57559da166c2bfa5e16a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/8b1008344647462ae6ec57559da166c2bfa5e16a", + "reference": "8b1008344647462ae6ec57559da166c2bfa5e16a", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php73": "^1.8", + "symfony/polyfill-php80": "^1.16", + "symfony/service-contracts": "^1.1|^2", + "symfony/string": "^5.1" + }, + "conflict": { + "psr/log": ">=3", + "symfony/dependency-injection": "<4.4", + "symfony/dotenv": "<5.1", + "symfony/event-dispatcher": "<4.4", + "symfony/lock": "<4.4", + "symfony/process": "<4.4" + }, + "provide": { + "psr/log-implementation": "1.0|2.0" + }, + "require-dev": { + "psr/log": "^1|^2", + "symfony/config": "^4.4|^5.0", + "symfony/dependency-injection": "^4.4|^5.0", + "symfony/event-dispatcher": "^4.4|^5.0", + "symfony/lock": "^4.4|^5.0", + "symfony/process": "^4.4|^5.0", + "symfony/var-dumper": "^4.4|^5.0" + }, + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/lock": "", + "symfony/process": "" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Eases the creation of beautiful and testable command line interfaces", + "homepage": "https://symfony.com", + "keywords": [ + "cli", + "command line", + "console", + "terminal" + ], + "support": { + "source": "https://github.com/symfony/console/tree/v5.3.7" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-08-25T20:02:16+00:00" + }, + { + "name": "symfony/deprecation-contracts", + "version": "v2.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "5f38c8804a9e97d23e0c8d63341088cd8a22d627" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/5f38c8804a9e97d23e0c8d63341088cd8a22d627", + "reference": "5f38c8804a9e97d23e0c8d63341088cd8a22d627", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.4-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v2.4.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-03-23T23:28:01+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.23.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/46cd95797e9df938fdd2b03693b5fca5e64b01ce", + "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.23.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-02-19T12:13:01+00:00" + }, + { + "name": "symfony/polyfill-intl-grapheme", + "version": "v1.23.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-grapheme.git", + "reference": "16880ba9c5ebe3642d1995ab866db29270b36535" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/16880ba9c5ebe3642d1995ab866db29270b36535", + "reference": "16880ba9c5ebe3642d1995ab866db29270b36535", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Intl\\Grapheme\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's grapheme_* functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "grapheme", + "intl", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.23.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-05-27T12:26:48+00:00" + }, + { + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.23.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8590a5f561694770bdcd3f9b5c69dde6945028e8", + "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's Normalizer class and related functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "intl", + "normalizer", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.23.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-02-19T12:13:01+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.23.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9174a3d80210dca8daa7f31fec659150bbeabfc6", + "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.23.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-05-27T12:26:48+00:00" + }, + { + "name": "symfony/polyfill-php73", + "version": "v1.23.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php73.git", + "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fba8933c384d6476ab14fb7b8526e5287ca7e010", + "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php73\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php73/tree/v1.23.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-02-19T12:13:01+00:00" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.23.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/1100343ed1a92e3a38f9ae122fc0eb21602547be", + "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.23.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-07-28T13:41:28+00:00" + }, + { + "name": "symfony/service-contracts", + "version": "v2.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/service-contracts.git", + "reference": "f040a30e04b57fbcc9c6cbcf4dbaa96bd318b9bb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/f040a30e04b57fbcc9c6cbcf4dbaa96bd318b9bb", + "reference": "f040a30e04b57fbcc9c6cbcf4dbaa96bd318b9bb", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "psr/container": "^1.1" + }, + "suggest": { + "symfony/service-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.4-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Service\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to writing services", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/service-contracts/tree/v2.4.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-04-01T10:43:52+00:00" + }, + { + "name": "symfony/string", + "version": "v5.3.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/string.git", + "reference": "8d224396e28d30f81969f083a58763b8b9ceb0a5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/string/zipball/8d224396e28d30f81969f083a58763b8b9ceb0a5", + "reference": "8d224396e28d30f81969f083a58763b8b9ceb0a5", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-intl-grapheme": "~1.0", + "symfony/polyfill-intl-normalizer": "~1.0", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php80": "~1.15" + }, + "require-dev": { + "symfony/error-handler": "^4.4|^5.0", + "symfony/http-client": "^4.4|^5.0", + "symfony/translation-contracts": "^1.1|^2", + "symfony/var-exporter": "^4.4|^5.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\String\\": "" + }, + "files": [ + "Resources/functions.php" + ], + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", + "homepage": "https://symfony.com", + "keywords": [ + "grapheme", + "i18n", + "string", + "unicode", + "utf-8", + "utf8" + ], + "support": { + "source": "https://github.com/symfony/string/tree/v5.3.7" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-08-26T08:00:08+00:00" + }, + { + "name": "theseer/tokenizer", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", + "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + } + ], + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "support": { + "issues": "https://github.com/theseer/tokenizer/issues", + "source": "https://github.com/theseer/tokenizer/tree/1.2.1" + }, + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2021-07-28T10:34:58+00:00" + }, + { + "name": "vimeo/psalm", + "version": "4.9.3", + "source": { + "type": "git", + "url": "https://github.com/vimeo/psalm.git", + "reference": "4c262932602b9bbab5020863d1eb22d49de0dbf4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/vimeo/psalm/zipball/4c262932602b9bbab5020863d1eb22d49de0dbf4", + "reference": "4c262932602b9bbab5020863d1eb22d49de0dbf4", + "shasum": "" + }, + "require": { + "amphp/amp": "^2.4.2", + "amphp/byte-stream": "^1.5", + "composer/package-versions-deprecated": "^1.8.0", + "composer/semver": "^1.4 || ^2.0 || ^3.0", + "composer/xdebug-handler": "^1.1 || ^2.0", + "dnoegel/php-xdg-base-dir": "^0.1.1", + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-simplexml": "*", + "ext-tokenizer": "*", + "felixfbecker/advanced-json-rpc": "^3.0.3", + "felixfbecker/language-server-protocol": "^1.5", + "netresearch/jsonmapper": "^1.0 || ^2.0 || ^3.0 || ^4.0", + "nikic/php-parser": "^4.12", + "openlss/lib-array2xml": "^1.0", + "php": "^7.1|^8", + "sebastian/diff": "^3.0 || ^4.0", + "symfony/console": "^3.4.17 || ^4.1.6 || ^5.0", + "webmozart/path-util": "^2.3" + }, + "provide": { + "psalm/psalm": "self.version" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.2", + "brianium/paratest": "^4.0||^6.0", + "ext-curl": "*", + "php-parallel-lint/php-parallel-lint": "^1.2", + "phpdocumentor/reflection-docblock": "^5", + "phpmyadmin/sql-parser": "5.1.0||dev-master", + "phpspec/prophecy": ">=1.9.0", + "phpunit/phpunit": "^9.0", + "psalm/plugin-phpunit": "^0.16", + "slevomat/coding-standard": "^7.0", + "squizlabs/php_codesniffer": "^3.5", + "symfony/process": "^4.3 || ^5.0", + "weirdan/prophecy-shim": "^1.0 || ^2.0" + }, + "suggest": { + "ext-igbinary": "^2.0.5" + }, + "bin": [ + "psalm", + "psalm-language-server", + "psalm-plugin", + "psalm-refactor", + "psalter" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.x-dev", + "dev-3.x": "3.x-dev", + "dev-2.x": "2.x-dev", + "dev-1.x": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psalm\\": "src/Psalm/" + }, + "files": [ + "src/functions.php", + "src/spl_object_id.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matthew Brown" + } + ], + "description": "A static analysis tool for finding errors in PHP applications", + "keywords": [ + "code", + "inspection", + "php" + ], + "support": { + "issues": "https://github.com/vimeo/psalm/issues", + "source": "https://github.com/vimeo/psalm/tree/4.9.3" + }, + "time": "2021-08-14T16:19:38+00:00" + }, + { + "name": "webmozart/assert", + "version": "1.10.0", + "source": { + "type": "git", + "url": "https://github.com/webmozarts/assert.git", + "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/6964c76c7804814a842473e0c8fd15bab0f18e25", + "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0", + "symfony/polyfill-ctype": "^1.8" + }, + "conflict": { + "phpstan/phpstan": "<0.12.20", + "vimeo/psalm": "<4.6.1 || 4.6.2" + }, + "require-dev": { + "phpunit/phpunit": "^8.5.13" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.10-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "support": { + "issues": "https://github.com/webmozarts/assert/issues", + "source": "https://github.com/webmozarts/assert/tree/1.10.0" + }, + "time": "2021-03-09T10:59:23+00:00" + }, + { + "name": "webmozart/path-util", + "version": "2.3.0", + "source": { + "type": "git", + "url": "https://github.com/webmozart/path-util.git", + "reference": "d939f7edc24c9a1bb9c0dee5cb05d8e859490725" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/path-util/zipball/d939f7edc24c9a1bb9c0dee5cb05d8e859490725", + "reference": "d939f7edc24c9a1bb9c0dee5cb05d8e859490725", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "webmozart/assert": "~1.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.6", + "sebastian/version": "^1.0.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\PathUtil\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "A robust cross-platform utility for normalizing, comparing and modifying file paths.", + "support": { + "issues": "https://github.com/webmozart/path-util/issues", + "source": "https://github.com/webmozart/path-util/tree/2.3.0" + }, + "time": "2015-12-17T08:42:14+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": "^7.3 || ~8.0.0 || ~8.1.0" + }, + "platform-dev": [], + "plugin-api-version": "2.0.0" +} diff --git a/app/vendor/laminas/laminas-zendframework-bridge/psalm-baseline.xml b/app/vendor/laminas/laminas-zendframework-bridge/psalm-baseline.xml index eabf89c51..4a186e52c 100644 --- a/app/vendor/laminas/laminas-zendframework-bridge/psalm-baseline.xml +++ b/app/vendor/laminas/laminas-zendframework-bridge/psalm-baseline.xml @@ -1,5 +1,5 @@ - + 'ZendAcl' => 'LaminasAcl' @@ -169,13 +169,6 @@ testLegacyClassIsAliasToLaminas - - self::assertSame($actual, get_class(new $legacy())) - self::assertTrue($isInterface ? interface_exists($legacy) : class_exists($legacy)) - self::assertTrue(class_exists($actual)) - self::assertTrue(class_exists($legacy)) - self::assertTrue(class_exists('Laminas\LegacyTypeHint')) - @@ -194,11 +187,6 @@ iterable - - $this->assertSame($expected, $processor($config)) - self::assertSame($config, $processor($config)) - self::assertSame($expected, $processor($config)) - require $configLocation require $expectedResultLocation @@ -223,10 +211,6 @@ iterable - - $this->assertNull($module->onMergeConfig($event)) - $this->assertSame($expected, $listener->getMergedConfig()) - require $configFile require $expectationsFile @@ -239,9 +223,6 @@ iterable - - $this->assertSame($expected, $replacements->replace($string)) - diff --git a/app/vendor/nikic/php-parser/grammar/php5.y b/app/vendor/nikic/php-parser/grammar/php5.y index c7d245dc7..f9e7e7dd1 100644 --- a/app/vendor/nikic/php-parser/grammar/php5.y +++ b/app/vendor/nikic/php-parser/grammar/php5.y @@ -20,6 +20,11 @@ top_statement_list: if ($nop !== null) { $1[] = $nop; } $$ = $1; } ; +ampersand: + T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG + | T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG +; + reserved_non_modifiers: T_INCLUDE | T_INCLUDE_ONCE | T_EVAL | T_REQUIRE | T_REQUIRE_ONCE | T_LOGICAL_OR | T_LOGICAL_XOR | T_LOGICAL_AND | T_INSTANCEOF | T_NEW | T_CLONE | T_EXIT | T_IF | T_ELSEIF | T_ELSE | T_ENDIF | T_ECHO | T_DO | T_WHILE @@ -246,7 +251,12 @@ variables_list: optional_ref: /* empty */ { $$ = false; } - | '&' { $$ = true; } + | ampersand { $$ = true; } +; + +optional_arg_ref: + /* empty */ { $$ = false; } + | T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG { $$ = true; } ; optional_ellipsis: @@ -378,7 +388,7 @@ new_else_single: foreach_variable: variable { $$ = array($1, false); } - | '&' variable { $$ = array($2, true); } + | ampersand variable { $$ = array($2, true); } | list_expr { $$ = array($1, false); } ; @@ -393,9 +403,9 @@ non_empty_parameter_list: ; parameter: - optional_param_type optional_ref optional_ellipsis plain_variable + optional_param_type optional_arg_ref optional_ellipsis plain_variable { $$ = Node\Param[$4, null, $1, $2, $3]; $this->checkParam($$); } - | optional_param_type optional_ref optional_ellipsis plain_variable '=' static_scalar + | optional_param_type optional_arg_ref optional_ellipsis plain_variable '=' static_scalar { $$ = Node\Param[$4, $6, $1, $2, $3]; $this->checkParam($$); } ; @@ -428,7 +438,7 @@ non_empty_argument_list: argument: expr { $$ = Node\Arg[$1, false, false]; } - | '&' variable { $$ = Node\Arg[$2, true, false]; } + | ampersand variable { $$ = Node\Arg[$2, true, false]; } | T_ELLIPSIS expr { $$ = Node\Arg[$2, false, true]; } ; @@ -562,8 +572,8 @@ expr: variable { $$ = $1; } | list_expr '=' expr { $$ = Expr\Assign[$1, $3]; } | variable '=' expr { $$ = Expr\Assign[$1, $3]; } - | variable '=' '&' variable { $$ = Expr\AssignRef[$1, $4]; } - | variable '=' '&' new_expr { $$ = Expr\AssignRef[$1, $4]; } + | variable '=' ampersand variable { $$ = Expr\AssignRef[$1, $4]; } + | variable '=' ampersand new_expr { $$ = Expr\AssignRef[$1, $4]; } | new_expr { $$ = $1; } | T_CLONE expr { $$ = Expr\Clone_[$2]; } | variable T_PLUS_EQUAL expr { $$ = Expr\AssignOp\Plus [$1, $3]; } @@ -589,7 +599,8 @@ expr: | expr T_LOGICAL_AND expr { $$ = Expr\BinaryOp\LogicalAnd[$1, $3]; } | expr T_LOGICAL_XOR expr { $$ = Expr\BinaryOp\LogicalXor[$1, $3]; } | expr '|' expr { $$ = Expr\BinaryOp\BitwiseOr [$1, $3]; } - | expr '&' expr { $$ = Expr\BinaryOp\BitwiseAnd[$1, $3]; } + | expr T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG expr { $$ = Expr\BinaryOp\BitwiseAnd[$1, $3]; } + | expr T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG expr { $$ = Expr\BinaryOp\BitwiseAnd[$1, $3]; } | expr '^' expr { $$ = Expr\BinaryOp\BitwiseXor[$1, $3]; } | expr '.' expr { $$ = Expr\BinaryOp\Concat [$1, $3]; } | expr '+' expr { $$ = Expr\BinaryOp\Plus [$1, $3]; } @@ -816,7 +827,10 @@ static_operation: | static_scalar T_LOGICAL_AND static_scalar { $$ = Expr\BinaryOp\LogicalAnd[$1, $3]; } | static_scalar T_LOGICAL_XOR static_scalar { $$ = Expr\BinaryOp\LogicalXor[$1, $3]; } | static_scalar '|' static_scalar { $$ = Expr\BinaryOp\BitwiseOr [$1, $3]; } - | static_scalar '&' static_scalar { $$ = Expr\BinaryOp\BitwiseAnd[$1, $3]; } + | static_scalar T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG static_scalar + { $$ = Expr\BinaryOp\BitwiseAnd[$1, $3]; } + | static_scalar T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG static_scalar + { $$ = Expr\BinaryOp\BitwiseAnd[$1, $3]; } | static_scalar '^' static_scalar { $$ = Expr\BinaryOp\BitwiseXor[$1, $3]; } | static_scalar '.' static_scalar { $$ = Expr\BinaryOp\Concat [$1, $3]; } | static_scalar '+' static_scalar { $$ = Expr\BinaryOp\Plus [$1, $3]; } @@ -986,8 +1000,8 @@ non_empty_array_pair_list: array_pair: expr T_DOUBLE_ARROW expr { $$ = Expr\ArrayItem[$3, $1, false]; } | expr { $$ = Expr\ArrayItem[$1, null, false]; } - | expr T_DOUBLE_ARROW '&' variable { $$ = Expr\ArrayItem[$4, $1, true]; } - | '&' variable { $$ = Expr\ArrayItem[$2, null, true]; } + | expr T_DOUBLE_ARROW ampersand variable { $$ = Expr\ArrayItem[$4, $1, true]; } + | ampersand variable { $$ = Expr\ArrayItem[$2, null, true]; } | T_ELLIPSIS expr { $$ = Expr\ArrayItem[$2, null, false, attributes(), true]; } ; diff --git a/app/vendor/nikic/php-parser/grammar/php7.y b/app/vendor/nikic/php-parser/grammar/php7.y index 3c34398d6..ef0f271c6 100644 --- a/app/vendor/nikic/php-parser/grammar/php7.y +++ b/app/vendor/nikic/php-parser/grammar/php7.y @@ -20,6 +20,11 @@ top_statement_list: if ($nop !== null) { $1[] = $nop; } $$ = $1; } ; +ampersand: + T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG + | T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG +; + reserved_non_modifiers: T_INCLUDE | T_INCLUDE_ONCE | T_EVAL | T_REQUIRE | T_REQUIRE_ONCE | T_LOGICAL_OR | T_LOGICAL_XOR | T_LOGICAL_AND | T_INSTANCEOF | T_NEW | T_CLONE | T_EXIT | T_IF | T_ELSEIF | T_ELSE | T_ENDIF | T_ECHO | T_DO | T_WHILE @@ -33,7 +38,7 @@ reserved_non_modifiers: semi_reserved: reserved_non_modifiers - | T_STATIC | T_ABSTRACT | T_FINAL | T_PRIVATE | T_PROTECTED | T_PUBLIC + | T_STATIC | T_ABSTRACT | T_FINAL | T_PRIVATE | T_PROTECTED | T_PUBLIC | T_READONLY ; identifier_ex: @@ -327,7 +332,12 @@ non_empty_variables_list: optional_ref: /* empty */ { $$ = false; } - | '&' { $$ = true; } + | ampersand { $$ = true; } +; + +optional_arg_ref: + /* empty */ { $$ = false; } + | T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG { $$ = true; } ; optional_ellipsis: @@ -505,7 +515,7 @@ new_else_single: foreach_variable: variable { $$ = array($1, false); } - | '&' variable { $$ = array($2, true); } + | ampersand variable { $$ = array($2, true); } | list_expr { $$ = array($1, false); } | array_short_syntax { $$ = array($1, false); } ; @@ -520,21 +530,30 @@ non_empty_parameter_list: | non_empty_parameter_list ',' parameter { push($1, $3); } ; -optional_visibility_modifier: +optional_property_modifiers: /* empty */ { $$ = 0; } - | T_PUBLIC { $$ = Stmt\Class_::MODIFIER_PUBLIC; } + | optional_property_modifiers property_modifier + { $this->checkModifier($1, $2, #2); $$ = $1 | $2; } +; + +property_modifier: + T_PUBLIC { $$ = Stmt\Class_::MODIFIER_PUBLIC; } | T_PROTECTED { $$ = Stmt\Class_::MODIFIER_PROTECTED; } | T_PRIVATE { $$ = Stmt\Class_::MODIFIER_PRIVATE; } + | T_READONLY { $$ = Stmt\Class_::MODIFIER_READONLY; } ; parameter: - optional_attributes optional_visibility_modifier optional_type_without_static optional_ref optional_ellipsis plain_variable + optional_attributes optional_property_modifiers optional_type_without_static + optional_arg_ref optional_ellipsis plain_variable { $$ = new Node\Param($6, null, $3, $4, $5, attributes(), $2, $1); $this->checkParam($$); } - | optional_attributes optional_visibility_modifier optional_type_without_static optional_ref optional_ellipsis plain_variable '=' expr + | optional_attributes optional_property_modifiers optional_type_without_static + optional_arg_ref optional_ellipsis plain_variable '=' expr { $$ = new Node\Param($6, $8, $3, $4, $5, attributes(), $2, $1); $this->checkParam($$); } - | optional_attributes optional_visibility_modifier optional_type_without_static optional_ref optional_ellipsis error + | optional_attributes optional_property_modifiers optional_type_without_static + optional_arg_ref optional_ellipsis error { $$ = new Node\Param(Expr\Error[], null, $3, $4, $5, attributes(), $2, $1); } ; @@ -542,6 +561,7 @@ type_expr: type { $$ = $1; } | '?' type { $$ = Node\NullableType[$2]; } | union_type { $$ = Node\UnionType[$1]; } + | intersection_type { $$ = Node\IntersectionType[$1]; } ; type: @@ -565,10 +585,24 @@ union_type_without_static: | union_type_without_static '|' type_without_static { push($1, $3); } ; +intersection_type: + type T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG type { init($1, $3); } + | intersection_type T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG type + { push($1, $3); } +; + +intersection_type_without_static: + type_without_static T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG type_without_static + { init($1, $3); } + | intersection_type_without_static T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG type_without_static + { push($1, $3); } +; + type_expr_without_static: type_without_static { $$ = $1; } | '?' type_without_static { $$ = Node\NullableType[$2]; } | union_type_without_static { $$ = Node\UnionType[$1]; } + | intersection_type_without_static { $$ = Node\IntersectionType[$1]; } ; optional_type_without_static: @@ -585,6 +619,11 @@ optional_return_type: argument_list: '(' ')' { $$ = array(); } | '(' non_empty_argument_list optional_comma ')' { $$ = $2; } + | '(' variadic_placeholder ')' { init($2); } +; + +variadic_placeholder: + T_ELLIPSIS { $$ = Node\VariadicPlaceholder[]; } ; non_empty_argument_list: @@ -594,7 +633,7 @@ non_empty_argument_list: argument: expr { $$ = Node\Arg[$1, false, false]; } - | '&' variable { $$ = Node\Arg[$2, true, false]; } + | ampersand variable { $$ = Node\Arg[$2, true, false]; } | T_ELLIPSIS expr { $$ = Node\Arg[$2, false, true]; } | identifier_ex ':' expr { $$ = new Node\Arg($3, false, false, attributes(), $1); } @@ -712,6 +751,7 @@ member_modifier: | T_STATIC { $$ = Stmt\Class_::MODIFIER_STATIC; } | T_ABSTRACT { $$ = Stmt\Class_::MODIFIER_ABSTRACT; } | T_FINAL { $$ = Stmt\Class_::MODIFIER_FINAL; } + | T_READONLY { $$ = Stmt\Class_::MODIFIER_READONLY; } ; property_declaration_list: @@ -756,7 +796,7 @@ expr: | list_expr '=' expr { $$ = Expr\Assign[$1, $3]; } | array_short_syntax '=' expr { $$ = Expr\Assign[$1, $3]; } | variable '=' expr { $$ = Expr\Assign[$1, $3]; } - | variable '=' '&' variable { $$ = Expr\AssignRef[$1, $4]; } + | variable '=' ampersand variable { $$ = Expr\AssignRef[$1, $4]; } | new_expr { $$ = $1; } | match { $$ = $1; } | T_CLONE expr { $$ = Expr\Clone_[$2]; } @@ -783,7 +823,8 @@ expr: | expr T_LOGICAL_AND expr { $$ = Expr\BinaryOp\LogicalAnd[$1, $3]; } | expr T_LOGICAL_XOR expr { $$ = Expr\BinaryOp\LogicalXor[$1, $3]; } | expr '|' expr { $$ = Expr\BinaryOp\BitwiseOr [$1, $3]; } - | expr '&' expr { $$ = Expr\BinaryOp\BitwiseAnd[$1, $3]; } + | expr T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG expr { $$ = Expr\BinaryOp\BitwiseAnd[$1, $3]; } + | expr T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG expr { $$ = Expr\BinaryOp\BitwiseAnd[$1, $3]; } | expr '^' expr { $$ = Expr\BinaryOp\BitwiseXor[$1, $3]; } | expr '.' expr { $$ = Expr\BinaryOp\Concat [$1, $3]; } | expr '+' expr { $$ = Expr\BinaryOp\Plus [$1, $3]; } @@ -1106,10 +1147,10 @@ inner_array_pair_list: array_pair: expr { $$ = Expr\ArrayItem[$1, null, false]; } - | '&' variable { $$ = Expr\ArrayItem[$2, null, true]; } + | ampersand variable { $$ = Expr\ArrayItem[$2, null, true]; } | list_expr { $$ = Expr\ArrayItem[$1, null, false]; } | expr T_DOUBLE_ARROW expr { $$ = Expr\ArrayItem[$3, $1, false]; } - | expr T_DOUBLE_ARROW '&' variable { $$ = Expr\ArrayItem[$4, $1, true]; } + | expr T_DOUBLE_ARROW ampersand variable { $$ = Expr\ArrayItem[$4, $1, true]; } | expr T_DOUBLE_ARROW list_expr { $$ = Expr\ArrayItem[$3, $1, false]; } | T_ELLIPSIS expr { $$ = Expr\ArrayItem[$2, null, false, attributes(), true]; } | /* empty */ { $$ = null; } diff --git a/app/vendor/nikic/php-parser/grammar/tokens.y b/app/vendor/nikic/php-parser/grammar/tokens.y index 88d4498bf..8f0b21725 100644 --- a/app/vendor/nikic/php-parser/grammar/tokens.y +++ b/app/vendor/nikic/php-parser/grammar/tokens.y @@ -18,7 +18,7 @@ %left T_BOOLEAN_AND %left '|' %left '^' -%left '&' +%left T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG %nonassoc T_IS_EQUAL T_IS_NOT_EQUAL T_IS_IDENTICAL T_IS_NOT_IDENTICAL T_SPACESHIP %nonassoc '<' T_IS_SMALLER_OR_EQUAL '>' T_IS_GREATER_OR_EQUAL %left T_SL T_SR @@ -74,7 +74,7 @@ %token T_USE %token T_INSTEADOF %token T_GLOBAL -%right T_STATIC T_ABSTRACT T_FINAL T_PRIVATE T_PROTECTED T_PUBLIC +%right T_STATIC T_ABSTRACT T_FINAL T_PRIVATE T_PROTECTED T_PUBLIC T_READONLY %token T_VAR %token T_UNSET %token T_ISSET diff --git a/app/vendor/nikic/php-parser/lib/PhpParser/Builder/ClassConst.php b/app/vendor/nikic/php-parser/lib/PhpParser/Builder/ClassConst.php index be7160f13..f616c6270 100644 --- a/app/vendor/nikic/php-parser/lib/PhpParser/Builder/ClassConst.php +++ b/app/vendor/nikic/php-parser/lib/PhpParser/Builder/ClassConst.php @@ -77,6 +77,17 @@ public function makePrivate() { return $this; } + /** + * Makes the constant final. + * + * @return $this The builder instance (for fluid interface) + */ + public function makeFinal() { + $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_FINAL); + + return $this; + } + /** * Sets doc comment for the constant. * diff --git a/app/vendor/nikic/php-parser/lib/PhpParser/Builder/FunctionLike.php b/app/vendor/nikic/php-parser/lib/PhpParser/Builder/FunctionLike.php index 8e7db399d..98ea9d336 100644 --- a/app/vendor/nikic/php-parser/lib/PhpParser/Builder/FunctionLike.php +++ b/app/vendor/nikic/php-parser/lib/PhpParser/Builder/FunctionLike.php @@ -61,8 +61,7 @@ public function addParams(array $params) { /** * Sets the return type for PHP 7. * - * @param string|Node\Name|Node\NullableType $type One of array, callable, string, int, float, - * bool, iterable, or a class/interface name. + * @param string|Node\Name|Node\Identifier|Node\ComplexType $type * * @return $this The builder instance (for fluid interface) */ diff --git a/app/vendor/nikic/php-parser/lib/PhpParser/Builder/Param.php b/app/vendor/nikic/php-parser/lib/PhpParser/Builder/Param.php index 0ea91683c..de9aae7e5 100644 --- a/app/vendor/nikic/php-parser/lib/PhpParser/Builder/Param.php +++ b/app/vendor/nikic/php-parser/lib/PhpParser/Builder/Param.php @@ -47,7 +47,7 @@ public function setDefault($value) { /** * Sets type for the parameter. * - * @param string|Node\Name|Node\NullableType|Node\UnionType $type Parameter type + * @param string|Node\Name|Node\Identifier|Node\ComplexType $type Parameter type * * @return $this The builder instance (for fluid interface) */ @@ -63,7 +63,7 @@ public function setType($type) { /** * Sets type for the parameter. * - * @param string|Node\Name|Node\NullableType|Node\UnionType $type Parameter type + * @param string|Node\Name|Node\Identifier|Node\ComplexType $type Parameter type * * @return $this The builder instance (for fluid interface) * diff --git a/app/vendor/nikic/php-parser/lib/PhpParser/Builder/Property.php b/app/vendor/nikic/php-parser/lib/PhpParser/Builder/Property.php index 94ed96106..68e318565 100644 --- a/app/vendor/nikic/php-parser/lib/PhpParser/Builder/Property.php +++ b/app/vendor/nikic/php-parser/lib/PhpParser/Builder/Property.php @@ -7,8 +7,8 @@ use PhpParser\Node; use PhpParser\Node\Identifier; use PhpParser\Node\Name; -use PhpParser\Node\NullableType; use PhpParser\Node\Stmt; +use PhpParser\Node\ComplexType; class Property implements PhpParser\Builder { @@ -77,6 +77,17 @@ public function makeStatic() { return $this; } + /** + * Makes the property readonly. + * + * @return $this The builder instance (for fluid interface) + */ + public function makeReadonly() { + $this->flags = BuilderHelpers::addModifier($this->flags, Stmt\Class_::MODIFIER_READONLY); + + return $this; + } + /** * Sets default value for the property. * @@ -108,7 +119,7 @@ public function setDocComment($docComment) { /** * Sets the property type for PHP 7.4+. * - * @param string|Name|NullableType|Identifier $type + * @param string|Name|Identifier|ComplexType $type * * @return $this */ diff --git a/app/vendor/nikic/php-parser/lib/PhpParser/BuilderHelpers.php b/app/vendor/nikic/php-parser/lib/PhpParser/BuilderHelpers.php index c6d8f1613..2f0e91273 100644 --- a/app/vendor/nikic/php-parser/lib/PhpParser/BuilderHelpers.php +++ b/app/vendor/nikic/php-parser/lib/PhpParser/BuilderHelpers.php @@ -2,13 +2,13 @@ namespace PhpParser; +use PhpParser\Node\ComplexType; use PhpParser\Node\Expr; use PhpParser\Node\Identifier; use PhpParser\Node\Name; use PhpParser\Node\NullableType; use PhpParser\Node\Scalar; use PhpParser\Node\Stmt; -use PhpParser\Node\UnionType; /** * This class defines helpers used in the implementation of builders. Don't use it directly. @@ -104,29 +104,6 @@ public static function normalizeIdentifierOrExpr($name) { * @return Name The normalized name */ public static function normalizeName($name) : Name { - return self::normalizeNameCommon($name, false); - } - - /** - * Normalizes a name: Converts string names to Name nodes, while also allowing expressions. - * - * @param Expr|Name|string $name The name to normalize - * - * @return Name|Expr The normalized name or expression - */ - public static function normalizeNameOrExpr($name) { - return self::normalizeNameCommon($name, true); - } - - /** - * Normalizes a name: Converts string names to Name nodes, optionally allowing expressions. - * - * @param Expr|Name|string $name The name to normalize - * @param bool $allowExpr Whether to also allow expressions - * - * @return Name|Expr The normalized name, or expression (if allowed) - */ - private static function normalizeNameCommon($name, bool $allowExpr) { if ($name instanceof Name) { return $name; } @@ -147,16 +124,28 @@ private static function normalizeNameCommon($name, bool $allowExpr) { return new Name($name); } - if ($allowExpr) { - if ($name instanceof Expr) { - return $name; - } + throw new \LogicException('Name must be a string or an instance of Node\Name'); + } + + /** + * Normalizes a name: Converts string names to Name nodes, while also allowing expressions. + * + * @param Expr|Name|string $name The name to normalize + * + * @return Name|Expr The normalized name or expression + */ + public static function normalizeNameOrExpr($name) { + if ($name instanceof Expr) { + return $name; + } + + if (!is_string($name) && !($name instanceof Name)) { throw new \LogicException( 'Name must be a string or an instance of Node\Name or Node\Expr' ); } - throw new \LogicException('Name must be a string or an instance of Node\Name'); + return self::normalizeName($name); } /** @@ -165,18 +154,18 @@ private static function normalizeNameCommon($name, bool $allowExpr) { * In particular, builtin types become Identifiers, custom types become Names and nullables * are wrapped in NullableType nodes. * - * @param string|Name|Identifier|NullableType|UnionType $type The type to normalize + * @param string|Name|Identifier|ComplexType $type The type to normalize * - * @return Name|Identifier|NullableType|UnionType The normalized type + * @return Name|Identifier|ComplexType The normalized type */ public static function normalizeType($type) { if (!is_string($type)) { if ( !$type instanceof Name && !$type instanceof Identifier && - !$type instanceof NullableType && !$type instanceof UnionType + !$type instanceof ComplexType ) { throw new \LogicException( - 'Type must be a string, or an instance of Name, Identifier, NullableType or UnionType' + 'Type must be a string, or an instance of Name, Identifier or ComplexType' ); } return $type; diff --git a/app/vendor/nikic/php-parser/lib/PhpParser/Lexer.php b/app/vendor/nikic/php-parser/lib/PhpParser/Lexer.php index e29e4b91f..e15dd0a5d 100644 --- a/app/vendor/nikic/php-parser/lib/PhpParser/Lexer.php +++ b/app/vendor/nikic/php-parser/lib/PhpParser/Lexer.php @@ -134,10 +134,11 @@ protected function postprocessTokens(ErrorHandler $errorHandler) { // detected by finding "gaps" in the token array. Unterminated comments are detected // by checking if a trailing comment has a "*/" at the end. // - // Additionally, we canonicalize to the PHP 8 comment format here, which does not include - // the trailing whitespace anymore. - // - // We also canonicalize to the PHP 8 T_NAME_* tokens. + // Additionally, we perform a number of canonicalizations here: + // * Use the PHP 8.0 comment format, which does not include trailing whitespace anymore. + // * Use PHP 8.0 T_NAME_* tokens. + // * Use PHP 8.1 T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG and + // T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG tokens used to disambiguate intersection types. $filePos = 0; $line = 1; @@ -208,6 +209,22 @@ protected function postprocessTokens(ErrorHandler $errorHandler) { } } + if ($token === '&') { + $next = $i + 1; + while (isset($this->tokens[$next]) && $this->tokens[$next][0] === \T_WHITESPACE) { + $next++; + } + $followedByVarOrVarArg = isset($this->tokens[$next]) && + ($this->tokens[$next][0] === \T_VARIABLE || $this->tokens[$next][0] === \T_ELLIPSIS); + $this->tokens[$i] = $token = [ + $followedByVarOrVarArg + ? \T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG + : \T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG, + '&', + $line, + ]; + } + $tokenValue = \is_string($token) ? $token : $token[1]; $tokenLen = \strlen($tokenValue); @@ -424,6 +441,9 @@ private function defineCompatibilityTokens() { 'T_ATTRIBUTE', // PHP 8.1 'T_ENUM', + 'T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG', + 'T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG', + 'T_READONLY', ]; // PHP-Parser might be used together with another library that also emulates some or all @@ -514,7 +534,10 @@ protected function createTokenMap() : array { $tokenMap[\T_MATCH] = Tokens::T_MATCH; $tokenMap[\T_NULLSAFE_OBJECT_OPERATOR] = Tokens::T_NULLSAFE_OBJECT_OPERATOR; $tokenMap[\T_ATTRIBUTE] = Tokens::T_ATTRIBUTE; + $tokenMap[\T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG] = Tokens::T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG; + $tokenMap[\T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG] = Tokens::T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG; $tokenMap[\T_ENUM] = Tokens::T_ENUM; + $tokenMap[\T_READONLY] = Tokens::T_READONLY; return $tokenMap; } @@ -523,7 +546,7 @@ private function createIdentifierTokenMap(): array { // Based on semi_reserved production. return array_fill_keys([ \T_STRING, - \T_STATIC, \T_ABSTRACT, \T_FINAL, \T_PRIVATE, \T_PROTECTED, \T_PUBLIC, + \T_STATIC, \T_ABSTRACT, \T_FINAL, \T_PRIVATE, \T_PROTECTED, \T_PUBLIC, \T_READONLY, \T_INCLUDE, \T_INCLUDE_ONCE, \T_EVAL, \T_REQUIRE, \T_REQUIRE_ONCE, \T_LOGICAL_OR, \T_LOGICAL_XOR, \T_LOGICAL_AND, \T_INSTANCEOF, \T_NEW, \T_CLONE, \T_EXIT, \T_IF, \T_ELSEIF, \T_ELSE, \T_ENDIF, \T_ECHO, \T_DO, \T_WHILE, \T_ENDWHILE, \T_FOR, \T_ENDFOR, \T_FOREACH, \T_ENDFOREACH, \T_DECLARE, \T_ENDDECLARE, \T_AS, \T_TRY, \T_CATCH, diff --git a/app/vendor/nikic/php-parser/lib/PhpParser/Lexer/Emulative.php b/app/vendor/nikic/php-parser/lib/PhpParser/Lexer/Emulative.php index 6d517f40a..5086f8ce2 100644 --- a/app/vendor/nikic/php-parser/lib/PhpParser/Lexer/Emulative.php +++ b/app/vendor/nikic/php-parser/lib/PhpParser/Lexer/Emulative.php @@ -8,11 +8,13 @@ use PhpParser\Lexer\TokenEmulator\AttributeEmulator; use PhpParser\Lexer\TokenEmulator\EnumTokenEmulator; use PhpParser\Lexer\TokenEmulator\CoaleseEqualTokenEmulator; +use PhpParser\Lexer\TokenEmulator\ExplicitOctalEmulator; use PhpParser\Lexer\TokenEmulator\FlexibleDocStringEmulator; use PhpParser\Lexer\TokenEmulator\FnTokenEmulator; use PhpParser\Lexer\TokenEmulator\MatchTokenEmulator; use PhpParser\Lexer\TokenEmulator\NullsafeTokenEmulator; use PhpParser\Lexer\TokenEmulator\NumericLiteralSeparatorEmulator; +use PhpParser\Lexer\TokenEmulator\ReadonlyTokenEmulator; use PhpParser\Lexer\TokenEmulator\ReverseEmulator; use PhpParser\Lexer\TokenEmulator\TokenEmulator; @@ -53,6 +55,8 @@ public function __construct(array $options = []) new NullsafeTokenEmulator(), new AttributeEmulator(), new EnumTokenEmulator(), + new ReadonlyTokenEmulator(), + new ExplicitOctalEmulator(), ]; // Collect emulators that are relevant for the PHP version we're running diff --git a/app/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ExplicitOctalEmulator.php b/app/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ExplicitOctalEmulator.php new file mode 100644 index 000000000..f5f6805b8 --- /dev/null +++ b/app/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ExplicitOctalEmulator.php @@ -0,0 +1,44 @@ +resolveIntegerOrFloatToken($tokens[$i + 1][1]); + array_splice($tokens, $i, 2, [ + [$tokenKind, '0' . $tokens[$i + 1][1], $tokens[$i][2]], + ]); + $c--; + } + } + return $tokens; + } + + private function resolveIntegerOrFloatToken(string $str): int + { + $str = substr($str, 1); + $str = str_replace('_', '', $str); + $num = octdec($str); + return is_float($num) ? \T_DNUMBER : \T_LNUMBER; + } + + public function reverseEmulate(string $code, array $tokens): array { + // Explicit octals were not legal code previously, don't bother. + return $tokens; + } +} \ No newline at end of file diff --git a/app/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReadonlyTokenEmulator.php b/app/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReadonlyTokenEmulator.php new file mode 100644 index 000000000..b97f8d112 --- /dev/null +++ b/app/vendor/nikic/php-parser/lib/PhpParser/Lexer/TokenEmulator/ReadonlyTokenEmulator.php @@ -0,0 +1,23 @@ + + */ + abstract public function getRawArgs(): array; + + /** + * Returns whether this call expression is actually a first class callable. + */ + public function isFirstClassCallable(): bool { + foreach ($this->getRawArgs() as $arg) { + if ($arg instanceof VariadicPlaceholder) { + return true; + } + } + return false; + } + + /** + * Assert that this is not a first-class callable and return only ordinary Args. + * + * @return Arg[] + */ + public function getArgs(): array { + assert(!$this->isFirstClassCallable()); + return $this->getRawArgs(); + } +} \ No newline at end of file diff --git a/app/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Closure.php b/app/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Closure.php index 56e621f25..56ddea6aa 100644 --- a/app/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Closure.php +++ b/app/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Closure.php @@ -16,7 +16,7 @@ class Closure extends Expr implements FunctionLike public $params; /** @var ClosureUse[] use()s */ public $uses; - /** @var null|Node\Identifier|Node\Name|Node\NullableType|Node\UnionType Return type */ + /** @var null|Node\Identifier|Node\Name|Node\ComplexType Return type */ public $returnType; /** @var Node\Stmt[] Statements */ public $stmts; diff --git a/app/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/FuncCall.php b/app/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/FuncCall.php index 1e8afa559..2de4d0dd5 100644 --- a/app/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/FuncCall.php +++ b/app/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/FuncCall.php @@ -5,19 +5,19 @@ use PhpParser\Node; use PhpParser\Node\Expr; -class FuncCall extends Expr +class FuncCall extends CallLike { /** @var Node\Name|Expr Function name */ public $name; - /** @var Node\Arg[] Arguments */ + /** @var array Arguments */ public $args; /** * Constructs a function call node. * - * @param Node\Name|Expr $name Function name - * @param Node\Arg[] $args Arguments - * @param array $attributes Additional attributes + * @param Node\Name|Expr $name Function name + * @param array $args Arguments + * @param array $attributes Additional attributes */ public function __construct($name, array $args = [], array $attributes = []) { $this->attributes = $attributes; @@ -32,4 +32,8 @@ public function getSubNodeNames() : array { public function getType() : string { return 'Expr_FuncCall'; } + + public function getRawArgs(): array { + return $this->args; + } } diff --git a/app/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/MethodCall.php b/app/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/MethodCall.php index bd81bb43f..49ca48356 100644 --- a/app/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/MethodCall.php +++ b/app/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/MethodCall.php @@ -5,23 +5,24 @@ use PhpParser\Node\Arg; use PhpParser\Node\Expr; use PhpParser\Node\Identifier; +use PhpParser\Node\VariadicPlaceholder; -class MethodCall extends Expr +class MethodCall extends CallLike { /** @var Expr Variable holding object */ public $var; /** @var Identifier|Expr Method name */ public $name; - /** @var Arg[] Arguments */ + /** @var array Arguments */ public $args; /** * Constructs a function call node. * - * @param Expr $var Variable holding object - * @param string|Identifier|Expr $name Method name - * @param Arg[] $args Arguments - * @param array $attributes Additional attributes + * @param Expr $var Variable holding object + * @param string|Identifier|Expr $name Method name + * @param array $args Arguments + * @param array $attributes Additional attributes */ public function __construct(Expr $var, $name, array $args = [], array $attributes = []) { $this->attributes = $attributes; @@ -37,4 +38,8 @@ public function getSubNodeNames() : array { public function getType() : string { return 'Expr_MethodCall'; } + + public function getRawArgs(): array { + return $this->args; + } } diff --git a/app/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/New_.php b/app/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/New_.php index c86f0c601..e2bb64928 100644 --- a/app/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/New_.php +++ b/app/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/New_.php @@ -3,20 +3,22 @@ namespace PhpParser\Node\Expr; use PhpParser\Node; +use PhpParser\Node\Arg; use PhpParser\Node\Expr; +use PhpParser\Node\VariadicPlaceholder; -class New_ extends Expr +class New_ extends CallLike { /** @var Node\Name|Expr|Node\Stmt\Class_ Class name */ public $class; - /** @var Node\Arg[] Arguments */ + /** @var array Arguments */ public $args; /** * Constructs a function call node. * * @param Node\Name|Expr|Node\Stmt\Class_ $class Class name (or class node for anonymous classes) - * @param Node\Arg[] $args Arguments + * @param array $args Arguments * @param array $attributes Additional attributes */ public function __construct($class, array $args = [], array $attributes = []) { @@ -32,4 +34,8 @@ public function getSubNodeNames() : array { public function getType() : string { return 'Expr_New'; } + + public function getRawArgs(): array { + return $this->args; + } } diff --git a/app/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/StaticCall.php b/app/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/StaticCall.php index 9883f5af5..d0d099c47 100644 --- a/app/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/StaticCall.php +++ b/app/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/StaticCall.php @@ -3,25 +3,27 @@ namespace PhpParser\Node\Expr; use PhpParser\Node; +use PhpParser\Node\Arg; use PhpParser\Node\Expr; use PhpParser\Node\Identifier; +use PhpParser\Node\VariadicPlaceholder; -class StaticCall extends Expr +class StaticCall extends CallLike { /** @var Node\Name|Expr Class name */ public $class; /** @var Identifier|Expr Method name */ public $name; - /** @var Node\Arg[] Arguments */ + /** @var array Arguments */ public $args; /** * Constructs a static method call node. * - * @param Node\Name|Expr $class Class name - * @param string|Identifier|Expr $name Method name - * @param Node\Arg[] $args Arguments - * @param array $attributes Additional attributes + * @param Node\Name|Expr $class Class name + * @param string|Identifier|Expr $name Method name + * @param array $args Arguments + * @param array $attributes Additional attributes */ public function __construct($class, $name, array $args = [], array $attributes = []) { $this->attributes = $attributes; @@ -37,4 +39,8 @@ public function getSubNodeNames() : array { public function getType() : string { return 'Expr_StaticCall'; } + + public function getRawArgs(): array { + return $this->args; + } } diff --git a/app/vendor/nikic/php-parser/lib/PhpParser/Node/FunctionLike.php b/app/vendor/nikic/php-parser/lib/PhpParser/Node/FunctionLike.php index bbcf53e55..5a825e731 100644 --- a/app/vendor/nikic/php-parser/lib/PhpParser/Node/FunctionLike.php +++ b/app/vendor/nikic/php-parser/lib/PhpParser/Node/FunctionLike.php @@ -23,7 +23,7 @@ public function getParams() : array; /** * Get the declared return type or null * - * @return null|Identifier|Name|NullableType|UnionType + * @return null|Identifier|Name|ComplexType */ public function getReturnType(); diff --git a/app/vendor/nikic/php-parser/lib/PhpParser/Node/IntersectionType.php b/app/vendor/nikic/php-parser/lib/PhpParser/Node/IntersectionType.php new file mode 100644 index 000000000..9208e1392 --- /dev/null +++ b/app/vendor/nikic/php-parser/lib/PhpParser/Node/IntersectionType.php @@ -0,0 +1,30 @@ +attributes = $attributes; + $this->types = $types; + } + + public function getSubNodeNames() : array { + return ['types']; + } + + public function getType() : string { + return 'IntersectionType'; + } +} diff --git a/app/vendor/nikic/php-parser/lib/PhpParser/Node/NullableType.php b/app/vendor/nikic/php-parser/lib/PhpParser/Node/NullableType.php index 36463657e..d68e26a38 100644 --- a/app/vendor/nikic/php-parser/lib/PhpParser/Node/NullableType.php +++ b/app/vendor/nikic/php-parser/lib/PhpParser/Node/NullableType.php @@ -2,9 +2,7 @@ namespace PhpParser\Node; -use PhpParser\NodeAbstract; - -class NullableType extends NodeAbstract +class NullableType extends ComplexType { /** @var Identifier|Name Type */ public $type; diff --git a/app/vendor/nikic/php-parser/lib/PhpParser/Node/Param.php b/app/vendor/nikic/php-parser/lib/PhpParser/Node/Param.php index 315b5f24f..1e90b7944 100644 --- a/app/vendor/nikic/php-parser/lib/PhpParser/Node/Param.php +++ b/app/vendor/nikic/php-parser/lib/PhpParser/Node/Param.php @@ -6,7 +6,7 @@ class Param extends NodeAbstract { - /** @var null|Identifier|Name|NullableType|UnionType Type declaration */ + /** @var null|Identifier|Name|ComplexType Type declaration */ public $type; /** @var bool Whether parameter is passed by reference */ public $byRef; @@ -24,14 +24,14 @@ class Param extends NodeAbstract /** * Constructs a parameter node. * - * @param Expr\Variable|Expr\Error $var Parameter variable - * @param null|Expr $default Default value - * @param null|string|Identifier|Name|NullableType|UnionType $type Type declaration - * @param bool $byRef Whether is passed by reference - * @param bool $variadic Whether this is a variadic argument - * @param array $attributes Additional attributes - * @param int $flags Optional visibility flags - * @param AttributeGroup[] $attrGroups PHP attribute groups + * @param Expr\Variable|Expr\Error $var Parameter variable + * @param null|Expr $default Default value + * @param null|string|Identifier|Name|ComplexType $type Type declaration + * @param bool $byRef Whether is passed by reference + * @param bool $variadic Whether this is a variadic argument + * @param array $attributes Additional attributes + * @param int $flags Optional visibility flags + * @param AttributeGroup[] $attrGroups PHP attribute groups */ public function __construct( $var, Expr $default = null, $type = null, diff --git a/app/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/LNumber.php b/app/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/LNumber.php index b33943547..f17dd1f8a 100644 --- a/app/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/LNumber.php +++ b/app/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/LNumber.php @@ -62,6 +62,11 @@ public static function fromString(string $str, array $attributes = [], bool $all throw new Error('Invalid numeric literal', $attributes); } + // Strip optional explicit octal prefix. + if ('o' === $str[1] || 'O' === $str[1]) { + $str = substr($str, 2); + } + // use intval instead of octdec to get proper cutting behavior with malformed numbers $attributes['kind'] = LNumber::KIND_OCT; return new LNumber(intval($str, 8), $attributes); diff --git a/app/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassConst.php b/app/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassConst.php index c459acb15..1fc7f3362 100644 --- a/app/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassConst.php +++ b/app/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassConst.php @@ -65,6 +65,15 @@ public function isPrivate() : bool { return (bool) ($this->flags & Class_::MODIFIER_PRIVATE); } + /** + * Whether constant is final. + * + * @return bool + */ + public function isFinal() : bool { + return (bool) ($this->flags & Class_::MODIFIER_FINAL); + } + public function getType() : string { return 'Stmt_ClassConst'; } diff --git a/app/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassMethod.php b/app/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassMethod.php index 92157fab2..09b877a92 100644 --- a/app/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassMethod.php +++ b/app/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/ClassMethod.php @@ -15,7 +15,7 @@ class ClassMethod extends Node\Stmt implements FunctionLike public $name; /** @var Node\Param[] Parameters */ public $params; - /** @var null|Node\Identifier|Node\Name|Node\NullableType|Node\UnionType Return type */ + /** @var null|Node\Identifier|Node\Name|Node\ComplexType Return type */ public $returnType; /** @var Node\Stmt[]|null Statements */ public $stmts; diff --git a/app/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Class_.php b/app/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Class_.php index 0f35fe086..b290aaf6d 100644 --- a/app/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Class_.php +++ b/app/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Class_.php @@ -13,6 +13,7 @@ class Class_ extends ClassLike const MODIFIER_STATIC = 8; const MODIFIER_ABSTRACT = 16; const MODIFIER_FINAL = 32; + const MODIFIER_READONLY = 64; const VISIBILITY_MODIFIER_MASK = 7; // 1 | 2 | 4 @@ -96,6 +97,10 @@ public static function verifyModifier($a, $b) { throw new Error('Multiple final modifiers are not allowed'); } + if ($a & self::MODIFIER_READONLY && $b & self::MODIFIER_READONLY) { + throw new Error('Multiple readonly modifiers are not allowed'); + } + if ($a & 48 && $b & 48) { throw new Error('Cannot use the final modifier on an abstract class member'); } diff --git a/app/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Function_.php b/app/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Function_.php index f08481fae..3fa24f493 100644 --- a/app/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Function_.php +++ b/app/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Function_.php @@ -16,7 +16,7 @@ class Function_ extends Node\Stmt implements FunctionLike public $name; /** @var Node\Param[] Parameters */ public $params; - /** @var null|Node\Identifier|Node\Name|Node\NullableType|Node\UnionType Return type */ + /** @var null|Node\Identifier|Node\Name|Node\ComplexType Return type */ public $returnType; /** @var Node\Stmt[] Statements */ public $stmts; diff --git a/app/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Property.php b/app/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Property.php index 324345b85..bc781bbff 100644 --- a/app/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Property.php +++ b/app/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/Property.php @@ -3,10 +3,9 @@ namespace PhpParser\Node\Stmt; use PhpParser\Node; +use PhpParser\Node\ComplexType; use PhpParser\Node\Identifier; use PhpParser\Node\Name; -use PhpParser\Node\NullableType; -use PhpParser\Node\UnionType; class Property extends Node\Stmt { @@ -14,7 +13,7 @@ class Property extends Node\Stmt public $flags; /** @var PropertyProperty[] Properties */ public $props; - /** @var null|Identifier|Name|NullableType|UnionType Type declaration */ + /** @var null|Identifier|Name|ComplexType Type declaration */ public $type; /** @var Node\AttributeGroup[] PHP attribute groups */ public $attrGroups; @@ -22,11 +21,11 @@ class Property extends Node\Stmt /** * Constructs a class property list node. * - * @param int $flags Modifiers - * @param PropertyProperty[] $props Properties - * @param array $attributes Additional attributes - * @param null|string|Identifier|Name|NullableType|UnionType $type Type declaration - * @param Node\AttributeGroup[] $attrGroups PHP attribute groups + * @param int $flags Modifiers + * @param PropertyProperty[] $props Properties + * @param array $attributes Additional attributes + * @param null|string|Identifier|Name|ComplexType $type Type declaration + * @param Node\AttributeGroup[] $attrGroups PHP attribute groups */ public function __construct(int $flags, array $props, array $attributes = [], $type = null, array $attrGroups = []) { $this->attributes = $attributes; @@ -77,6 +76,15 @@ public function isStatic() : bool { return (bool) ($this->flags & Class_::MODIFIER_STATIC); } + /** + * Whether the property is readonly. + * + * @return bool + */ + public function isReadonly() : bool { + return (bool) ($this->flags & Class_::MODIFIER_READONLY); + } + public function getType() : string { return 'Stmt_Property'; } diff --git a/app/vendor/nikic/php-parser/lib/PhpParser/Node/UnionType.php b/app/vendor/nikic/php-parser/lib/PhpParser/Node/UnionType.php index c8f45235d..61c2d8106 100644 --- a/app/vendor/nikic/php-parser/lib/PhpParser/Node/UnionType.php +++ b/app/vendor/nikic/php-parser/lib/PhpParser/Node/UnionType.php @@ -2,9 +2,7 @@ namespace PhpParser\Node; -use PhpParser\NodeAbstract; - -class UnionType extends NodeAbstract +class UnionType extends ComplexType { /** @var (Identifier|Name)[] Types */ public $types; diff --git a/app/vendor/nikic/php-parser/lib/PhpParser/Node/VariadicPlaceholder.php b/app/vendor/nikic/php-parser/lib/PhpParser/Node/VariadicPlaceholder.php new file mode 100644 index 000000000..403a24df2 --- /dev/null +++ b/app/vendor/nikic/php-parser/lib/PhpParser/Node/VariadicPlaceholder.php @@ -0,0 +1,27 @@ +attributes = $attributes; + } + + public function getType(): string { + return 'VariadicPlaceholder'; + } + + public function getSubNodeNames(): array { + return []; + } +} \ No newline at end of file diff --git a/app/vendor/nikic/php-parser/lib/PhpParser/NodeDumper.php b/app/vendor/nikic/php-parser/lib/PhpParser/NodeDumper.php index 197ebc144..ba622efd1 100644 --- a/app/vendor/nikic/php-parser/lib/PhpParser/NodeDumper.php +++ b/app/vendor/nikic/php-parser/lib/PhpParser/NodeDumper.php @@ -128,6 +128,9 @@ protected function dumpFlags($flags) { if ($flags & Class_::MODIFIER_FINAL) { $strs[] = 'MODIFIER_FINAL'; } + if ($flags & Class_::MODIFIER_READONLY) { + $strs[] = 'MODIFIER_READONLY'; + } if ($strs) { return implode(' | ', $strs) . ' (' . $flags . ')'; diff --git a/app/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/NameResolver.php b/app/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/NameResolver.php index 79bbc4577..8e259c57b 100644 --- a/app/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/NameResolver.php +++ b/app/vendor/nikic/php-parser/lib/PhpParser/NodeVisitor/NameResolver.php @@ -189,7 +189,7 @@ private function resolveType($node) { $node->type = $this->resolveType($node->type); return $node; } - if ($node instanceof Node\UnionType) { + if ($node instanceof Node\UnionType || $node instanceof Node\IntersectionType) { foreach ($node->types as &$type) { $type = $this->resolveType($type); } diff --git a/app/vendor/nikic/php-parser/lib/PhpParser/Parser/Php5.php b/app/vendor/nikic/php-parser/lib/PhpParser/Parser/Php5.php index 39cdbcc30..c62adfd2c 100644 --- a/app/vendor/nikic/php-parser/lib/PhpParser/Parser/Php5.php +++ b/app/vendor/nikic/php-parser/lib/PhpParser/Parser/Php5.php @@ -17,17 +17,17 @@ */ class Php5 extends \PhpParser\ParserAbstract { - protected $tokenToSymbolMapSize = 393; - protected $actionTableSize = 1069; - protected $gotoTableSize = 580; + protected $tokenToSymbolMapSize = 396; + protected $actionTableSize = 1093; + protected $gotoTableSize = 643; - protected $invalidSymbol = 166; + protected $invalidSymbol = 168; protected $errorSymbol = 1; protected $defaultAction = -32766; protected $unexpectedTokenRule = 32767; - protected $YY2TBLSTATE = 405; - protected $numNonLeafStates = 658; + protected $YY2TBLSTATE = 415; + protected $numNonLeafStates = 662; protected $symbolToName = array( "EOF", @@ -67,7 +67,8 @@ class Php5 extends \PhpParser\ParserAbstract "T_BOOLEAN_AND", "'|'", "'^'", - "'&'", + "T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG", + "T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG", "T_IS_EQUAL", "T_IS_NOT_EQUAL", "T_IS_IDENTICAL", @@ -193,668 +194,692 @@ class Php5 extends \PhpParser\ParserAbstract "'`'", "']'", "'\"'", + "T_READONLY", "T_ENUM", "T_NULLSAFE_OBJECT_OPERATOR", "T_ATTRIBUTE" ); protected $tokenToSymbol = array( - 0, 166, 166, 166, 166, 166, 166, 166, 166, 166, - 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, - 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, - 166, 166, 166, 55, 162, 166, 159, 54, 37, 166, - 157, 158, 52, 49, 8, 50, 51, 53, 166, 166, - 166, 166, 166, 166, 166, 166, 166, 166, 31, 154, - 43, 16, 45, 30, 67, 166, 166, 166, 166, 166, - 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, - 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, - 166, 69, 166, 161, 36, 166, 160, 166, 166, 166, - 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, - 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, - 166, 166, 166, 155, 35, 156, 57, 166, 166, 166, - 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, - 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, - 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, - 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, - 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, - 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, - 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, - 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, - 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, - 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, - 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, - 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, - 166, 166, 166, 166, 166, 166, 1, 2, 3, 4, + 0, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 56, 163, 168, 160, 55, 168, 168, + 158, 159, 53, 50, 8, 51, 52, 54, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 31, 155, + 44, 16, 46, 30, 68, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 70, 168, 162, 36, 168, 161, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 156, 35, 157, 58, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 32, 33, 34, 38, 39, 40, 41, - 42, 44, 46, 47, 48, 56, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 68, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 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, 128, 163, 129, 130, 131, 164, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, - 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, - 152, 153, 165 + 27, 28, 29, 32, 33, 34, 37, 38, 39, 40, + 41, 42, 43, 45, 47, 48, 49, 57, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 69, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 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, 164, + 122, 123, 124, 125, 126, 127, 128, 129, 165, 130, + 131, 132, 166, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 167 ); protected $action = array( - 693, 663, 664, 665, 666, 667, 282, 668, 669, 670, - 706, 707, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 0, 230, 231, 232, 233, 234, 235, 236, 237, - 238, 239, 240, 241,-32766,-32766,-32766,-32766,-32766,-32766, - -32766,-32766,-32767,-32767,-32767,-32767, 27, 242, 243,-32766, - -32766,-32766,-32766,-32766, 671,-32766, 333,-32766,-32766,-32766, - -32766,-32766,-32766,-32767,-32767,-32767,-32767,-32767, 672, 673, - 674, 675, 676, 677, 678, 1034, 816, 740, 941, 942, - 943, 940, 939, 938, 679, 680, 681, 682, 683, 684, - 685, 686, 687, 688, 689, 709, 732, 710, 711, 712, - 713, 701, 702, 703, 731, 704, 705, 690, 691, 692, - 694, 695, 696, 734, 735, 736, 737, 738, 739, 697, - 698, 699, 700, 730, 721, 719, 720, 716, 717, 437, - 708, 714, 715, 722, 723, 725, 724, 726, 727, 55, - 56, 417, 57, 58, 718, 729, 728, 28, 59, 60, - -220, 61,-32766,-32766,-32766,-32766,-32766,-32766,-32766,-32766, - -32766, 36,-32767,-32767,-32767,-32767, 1034, 35, 106, 107, + 699, 669, 670, 671, 672, 673, 286, 674, 675, 676, + 712, 713, 223, 224, 225, 226, 227, 228, 229, 230, + 231, 232, 0, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244,-32766,-32766,-32766,-32766,-32766, + -32766,-32766,-32766,-32766,-32767,-32767,-32767,-32767, 245, 246, + 242, 243, 244,-32766,-32766, 677,-32766, 750,-32766,-32766, + -32766,-32766,-32766,-32766,-32766, 1224, 245, 246, 1225, 678, + 679, 680, 681, 682, 683, 684,-32766, 48, 746,-32766, + -32766,-32766,-32766,-32766,-32766, 685, 686, 687, 688, 689, + 690, 691, 692, 693, 694, 695, 715, 738, 716, 717, + 718, 719, 707, 708, 709, 737, 710, 711, 696, 697, + 698, 700, 701, 702, 740, 741, 742, 743, 744, 745, + 703, 704, 705, 706, 736, 727, 725, 726, 722, 723, + 751, 714, 720, 721, 728, 729, 731, 730, 732, 733, + 55, 56, 425, 57, 58, 724, 735, 734, 1073, 59, + 60, -224, 61,-32766,-32766,-32766,-32766,-32766,-32766,-32766, + -32766,-32766,-32766, 121,-32767,-32767,-32767,-32767, 29, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118,-32766,-32766,-32766,-32766, 62, 63, 1034, 125, 285, - 292, 64, 748, 65, 290, 291, 66, 67, 68, 69, - 70, 71, 72, 73, 763, 25, 298, 74, 409, 973, - 975, 294, 294, 1086, 1087, 1064, 796, 748, 218, 219, - 220, 465,-32766,-32766,-32766, 742, 864, 817, 54, 807, - 9,-32766,-32766,-32766, 760, 320, 761, 410, 10, 202, - 246, 428, 209,-32766, 933,-32766,-32766,-32766,-32766,-32766, - -32766, 488,-32766, 438,-32766,-32766,-32766,-32766,-32766, 473, - 474, 941, 942, 943, 940, 939, 938,-32766, 475, 476, - 337, 1092, 1093, 1094, 1095, 1089, 1090, 315, 1214, -255, - 747, 1215, -505, 1096, 1091, 888, 889, 1066, 1065, 1067, - 218, 219, 220, 41, 414, 337, 330, 895, 332, 418, - -126, -126, -126, 75, 52, 464, -4, 817, 54, 805, - -224, 202, 40, 21, 419, -126, 466, -126, 467, -126, - 468, -126, 359, 420, 128, 128, 748, 1171, 31, 32, - 421, 422, 1034, 894, 33, 469,-32766,-32766,-32766, 1186, - 351, 352, 470, 471,-32766,-32766,-32766, 309, 472, 865, - 323, 788, 835, 423, 424,-32767,-32767,-32767,-32767, 97, - 98, 99, 100, 101, 615,-32766, 313,-32766,-32766,-32766, - -32766, 354, 1185, 1171, 218, 219, 220, 475, 748, 418, - 819, 629, -126, 297, 915, 464, 817, 54,-32766, 805, - 124, 748, 40, 21, 419, 202, 466, 48, 467, 534, - 468, 129, 429, 420, 337, 341, 888, 889, 31, 32, - 421, 422, 416, 405, 33, 469,-32766,-32766, 311, 298, - 351, 352, 470, 471,-32766,-32766,-32766, 748, 472, 412, - 748, 752, 835, 423, 424, 338, 1066, 1065, 1067, 219, - 220, 919, 1136, 296, 20,-32766, 576,-32766,-32766,-32766, - 742, 341, 342, 413, 429, 1064, 337, 512, 418, 202, - 819, 629, -4, 1034, 464, 817, 54, 49, 805, 337, - 762, 40, 21, 419, 51, 466, 1034, 467, 475, 468, - 340, 748, 420, 120, -205, -205, -205, 31, 32, 421, - 422, 1062,-32766, 33, 469,-32766,-32766,-32766, 744, 351, - 352, 470, 471, 429, 1098, 337, 429, 472, 337, 1034, - 788, 835, 423, 424, 415, 1098,-32766, 802,-32766,-32766, - 102, 103, 104, 1137, 303, 202, 130, 1066, 1065, 1067, - 337, 123, 239, 240, 241, 748, 105, 418, 1205, 819, - 629, -205, 440, 464,-32766,-32766,-32766, 805, 242, 243, - 40, 21, 419, 121, 466, 126, 467, 429, 468, 337, - 122, 420, 1052, -204, -204, -204, 31, 32, 421, 422, - 1034, 745, 33, 469, 220, 759, 817, 54, 351, 352, - 470, 471, 218, 219, 220, 119, 472, 244, 127, 788, - 835, 423, 424, 202,-32766,-32766,-32766, 30, 293, 803, - 79, 80, 81, 202, 798, 210, 632, 99, 100, 101, - 236, 237, 238, 817, 54,-32766, 211, 800, 819, 629, - -204, 34, 1034, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 286, 303, 418, 1034, - 817, 54,-32766,-32766, 464, 218, 219, 220, 805, 105, - 914, 40, 21, 419, 78, 466, 212, 467, 337, 468, - 133, 247, 420, 295, 567, 248, 202, 31, 32, 421, - 633, 242, 243, 33, 469, 418, 249, 817, 54, 351, - 352, 464, 760, -84, 761, 805, 310, 472, 40, 21, - 419,-32766, 466, 640, 467, 643, 468, 447, 22, 420, - 815, 452, 584, 132, 31, 32, 421, 637, 134, 364, - 33, 469, 418, 303, 817, 54, 351, 352, 464, 819, - 629, 828, 805, 43, 472, 40, 21, 419, 44, 466, - 45, 467, 46, 468, 591, 592, 420, 753, 635, 930, - 649, 31, 32, 421, 641, 918, 657, 33, 469, 418, - 105, 817, 54, 351, 352, 464, 819, 629, 47, 805, - 50, 472, 40, 21, 419, 53, 466, 131, 467, 298, - 468, 599, 742, 420,-32766, -274, 516, 570, 31, 32, - 421, 646, 748, 946, 33, 469, 418, 589, 436,-32766, - 351, 352, 464, 819, 629, 623, 805, 836, 472, 40, - 21, 419, 611, 466, -82, 467, 603, 468, 11, 573, - 420, 439, 456, 281, 318, 31, 32, 421, 588, 432, - 321, 33, 469, 418, -414, 458, 322, 351, 352, 464, - 851, 629, 837, 805, -505, 472, 40, 21, 419, 654, - 466, 38, 467, 24, 468, 0, 0, 420, 319, 0, - -405, 0, 31, 32, 421, 245, 312, 314, 33, 469, - -506, 0, 0, 1097, 351, 352, 1143, 819, 629, 0, - 0, 527, 472, 213, 214, 6, 7, 12, 14, 215, - 363, 216, -415, 558, 789, -221, 830, 0, 0, 747, - 0, 0, 0, 207, 39, 652, 653, 758, 806, 814, - 793, 1086, 1087, 808, 819, 629, 213, 214, 867, 1088, - 858, 859, 215, 791, 216, 852, 849, 847, 925, 926, - 923, 813, 797, 799, 801, 804, 207, 922, 756, 757, - 924, 287, 78, 331, 1086, 1087, 353, 630, 634, 636, - 638, 639, 1088, 642, 644, 645, 647, 648, 631, 1142, - 1211, 1213, 755, 834, 754, 833, 1212, 554, 832, 1092, - 1093, 1094, 1095, 1089, 1090, 388, 1048, 824, 1036, 831, - 1037, 1096, 1091, 822, 931, 856, 857, 451, 1210, 1179, - 0, 217, 1177, 1162, 1175, 1077, 906, 1183, 1173, 0, - 554, 26, 1092, 1093, 1094, 1095, 1089, 1090, 388, 29, - 37, 42, 76, 77, 1096, 1091, 208, 284, 288, 289, - 304, 305, 306, 307, 217, 335, 406, 408, 0, -220, - 16, 17, 18, 383, 448, 455, 457, 462, 548, 620, - 1039, 1042, 896, 1102, 1038, 1014, 559, 1013, 1079, 0, - 0, -424, 1032, 0, 1043, 1045, 1044, 1047, 1046, 1061, - 1176, 1161, 1157, 1174, 1076, 1208, 1103, 1156, 595 + 118, 119, 1043, 766, 1071, 767, 580, 62, 63,-32766, + -32766,-32766,-32766, 64, 516, 65, 294, 295, 66, 67, + 68, 69, 70, 71, 72, 73, 822, 25, 302, 74, + 418, 981, 983, 1043, 1181, 1095, 1096, 1073, 748, 754, + 1075, 1074, 1076, 469,-32766,-32766,-32766, 337, 823, 54, + -32767,-32767,-32767,-32767, 98, 99, 100, 101, 102, 220, + 221, 222, 78, 361, 1107,-32766, 341,-32766,-32766,-32766, + -32766,-32766, 1107, 492, 949, 950, 951, 948, 947, 946, + 207, 477, 478, 949, 950, 951, 948, 947, 946, 1043, + 479, 480, 52, 1101, 1102, 1103, 1104, 1098, 1099, 319, + 872, 668, 667, 27, -511, 1105, 1100,-32766, 130, 1075, + 1074, 1076, 345, 668, 667, 41, 126, 341, 334, 369, + 336, 426, -128, -128, -128, 896, 897, 468, 220, 221, + 222, 811, 1195, 619, 40, 21, 427, -128, 470, -128, + 471, -128, 472, -128, 802, 428, -4, 823, 54, 207, + 33, 34, 429, 360, 317, 28, 35, 473,-32766,-32766, + -32766, 211, 356, 357, 474, 475,-32766,-32766,-32766, 754, + 476, 49, 313, 794, 843, 430, 431, 289, 125,-32766, + 813,-32766,-32766,-32766,-32766,-32766,-32766,-32766,-32767,-32767, + -32767,-32767,-32767,-32766,-32766,-32766, 769, 103, 104, 105, + 327, 307, 825, 633, -128, 1075, 1074, 1076, 221, 222, + 927, 748, 1146, 106,-32766, 129,-32766,-32766,-32766,-32766, + 426, 823, 54, 902, 873, 302, 468, 75, 207, 359, + 811, 668, 667, 40, 21, 427, 754, 470, 754, 471, + 423, 472, 1043, 127, 428, 435, 1043, 341, 1043, 33, + 34, 429, 360, 1181, 415, 35, 473, 122, 10, 315, + 128, 356, 357, 474, 475,-32766,-32766,-32766, 768, 476, + 668, 667, 758, 843, 430, 431, 754, 1043, 1147,-32766, + -32766,-32766, 754, 419, 342, 1215,-32766, 131,-32766,-32766, + -32766, 341, 363, 346, 426, 823, 54, 100, 101, 102, + 468, 825, 633, -4, 811, 442, 903, 40, 21, 427, + 754, 470, 435, 471, 341, 472, 341, 766, 428, 767, + -209, -209, -209, 33, 34, 429, 360, 479, 1196, 35, + 473, 345,-32766,-32766,-32766, 356, 357, 474, 475, 220, + 221, 222, 421, 476, 32, 297, 794, 843, 430, 431, + 754, 754, 435,-32766, 341,-32766,-32766, 9, 300, 51, + 207, 249, 324, 753, 120, 220, 221, 222, 426, 30, + 247, 941, 422, 424, 468, 825, 633, -209, 811, 1043, + 1061, 40, 21, 427, 129, 470, 207, 471, 341, 472, + 804, 20, 428, 124, -208, -208, -208, 33, 34, 429, + 360, 479, 212, 35, 473, 923, -259, 823, 54, 356, + 357, 474, 475,-32766,-32766,-32766, 1043, 476, 213, 806, + 794, 843, 430, 431,-32766,-32766, 435, 435, 341, 341, + 443, 79, 80, 81,-32766, 668, 667, 636, 344, 808, + 668, 667, 239, 240, 241, 123, 214, 538, 250, 825, + 633, -208, 36, 251, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 252, 307, + 426, 220, 221, 222, 823, 54, 468,-32766, 222, 765, + 811, 106, 134, 40, 21, 427, 571, 470, 207, 471, + 445, 472, 207,-32766, 428, 896, 897, 207, 307, 33, + 34, 429, 245, 246, 637, 35, 473, 452, 22, 809, + 922, 356, 357, 457, 588, 135, 374, 595, 596, 476, + -228, 759, 639, 938, 653, 926, 661, -86, 823, 54, + 314, 644, 647, 821, 133, 836, 43, 106, 603, 44, + 45, 46, 47, 748, 50, 53, 132, 426, 302,-32766, + 520, 825, 633, 468, -84, 607, 577, 811, 641, 362, + 40, 21, 427, -278, 470, 754, 471, 954, 472, 441, + 627, 428, 823, 54, 574, 844, 33, 34, 429, 11, + 615, 845, 35, 473, 444, 461, 285, -511, 356, 357, + 592, -419, 593, 1106, 1153, -410, 476, 368, 838, 38, + 658, 426, 645, 795, 1052, 0, 325, 468, 0,-32766, + 0, 811, 0, 0, 40, 21, 427, 0, 470, 0, + 471, 0, 472, 0, 322, 428, 823, 54, 825, 633, + 33, 34, 429, 0, 326, 0, 35, 473, 323, 0, + 316, 318, 356, 357, -512, 426, 0, 753, 531, 0, + 476, 468, 6, 0, 0, 811, 650, 7, 40, 21, + 427, 12, 470, 14, 471, 373, 472, -420, 562, 428, + 823, 54, 78, -225, 33, 34, 429, 39, 656, 657, + 35, 473, 859, 633, 764, 812, 356, 357, 820, 799, + 814, 875, 866, 867, 476, 797, 860, 857, 855, 426, + 933, 934, 931, 819, 803, 468, 805, 807, 810, 811, + 930, 762, 40, 21, 427, 763, 470, 932, 471, 335, + 472, 358, 634, 428, 638, 640, 825, 633, 33, 34, + 429, 642, 643, 646, 35, 473, 648, 649, 651, 652, + 356, 357, 635, 426, 1221, 1223, 761, 842, 476, 468, + 248, 760, 841, 811, 1222, 840, 40, 21, 427, 1057, + 470, 830, 471, 1045, 472, 839, 1046, 428, 828, 215, + 216, 939, 33, 34, 429, 217, 864, 218, 35, 473, + 825, 633, 24, 865, 356, 357, 456, 1220, 1189, 209, + 1187, 1172, 476, 1185, 215, 216, 1086, 1095, 1096, 914, + 217, 1193, 218, 1183, -224, 1097, 26, 31, 37, 42, + 76, 77, 210, 288, 209, 292, 293, 308, 309, 310, + 311, 339, 1095, 1096, 825, 633, 355, 291, 416, 1152, + 1097, 16, 17, 18, 393, 453, 460, 462, 466, 552, + 624, 1048, 1051, 904, 1111, 1047, 1023, 563, 1022, 1088, + 0, 0, -429, 558, 1041, 1101, 1102, 1103, 1104, 1098, + 1099, 398, 1054, 1053, 1056, 1055, 1070, 1105, 1100, 1186, + 1171, 1167, 1184, 1085, 1218, 1112, 1166, 219, 558, 599, + 1101, 1102, 1103, 1104, 1098, 1099, 398, 0, 0, 0, + 0, 0, 1105, 1100, 0, 0, 0, 0, 0, 0, + 0, 0, 219 ); protected $actionCheck = array( 2, 3, 4, 5, 6, 7, 14, 9, 10, 11, 12, 13, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 0, 43, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53, 54, 9, 10, 11, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 8, 68, 69, 33, - 34, 35, 36, 37, 56, 30, 8, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 70, 71, - 72, 73, 74, 75, 76, 13, 1, 79, 115, 116, - 117, 118, 119, 120, 86, 87, 88, 89, 90, 91, + 41, 42, 0, 44, 45, 46, 47, 48, 49, 50, + 51, 52, 53, 54, 55, 9, 10, 11, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 69, 70, + 53, 54, 55, 9, 10, 57, 30, 80, 32, 33, + 34, 35, 36, 37, 38, 80, 69, 70, 83, 71, + 72, 73, 74, 75, 76, 77, 9, 70, 80, 33, + 34, 35, 36, 37, 38, 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, 128, 129, 130, 31, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 3, - 4, 5, 6, 7, 146, 147, 148, 8, 12, 13, - 158, 15, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 14, 43, 44, 45, 46, 13, 16, 17, 18, - 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, - 29, 33, 34, 35, 36, 49, 50, 13, 8, 8, - 37, 55, 81, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 156, 69, 70, 71, 72, 58, - 59, 37, 37, 77, 78, 79, 154, 81, 9, 10, - 11, 85, 9, 10, 11, 79, 31, 1, 2, 154, - 107, 9, 10, 11, 105, 112, 107, 126, 8, 30, - 31, 105, 8, 30, 121, 32, 33, 34, 35, 36, - 37, 115, 30, 155, 32, 33, 34, 35, 36, 123, - 124, 115, 116, 117, 118, 119, 120, 115, 132, 133, - 159, 135, 136, 137, 138, 139, 140, 141, 79, 156, - 151, 82, 131, 147, 148, 133, 134, 151, 152, 153, - 9, 10, 11, 157, 8, 159, 160, 158, 162, 73, - 74, 75, 76, 150, 69, 79, 0, 1, 2, 83, - 158, 30, 86, 87, 88, 89, 90, 91, 92, 93, - 94, 95, 8, 97, 150, 150, 81, 81, 102, 103, - 104, 105, 13, 158, 108, 109, 9, 10, 11, 158, - 114, 115, 116, 117, 9, 10, 11, 8, 122, 154, - 8, 125, 126, 127, 128, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 79, 30, 131, 32, 33, 34, - 35, 8, 1, 81, 9, 10, 11, 132, 81, 73, - 154, 155, 156, 37, 154, 79, 1, 2, 115, 83, - 155, 81, 86, 87, 88, 30, 90, 69, 92, 80, - 94, 155, 157, 97, 159, 159, 133, 134, 102, 103, - 104, 105, 8, 107, 108, 109, 9, 10, 112, 70, - 114, 115, 116, 117, 9, 10, 11, 81, 122, 8, - 81, 125, 126, 127, 128, 8, 151, 152, 153, 10, - 11, 156, 161, 8, 158, 30, 84, 32, 33, 34, - 79, 159, 146, 8, 157, 79, 159, 84, 73, 30, - 154, 155, 156, 13, 79, 1, 2, 69, 83, 159, - 156, 86, 87, 88, 69, 90, 13, 92, 132, 94, - 69, 81, 97, 155, 99, 100, 101, 102, 103, 104, - 105, 115, 9, 108, 109, 9, 10, 11, 79, 114, - 115, 116, 117, 157, 142, 159, 157, 122, 159, 13, - 125, 126, 127, 128, 8, 142, 30, 154, 32, 33, - 52, 53, 54, 158, 56, 30, 155, 151, 152, 153, - 159, 14, 52, 53, 54, 81, 68, 73, 84, 154, - 155, 156, 131, 79, 33, 34, 35, 83, 68, 69, - 86, 87, 88, 155, 90, 155, 92, 157, 94, 159, - 155, 97, 158, 99, 100, 101, 102, 103, 104, 105, - 13, 152, 108, 109, 11, 154, 1, 2, 114, 115, - 116, 117, 9, 10, 11, 16, 122, 14, 31, 125, - 126, 127, 128, 30, 9, 10, 11, 143, 144, 154, - 9, 10, 11, 30, 154, 16, 31, 49, 50, 51, - 49, 50, 51, 1, 2, 30, 16, 154, 154, 155, - 156, 30, 13, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 37, 56, 73, 13, - 1, 2, 33, 34, 79, 9, 10, 11, 83, 68, - 154, 86, 87, 88, 155, 90, 16, 92, 159, 94, - 155, 16, 97, 37, 159, 16, 30, 102, 103, 104, - 31, 68, 69, 108, 109, 73, 16, 1, 2, 114, - 115, 79, 105, 31, 107, 83, 31, 122, 86, 87, - 88, 33, 90, 31, 92, 31, 94, 74, 75, 97, - 31, 74, 75, 31, 102, 103, 104, 31, 100, 101, - 108, 109, 73, 56, 1, 2, 114, 115, 79, 154, - 155, 37, 83, 69, 122, 86, 87, 88, 69, 90, - 69, 92, 69, 94, 110, 111, 97, 154, 155, 154, - 155, 102, 103, 104, 31, 154, 155, 108, 109, 73, - 68, 1, 2, 114, 115, 79, 154, 155, 69, 83, - 69, 122, 86, 87, 88, 69, 90, 69, 92, 70, - 94, 76, 79, 97, 84, 81, 84, 89, 102, 103, - 104, 31, 81, 81, 108, 109, 73, 112, 88, 115, - 114, 115, 79, 154, 155, 91, 83, 126, 122, 86, - 87, 88, 93, 90, 96, 92, 95, 94, 96, 99, - 97, 96, 96, 96, 129, 102, 103, 104, 99, 105, - 113, 108, 109, 73, 145, 105, 129, 114, 115, 79, - 154, 155, 126, 83, 131, 122, 86, 87, 88, 156, - 90, 154, 92, 157, 94, -1, -1, 97, 130, -1, - 145, -1, 102, 103, 104, 31, 131, 131, 108, 109, - 131, -1, -1, 142, 114, 115, 142, 154, 155, -1, - -1, 149, 122, 49, 50, 145, 145, 145, 145, 55, - 145, 57, 145, 149, 156, 158, 150, -1, -1, 151, - -1, -1, -1, 69, 154, 154, 154, 154, 154, 154, - 154, 77, 78, 154, 154, 155, 49, 50, 154, 85, - 154, 154, 55, 154, 57, 154, 154, 154, 154, 154, - 154, 154, 154, 154, 154, 154, 69, 154, 154, 154, - 154, 159, 155, 155, 77, 78, 155, 155, 155, 155, - 155, 155, 85, 155, 155, 155, 155, 155, 155, 162, - 156, 156, 156, 156, 156, 156, 156, 133, 156, 135, - 136, 137, 138, 139, 140, 141, 156, 156, 156, 156, - 156, 147, 148, 156, 156, 156, 156, 156, 156, 156, - -1, 157, 156, 156, 156, 156, 156, 156, 156, -1, - 133, 157, 135, 136, 137, 138, 139, 140, 141, 157, - 157, 157, 157, 157, 147, 148, 157, 157, 157, 157, - 157, 157, 157, 157, 157, 157, 157, 157, -1, 158, - 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, - 158, 158, 158, 158, 158, 158, 158, 158, 158, -1, - -1, 160, 160, -1, 161, 161, 161, 161, 161, 161, - 161, 161, 161, 161, 161, 161, 161, 161, 161 + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 153, 133, 134, 135, 136, 137, 138, 139, 140, 141, + 3, 4, 5, 6, 7, 147, 148, 149, 80, 12, + 13, 159, 15, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 156, 44, 45, 46, 47, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 13, 106, 116, 108, 85, 50, 51, 33, + 34, 35, 36, 56, 85, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 1, 70, 71, 72, + 73, 59, 60, 13, 82, 78, 79, 80, 80, 82, + 152, 153, 154, 86, 9, 10, 11, 8, 1, 2, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 9, + 10, 11, 156, 106, 143, 30, 160, 32, 33, 34, + 35, 36, 143, 116, 116, 117, 118, 119, 120, 121, + 30, 124, 125, 116, 117, 118, 119, 120, 121, 13, + 133, 134, 70, 136, 137, 138, 139, 140, 141, 142, + 31, 37, 38, 8, 132, 148, 149, 116, 156, 152, + 153, 154, 160, 37, 38, 158, 8, 160, 161, 8, + 163, 74, 75, 76, 77, 134, 135, 80, 9, 10, + 11, 84, 1, 80, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 155, 98, 0, 1, 2, 30, + 103, 104, 105, 106, 132, 8, 109, 110, 9, 10, + 11, 8, 115, 116, 117, 118, 9, 10, 11, 82, + 123, 70, 8, 126, 127, 128, 129, 8, 156, 30, + 155, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 9, 10, 11, 157, 53, 54, 55, + 8, 57, 155, 156, 157, 152, 153, 154, 10, 11, + 157, 80, 162, 69, 30, 151, 32, 33, 34, 35, + 74, 1, 2, 159, 155, 71, 80, 151, 30, 8, + 84, 37, 38, 87, 88, 89, 82, 91, 82, 93, + 8, 95, 13, 156, 98, 158, 13, 160, 13, 103, + 104, 105, 106, 82, 108, 109, 110, 156, 8, 113, + 31, 115, 116, 117, 118, 9, 10, 11, 157, 123, + 37, 38, 126, 127, 128, 129, 82, 13, 159, 33, + 34, 35, 82, 127, 8, 85, 30, 156, 32, 33, + 34, 160, 8, 147, 74, 1, 2, 50, 51, 52, + 80, 155, 156, 157, 84, 31, 159, 87, 88, 89, + 82, 91, 158, 93, 160, 95, 160, 106, 98, 108, + 100, 101, 102, 103, 104, 105, 106, 133, 159, 109, + 110, 160, 9, 10, 11, 115, 116, 117, 118, 9, + 10, 11, 8, 123, 144, 145, 126, 127, 128, 129, + 82, 82, 158, 30, 160, 32, 33, 108, 8, 70, + 30, 31, 113, 152, 16, 9, 10, 11, 74, 14, + 14, 122, 8, 8, 80, 155, 156, 157, 84, 13, + 159, 87, 88, 89, 151, 91, 30, 93, 160, 95, + 155, 159, 98, 14, 100, 101, 102, 103, 104, 105, + 106, 133, 16, 109, 110, 155, 157, 1, 2, 115, + 116, 117, 118, 9, 10, 11, 13, 123, 16, 155, + 126, 127, 128, 129, 33, 34, 158, 158, 160, 160, + 156, 9, 10, 11, 30, 37, 38, 31, 70, 155, + 37, 38, 50, 51, 52, 156, 16, 81, 16, 155, + 156, 157, 30, 16, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 16, 57, + 74, 9, 10, 11, 1, 2, 80, 116, 11, 155, + 84, 69, 156, 87, 88, 89, 160, 91, 30, 93, + 132, 95, 30, 33, 98, 134, 135, 30, 57, 103, + 104, 105, 69, 70, 31, 109, 110, 75, 76, 155, + 155, 115, 116, 75, 76, 101, 102, 111, 112, 123, + 159, 155, 156, 155, 156, 155, 156, 31, 1, 2, + 31, 31, 31, 31, 31, 38, 70, 69, 77, 70, + 70, 70, 70, 80, 70, 70, 70, 74, 71, 85, + 85, 155, 156, 80, 97, 96, 100, 84, 31, 106, + 87, 88, 89, 82, 91, 82, 93, 82, 95, 89, + 92, 98, 1, 2, 90, 127, 103, 104, 105, 97, + 94, 127, 109, 110, 97, 97, 97, 132, 115, 116, + 100, 146, 113, 143, 143, 146, 123, 106, 151, 155, + 157, 74, 31, 157, 162, -1, 114, 80, -1, 116, + -1, 84, -1, -1, 87, 88, 89, -1, 91, -1, + 93, -1, 95, -1, 130, 98, 1, 2, 155, 156, + 103, 104, 105, -1, 130, -1, 109, 110, 131, -1, + 132, 132, 115, 116, 132, 74, -1, 152, 150, -1, + 123, 80, 146, -1, -1, 84, 31, 146, 87, 88, + 89, 146, 91, 146, 93, 146, 95, 146, 150, 98, + 1, 2, 156, 159, 103, 104, 105, 155, 155, 155, + 109, 110, 155, 156, 155, 155, 115, 116, 155, 155, + 155, 155, 155, 155, 123, 155, 155, 155, 155, 74, + 155, 155, 155, 155, 155, 80, 155, 155, 155, 84, + 155, 155, 87, 88, 89, 155, 91, 155, 93, 156, + 95, 156, 156, 98, 156, 156, 155, 156, 103, 104, + 105, 156, 156, 156, 109, 110, 156, 156, 156, 156, + 115, 116, 156, 74, 157, 157, 157, 157, 123, 80, + 31, 157, 157, 84, 157, 157, 87, 88, 89, 157, + 91, 157, 93, 157, 95, 157, 157, 98, 157, 50, + 51, 157, 103, 104, 105, 56, 157, 58, 109, 110, + 155, 156, 158, 157, 115, 116, 157, 157, 157, 70, + 157, 157, 123, 157, 50, 51, 157, 78, 79, 157, + 56, 157, 58, 157, 159, 86, 158, 158, 158, 158, + 158, 158, 158, 158, 70, 158, 158, 158, 158, 158, + 158, 158, 78, 79, 155, 156, 158, 160, 158, 163, + 86, 159, 159, 159, 159, 159, 159, 159, 159, 159, + 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, + -1, -1, 161, 134, 161, 136, 137, 138, 139, 140, + 141, 142, 162, 162, 162, 162, 162, 148, 149, 162, + 162, 162, 162, 162, 162, 162, 162, 158, 134, 162, + 136, 137, 138, 139, 140, 141, 142, -1, -1, -1, + -1, -1, 148, 149, -1, -1, -1, -1, -1, -1, + -1, -1, 158 ); protected $actionBase = array( - 0, 226, 306, 385, 464, 285, 246, 246, 786, -2, - -2, 146, -2, -2, -2, 649, 723, 760, 723, 575, - 686, 612, 612, 612, 175, 153, 153, 153, 174, 890, - 319, 62, 450, 463, 557, 609, 636, 496, 496, 496, - 496, 136, 136, 496, 496, 496, 496, 496, 496, 496, - 496, 496, 496, 496, 496, 496, 496, 496, 496, 496, - 496, 496, 496, 496, 496, 496, 496, 496, 496, 496, - 496, 496, 496, 496, 496, 496, 496, 496, 496, 496, - 496, 496, 496, 496, 496, 496, 496, 496, 496, 496, - 496, 496, 496, 496, 496, 496, 496, 496, 496, 496, - 496, 496, 496, 496, 496, 496, 496, 496, 496, 496, - 496, 496, 496, 496, 496, 496, 496, 496, 496, 496, - 496, 496, 496, 496, 496, 496, 496, 496, 496, 496, - 496, 496, 496, 496, 496, 195, 75, 777, 517, 147, - 778, 779, 780, 886, 727, 887, 832, 833, 682, 836, - 837, 838, 839, 840, 831, 841, 907, 842, 591, 591, - 591, 591, 591, 591, 591, 591, 591, 591, 591, 591, - 483, 573, 365, 209, 281, 407, 646, 646, 646, 646, - 646, 646, 646, 327, 327, 327, 327, 327, 327, 327, - 327, 327, 327, 327, 327, 327, 327, 327, 327, 327, - 327, 429, 834, 585, 585, 585, 563, 867, 867, 867, - 867, 867, 867, 867, 867, 867, 867, 867, 867, 867, - 867, 867, 867, 867, 867, 867, 867, 867, 867, 867, - 867, 867, 867, 867, 867, 867, 867, 867, 867, 867, - 867, 867, 867, 867, 867, 867, 867, 867, 867, 867, - 495, 486, -21, -21, 415, 668, 335, 619, 222, 511, - 213, 25, 25, 25, 25, 25, 148, 16, 4, 4, - 4, 4, 151, 312, 312, 312, 312, 119, 119, 119, - 119, 346, 346, 123, 245, 245, 349, 400, 297, 297, - 297, 297, 297, 297, 297, 297, 297, 297, 111, 558, - 558, 561, 561, 310, 152, 152, 152, 152, 704, 273, - 273, 129, 371, 371, 371, 373, 734, 797, 376, 376, - 376, 376, 376, 376, 468, 468, 468, 480, 480, 480, - 702, 587, 454, 587, 454, 684, 748, 509, 748, 700, - 199, 515, 803, 398, 720, 829, 729, 830, 601, 747, - 235, 782, 724, 419, 782, 633, 637, 634, 419, 419, - 715, 98, 863, 292, 195, 595, 405, 667, 781, 421, - 732, 784, 363, 445, 411, 593, 328, 286, 744, 785, - 888, 889, 181, 739, 667, 667, 667, 139, 362, 328, - -8, 613, 613, 613, 613, 48, 613, 613, 613, 613, - 314, 230, 506, 404, 783, 703, 703, 712, 694, 852, - 696, 696, 703, 711, 703, 712, 694, 854, 854, 854, - 854, 703, 694, 703, 703, 703, 696, 696, 694, 709, - 696, 38, 694, 695, 707, 707, 854, 751, 752, 703, - 703, 728, 696, 696, 696, 728, 694, 854, 685, 746, - 234, 696, 854, 665, 711, 665, 703, 685, 694, 665, - 711, 711, 665, 21, 662, 664, 853, 855, 869, 792, - 681, 716, 861, 862, 856, 860, 844, 679, 753, 754, - 569, 669, 671, 673, 699, 740, 701, 735, 724, 692, - 692, 692, 713, 741, 713, 692, 692, 692, 692, 692, - 692, 692, 692, 893, 689, 745, 736, 710, 755, 589, - 600, 793, 731, 738, 882, 875, 891, 892, 863, 880, - 713, 894, 697, 180, 650, 864, 693, 788, 713, 865, - 713, 794, 713, 883, 804, 708, 805, 806, 692, 884, - 895, 896, 897, 898, 899, 900, 901, 902, 706, 903, - 756, 698, 876, 339, 859, 715, 742, 725, 791, 759, - 807, 342, 904, 808, 713, 713, 795, 787, 713, 796, - 764, 750, 872, 766, 877, 905, 731, 726, 878, 713, - 730, 809, 906, 342, 672, 705, 737, 721, 767, 870, - 885, 868, 798, 655, 659, 810, 812, 820, 674, 769, - 873, 874, 871, 771, 799, 670, 800, 719, 821, 801, - 866, 772, 822, 823, 881, 718, 743, 717, 722, 714, - 802, 824, 879, 773, 774, 775, 827, 776, 828, 0, + 0, 227, 326, 400, 474, 233, 132, 132, 752, -2, + -2, 138, -2, -2, -2, 663, 761, 815, 761, 586, + 717, 859, 859, 859, 244, 256, 256, 256, 413, 583, + 583, 880, 546, 169, 415, 444, 409, 200, 200, 200, + 200, 137, 137, 200, 200, 200, 200, 200, 200, 200, + 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, + 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, + 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, + 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, + 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, + 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, + 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, + 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, + 200, 200, 200, 200, 200, 200, 249, 205, 738, 559, + 535, 739, 741, 742, 876, 679, 877, 820, 821, 693, + 823, 824, 826, 829, 832, 819, 834, 907, 836, 602, + 602, 602, 602, 602, 602, 602, 602, 602, 602, 602, + 602, 67, 536, 299, 510, 230, 44, 652, 652, 652, + 652, 652, 652, 652, 337, 337, 337, 337, 337, 337, + 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, + 337, 337, 378, 584, 584, 584, 657, 909, 648, 934, + 934, 934, 934, 934, 934, 934, 934, 934, 934, 934, + 934, 934, 934, 934, 934, 934, 934, 934, 934, 934, + 934, 934, 934, 934, 934, 934, 934, 934, 934, 934, + 934, 934, 934, 934, 934, 934, 934, 934, 934, 934, + 934, 934, 934, 503, -21, -21, 436, 650, 364, 571, + 215, 426, 156, 26, 26, 329, 329, 329, 329, 329, + 46, 46, 5, 5, 5, 5, 152, 186, 186, 186, + 186, 120, 120, 120, 120, 374, 374, 429, 448, 448, + 334, 267, 449, 449, 449, 449, 449, 449, 449, 449, + 449, 449, 336, 427, 427, 572, 572, 408, 551, 551, + 551, 551, 671, 171, 171, 391, 311, 311, 311, 109, + 641, 856, 68, 68, 68, 68, 68, 68, 324, 324, + 324, -3, -3, -3, 655, 77, 380, 77, 380, 683, + 685, 86, 685, 654, -15, 516, 776, 281, 646, 809, + 680, 816, 560, 711, 202, 578, 857, 643, -23, 578, + 578, 578, 578, 857, 622, 628, 596, -23, 578, -23, + 639, 454, 849, 351, 249, 558, 469, 631, 743, 514, + 688, 746, 464, 544, 548, 556, 7, 412, 708, 750, + 878, 879, 349, 702, 631, 631, 631, 327, 101, 7, + -8, 623, 623, 623, 623, 219, 623, 623, 623, 623, + 291, 430, 545, 401, 745, 653, 653, 675, 839, 814, + 814, 653, 673, 653, 675, 841, 841, 841, 841, 653, + 653, 653, 653, 814, 814, 667, 814, 275, 684, 694, + 694, 841, 713, 714, 653, 653, 697, 814, 814, 814, + 697, 687, 841, 669, 637, 333, 814, 841, 689, 673, + 689, 653, 669, 689, 673, 673, 689, 22, 686, 656, + 840, 842, 860, 756, 638, 644, 847, 848, 843, 845, + 838, 692, 719, 720, 528, 659, 660, 661, 662, 696, + 664, 698, 643, 658, 658, 658, 645, 701, 645, 658, + 658, 658, 658, 658, 658, 658, 658, 632, 635, 709, + 699, 670, 723, 566, 582, 758, 640, 636, 872, 865, + 881, 883, 849, 870, 645, 890, 634, 288, 610, 850, + 633, 753, 645, 851, 645, 759, 645, 873, 777, 666, + 778, 779, 658, 874, 891, 892, 893, 894, 897, 898, + 899, 900, 665, 901, 724, 674, 866, 344, 844, 639, + 705, 677, 755, 725, 780, 372, 902, 784, 645, 645, + 765, 706, 645, 766, 726, 712, 862, 727, 867, 903, + 640, 678, 868, 645, 681, 785, 904, 372, 690, 651, + 704, 649, 728, 858, 875, 853, 767, 612, 617, 787, + 788, 792, 691, 730, 863, 864, 835, 731, 770, 642, + 771, 676, 794, 772, 852, 732, 796, 798, 871, 647, + 707, 682, 672, 668, 773, 799, 869, 733, 735, 736, + 801, 737, 804, 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, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 136, - 136, 136, 136, -2, -2, -2, -2, 0, 0, -2, - 0, 0, 0, 136, 136, 136, 136, 136, 136, 136, - 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, - 136, 136, 136, 136, 136, 136, 136, 136, 136, 0, - 0, 136, 136, 136, 136, 136, 136, 136, 136, 136, - 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, - 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, - 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, - 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, - 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, - 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, - 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, - 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, - 136, 136, 136, 591, 591, 591, 591, 591, 591, 591, - 591, 591, 591, 591, 591, 591, 591, 591, 591, 591, - 591, 591, 591, 591, 591, 591, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 591, -21, - -21, -21, -21, 591, -21, -21, -21, -21, -21, -21, - -21, 591, 591, 591, 591, 591, 591, 591, 591, 591, - 591, 591, 591, 591, 591, 591, 591, 591, 591, -21, - 376, 591, 591, 591, -21, 376, 376, 376, 376, 376, - 376, 376, 376, 376, 376, 376, 376, 376, 376, 376, - 376, 376, 376, 376, 376, 376, 376, 376, 376, 376, - 376, 376, 376, 376, 376, 376, 376, 376, 376, 376, - 376, 376, 376, 376, 376, 376, 376, 376, -21, 591, - 0, 0, 591, -21, 591, -21, 591, -21, 591, 591, - 591, 591, 591, 591, -21, -21, -21, -21, -21, -21, - 0, 468, 468, 468, 468, -21, -21, -21, -21, 376, - 376, -37, 376, 376, 376, 376, 376, 376, 376, 376, - 376, 376, 376, 376, 376, 376, 376, 468, 468, 480, - 480, 376, 376, 376, 376, 376, -37, 376, 376, 419, - 711, 711, 711, 454, 454, 454, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 454, 419, - 0, 419, 0, 376, 419, 711, 419, 454, 711, 711, - 419, 696, 618, 618, 618, 618, 342, 328, 0, 711, - 711, 0, 711, 0, 0, 0, 0, 0, 696, 0, - 703, 0, 0, 0, 0, 692, 180, 0, 725, 427, - 0, 0, 0, 0, 0, 0, 725, 427, 435, 435, - 0, 706, 692, 692, 692, 0, 0, 0, 0, 0, + 0, 0, 0, 137, 137, 137, 137, -2, -2, -2, + -2, 0, 0, -2, 0, 0, 0, 137, 137, 137, + 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, + 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, + 137, 137, 137, 0, 0, 137, 137, 137, 137, 137, + 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, + 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, + 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, + 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, + 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, + 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, + 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, + 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, + 137, 137, 137, 137, 137, 137, 137, 137, 602, 602, + 602, 602, 602, 602, 602, 602, 602, 602, 602, 602, + 602, 602, 602, 602, 602, 602, 602, 602, 602, 602, + 602, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 602, -21, -21, -21, -21, 602, -21, + -21, -21, -21, -21, -21, -21, 602, 602, 602, 602, + 602, 602, 602, 602, 602, 602, 602, 602, 602, 602, + 602, 602, 602, 602, -21, 602, 602, 602, -21, 68, + -21, 68, 68, 68, 68, 68, 68, 68, 68, 68, + 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, + 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, + 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, + 68, 68, 68, 68, 68, 602, 0, 0, 602, -21, + 602, -21, 602, -21, -21, 602, 602, 602, 602, 602, + 602, 602, -21, -21, -21, -21, -21, -21, 0, 324, + 324, 324, 324, -21, -21, -21, -21, 68, 68, 147, + 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, + 68, 68, 68, 68, 68, 324, 324, -3, -3, 68, + 68, 68, 68, 68, 147, 68, 68, -23, 673, 673, + 673, 380, 380, 380, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 380, -23, 0, -23, + 0, 68, -23, 673, -23, 380, 673, 673, -23, 814, + 604, 604, 604, 604, 372, 7, 0, 0, 673, 673, + 0, 0, 0, 0, 0, 673, 0, 0, 0, 0, + 0, 0, 814, 0, 653, 0, 0, 0, 0, 658, + 288, 0, 677, 456, 0, 0, 0, 0, 0, 0, + 677, 456, 530, 530, 0, 665, 658, 658, 658, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 342 + 0, 0, 0, 0, 0, 0, 372 ); protected $actionDefault = array( 3,32767,32767,32767,32767,32767,32767,32767,32767,32767, 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767, 534, 534, 489,32767,32767, - 32767,32767,32767,32767,32767,32767,32767, 293, 293, 293, - 32767,32767,32767, 522, 522, 522, 522, 522, 522, 522, - 522, 522, 522, 522,32767,32767,32767,32767,32767,32767, - 376,32767,32767,32767,32767,32767,32767,32767,32767,32767, + 32767,32767,32767,32767,32767, 540, 540, 495,32767,32767, + 32767,32767,32767,32767,32767,32767,32767, 297, 297, 297, + 32767,32767,32767, 528, 528, 528, 528, 528, 528, 528, + 528, 528, 528, 528,32767,32767,32767,32767,32767,32767, + 381,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, 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, 382, 539, + 32767,32767,32767,32767,32767,32767,32767,32767,32767, 387, + 545,32767,32767,32767,32767,32767,32767,32767,32767,32767, + 32767,32767,32767,32767,32767,32767,32767,32767,32767, 362, + 363, 365, 366, 296, 548, 529, 245, 388, 544, 295, + 247, 325, 499,32767,32767,32767, 327, 122, 256, 201, + 498, 125, 294, 232, 380, 382, 326, 301, 306, 307, + 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, + 318, 300, 454, 359, 358, 357, 456,32767, 455, 492, + 492, 495,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, 357, 358, - 360, 361, 292, 542, 523, 241, 383, 538, 291, 243, - 321, 493,32767,32767,32767, 323, 120, 252, 197, 492, - 123, 290, 228, 375, 377, 322, 297, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 296, 449,32767, 354, 353, 352, 451, 486, 486, 489, 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, + 32767,32767,32767, 323, 483, 482, 324, 452, 328, 453, + 331, 457, 460, 329, 330, 347, 348, 345, 346, 349, + 458, 459, 476, 477, 474, 475, 299, 350, 351, 352, + 353, 478, 479, 480, 481,32767,32767, 280, 539, 539, 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, + 32767,32767,32767, 338, 339, 467, 468,32767, 236, 236, + 236, 236, 281, 236,32767,32767,32767,32767,32767,32767, + 32767,32767,32767,32767,32767,32767,32767,32767, 333, 334, + 332, 462, 463, 461, 428,32767,32767,32767, 430,32767, + 32767,32767,32767,32767,32767,32767,32767, 500,32767,32767, + 32767,32767,32767, 513, 417, 171,32767, 409,32767, 171, + 171, 171, 171,32767, 220, 222, 167,32767, 171,32767, + 486,32767,32767,32767,32767,32767, 518, 343,32767,32767, + 116,32767,32767,32767, 555,32767, 513,32767, 116,32767, + 32767,32767,32767, 356, 335, 336, 337,32767,32767, 517, + 511, 470, 471, 472, 473,32767, 464, 465, 466, 469, + 32767,32767,32767,32767,32767,32767,32767,32767, 425, 431, + 431,32767,32767,32767,32767,32767,32767,32767,32767,32767, + 32767,32767,32767, 516, 515,32767, 410, 494, 186, 184, + 184,32767, 206, 206,32767,32767, 188, 487, 506,32767, + 188, 173,32767, 398, 175, 494,32767,32767, 238,32767, + 238,32767, 398, 238,32767,32767, 238,32767, 411, 435, 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 450, 319, 477, 476, 320, 447, 324, 448, 326, 452, - 325, 342, 343, 340, 341, 344, 454, 453, 470, 471, - 468, 469, 295, 345, 346, 347, 348, 472, 473, 474, - 475,32767,32767, 276, 533, 533,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767, 333, - 334, 461, 462,32767, 232, 232, 232, 232, 277, 232, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767, 328, 329, 327, 456, 457, 455, - 423,32767,32767,32767, 425,32767,32767,32767,32767,32767, - 32767,32767,32767, 494,32767,32767,32767,32767,32767, 507, - 412,32767, 404,32767,32767, 216, 218, 165,32767,32767, - 480,32767,32767,32767,32767,32767, 512, 338,32767,32767, - 114,32767,32767,32767, 549,32767, 507,32767, 114,32767, - 32767,32767,32767, 351, 330, 331, 332,32767,32767, 511, - 505, 464, 465, 466, 467,32767, 458, 459, 460, 463, - 32767,32767,32767,32767,32767,32767,32767,32767, 169, 420, - 426, 426,32767,32767,32767,32767, 169,32767,32767,32767, - 32767,32767, 169,32767,32767,32767, 510, 509, 169,32767, - 405, 488, 169, 182, 180, 180,32767, 202, 202,32767, - 32767, 184, 481, 500,32767, 184, 169,32767, 393, 171, - 488,32767,32767, 234,32767, 234,32767, 393, 169, 234, - 32767,32767, 234,32767, 406, 430,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767, 372, 373, 483, 496,32767, 497,32767, 404, 336, - 337, 339, 316,32767, 318, 362, 363, 364, 365, 366, - 367, 368, 370,32767, 410,32767, 413,32767,32767,32767, - 251,32767, 547,32767,32767, 300, 547,32767,32767,32767, - 541,32767,32767, 294,32767,32767,32767,32767, 247,32767, - 167,32767, 531,32767, 548,32767, 505,32767, 335,32767, - 32767,32767,32767,32767,32767,32767,32767,32767, 506,32767, - 32767,32767,32767, 223,32767, 443,32767, 114,32767,32767, - 32767, 183,32767,32767, 298, 242,32767,32767, 540,32767, - 32767,32767,32767,32767,32767,32767,32767, 112,32767, 168, - 32767,32767,32767, 185,32767,32767, 505,32767,32767,32767, - 32767,32767,32767,32767, 289,32767,32767,32767,32767,32767, - 32767,32767, 505,32767,32767, 227,32767,32767,32767,32767, - 32767,32767,32767,32767,32767, 406,32767, 270,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767, 125, - 125, 3, 125, 125, 254, 3, 254, 125, 254, 254, - 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, - 210, 213, 202, 202, 162, 125, 125, 262 + 32767,32767,32767,32767,32767, 377, 378, 489, 502,32767, + 503,32767, 409, 341, 342, 344, 320,32767, 322, 367, + 368, 369, 370, 371, 372, 373, 375,32767, 415,32767, + 418,32767,32767,32767, 255,32767, 553,32767,32767, 304, + 553,32767,32767,32767, 547,32767,32767, 298,32767,32767, + 32767,32767, 251,32767, 169,32767, 537,32767, 554,32767, + 511,32767, 340,32767,32767,32767,32767,32767,32767,32767, + 32767,32767, 512,32767,32767,32767,32767, 227,32767, 448, + 32767, 116,32767,32767,32767, 187,32767,32767, 302, 246, + 32767,32767, 546,32767,32767,32767,32767,32767,32767,32767, + 32767, 114,32767, 170,32767,32767,32767, 189,32767,32767, + 511,32767,32767,32767,32767,32767,32767,32767, 293,32767, + 32767,32767,32767,32767,32767,32767, 511,32767,32767, 231, + 32767,32767,32767,32767,32767,32767,32767,32767,32767, 411, + 32767, 274,32767,32767,32767,32767,32767,32767,32767,32767, + 32767,32767,32767, 127, 127, 3, 127, 127, 258, 3, + 258, 127, 258, 258, 127, 127, 127, 127, 127, 127, + 127, 127, 127, 127, 214, 217, 206, 206, 164, 127, + 127, 266 ); protected $goto = array( - 165, 139, 139, 139, 165, 143, 146, 140, 141, 142, - 148, 186, 167, 162, 162, 162, 162, 143, 143, 164, - 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, - 137, 158, 159, 160, 161, 183, 138, 184, 489, 490, - 367, 491, 495, 496, 497, 498, 499, 500, 501, 502, - 959, 163, 144, 145, 147, 170, 175, 185, 203, 251, - 254, 256, 258, 260, 261, 262, 263, 264, 265, 273, - 274, 275, 276, 299, 300, 324, 325, 326, 384, 385, - 386, 538, 187, 188, 189, 190, 191, 192, 193, 194, - 195, 196, 197, 198, 199, 200, 149, 150, 151, 166, - 152, 168, 153, 204, 169, 154, 155, 156, 205, 157, - 135, 616, 556, 574, 578, 622, 624, 556, 556, 556, - 556, 556, 556, 556, 556, 556, 556, 556, 556, 556, - 556, 556, 556, 556, 556, 556, 556, 556, 556, 556, - 556, 556, 556, 556, 556, 556, 556, 556, 556, 556, - 556, 556, 556, 556, 556, 556, 556, 556, 556, 556, - 1099, 515, 345, 571, 600, 1099, 1099, 1099, 1099, 1099, - 1099, 1099, 1099, 1099, 1099, 1099, 1099, 1099, 1099, 1099, - 1099, 1099, 1099, 1099, 1099, 1099, 1099, 1099, 1099, 1099, - 1099, 1099, 1099, 1099, 1099, 1099, 1099, 1099, 1099, 1099, - 1099, 1099, 1099, 1099, 1099, 1099, 1099, 1099, 504, 1202, - 1202, 1075, 1074, 504, 540, 541, 542, 543, 544, 545, - 546, 547, 549, 582, 3, 4, 173, 1202, 844, 844, - 844, 844, 839, 845, 176, 177, 178, 391, 392, 393, - 394, 172, 201, 206, 250, 255, 257, 259, 266, 267, - 268, 269, 270, 271, 277, 278, 279, 280, 301, 302, - 327, 328, 329, 396, 397, 398, 399, 174, 179, 252, - 253, 180, 181, 182, 493, 493, 750, 493, 493, 493, - 493, 493, 493, 493, 493, 493, 493, 493, 493, 493, - 493, 505, 929, 442, 444, 627, 505, 751, 779, 1100, - 610, 927, 880, 880, 765, 1190, 1190, 1168, 555, 775, - 764, 743, 1168, 555, 555, 555, 555, 555, 555, 555, - 555, 555, 555, 555, 555, 555, 555, 555, 555, 555, - 555, 555, 555, 555, 555, 555, 555, 555, 555, 555, - 555, 555, 555, 555, 555, 555, 555, 555, 555, 555, - 555, 555, 555, 555, 555, 555, 390, 602, 746, 532, - 532, 564, 528, 530, 530, 492, 494, 520, 536, 565, - 568, 579, 586, 810, 606, 506, 346, 347, 609, 850, - 506, 365, 537, 746, 533, 746, 563, 430, 430, 375, - 430, 430, 430, 430, 430, 430, 430, 430, 430, 430, - 430, 430, 430, 430, 1063, 581, 957, 596, 597, 1063, - 887, 887, 887, 887, 1160, 887, 887, 1182, 1182, 1182, - 376, 376, 376, 749, 1063, 1063, 1063, 1063, 1063, 1063, - 334, 1056, 317, 374, 374, 374, 866, 848, 846, 848, - 650, 461, 507, 875, 870, 376, 1194, 368, 374, 389, - 374, 898, 374, 1080, 583, 348, 404, 374, 1216, 590, - 601, 1017, 19, 15, 361, 1148, 1187, 525, 936, 904, - 510, 526, 904, 651, 551, 381, 1201, 1201, 587, 1007, - 550, 877, 607, 608, 873, 612, 613, 619, 621, 626, - 628, 23, 884, 937, 1201, 336, 598, 1059, 1060, 1204, - 378, 1056, 557, 539, 893, 768, 766, 379, 514, 902, - 509, 524, 655, 1057, 1159, 1057, 776, 509, 1167, 524, - 514, 514, 1058, 1167, 1049, 907, 508, 1054, 511, 433, - 434, 510, 1184, 1184, 1184, 854, 445, 945, 569, 1145, - 459, 362, 0, 0, 773, 1209, 0, 518, 0, 519, - 0, 529, 0, 0, 0, 0, 0, 1166, 0, 0, - 0, 771, 0, 0, 0, 449, 0, 0, 0, 0, - 0, 0, 605, 0, 0, 0, 0, 13, 1055, 614 + 166, 140, 140, 140, 166, 187, 168, 144, 147, 141, + 142, 143, 149, 163, 163, 163, 163, 144, 144, 165, + 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, + 138, 159, 160, 161, 162, 184, 139, 185, 493, 494, + 377, 495, 499, 500, 501, 502, 503, 504, 505, 506, + 967, 164, 145, 146, 148, 171, 176, 186, 203, 253, + 256, 258, 260, 263, 264, 265, 266, 267, 268, 269, + 277, 278, 279, 280, 303, 304, 328, 329, 330, 394, + 395, 396, 542, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 150, 151, 152, + 167, 153, 169, 154, 204, 170, 155, 156, 157, 205, + 158, 136, 620, 560, 756, 560, 560, 560, 560, 560, + 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, + 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, + 560, 560, 560, 560, 560, 560, 560, 560, 560, 560, + 560, 560, 560, 560, 560, 560, 560, 560, 560, 1108, + 628, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, + 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, + 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, + 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, + 1108, 1108, 1108, 1108, 1108, 757, 888, 888, 508, 1200, + 1200, 400, 606, 508, 536, 536, 568, 532, 534, 534, + 496, 498, 524, 540, 569, 572, 583, 590, 852, 852, + 852, 852, 847, 853, 174, 585, 519, 600, 601, 177, + 178, 179, 401, 402, 403, 404, 173, 202, 206, 208, + 257, 259, 261, 262, 270, 271, 272, 273, 274, 275, + 281, 282, 283, 284, 305, 306, 331, 332, 333, 406, + 407, 408, 409, 175, 180, 254, 255, 181, 182, 183, + 497, 497, 785, 497, 497, 497, 497, 497, 497, 497, + 497, 497, 497, 497, 497, 497, 497, 509, 578, 582, + 626, 749, 509, 544, 545, 546, 547, 548, 549, 550, + 551, 553, 586, 338, 559, 321, 559, 559, 559, 559, + 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, + 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, + 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, + 559, 559, 559, 559, 559, 559, 559, 559, 559, 559, + 530, 349, 655, 555, 587, 352, 414, 591, 575, 604, + 885, 611, 612, 881, 616, 617, 623, 625, 630, 632, + 298, 296, 296, 296, 298, 290, 299, 944, 610, 816, + 1170, 613, 436, 436, 375, 436, 436, 436, 436, 436, + 436, 436, 436, 436, 436, 436, 436, 436, 436, 1072, + 1084, 1083, 945, 1065, 1072, 895, 895, 895, 895, 1178, + 895, 895, 1212, 1212, 1178, 388, 858, 561, 755, 1072, + 1072, 1072, 1072, 1072, 1072, 3, 4, 384, 384, 384, + 1212, 874, 856, 854, 856, 654, 465, 511, 883, 878, + 1089, 541, 384, 537, 384, 567, 384, 1026, 19, 15, + 371, 384, 1226, 510, 1204, 1192, 1192, 1192, 510, 906, + 372, 522, 533, 554, 912, 514, 1068, 1069, 13, 1065, + 378, 912, 1158, 594, 23, 965, 386, 386, 386, 602, + 1066, 1169, 1066, 937, 447, 449, 631, 752, 1177, 1067, + 1109, 614, 935, 1177, 605, 1197, 391, 1211, 1211, 543, + 892, 386, 1194, 1194, 1194, 399, 518, 1016, 901, 389, + 771, 529, 752, 340, 752, 1211, 518, 518, 385, 781, + 1214, 770, 772, 1063, 910, 774, 1058, 1176, 659, 953, + 514, 782, 862, 915, 450, 573, 1155, 0, 463, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 513, 528, 0, 0, 0, 0, + 513, 0, 528, 0, 350, 351, 0, 609, 512, 515, + 438, 439, 1064, 618, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 779, 1219, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 777, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 523, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 301, 301 ); protected $gotoCheck = array( - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 56, 66, 59, 59, 59, 8, 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, 66, 66, 66, 66, 66, 66, 66, - 124, 99, 69, 39, 39, 124, 124, 124, 124, 124, - 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, - 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, - 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, - 124, 124, 124, 124, 124, 124, 124, 124, 66, 140, - 140, 122, 122, 66, 108, 108, 108, 108, 108, 108, - 108, 108, 108, 108, 29, 29, 26, 140, 66, 66, - 66, 66, 66, 66, 26, 26, 26, 26, 26, 26, - 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, - 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, - 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, - 26, 26, 26, 26, 115, 115, 14, 115, 115, 115, - 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, - 115, 115, 7, 7, 7, 7, 115, 15, 28, 7, - 7, 7, 74, 74, 22, 74, 74, 116, 56, 22, - 22, 5, 116, 56, 56, 56, 56, 56, 56, 56, - 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, - 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, - 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, - 56, 56, 56, 56, 56, 56, 50, 50, 10, 50, - 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, - 50, 50, 50, 49, 60, 120, 69, 69, 60, 32, - 120, 60, 2, 10, 107, 10, 2, 56, 56, 10, - 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, - 56, 56, 56, 56, 56, 64, 99, 64, 64, 56, - 56, 56, 56, 56, 79, 56, 56, 8, 8, 8, - 121, 121, 121, 13, 56, 56, 56, 56, 56, 56, - 123, 79, 123, 12, 12, 12, 13, 13, 13, 13, - 13, 56, 13, 13, 13, 121, 138, 45, 12, 121, - 12, 81, 12, 33, 67, 67, 67, 12, 12, 125, - 48, 33, 33, 33, 33, 129, 136, 8, 95, 12, - 12, 31, 12, 31, 31, 47, 139, 139, 31, 100, - 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, - 31, 33, 76, 95, 139, 17, 33, 79, 79, 139, - 11, 79, 11, 46, 78, 24, 23, 16, 46, 82, - 8, 8, 71, 79, 79, 79, 25, 8, 117, 8, - 46, 46, 79, 117, 111, 83, 8, 113, 8, 8, - 8, 12, 117, 117, 117, 68, 62, 97, 63, 128, - 106, 57, -1, -1, 8, 8, -1, 57, -1, 99, - -1, 57, -1, -1, -1, -1, -1, 117, -1, -1, - -1, 8, -1, -1, -1, 57, -1, -1, -1, -1, - -1, -1, 12, -1, -1, -1, -1, 57, 12, 12 + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 57, 68, 15, 68, 68, 68, 68, 68, + 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, + 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, + 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, + 68, 68, 68, 68, 68, 68, 68, 68, 68, 126, + 9, 126, 126, 126, 126, 126, 126, 126, 126, 126, + 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, + 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, + 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, + 126, 126, 126, 126, 126, 16, 76, 76, 68, 76, + 76, 51, 51, 68, 51, 51, 51, 51, 51, 51, + 51, 51, 51, 51, 51, 51, 51, 51, 68, 68, + 68, 68, 68, 68, 27, 66, 101, 66, 66, 27, + 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, + 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, + 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, + 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, + 117, 117, 29, 117, 117, 117, 117, 117, 117, 117, + 117, 117, 117, 117, 117, 117, 117, 117, 61, 61, + 61, 6, 117, 110, 110, 110, 110, 110, 110, 110, + 110, 110, 110, 125, 57, 125, 57, 57, 57, 57, + 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, + 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, + 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, + 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, + 32, 71, 32, 32, 69, 69, 69, 32, 40, 40, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 5, 5, 5, 5, 5, 5, 5, 97, 62, 50, + 81, 62, 57, 57, 62, 57, 57, 57, 57, 57, + 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, + 124, 124, 97, 81, 57, 57, 57, 57, 57, 118, + 57, 57, 142, 142, 118, 12, 33, 12, 14, 57, + 57, 57, 57, 57, 57, 30, 30, 13, 13, 13, + 142, 14, 14, 14, 14, 14, 57, 14, 14, 14, + 34, 2, 13, 109, 13, 2, 13, 34, 34, 34, + 34, 13, 13, 122, 140, 9, 9, 9, 122, 83, + 58, 58, 58, 34, 13, 13, 81, 81, 58, 81, + 46, 13, 131, 127, 34, 101, 123, 123, 123, 34, + 81, 81, 81, 8, 8, 8, 8, 11, 119, 81, + 8, 8, 8, 119, 49, 138, 48, 141, 141, 47, + 78, 123, 119, 119, 119, 123, 47, 102, 80, 17, + 23, 9, 11, 18, 11, 141, 47, 47, 11, 23, + 141, 23, 24, 115, 84, 25, 113, 119, 73, 99, + 13, 26, 70, 85, 64, 65, 130, -1, 108, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 9, 9, -1, -1, -1, -1, + 9, -1, 9, -1, 71, 71, -1, 13, 9, 9, + 9, 9, 13, 13, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 9, 9, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 101, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 5, 5 ); protected $gotoBase = array( - 0, 0, -249, 0, 0, 300, 0, 287, 105, 0, - 47, 164, 118, 421, 274, 295, 171, 184, 0, 0, - 0, 0, -49, 168, 172, 104, 24, 0, 288, -431, - 0, -159, 359, 44, 0, 0, 0, 0, 0, 125, - 0, 0, -24, 0, 0, 407, 479, 186, 178, 355, - 75, 0, 0, 0, 0, 0, 106, 119, 0, -192, - -81, 0, 101, 93, -231, 0, -90, 135, 121, -276, - 0, 148, 0, 0, 21, 0, 183, 0, 194, 71, - 0, 423, 155, 112, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 185, 0, 122, 0, 120, - 176, 0, 0, 0, 0, 0, 83, 358, 170, 0, - 0, 113, 0, 111, 0, -7, 9, 220, 0, 0, - 77, 108, -102, 100, -42, 251, 0, 0, 89, 256, - 0, 0, 0, 0, 0, 0, 181, 0, 419, 160, - -107, 0, 0 + 0, 0, -184, 0, 0, 356, 290, 0, 488, 149, + 0, 182, 85, 118, 426, 112, 203, 179, 208, 0, + 0, 0, 0, 162, 190, 198, 120, 27, 0, 272, + -224, 0, -274, 406, 32, 0, 0, 0, 0, 0, + 330, 0, 0, -24, 0, 0, 440, 485, 213, 218, + 371, -74, 0, 0, 0, 0, 0, 107, 110, 0, + 0, -11, -72, 0, 104, 95, -405, 0, -94, 41, + 119, -82, 0, 164, 0, 0, -79, 0, 197, 0, + 204, 43, 0, 441, 171, 121, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 100, 0, 115, + 0, 195, 210, 0, 0, 0, 0, 0, 86, 427, + 259, 0, 0, 116, 0, 174, 0, -5, 117, 196, + 0, 0, 161, 170, 93, -21, -48, 273, 0, 0, + 91, 271, 0, 0, 0, 0, 0, 0, 216, 0, + 437, 187, 102, 0, 0 ); protected $gotoDefault = array( - -32768, 463, 659, 2, 660, 733, 741, 593, 477, 625, - 577, 370, 1178, 785, 786, 787, 371, 358, 478, 369, - 400, 395, 774, 767, 769, 777, 171, 401, 780, 1, - 782, 513, 818, 1008, 355, 790, 356, 585, 792, 522, - 794, 795, 136, 372, 373, 523, 479, 380, 572, 809, - 272, 377, 811, 357, 812, 821, 360, 460, 454, 552, - 604, 425, 441, 566, 560, 531, 1072, 561, 853, 344, - 861, 656, 869, 872, 480, 553, 883, 446, 891, 1085, - 387, 897, 903, 908, 283, 911, 407, 402, 580, 916, - 917, 5, 921, 617, 618, 8, 308, 944, 594, 958, - 411, 1027, 1029, 481, 482, 517, 453, 503, 521, 483, - 1050, 435, 403, 1053, 484, 485, 426, 427, 1069, 350, - 1153, 349, 443, 316, 1140, 575, 1104, 450, 1193, 1149, - 343, 486, 487, 366, 1172, 382, 1188, 431, 1195, 1203, - 339, 535, 562 + -32768, 467, 663, 2, 664, 834, 739, 747, 597, 481, + 629, 581, 380, 1188, 791, 792, 793, 381, 367, 482, + 379, 410, 405, 780, 773, 775, 783, 172, 411, 786, + 1, 788, 517, 824, 1017, 364, 796, 365, 589, 798, + 526, 800, 801, 137, 382, 383, 527, 483, 390, 576, + 815, 276, 387, 817, 366, 818, 827, 370, 464, 454, + 459, 556, 608, 432, 446, 570, 564, 535, 1081, 565, + 861, 348, 869, 660, 877, 880, 484, 557, 891, 451, + 899, 1094, 397, 905, 911, 916, 287, 919, 417, 412, + 584, 924, 925, 5, 929, 621, 622, 8, 312, 952, + 598, 966, 420, 1036, 1038, 485, 486, 521, 458, 507, + 525, 487, 1059, 440, 413, 1062, 488, 489, 433, 434, + 1078, 354, 1163, 353, 448, 320, 1150, 579, 1113, 455, + 1203, 1159, 347, 490, 491, 376, 1182, 392, 1198, 437, + 1205, 1213, 343, 539, 566 ); protected $ruleToNonTerminal = array( - 0, 1, 3, 3, 2, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, - 6, 6, 7, 7, 8, 9, 10, 10, 11, 11, - 12, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 17, 17, 18, 18, 20, 20, 16, 16, - 21, 21, 22, 22, 23, 23, 24, 24, 19, 19, - 25, 27, 27, 28, 29, 29, 31, 30, 30, 30, - 30, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 13, 13, 53, 53, 55, 54, 54, 47, 47, 57, - 57, 58, 58, 14, 15, 15, 15, 61, 61, 61, - 62, 62, 65, 65, 63, 63, 67, 67, 40, 40, - 49, 49, 52, 52, 52, 51, 51, 68, 41, 41, - 41, 41, 69, 69, 70, 70, 71, 71, 38, 38, - 34, 34, 72, 36, 36, 73, 35, 35, 37, 37, - 48, 48, 48, 59, 59, 75, 75, 76, 76, 78, - 78, 78, 77, 77, 60, 60, 79, 79, 79, 80, - 80, 81, 81, 81, 43, 43, 82, 82, 82, 44, - 44, 83, 83, 84, 84, 64, 85, 85, 85, 85, - 90, 90, 91, 91, 92, 92, 92, 92, 92, 93, - 94, 94, 89, 89, 86, 86, 88, 88, 96, 96, - 95, 95, 95, 95, 95, 95, 87, 87, 98, 97, - 97, 45, 45, 39, 39, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 33, 33, 46, 46, 103, 103, 104, 104, 104, 104, - 110, 99, 99, 106, 106, 112, 112, 113, 114, 114, - 114, 114, 114, 114, 66, 66, 56, 56, 56, 56, - 100, 100, 118, 118, 115, 115, 119, 119, 119, 119, - 101, 101, 101, 105, 105, 105, 111, 111, 124, 124, - 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, - 124, 26, 26, 26, 26, 26, 26, 126, 126, 126, - 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, - 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, - 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, - 109, 109, 102, 102, 102, 102, 125, 125, 128, 128, - 127, 127, 129, 129, 50, 50, 50, 50, 131, 131, - 130, 130, 130, 130, 130, 132, 132, 117, 117, 120, - 120, 116, 116, 134, 133, 133, 133, 133, 121, 121, - 121, 121, 108, 108, 122, 122, 122, 122, 74, 135, - 135, 136, 136, 136, 107, 107, 137, 137, 138, 138, - 138, 138, 138, 123, 123, 123, 123, 140, 141, 139, - 139, 139, 139, 139, 139, 139, 142, 142, 142 + 0, 1, 3, 3, 2, 5, 5, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, + 7, 7, 7, 7, 8, 8, 9, 10, 11, 11, + 12, 12, 13, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 18, 18, 19, 19, 21, 21, + 17, 17, 22, 22, 23, 23, 24, 24, 25, 25, + 20, 20, 26, 28, 28, 29, 30, 30, 32, 31, + 31, 31, 31, 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, 14, 14, 54, 54, 56, 55, 55, 48, + 48, 58, 58, 59, 59, 60, 60, 15, 16, 16, + 16, 63, 63, 63, 64, 64, 67, 67, 65, 65, + 69, 69, 41, 41, 50, 50, 53, 53, 53, 52, + 52, 70, 42, 42, 42, 42, 71, 71, 72, 72, + 73, 73, 39, 39, 35, 35, 74, 37, 37, 75, + 36, 36, 38, 38, 49, 49, 49, 61, 61, 77, + 77, 78, 78, 80, 80, 80, 79, 79, 62, 62, + 81, 81, 81, 82, 82, 83, 83, 83, 44, 44, + 84, 84, 84, 45, 45, 85, 85, 86, 86, 66, + 87, 87, 87, 87, 92, 92, 93, 93, 94, 94, + 94, 94, 94, 95, 96, 96, 91, 91, 88, 88, + 90, 90, 98, 98, 97, 97, 97, 97, 97, 97, + 89, 89, 100, 99, 99, 46, 46, 40, 40, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 34, 34, 47, 47, 105, + 105, 106, 106, 106, 106, 112, 101, 101, 108, 108, + 114, 114, 115, 116, 116, 116, 116, 116, 116, 68, + 68, 57, 57, 57, 57, 102, 102, 120, 120, 117, + 117, 121, 121, 121, 121, 103, 103, 103, 107, 107, + 107, 113, 113, 126, 126, 126, 126, 126, 126, 126, + 126, 126, 126, 126, 126, 126, 27, 27, 27, 27, + 27, 27, 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 111, 111, 104, 104, + 104, 104, 127, 127, 130, 130, 129, 129, 131, 131, + 51, 51, 51, 51, 133, 133, 132, 132, 132, 132, + 132, 134, 134, 119, 119, 122, 122, 118, 118, 136, + 135, 135, 135, 135, 123, 123, 123, 123, 110, 110, + 124, 124, 124, 124, 76, 137, 137, 138, 138, 138, + 109, 109, 139, 139, 140, 140, 140, 140, 140, 125, + 125, 125, 125, 142, 143, 141, 141, 141, 141, 141, + 141, 141, 144, 144, 144 ); protected $ruleToLength = array( @@ -867,53 +892,54 @@ class Php5 extends \PhpParser\ParserAbstract 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 3, 5, 4, 3, 4, - 2, 3, 1, 1, 7, 6, 3, 1, 3, 1, - 3, 1, 1, 3, 1, 3, 1, 2, 3, 1, - 3, 3, 1, 3, 2, 0, 1, 1, 1, 1, - 1, 3, 5, 8, 3, 5, 9, 3, 2, 3, - 2, 3, 2, 3, 3, 3, 3, 1, 2, 2, - 5, 7, 9, 5, 6, 3, 3, 2, 2, 1, - 1, 1, 0, 2, 8, 0, 4, 1, 3, 0, - 1, 0, 1, 10, 7, 6, 5, 1, 2, 2, - 0, 2, 0, 2, 0, 2, 1, 3, 1, 4, - 1, 4, 1, 1, 4, 1, 3, 3, 3, 4, - 4, 5, 0, 2, 4, 3, 1, 1, 1, 4, - 0, 2, 3, 0, 2, 4, 0, 2, 0, 3, - 1, 2, 1, 1, 0, 1, 3, 4, 6, 1, - 1, 1, 0, 1, 0, 2, 2, 3, 3, 1, - 3, 1, 2, 2, 3, 1, 1, 2, 4, 3, - 1, 1, 3, 2, 0, 1, 3, 3, 9, 3, - 1, 3, 0, 2, 4, 5, 4, 4, 4, 3, - 1, 1, 1, 3, 1, 1, 0, 1, 1, 2, - 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, - 3, 3, 1, 0, 1, 1, 3, 3, 4, 4, - 1, 2, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 2, 2, 2, 2, 3, + 1, 1, 1, 1, 1, 1, 1, 3, 5, 4, + 3, 4, 2, 3, 1, 1, 7, 6, 3, 1, + 3, 1, 3, 1, 1, 3, 1, 3, 1, 2, + 3, 1, 3, 3, 1, 3, 2, 0, 1, 1, + 1, 1, 1, 3, 5, 8, 3, 5, 9, 3, + 2, 3, 2, 3, 2, 3, 3, 3, 3, 1, + 2, 2, 5, 7, 9, 5, 6, 3, 3, 2, + 2, 1, 1, 1, 0, 2, 8, 0, 4, 1, + 3, 0, 1, 0, 1, 0, 1, 10, 7, 6, + 5, 1, 2, 2, 0, 2, 0, 2, 0, 2, + 1, 3, 1, 4, 1, 4, 1, 1, 4, 1, + 3, 3, 3, 4, 4, 5, 0, 2, 4, 3, + 1, 1, 1, 4, 0, 2, 3, 0, 2, 4, + 0, 2, 0, 3, 1, 2, 1, 1, 0, 1, + 3, 4, 6, 1, 1, 1, 0, 1, 0, 2, + 2, 3, 3, 1, 3, 1, 2, 2, 3, 1, + 1, 2, 4, 3, 1, 1, 3, 2, 0, 1, + 3, 3, 9, 3, 1, 3, 0, 2, 4, 5, + 4, 4, 4, 3, 1, 1, 1, 3, 1, 1, + 0, 1, 1, 2, 1, 1, 1, 1, 1, 1, + 1, 3, 1, 1, 3, 3, 1, 0, 1, 1, + 3, 3, 4, 4, 1, 2, 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, 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, - 1, 3, 5, 4, 3, 4, 4, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 1, 1, 1, 3, 2, 1, 2, 10, 11, - 3, 3, 2, 4, 4, 3, 4, 4, 4, 4, - 7, 3, 2, 0, 4, 1, 3, 2, 2, 4, - 6, 2, 2, 4, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 3, 3, 4, 4, - 0, 2, 1, 0, 1, 1, 0, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, - 2, 1, 3, 1, 4, 3, 1, 3, 3, 3, + 3, 2, 2, 2, 2, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 1, 3, 5, 4, 3, + 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 1, 1, 1, 3, + 2, 1, 2, 10, 11, 3, 3, 2, 4, 4, + 3, 4, 4, 4, 4, 7, 3, 2, 0, 4, + 1, 3, 2, 2, 4, 6, 2, 2, 4, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 3, 3, 4, 4, 0, 2, 1, 0, 1, + 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 3, 2, 1, 3, 1, 4, + 3, 1, 3, 3, 3, 3, 3, 3, 3, 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, 5, 4, 4, 3, - 1, 3, 1, 1, 3, 3, 0, 2, 0, 1, - 3, 1, 3, 1, 1, 1, 1, 1, 6, 4, - 3, 4, 2, 4, 4, 1, 3, 1, 2, 1, - 1, 4, 1, 1, 3, 6, 4, 4, 4, 4, - 1, 4, 0, 1, 1, 3, 1, 1, 4, 3, - 1, 1, 1, 0, 0, 2, 3, 1, 3, 1, - 4, 2, 2, 2, 2, 1, 2, 1, 1, 1, - 4, 3, 3, 3, 6, 3, 1, 1, 1 + 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, + 3, 3, 5, 4, 4, 3, 1, 3, 1, 1, + 3, 3, 0, 2, 0, 1, 3, 1, 3, 1, + 1, 1, 1, 1, 6, 4, 3, 4, 2, 4, + 4, 1, 3, 1, 2, 1, 1, 4, 1, 1, + 3, 6, 4, 4, 4, 4, 1, 4, 0, 1, + 1, 3, 1, 1, 4, 3, 1, 1, 1, 0, + 0, 2, 3, 1, 3, 1, 4, 2, 2, 2, + 2, 1, 2, 1, 1, 1, 4, 3, 3, 3, + 6, 3, 1, 1, 1 ); protected function initReduceCallbacks() { @@ -1166,10 +1192,10 @@ protected function initReduceCallbacks() { $this->semValue = $this->semStack[$stackPos]; }, 82 => function ($stackPos) { - $this->semValue = new Node\Identifier($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = $this->semStack[$stackPos]; }, 83 => function ($stackPos) { - $this->semValue = new Node\Identifier($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = $this->semStack[$stackPos]; }, 84 => function ($stackPos) { $this->semValue = new Node\Identifier($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); @@ -1178,76 +1204,76 @@ protected function initReduceCallbacks() { $this->semValue = new Node\Identifier($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 86 => function ($stackPos) { - $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = new Node\Identifier($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 87 => function ($stackPos) { - $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = new Node\Identifier($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 88 => 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); }, 89 => function ($stackPos) { - $this->semValue = new Name(substr($this->semStack[$stackPos-(1-1)], 1), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 90 => function ($stackPos) { - $this->semValue = new Expr\Variable(substr($this->semStack[$stackPos-(1-1)], 1), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 91 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = new Name(substr($this->semStack[$stackPos-(1-1)], 1), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 92 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = new Expr\Variable(substr($this->semStack[$stackPos-(1-1)], 1), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 93 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 94 => function ($stackPos) { - $this->semValue = new Stmt\HaltCompiler($this->lexer->handleHaltCompiler(), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 95 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(1-1)]; + }, + 96 => function ($stackPos) { + $this->semValue = new Stmt\HaltCompiler($this->lexer->handleHaltCompiler(), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + }, + 97 => function ($stackPos) { $this->semValue = new Stmt\Namespace_($this->semStack[$stackPos-(3-2)], null, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); $this->semValue->setAttribute('kind', Stmt\Namespace_::KIND_SEMICOLON); $this->checkNamespace($this->semValue); }, - 96 => function ($stackPos) { + 98 => function ($stackPos) { $this->semValue = new Stmt\Namespace_($this->semStack[$stackPos-(5-2)], $this->semStack[$stackPos-(5-4)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); $this->semValue->setAttribute('kind', Stmt\Namespace_::KIND_BRACED); $this->checkNamespace($this->semValue); }, - 97 => function ($stackPos) { + 99 => function ($stackPos) { $this->semValue = new Stmt\Namespace_(null, $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); $this->semValue->setAttribute('kind', Stmt\Namespace_::KIND_BRACED); $this->checkNamespace($this->semValue); }, - 98 => function ($stackPos) { - $this->semValue = new Stmt\Use_($this->semStack[$stackPos-(3-2)], Stmt\Use_::TYPE_NORMAL, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 99 => function ($stackPos) { - $this->semValue = new Stmt\Use_($this->semStack[$stackPos-(4-3)], $this->semStack[$stackPos-(4-2)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, 100 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; + $this->semValue = new Stmt\Use_($this->semStack[$stackPos-(3-2)], Stmt\Use_::TYPE_NORMAL, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 101 => function ($stackPos) { - $this->semValue = new Stmt\Const_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Stmt\Use_($this->semStack[$stackPos-(4-3)], $this->semStack[$stackPos-(4-2)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, 102 => function ($stackPos) { - $this->semValue = Stmt\Use_::TYPE_FUNCTION; + $this->semValue = $this->semStack[$stackPos-(2-1)]; }, 103 => function ($stackPos) { - $this->semValue = Stmt\Use_::TYPE_CONSTANT; + $this->semValue = new Stmt\Const_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 104 => function ($stackPos) { - $this->semValue = new Stmt\GroupUse($this->semStack[$stackPos-(7-3)], $this->semStack[$stackPos-(7-6)], $this->semStack[$stackPos-(7-2)], $this->startAttributeStack[$stackPos-(7-1)] + $this->endAttributes); + $this->semValue = Stmt\Use_::TYPE_FUNCTION; }, 105 => function ($stackPos) { - $this->semValue = new Stmt\GroupUse($this->semStack[$stackPos-(6-2)], $this->semStack[$stackPos-(6-5)], Stmt\Use_::TYPE_UNKNOWN, $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); + $this->semValue = Stmt\Use_::TYPE_CONSTANT; }, 106 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + $this->semValue = new Stmt\GroupUse($this->semStack[$stackPos-(7-3)], $this->semStack[$stackPos-(7-6)], $this->semStack[$stackPos-(7-2)], $this->startAttributeStack[$stackPos-(7-1)] + $this->endAttributes); }, 107 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); + $this->semValue = new Stmt\GroupUse($this->semStack[$stackPos-(6-2)], $this->semStack[$stackPos-(6-5)], Stmt\Use_::TYPE_UNKNOWN, $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); }, 108 => function ($stackPos) { $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; @@ -1262,10 +1288,10 @@ protected function initReduceCallbacks() { $this->semValue = array($this->semStack[$stackPos-(1-1)]); }, 112 => function ($stackPos) { - $this->semValue = new Stmt\UseUse($this->semStack[$stackPos-(1-1)], null, Stmt\Use_::TYPE_UNKNOWN, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); $this->checkUseUse($this->semValue, $stackPos-(1-1)); + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; }, 113 => function ($stackPos) { - $this->semValue = new Stmt\UseUse($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], Stmt\Use_::TYPE_UNKNOWN, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); $this->checkUseUse($this->semValue, $stackPos-(3-3)); + $this->semValue = array($this->semStack[$stackPos-(1-1)]); }, 114 => function ($stackPos) { $this->semValue = new Stmt\UseUse($this->semStack[$stackPos-(1-1)], null, Stmt\Use_::TYPE_UNKNOWN, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); $this->checkUseUse($this->semValue, $stackPos-(1-1)); @@ -1274,52 +1300,58 @@ protected function initReduceCallbacks() { $this->semValue = new Stmt\UseUse($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], Stmt\Use_::TYPE_UNKNOWN, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); $this->checkUseUse($this->semValue, $stackPos-(3-3)); }, 116 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; $this->semValue->type = Stmt\Use_::TYPE_NORMAL; + $this->semValue = new Stmt\UseUse($this->semStack[$stackPos-(1-1)], null, Stmt\Use_::TYPE_UNKNOWN, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); $this->checkUseUse($this->semValue, $stackPos-(1-1)); }, 117 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-2)]; $this->semValue->type = $this->semStack[$stackPos-(2-1)]; + $this->semValue = new Stmt\UseUse($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], Stmt\Use_::TYPE_UNKNOWN, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); $this->checkUseUse($this->semValue, $stackPos-(3-3)); }, 118 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + $this->semValue = $this->semStack[$stackPos-(1-1)]; $this->semValue->type = Stmt\Use_::TYPE_NORMAL; }, 119 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); + $this->semValue = $this->semStack[$stackPos-(2-2)]; $this->semValue->type = $this->semStack[$stackPos-(2-1)]; }, 120 => function ($stackPos) { - $this->semValue = new Node\Const_($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; }, 121 => 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)]); }, 122 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); + $this->semValue = new Node\Const_($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 123 => function ($stackPos) { - $this->semValue = new Node\Const_($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; }, 124 => function ($stackPos) { - if (is_array($this->semStack[$stackPos-(2-2)])) { $this->semValue = array_merge($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)]); } else { $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; }; + $this->semValue = array($this->semStack[$stackPos-(1-1)]); }, 125 => function ($stackPos) { - $this->semValue = array(); + $this->semValue = new Node\Const_($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 126 => function ($stackPos) { - $startAttributes = $this->lookaheadStartAttributes; if (isset($startAttributes['comments'])) { $nop = new Stmt\Nop($this->createCommentNopAttributes($startAttributes['comments'])); } else { $nop = null; }; - if ($nop !== null) { $this->semStack[$stackPos-(1-1)][] = $nop; } $this->semValue = $this->semStack[$stackPos-(1-1)]; + if (is_array($this->semStack[$stackPos-(2-2)])) { $this->semValue = array_merge($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)]); } else { $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; }; }, 127 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = array(); }, 128 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $startAttributes = $this->lookaheadStartAttributes; if (isset($startAttributes['comments'])) { $nop = new Stmt\Nop($this->createCommentNopAttributes($startAttributes['comments'])); } else { $nop = null; }; + if ($nop !== null) { $this->semStack[$stackPos-(1-1)][] = $nop; } $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 129 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 130 => function ($stackPos) { - throw new Error('__HALT_COMPILER() can only be used from the outermost scope', $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 131 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(1-1)]; + }, + 132 => function ($stackPos) { + throw new Error('__HALT_COMPILER() can only be used from the outermost scope', $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + }, + 133 => function ($stackPos) { if ($this->semStack[$stackPos-(3-2)]) { $this->semValue = $this->semStack[$stackPos-(3-2)]; $attrs = $this->startAttributeStack[$stackPos-(3-1)]; $stmts = $this->semValue; if (!empty($attrs['comments'])) {$stmts[0]->setAttribute('comments', array_merge($attrs['comments'], $stmts[0]->getAttribute('comments', []))); }; @@ -1329,123 +1361,117 @@ protected function initReduceCallbacks() { } }, - 132 => function ($stackPos) { + 134 => function ($stackPos) { $this->semValue = new Stmt\If_($this->semStack[$stackPos-(5-2)], ['stmts' => is_array($this->semStack[$stackPos-(5-3)]) ? $this->semStack[$stackPos-(5-3)] : array($this->semStack[$stackPos-(5-3)]), 'elseifs' => $this->semStack[$stackPos-(5-4)], 'else' => $this->semStack[$stackPos-(5-5)]], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); }, - 133 => function ($stackPos) { + 135 => function ($stackPos) { $this->semValue = new Stmt\If_($this->semStack[$stackPos-(8-2)], ['stmts' => $this->semStack[$stackPos-(8-4)], 'elseifs' => $this->semStack[$stackPos-(8-5)], 'else' => $this->semStack[$stackPos-(8-6)]], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes); }, - 134 => function ($stackPos) { + 136 => function ($stackPos) { $this->semValue = new Stmt\While_($this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 135 => function ($stackPos) { + 137 => function ($stackPos) { $this->semValue = new Stmt\Do_($this->semStack[$stackPos-(5-4)], is_array($this->semStack[$stackPos-(5-2)]) ? $this->semStack[$stackPos-(5-2)] : array($this->semStack[$stackPos-(5-2)]), $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); }, - 136 => function ($stackPos) { + 138 => function ($stackPos) { $this->semValue = new Stmt\For_(['init' => $this->semStack[$stackPos-(9-3)], 'cond' => $this->semStack[$stackPos-(9-5)], 'loop' => $this->semStack[$stackPos-(9-7)], 'stmts' => $this->semStack[$stackPos-(9-9)]], $this->startAttributeStack[$stackPos-(9-1)] + $this->endAttributes); }, - 137 => function ($stackPos) { + 139 => function ($stackPos) { $this->semValue = new Stmt\Switch_($this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 138 => function ($stackPos) { + 140 => function ($stackPos) { $this->semValue = new Stmt\Break_(null, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 139 => function ($stackPos) { + 141 => function ($stackPos) { $this->semValue = new Stmt\Break_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 140 => function ($stackPos) { + 142 => function ($stackPos) { $this->semValue = new Stmt\Continue_(null, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 141 => function ($stackPos) { + 143 => function ($stackPos) { $this->semValue = new Stmt\Continue_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 142 => function ($stackPos) { + 144 => function ($stackPos) { $this->semValue = new Stmt\Return_(null, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 143 => function ($stackPos) { + 145 => function ($stackPos) { $this->semValue = new Stmt\Return_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 144 => function ($stackPos) { + 146 => function ($stackPos) { $this->semValue = new Stmt\Global_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 145 => function ($stackPos) { + 147 => function ($stackPos) { $this->semValue = new Stmt\Static_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 146 => function ($stackPos) { + 148 => function ($stackPos) { $this->semValue = new Stmt\Echo_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 147 => function ($stackPos) { + 149 => function ($stackPos) { $this->semValue = new Stmt\InlineHTML($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 148 => function ($stackPos) { + 150 => function ($stackPos) { $this->semValue = new Stmt\Expression($this->semStack[$stackPos-(2-1)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 149 => function ($stackPos) { + 151 => function ($stackPos) { $this->semValue = new Stmt\Expression($this->semStack[$stackPos-(2-1)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 150 => function ($stackPos) { + 152 => function ($stackPos) { $this->semValue = new Stmt\Unset_($this->semStack[$stackPos-(5-3)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); }, - 151 => function ($stackPos) { + 153 => function ($stackPos) { $this->semValue = new Stmt\Foreach_($this->semStack[$stackPos-(7-3)], $this->semStack[$stackPos-(7-5)][0], ['keyVar' => null, 'byRef' => $this->semStack[$stackPos-(7-5)][1], 'stmts' => $this->semStack[$stackPos-(7-7)]], $this->startAttributeStack[$stackPos-(7-1)] + $this->endAttributes); }, - 152 => function ($stackPos) { + 154 => function ($stackPos) { $this->semValue = new Stmt\Foreach_($this->semStack[$stackPos-(9-3)], $this->semStack[$stackPos-(9-7)][0], ['keyVar' => $this->semStack[$stackPos-(9-5)], 'byRef' => $this->semStack[$stackPos-(9-7)][1], 'stmts' => $this->semStack[$stackPos-(9-9)]], $this->startAttributeStack[$stackPos-(9-1)] + $this->endAttributes); }, - 153 => function ($stackPos) { + 155 => function ($stackPos) { $this->semValue = new Stmt\Declare_($this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-5)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); }, - 154 => function ($stackPos) { + 156 => function ($stackPos) { $this->semValue = new Stmt\TryCatch($this->semStack[$stackPos-(6-3)], $this->semStack[$stackPos-(6-5)], $this->semStack[$stackPos-(6-6)], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); $this->checkTryCatch($this->semValue); }, - 155 => function ($stackPos) { + 157 => function ($stackPos) { $this->semValue = new Stmt\Throw_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 156 => function ($stackPos) { + 158 => function ($stackPos) { $this->semValue = new Stmt\Goto_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 157 => function ($stackPos) { + 159 => function ($stackPos) { $this->semValue = new Stmt\Label($this->semStack[$stackPos-(2-1)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 158 => function ($stackPos) { + 160 => function ($stackPos) { $this->semValue = new Stmt\Expression($this->semStack[$stackPos-(2-1)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 159 => function ($stackPos) { + 161 => function ($stackPos) { $this->semValue = array(); /* means: no statement */ }, - 160 => function ($stackPos) { + 162 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 161 => function ($stackPos) { + 163 => function ($stackPos) { $startAttributes = $this->startAttributeStack[$stackPos-(1-1)]; if (isset($startAttributes['comments'])) { $this->semValue = new Stmt\Nop($startAttributes + $this->endAttributes); } else { $this->semValue = null; }; if ($this->semValue === null) $this->semValue = array(); /* means: no statement */ }, - 162 => function ($stackPos) { - $this->semValue = array(); - }, - 163 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, 164 => function ($stackPos) { - $this->semValue = new Stmt\Catch_(array($this->semStack[$stackPos-(8-3)]), $this->semStack[$stackPos-(8-4)], $this->semStack[$stackPos-(8-7)], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes); + $this->semValue = array(); }, 165 => function ($stackPos) { - $this->semValue = null; + $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; }, 166 => function ($stackPos) { - $this->semValue = new Stmt\Finally_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + $this->semValue = new Stmt\Catch_(array($this->semStack[$stackPos-(8-3)]), $this->semStack[$stackPos-(8-4)], $this->semStack[$stackPos-(8-7)], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes); }, 167 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); + $this->semValue = null; }, 168 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + $this->semValue = new Stmt\Finally_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, 169 => function ($stackPos) { - $this->semValue = false; + $this->semValue = array($this->semStack[$stackPos-(1-1)]); }, 170 => function ($stackPos) { - $this->semValue = true; + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; }, 171 => function ($stackPos) { $this->semValue = false; @@ -1454,1175 +1480,1193 @@ protected function initReduceCallbacks() { $this->semValue = true; }, 173 => function ($stackPos) { - $this->semValue = new Stmt\Function_($this->semStack[$stackPos-(10-3)], ['byRef' => $this->semStack[$stackPos-(10-2)], 'params' => $this->semStack[$stackPos-(10-5)], 'returnType' => $this->semStack[$stackPos-(10-7)], 'stmts' => $this->semStack[$stackPos-(10-9)]], $this->startAttributeStack[$stackPos-(10-1)] + $this->endAttributes); + $this->semValue = false; }, 174 => function ($stackPos) { - $this->semValue = new Stmt\Class_($this->semStack[$stackPos-(7-2)], ['type' => $this->semStack[$stackPos-(7-1)], '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->checkClass($this->semValue, $stackPos-(7-2)); + $this->semValue = true; }, 175 => function ($stackPos) { - $this->semValue = new Stmt\Interface_($this->semStack[$stackPos-(6-2)], ['extends' => $this->semStack[$stackPos-(6-3)], 'stmts' => $this->semStack[$stackPos-(6-5)]], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); - $this->checkInterface($this->semValue, $stackPos-(6-2)); + $this->semValue = false; }, 176 => function ($stackPos) { - $this->semValue = new Stmt\Trait_($this->semStack[$stackPos-(5-2)], ['stmts' => $this->semStack[$stackPos-(5-4)]], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); + $this->semValue = true; }, 177 => function ($stackPos) { - $this->semValue = 0; + $this->semValue = new Stmt\Function_($this->semStack[$stackPos-(10-3)], ['byRef' => $this->semStack[$stackPos-(10-2)], 'params' => $this->semStack[$stackPos-(10-5)], 'returnType' => $this->semStack[$stackPos-(10-7)], 'stmts' => $this->semStack[$stackPos-(10-9)]], $this->startAttributeStack[$stackPos-(10-1)] + $this->endAttributes); }, 178 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_ABSTRACT; + $this->semValue = new Stmt\Class_($this->semStack[$stackPos-(7-2)], ['type' => $this->semStack[$stackPos-(7-1)], '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->checkClass($this->semValue, $stackPos-(7-2)); }, 179 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_FINAL; + $this->semValue = new Stmt\Interface_($this->semStack[$stackPos-(6-2)], ['extends' => $this->semStack[$stackPos-(6-3)], 'stmts' => $this->semStack[$stackPos-(6-5)]], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); + $this->checkInterface($this->semValue, $stackPos-(6-2)); }, 180 => function ($stackPos) { - $this->semValue = null; + $this->semValue = new Stmt\Trait_($this->semStack[$stackPos-(5-2)], ['stmts' => $this->semStack[$stackPos-(5-4)]], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); }, 181 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-2)]; + $this->semValue = 0; }, 182 => function ($stackPos) { - $this->semValue = array(); + $this->semValue = Stmt\Class_::MODIFIER_ABSTRACT; }, 183 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-2)]; + $this->semValue = Stmt\Class_::MODIFIER_FINAL; }, 184 => function ($stackPos) { - $this->semValue = array(); + $this->semValue = null; }, 185 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(2-2)]; }, 186 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); + $this->semValue = array(); }, 187 => 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-2)]; }, 188 => function ($stackPos) { - $this->semValue = is_array($this->semStack[$stackPos-(1-1)]) ? $this->semStack[$stackPos-(1-1)] : array($this->semStack[$stackPos-(1-1)]); + $this->semValue = array(); }, 189 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-2)]; + $this->semValue = $this->semStack[$stackPos-(2-2)]; }, 190 => function ($stackPos) { - $this->semValue = is_array($this->semStack[$stackPos-(1-1)]) ? $this->semStack[$stackPos-(1-1)] : array($this->semStack[$stackPos-(1-1)]); + $this->semValue = array($this->semStack[$stackPos-(1-1)]); }, 191 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-2)]; + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; }, 192 => function ($stackPos) { $this->semValue = is_array($this->semStack[$stackPos-(1-1)]) ? $this->semStack[$stackPos-(1-1)] : array($this->semStack[$stackPos-(1-1)]); }, 193 => function ($stackPos) { - $this->semValue = null; + $this->semValue = $this->semStack[$stackPos-(4-2)]; }, 194 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-2)]; + $this->semValue = is_array($this->semStack[$stackPos-(1-1)]) ? $this->semStack[$stackPos-(1-1)] : array($this->semStack[$stackPos-(1-1)]); }, 195 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); + $this->semValue = $this->semStack[$stackPos-(4-2)]; }, 196 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + $this->semValue = is_array($this->semStack[$stackPos-(1-1)]) ? $this->semStack[$stackPos-(1-1)] : array($this->semStack[$stackPos-(1-1)]); }, 197 => function ($stackPos) { - $this->semValue = new Stmt\DeclareDeclare($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = null; }, 198 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; + $this->semValue = $this->semStack[$stackPos-(4-2)]; }, 199 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-3)]; + $this->semValue = array($this->semStack[$stackPos-(1-1)]); }, 200 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-2)]; + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; }, 201 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(5-3)]; + $this->semValue = new Stmt\DeclareDeclare($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 202 => function ($stackPos) { - $this->semValue = array(); + $this->semValue = $this->semStack[$stackPos-(3-2)]; }, 203 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; + $this->semValue = $this->semStack[$stackPos-(4-3)]; }, 204 => function ($stackPos) { - $this->semValue = new Stmt\Case_($this->semStack[$stackPos-(4-2)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + $this->semValue = $this->semStack[$stackPos-(4-2)]; }, 205 => function ($stackPos) { - $this->semValue = new Stmt\Case_(null, $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = $this->semStack[$stackPos-(5-3)]; }, 206 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; + $this->semValue = array(); }, 207 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; + $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; }, 208 => function ($stackPos) { - $this->semValue = is_array($this->semStack[$stackPos-(1-1)]) ? $this->semStack[$stackPos-(1-1)] : array($this->semStack[$stackPos-(1-1)]); + $this->semValue = new Stmt\Case_($this->semStack[$stackPos-(4-2)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, 209 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(4-2)]; + $this->semValue = new Stmt\Case_(null, $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 210 => function ($stackPos) { - $this->semValue = array(); + $this->semValue = $this->semStack[$stackPos]; }, 211 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; + $this->semValue = $this->semStack[$stackPos]; }, 212 => function ($stackPos) { - $this->semValue = new Stmt\ElseIf_($this->semStack[$stackPos-(3-2)], is_array($this->semStack[$stackPos-(3-3)]) ? $this->semStack[$stackPos-(3-3)] : array($this->semStack[$stackPos-(3-3)]), $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = is_array($this->semStack[$stackPos-(1-1)]) ? $this->semStack[$stackPos-(1-1)] : array($this->semStack[$stackPos-(1-1)]); }, 213 => function ($stackPos) { - $this->semValue = array(); + $this->semValue = $this->semStack[$stackPos-(4-2)]; }, 214 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; + $this->semValue = array(); }, 215 => function ($stackPos) { - $this->semValue = new Stmt\ElseIf_($this->semStack[$stackPos-(4-2)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; }, 216 => function ($stackPos) { - $this->semValue = null; + $this->semValue = new Stmt\ElseIf_($this->semStack[$stackPos-(3-2)], is_array($this->semStack[$stackPos-(3-3)]) ? $this->semStack[$stackPos-(3-3)] : array($this->semStack[$stackPos-(3-3)]), $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 217 => function ($stackPos) { - $this->semValue = new Stmt\Else_(is_array($this->semStack[$stackPos-(2-2)]) ? $this->semStack[$stackPos-(2-2)] : array($this->semStack[$stackPos-(2-2)]), $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + $this->semValue = array(); }, 218 => function ($stackPos) { - $this->semValue = null; + $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; }, 219 => function ($stackPos) { - $this->semValue = new Stmt\Else_($this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Stmt\ElseIf_($this->semStack[$stackPos-(4-2)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, 220 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)], false); + $this->semValue = null; }, 221 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(2-2)], true); + $this->semValue = new Stmt\Else_(is_array($this->semStack[$stackPos-(2-2)]) ? $this->semStack[$stackPos-(2-2)] : array($this->semStack[$stackPos-(2-2)]), $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, 222 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)], false); + $this->semValue = null; }, 223 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = new Stmt\Else_($this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 224 => function ($stackPos) { - $this->semValue = array(); + $this->semValue = array($this->semStack[$stackPos-(1-1)], false); }, 225 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); + $this->semValue = array($this->semStack[$stackPos-(2-2)], true); }, 226 => 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)], false); }, 227 => function ($stackPos) { - $this->semValue = new Node\Param($this->semStack[$stackPos-(4-4)], null, $this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-2)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); $this->checkParam($this->semValue); + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 228 => function ($stackPos) { - $this->semValue = new Node\Param($this->semStack[$stackPos-(6-4)], $this->semStack[$stackPos-(6-6)], $this->semStack[$stackPos-(6-1)], $this->semStack[$stackPos-(6-2)], $this->semStack[$stackPos-(6-3)], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); $this->checkParam($this->semValue); + $this->semValue = array(); }, 229 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = array($this->semStack[$stackPos-(1-1)]); }, 230 => function ($stackPos) { - $this->semValue = new Node\Identifier('array', $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; }, 231 => function ($stackPos) { - $this->semValue = new Node\Identifier('callable', $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = new Node\Param($this->semStack[$stackPos-(4-4)], null, $this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-2)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); $this->checkParam($this->semValue); }, 232 => function ($stackPos) { - $this->semValue = null; + $this->semValue = new Node\Param($this->semStack[$stackPos-(6-4)], $this->semStack[$stackPos-(6-6)], $this->semStack[$stackPos-(6-1)], $this->semStack[$stackPos-(6-2)], $this->semStack[$stackPos-(6-3)], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); $this->checkParam($this->semValue); }, 233 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 234 => function ($stackPos) { - $this->semValue = null; + $this->semValue = new Node\Identifier('array', $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 235 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-2)]; + $this->semValue = new Node\Identifier('callable', $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 236 => function ($stackPos) { - $this->semValue = array(); + $this->semValue = null; }, 237 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 238 => function ($stackPos) { - $this->semValue = array(new Node\Arg($this->semStack[$stackPos-(3-2)], false, false, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes)); + $this->semValue = null; }, 239 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); + $this->semValue = $this->semStack[$stackPos-(2-2)]; }, 240 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + $this->semValue = array(); }, 241 => function ($stackPos) { - $this->semValue = new Node\Arg($this->semStack[$stackPos-(1-1)], false, false, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = $this->semStack[$stackPos-(3-2)]; }, 242 => function ($stackPos) { - $this->semValue = new Node\Arg($this->semStack[$stackPos-(2-2)], true, false, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + $this->semValue = array(new Node\Arg($this->semStack[$stackPos-(3-2)], false, false, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes)); }, 243 => function ($stackPos) { - $this->semValue = new Node\Arg($this->semStack[$stackPos-(2-2)], false, true, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + $this->semValue = array($this->semStack[$stackPos-(1-1)]); }, 244 => function ($stackPos) { $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; }, 245 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); + $this->semValue = new Node\Arg($this->semStack[$stackPos-(1-1)], false, false, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 246 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = new Node\Arg($this->semStack[$stackPos-(2-2)], true, false, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, 247 => function ($stackPos) { - $this->semValue = new Expr\Variable($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + $this->semValue = new Node\Arg($this->semStack[$stackPos-(2-2)], false, true, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, 248 => function ($stackPos) { - $this->semValue = new Expr\Variable($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; }, 249 => 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)]); }, 250 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 251 => function ($stackPos) { - $this->semValue = new Stmt\StaticVar($this->semStack[$stackPos-(1-1)], null, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = new Expr\Variable($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, 252 => 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 Expr\Variable($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, 253 => 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->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; }, 254 => function ($stackPos) { - $this->semValue = array(); + $this->semValue = array($this->semStack[$stackPos-(1-1)]); }, 255 => function ($stackPos) { - $startAttributes = $this->lookaheadStartAttributes; if (isset($startAttributes['comments'])) { $nop = new Stmt\Nop($this->createCommentNopAttributes($startAttributes['comments'])); } else { $nop = null; }; - if ($nop !== null) { $this->semStack[$stackPos-(1-1)][] = $nop; } $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = new Stmt\StaticVar($this->semStack[$stackPos-(1-1)], null, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 256 => 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)); + $this->semValue = new Stmt\StaticVar($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 257 => function ($stackPos) { - $this->semValue = new Stmt\ClassConst($this->semStack[$stackPos-(3-2)], 0, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + if ($this->semStack[$stackPos-(2-2)] !== null) { $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; } }, 258 => 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)); + $this->semValue = array(); }, 259 => function ($stackPos) { - $this->semValue = new Stmt\TraitUse($this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $startAttributes = $this->lookaheadStartAttributes; if (isset($startAttributes['comments'])) { $nop = new Stmt\Nop($this->createCommentNopAttributes($startAttributes['comments'])); } else { $nop = null; }; + if ($nop !== null) { $this->semStack[$stackPos-(1-1)][] = $nop; } $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 260 => function ($stackPos) { - $this->semValue = array(); + $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)); }, 261 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; + $this->semValue = new Stmt\ClassConst($this->semStack[$stackPos-(3-2)], 0, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 262 => function ($stackPos) { - $this->semValue = array(); + $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)); }, 263 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; + $this->semValue = new Stmt\TraitUse($this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 264 => 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->semValue = array(); }, 265 => 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 = $this->semStack[$stackPos-(3-2)]; }, 266 => 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 = array(); }, 267 => 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->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; }, 268 => 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\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); }, 269 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)]); + $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); }, 270 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $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); }, 271 => function ($stackPos) { - $this->semValue = array(null, $this->semStack[$stackPos-(1-1)]); + $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); }, 272 => function ($stackPos) { - $this->semValue = null; + $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); }, 273 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; + $this->semValue = array($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)]); }, 274 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 275 => function ($stackPos) { - $this->semValue = 0; + $this->semValue = array(null, $this->semStack[$stackPos-(1-1)]); }, 276 => function ($stackPos) { - $this->semValue = 0; + $this->semValue = null; }, 277 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = $this->semStack[$stackPos-(3-2)]; }, 278 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 279 => 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 = 0; }, 280 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_PUBLIC; + $this->semValue = 0; }, 281 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_PROTECTED; + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 282 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_PRIVATE; + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 283 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_STATIC; + $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)]; }, 284 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_ABSTRACT; + $this->semValue = Stmt\Class_::MODIFIER_PUBLIC; }, 285 => function ($stackPos) { - $this->semValue = Stmt\Class_::MODIFIER_FINAL; + $this->semValue = Stmt\Class_::MODIFIER_PROTECTED; }, 286 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); + $this->semValue = Stmt\Class_::MODIFIER_PRIVATE; }, 287 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + $this->semValue = Stmt\Class_::MODIFIER_STATIC; }, 288 => function ($stackPos) { - $this->semValue = new Node\VarLikeIdentifier(substr($this->semStack[$stackPos-(1-1)], 1), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = Stmt\Class_::MODIFIER_ABSTRACT; }, 289 => function ($stackPos) { - $this->semValue = new Stmt\PropertyProperty($this->semStack[$stackPos-(1-1)], null, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = Stmt\Class_::MODIFIER_FINAL; }, 290 => 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 = array($this->semStack[$stackPos-(1-1)]); }, 291 => function ($stackPos) { $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; }, 292 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); + $this->semValue = new Node\VarLikeIdentifier(substr($this->semStack[$stackPos-(1-1)], 1), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 293 => function ($stackPos) { - $this->semValue = array(); + $this->semValue = new Stmt\PropertyProperty($this->semStack[$stackPos-(1-1)], null, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 294 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = new Stmt\PropertyProperty($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 295 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; }, 296 => 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 = array($this->semStack[$stackPos-(1-1)]); }, 297 => 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 = array(); }, 298 => 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 = $this->semStack[$stackPos-(1-1)]; }, 299 => 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 = $this->semStack[$stackPos-(1-1)]; }, 300 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = new Expr\Assign($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 301 => function ($stackPos) { - $this->semValue = new Expr\Clone_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-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); }, 302 => 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\AssignRef($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, 303 => 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\AssignRef($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, 304 => 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 = $this->semStack[$stackPos-(1-1)]; }, 305 => 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\Clone_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, 306 => 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\Plus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 307 => 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\Minus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 308 => 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\Mul($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 309 => 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\Div($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 310 => 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\Concat($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 311 => 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\Mod($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 312 => 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\BitwiseAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 313 => 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\BitwiseOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 314 => function ($stackPos) { - $this->semValue = new Expr\AssignOp\Coalesce($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); }, 315 => function ($stackPos) { - $this->semValue = new Expr\PostInc($this->semStack[$stackPos-(2-1)], $this->startAttributeStack[$stackPos-(2-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); }, 316 => function ($stackPos) { - $this->semValue = new Expr\PreInc($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-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); }, 317 => function ($stackPos) { - $this->semValue = new Expr\PostDec($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); }, 318 => function ($stackPos) { - $this->semValue = new Expr\PreDec($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + $this->semValue = new Expr\AssignOp\Coalesce($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 319 => 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\PostInc($this->semStack[$stackPos-(2-1)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, 320 => 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\PreInc($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, 321 => 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\PostDec($this->semStack[$stackPos-(2-1)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, 322 => 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\PreDec($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, 323 => 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\BooleanOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 324 => 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\BooleanAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 325 => 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\LogicalOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 326 => 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\LogicalAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 327 => 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\LogicalXor($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 328 => 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\BitwiseOr($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 329 => 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\BitwiseAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 330 => 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\BitwiseAnd($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 331 => 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\BitwiseXor($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 332 => 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\Concat($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 333 => 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\Plus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 334 => 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\Minus($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 335 => 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\Mul($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 336 => function ($stackPos) { - $this->semValue = new Expr\UnaryPlus($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-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); }, 337 => function ($stackPos) { - $this->semValue = new Expr\UnaryMinus($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-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); }, 338 => function ($stackPos) { - $this->semValue = new Expr\BooleanNot($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-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); }, 339 => function ($stackPos) { - $this->semValue = new Expr\BitwiseNot($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-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); }, 340 => 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\BinaryOp\Pow($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\NotIdentical($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Expr\UnaryPlus($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, 342 => 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\UnaryMinus($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, 343 => 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\BooleanNot($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, 344 => 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\BitwiseNot($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, 345 => 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\Identical($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\SmallerOrEqual($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); }, 347 => 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\Equal($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\GreaterOrEqual($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); }, 349 => 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\Spaceship($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 350 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = new Expr\BinaryOp\Smaller($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 351 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(3-2)]; + $this->semValue = new Expr\BinaryOp\SmallerOrEqual($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 352 => 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 = new Expr\BinaryOp\Greater($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 353 => 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\BinaryOp\GreaterOrEqual($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 354 => 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\Instanceof_($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 355 => function ($stackPos) { - $this->semValue = new Expr\Isset_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 356 => function ($stackPos) { - $this->semValue = new Expr\Empty_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + $this->semValue = $this->semStack[$stackPos-(3-2)]; }, 357 => 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\Ternary($this->semStack[$stackPos-(5-1)], $this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-5)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); }, 358 => 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\Ternary($this->semStack[$stackPos-(4-1)], null, $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, 359 => function ($stackPos) { - $this->semValue = new Expr\Eval_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-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); }, 360 => 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\Isset_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, 361 => 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\Empty_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, 362 => 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_INCLUDE, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, 363 => function ($stackPos) { + $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_INCLUDE_ONCE, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + }, + 364 => function ($stackPos) { + $this->semValue = new Expr\Eval_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + }, + 365 => function ($stackPos) { + $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_REQUIRE, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + }, + 366 => function ($stackPos) { + $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_REQUIRE_ONCE, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + }, + 367 => function ($stackPos) { + $this->semValue = new Expr\Cast\Int_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + }, + 368 => function ($stackPos) { $attrs = $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes; $attrs['kind'] = $this->getFloatCastKind($this->semStack[$stackPos-(2-1)]); $this->semValue = new Expr\Cast\Double($this->semStack[$stackPos-(2-2)], $attrs); }, - 364 => function ($stackPos) { + 369 => function ($stackPos) { $this->semValue = new Expr\Cast\String_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 365 => function ($stackPos) { + 370 => function ($stackPos) { $this->semValue = new Expr\Cast\Array_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 366 => function ($stackPos) { + 371 => function ($stackPos) { $this->semValue = new Expr\Cast\Object_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 367 => function ($stackPos) { + 372 => function ($stackPos) { $this->semValue = new Expr\Cast\Bool_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 368 => function ($stackPos) { + 373 => function ($stackPos) { $this->semValue = new Expr\Cast\Unset_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 369 => function ($stackPos) { + 374 => 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); }, - 370 => function ($stackPos) { + 375 => function ($stackPos) { $this->semValue = new Expr\ErrorSuppress($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 371 => function ($stackPos) { + 376 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 372 => function ($stackPos) { + 377 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 373 => function ($stackPos) { + 378 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 374 => function ($stackPos) { + 379 => function ($stackPos) { $this->semValue = new Expr\ShellExec($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 375 => function ($stackPos) { + 380 => function ($stackPos) { $this->semValue = new Expr\Print_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 376 => function ($stackPos) { + 381 => function ($stackPos) { $this->semValue = new Expr\Yield_(null, null, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 377 => function ($stackPos) { + 382 => function ($stackPos) { $this->semValue = new Expr\YieldFrom($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 378 => function ($stackPos) { + 383 => function ($stackPos) { $this->semValue = new Expr\Closure(['static' => false, 'byRef' => $this->semStack[$stackPos-(10-2)], 'params' => $this->semStack[$stackPos-(10-4)], 'uses' => $this->semStack[$stackPos-(10-6)], 'returnType' => $this->semStack[$stackPos-(10-7)], 'stmts' => $this->semStack[$stackPos-(10-9)]], $this->startAttributeStack[$stackPos-(10-1)] + $this->endAttributes); }, - 379 => function ($stackPos) { + 384 => function ($stackPos) { $this->semValue = new Expr\Closure(['static' => true, 'byRef' => $this->semStack[$stackPos-(11-3)], 'params' => $this->semStack[$stackPos-(11-5)], 'uses' => $this->semStack[$stackPos-(11-7)], 'returnType' => $this->semStack[$stackPos-(11-8)], 'stmts' => $this->semStack[$stackPos-(11-10)]], $this->startAttributeStack[$stackPos-(11-1)] + $this->endAttributes); }, - 380 => function ($stackPos) { + 385 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(3-2)]; }, - 381 => function ($stackPos) { + 386 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(3-2)]; }, - 382 => function ($stackPos) { + 387 => function ($stackPos) { $this->semValue = new Expr\Yield_($this->semStack[$stackPos-(2-2)], null, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 383 => function ($stackPos) { + 388 => function ($stackPos) { $this->semValue = new Expr\Yield_($this->semStack[$stackPos-(4-4)], $this->semStack[$stackPos-(4-2)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, - 384 => function ($stackPos) { + 389 => 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); }, - 385 => function ($stackPos) { + 390 => 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); }, - 386 => function ($stackPos) { + 391 => function ($stackPos) { $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, - 387 => function ($stackPos) { + 392 => function ($stackPos) { $attrs = $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes; $attrs['kind'] = ($this->semStack[$stackPos-(4-1)][0] === "'" || ($this->semStack[$stackPos-(4-1)][1] === "'" && ($this->semStack[$stackPos-(4-1)][0] === 'b' || $this->semStack[$stackPos-(4-1)][0] === 'B')) ? Scalar\String_::KIND_SINGLE_QUOTED : Scalar\String_::KIND_DOUBLE_QUOTED); $this->semValue = new Expr\ArrayDimFetch(new Scalar\String_(Scalar\String_::parse($this->semStack[$stackPos-(4-1)]), $attrs), $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, - 388 => function ($stackPos) { + 393 => function ($stackPos) { $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, - 389 => function ($stackPos) { + 394 => function ($stackPos) { $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, - 390 => function ($stackPos) { + 395 => 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); }, - 391 => function ($stackPos) { + 396 => function ($stackPos) { $this->semValue = new Expr\New_($this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 392 => function ($stackPos) { + 397 => function ($stackPos) { list($class, $ctorArgs) = $this->semStack[$stackPos-(2-2)]; $this->semValue = new Expr\New_($class, $ctorArgs, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 393 => function ($stackPos) { + 398 => function ($stackPos) { $this->semValue = array(); }, - 394 => function ($stackPos) { + 399 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(4-3)]; }, - 395 => function ($stackPos) { + 400 => function ($stackPos) { $this->semValue = array($this->semStack[$stackPos-(1-1)]); }, - 396 => function ($stackPos) { + 401 => function ($stackPos) { $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; }, - 397 => function ($stackPos) { + 402 => function ($stackPos) { $this->semValue = new Expr\ClosureUse($this->semStack[$stackPos-(2-2)], $this->semStack[$stackPos-(2-1)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 398 => function ($stackPos) { + 403 => function ($stackPos) { $this->semValue = new Expr\FuncCall($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 399 => function ($stackPos) { + 404 => 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); }, - 400 => function ($stackPos) { + 405 => function ($stackPos) { $this->semValue = new Expr\StaticCall($this->semStack[$stackPos-(6-1)], $this->semStack[$stackPos-(6-4)], $this->semStack[$stackPos-(6-6)], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); }, - 401 => function ($stackPos) { + 406 => function ($stackPos) { $this->semValue = $this->fixupPhp5StaticPropCall($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 402 => function ($stackPos) { + 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); }, - 403 => function ($stackPos) { + 408 => function ($stackPos) { $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, - 404 => function ($stackPos) { + 409 => function ($stackPos) { $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 405 => function ($stackPos) { + 410 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 406 => function ($stackPos) { + 411 => function ($stackPos) { $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 407 => function ($stackPos) { + 412 => function ($stackPos) { $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 408 => function ($stackPos) { + 413 => function ($stackPos) { $this->semValue = new Name\FullyQualified(substr($this->semStack[$stackPos-(1-1)], 1), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 409 => function ($stackPos) { + 414 => function ($stackPos) { $this->semValue = new Name\Relative(substr($this->semStack[$stackPos-(1-1)], 10), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 410 => function ($stackPos) { + 415 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 411 => function ($stackPos) { + 416 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 412 => function ($stackPos) { + 417 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 413 => function ($stackPos) { + 418 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 414 => function ($stackPos) { + 419 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 415 => function ($stackPos) { + 420 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 416 => function ($stackPos) { + 421 => function ($stackPos) { $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 417 => function ($stackPos) { + 422 => function ($stackPos) { $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 418 => function ($stackPos) { + 423 => function ($stackPos) { $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, - 419 => function ($stackPos) { + 424 => function ($stackPos) { $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, - 420 => function ($stackPos) { + 425 => function ($stackPos) { $this->semValue = null; }, - 421 => function ($stackPos) { + 426 => function ($stackPos) { $this->semValue = null; }, - 422 => function ($stackPos) { + 427 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 423 => function ($stackPos) { + 428 => function ($stackPos) { $this->semValue = array(); }, - 424 => function ($stackPos) { + 429 => function ($stackPos) { $this->semValue = array(new Scalar\EncapsedStringPart(Scalar\String_::parseEscapeSequences($this->semStack[$stackPos-(1-1)], '`', false), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes)); }, - 425 => function ($stackPos) { + 430 => function ($stackPos) { foreach ($this->semStack[$stackPos-(1-1)] as $s) { if ($s instanceof Node\Scalar\EncapsedStringPart) { $s->value = Node\Scalar\String_::parseEscapeSequences($s->value, '`', false); } }; $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 426 => function ($stackPos) { + 431 => function ($stackPos) { $this->semValue = array(); }, - 427 => function ($stackPos) { + 432 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 428 => function ($stackPos) { + 433 => function ($stackPos) { $this->semValue = $this->parseLNumber($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes, true); }, - 429 => function ($stackPos) { + 434 => function ($stackPos) { $this->semValue = new Scalar\DNumber(Scalar\DNumber::parse($this->semStack[$stackPos-(1-1)]), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 430 => function ($stackPos) { + 435 => 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)], false), $attrs); }, - 431 => function ($stackPos) { + 436 => function ($stackPos) { $this->semValue = new Scalar\MagicConst\Line($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 432 => function ($stackPos) { + 437 => function ($stackPos) { $this->semValue = new Scalar\MagicConst\File($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 433 => function ($stackPos) { + 438 => function ($stackPos) { $this->semValue = new Scalar\MagicConst\Dir($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 434 => function ($stackPos) { + 439 => function ($stackPos) { $this->semValue = new Scalar\MagicConst\Class_($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 435 => function ($stackPos) { + 440 => function ($stackPos) { $this->semValue = new Scalar\MagicConst\Trait_($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 436 => function ($stackPos) { + 441 => function ($stackPos) { $this->semValue = new Scalar\MagicConst\Method($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 437 => function ($stackPos) { + 442 => function ($stackPos) { $this->semValue = new Scalar\MagicConst\Function_($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 438 => function ($stackPos) { + 443 => function ($stackPos) { $this->semValue = new Scalar\MagicConst\Namespace_($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 439 => function ($stackPos) { + 444 => 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)], false); }, - 440 => function ($stackPos) { + 445 => 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)], false); }, - 441 => function ($stackPos) { + 446 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 442 => function ($stackPos) { + 447 => function ($stackPos) { $this->semValue = new Expr\ClassConstFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 443 => function ($stackPos) { + 448 => function ($stackPos) { $this->semValue = new Expr\ConstFetch($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 444 => function ($stackPos) { + 449 => function ($stackPos) { $this->semValue = new Expr\Array_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, - 445 => function ($stackPos) { + 450 => function ($stackPos) { $this->semValue = new Expr\Array_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 446 => function ($stackPos) { + 451 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 447 => function ($stackPos) { + 452 => 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); }, - 448 => function ($stackPos) { + 453 => 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); }, - 449 => function ($stackPos) { + 454 => 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); }, - 450 => function ($stackPos) { + 455 => 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); }, - 451 => function ($stackPos) { + 456 => 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); }, - 452 => function ($stackPos) { + 457 => 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); }, - 453 => function ($stackPos) { + 458 => 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); }, - 454 => function ($stackPos) { + 459 => 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); + }, + 460 => 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); }, - 455 => function ($stackPos) { + 461 => 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); }, - 456 => function ($stackPos) { + 462 => 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); }, - 457 => function ($stackPos) { + 463 => 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); }, - 458 => function ($stackPos) { + 464 => 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); }, - 459 => function ($stackPos) { + 465 => 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); }, - 460 => function ($stackPos) { + 466 => 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); }, - 461 => function ($stackPos) { + 467 => 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); }, - 462 => function ($stackPos) { + 468 => 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); }, - 463 => function ($stackPos) { + 469 => 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); }, - 464 => function ($stackPos) { + 470 => function ($stackPos) { $this->semValue = new Expr\UnaryPlus($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 465 => function ($stackPos) { + 471 => function ($stackPos) { $this->semValue = new Expr\UnaryMinus($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 466 => function ($stackPos) { + 472 => function ($stackPos) { $this->semValue = new Expr\BooleanNot($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 467 => function ($stackPos) { + 473 => function ($stackPos) { $this->semValue = new Expr\BitwiseNot($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 468 => function ($stackPos) { + 474 => 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); }, - 469 => function ($stackPos) { + 475 => 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); }, - 470 => function ($stackPos) { + 476 => 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); }, - 471 => function ($stackPos) { + 477 => 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); }, - 472 => function ($stackPos) { + 478 => 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); }, - 473 => function ($stackPos) { + 479 => 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); }, - 474 => function ($stackPos) { + 480 => 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); }, - 475 => function ($stackPos) { + 481 => 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); }, - 476 => function ($stackPos) { + 482 => 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); }, - 477 => function ($stackPos) { + 483 => 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); }, - 478 => function ($stackPos) { + 484 => function ($stackPos) { $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, - 479 => function ($stackPos) { + 485 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(3-2)]; }, - 480 => function ($stackPos) { + 486 => function ($stackPos) { $this->semValue = new Expr\ConstFetch($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 481 => function ($stackPos) { + 487 => function ($stackPos) { $this->semValue = new Expr\ClassConstFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 482 => function ($stackPos) { + 488 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 483 => function ($stackPos) { + 489 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 484 => function ($stackPos) { + 490 => 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); }, - 485 => function ($stackPos) { + 491 => 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); }, - 486 => function ($stackPos) { + 492 => function ($stackPos) { $this->semValue = array(); }, - 487 => function ($stackPos) { + 493 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(2-1)]; }, - 488 => function ($stackPos) { + 494 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos]; }, - 489 => function ($stackPos) { + 495 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos]; }, - 490 => function ($stackPos) { + 496 => function ($stackPos) { $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; }, - 491 => function ($stackPos) { + 497 => function ($stackPos) { $this->semValue = array($this->semStack[$stackPos-(1-1)]); }, - 492 => function ($stackPos) { + 498 => 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); }, - 493 => function ($stackPos) { + 499 => function ($stackPos) { $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(1-1)], null, false, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 494 => function ($stackPos) { + 500 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 495 => function ($stackPos) { + 501 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 496 => function ($stackPos) { + 502 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 497 => function ($stackPos) { + 503 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 498 => function ($stackPos) { + 504 => function ($stackPos) { $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(6-2)], $this->semStack[$stackPos-(6-5)], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); }, - 499 => function ($stackPos) { + 505 => function ($stackPos) { $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, - 500 => function ($stackPos) { + 506 => function ($stackPos) { $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 501 => function ($stackPos) { + 507 => 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); }, - 502 => function ($stackPos) { + 508 => function ($stackPos) { $this->semValue = new Expr\FuncCall($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 503 => function ($stackPos) { + 509 => function ($stackPos) { $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, - 504 => function ($stackPos) { + 510 => function ($stackPos) { $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, - 505 => function ($stackPos) { + 511 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 506 => function ($stackPos) { + 512 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(3-2)]; }, - 507 => function ($stackPos) { + 513 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 508 => function ($stackPos) { + 514 => function ($stackPos) { $this->semValue = new Expr\Variable($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 509 => function ($stackPos) { + 515 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 510 => function ($stackPos) { + 516 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 511 => function ($stackPos) { + 517 => function ($stackPos) { $this->semValue = new Expr\StaticPropertyFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, - 512 => function ($stackPos) { + 518 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 513 => function ($stackPos) { + 519 => function ($stackPos) { $var = substr($this->semStack[$stackPos-(1-1)], 1); $this->semValue = \is_string($var) ? new Node\VarLikeIdentifier($var, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes) : $var; }, - 514 => function ($stackPos) { + 520 => function ($stackPos) { $this->semValue = new Expr\StaticPropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 515 => function ($stackPos) { + 521 => function ($stackPos) { $this->semValue = new Expr\StaticPropertyFetch($this->semStack[$stackPos-(6-1)], $this->semStack[$stackPos-(6-5)], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); }, - 516 => function ($stackPos) { + 522 => function ($stackPos) { $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, - 517 => function ($stackPos) { + 523 => function ($stackPos) { $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, - 518 => function ($stackPos) { + 524 => function ($stackPos) { $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, - 519 => function ($stackPos) { + 525 => function ($stackPos) { $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, - 520 => function ($stackPos) { + 526 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 521 => function ($stackPos) { + 527 => function ($stackPos) { $this->semValue = new Expr\Variable($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, - 522 => function ($stackPos) { + 528 => function ($stackPos) { $this->semValue = null; }, - 523 => function ($stackPos) { + 529 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 524 => function ($stackPos) { + 530 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 525 => function ($stackPos) { + 531 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(3-2)]; }, - 526 => function ($stackPos) { + 532 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 527 => function ($stackPos) { + 533 => function ($stackPos) { $this->semValue = new Expr\Error($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); $this->errorState = 2; }, - 528 => function ($stackPos) { + 534 => function ($stackPos) { $this->semValue = new Expr\List_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, - 529 => function ($stackPos) { + 535 => function ($stackPos) { $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; }, - 530 => function ($stackPos) { + 536 => function ($stackPos) { $this->semValue = array($this->semStack[$stackPos-(1-1)]); }, - 531 => function ($stackPos) { + 537 => function ($stackPos) { $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(1-1)], null, false, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 532 => function ($stackPos) { + 538 => function ($stackPos) { $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(1-1)], null, false, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 533 => function ($stackPos) { + 539 => function ($stackPos) { $this->semValue = null; }, - 534 => function ($stackPos) { + 540 => function ($stackPos) { $this->semValue = array(); }, - 535 => function ($stackPos) { + 541 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(2-1)]; }, - 536 => function ($stackPos) { + 542 => function ($stackPos) { $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; }, - 537 => function ($stackPos) { + 543 => function ($stackPos) { $this->semValue = array($this->semStack[$stackPos-(1-1)]); }, - 538 => function ($stackPos) { + 544 => 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); }, - 539 => function ($stackPos) { + 545 => function ($stackPos) { $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(1-1)], null, false, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 540 => function ($stackPos) { + 546 => 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); }, - 541 => function ($stackPos) { + 547 => function ($stackPos) { $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(2-2)], null, true, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 542 => function ($stackPos) { + 548 => function ($stackPos) { $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(2-2)], null, false, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes, true, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 543 => function ($stackPos) { + 549 => function ($stackPos) { $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; }, - 544 => function ($stackPos) { + 550 => function ($stackPos) { $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; }, - 545 => function ($stackPos) { + 551 => function ($stackPos) { $this->semValue = array($this->semStack[$stackPos-(1-1)]); }, - 546 => function ($stackPos) { + 552 => function ($stackPos) { $this->semValue = array($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)]); }, - 547 => function ($stackPos) { + 553 => function ($stackPos) { $this->semValue = new Scalar\EncapsedStringPart($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 548 => function ($stackPos) { + 554 => function ($stackPos) { $this->semValue = new Expr\Variable($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 549 => function ($stackPos) { + 555 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 550 => function ($stackPos) { + 556 => function ($stackPos) { $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, - 551 => function ($stackPos) { + 557 => function ($stackPos) { $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 552 => function ($stackPos) { + 558 => function ($stackPos) { $this->semValue = new Expr\Variable($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 553 => function ($stackPos) { + 559 => function ($stackPos) { $this->semValue = new Expr\Variable($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 554 => function ($stackPos) { + 560 => function ($stackPos) { $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(6-2)], $this->semStack[$stackPos-(6-4)], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); }, - 555 => function ($stackPos) { + 561 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(3-2)]; }, - 556 => function ($stackPos) { + 562 => function ($stackPos) { $this->semValue = new Scalar\String_($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 557 => function ($stackPos) { + 563 => function ($stackPos) { $this->semValue = $this->parseNumString($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 558 => function ($stackPos) { + 564 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, ]; diff --git a/app/vendor/nikic/php-parser/lib/PhpParser/Parser/Php7.php b/app/vendor/nikic/php-parser/lib/PhpParser/Parser/Php7.php index c56685c21..32a3fef4f 100644 --- a/app/vendor/nikic/php-parser/lib/PhpParser/Parser/Php7.php +++ b/app/vendor/nikic/php-parser/lib/PhpParser/Parser/Php7.php @@ -17,17 +17,17 @@ */ class Php7 extends \PhpParser\ParserAbstract { - protected $tokenToSymbolMapSize = 393; - protected $actionTableSize = 1178; - protected $gotoTableSize = 582; + protected $tokenToSymbolMapSize = 396; + protected $actionTableSize = 1196; + protected $gotoTableSize = 585; - protected $invalidSymbol = 166; + protected $invalidSymbol = 168; protected $errorSymbol = 1; protected $defaultAction = -32766; protected $unexpectedTokenRule = 32767; - protected $YY2TBLSTATE = 401; - protected $numNonLeafStates = 700; + protected $YY2TBLSTATE = 419; + protected $numNonLeafStates = 710; protected $symbolToName = array( "EOF", @@ -67,7 +67,8 @@ class Php7 extends \PhpParser\ParserAbstract "T_BOOLEAN_AND", "'|'", "'^'", - "'&'", + "T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG", + "T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG", "T_IS_EQUAL", "T_IS_NOT_EQUAL", "T_IS_IDENTICAL", @@ -151,6 +152,7 @@ class Php7 extends \PhpParser\ParserAbstract "T_PRIVATE", "T_PROTECTED", "T_PUBLIC", + "T_READONLY", "T_VAR", "T_UNSET", "T_ISSET", @@ -199,700 +201,711 @@ class Php7 extends \PhpParser\ParserAbstract ); protected $tokenToSymbol = array( - 0, 166, 166, 166, 166, 166, 166, 166, 166, 166, - 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, - 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, - 166, 166, 166, 55, 164, 166, 165, 54, 37, 166, - 161, 162, 52, 49, 8, 50, 51, 53, 166, 166, - 166, 166, 166, 166, 166, 166, 166, 166, 31, 157, - 43, 16, 45, 30, 67, 166, 166, 166, 166, 166, - 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, - 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, - 166, 69, 166, 158, 36, 166, 163, 166, 166, 166, - 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, - 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, - 166, 166, 166, 159, 35, 160, 57, 166, 166, 166, - 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, - 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, - 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, - 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, - 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, - 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, - 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, - 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, - 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, - 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, - 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, - 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, - 166, 166, 166, 166, 166, 166, 1, 2, 3, 4, + 0, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 56, 166, 168, 167, 55, 168, 168, + 163, 164, 53, 50, 8, 51, 52, 54, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 31, 159, + 44, 16, 46, 30, 68, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 70, 168, 160, 36, 168, 165, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 161, 35, 162, 58, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 32, 33, 34, 38, 39, 40, 41, - 42, 44, 46, 47, 48, 56, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 68, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 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, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, - 154, 155, 156 + 27, 28, 29, 32, 33, 34, 37, 38, 39, 40, + 41, 42, 43, 45, 47, 48, 49, 57, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 69, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 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, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158 ); protected $action = array( - 130, 131, 132, 561, 133, 134, 0, 710, 711, 712, - 135, 36, 896, 537, 538,-32766, 1231,-32766,-32766,-32766, - -558, 1164, 785, 907, 434, 435, 436, -558,-32766,-32766, - -32766, -299,-32766, 973,-32766, 247,-32766, -190,-32766,-32766, - -32766,-32766,-32766, 465,-32766,-32766,-32766,-32766,-32766,-32766, - -32766,-32766, 124, 796, 713,-32766,-32766, 392, 1043, 1044, - 1045, 1042, 1041, 1040,-32766,-32766,-32766,-32766, 263, 136, - 375, 717, 718, 719, 720, 980, 981, 401, 1043, 1044, - 1045, 1042, 1041, 1040, 721, 722, 723, 724, 725, 726, - 727, 728, 729, 730, 731, 751, 562, 752, 753, 754, - 755, 743, 744, 376, 377, 746, 747, 732, 733, 734, - 736, 737, 738, 336, 778, 779, 780, 781, 782, 739, - 740, 563, 564, 772, 763, 761, 762, 775, 758, 759, - -189, 978, 565, 566, 757, 567, 568, 569, 570, 571, - 572, 533, -555, -509,-32766,-32766, 760, 573, 574, -555, - 137, 980, 981, 313, 130, 131, 132, 561, 133, 134, - 994, 710, 711, 712, 135, 36,-32766,-32766,-32766,-32766, - 687,-32766,-32766,-32766, 80, 1164, 553, -558, 629, 24, - 312, -558,-32766,-32766,-32766, -299,-32766,-32766,-32766, 247, - -32766, -190,-32766,-32766,-32766,-32766,-32766,-32766,-32766,-32766, - -32766, 1203, 432, 433,-32766,-32766, -509, -509, 713, 795, - -32766, 392, 395,-32766,-32766,-32766, 443, 444,-32766, 438, - 433, -509, 263, 136, 375, 717, 718, 719, 720, 395, - -83, 401, 237, -509,-32766, -515,-32766,-32766, 721, 722, - 723, 724, 725, 726, 727, 728, 729, 730, 731, 751, - 562, 752, 753, 754, 755, 743, 744, 376, 377, 746, - 747, 732, 733, 734, 736, 737, 738, 336, 778, 779, - 780, 781, 782, 739, 740, 563, 564, 772, 763, 761, - 762, 775, 758, 759, -189, 2, 565, 566, 757, 567, - 568, 569, 570, 571, 572, -83, 81, 82, 83, -555, - 760, 573, 574, -555, 137, 735, 705, 706, 707, 708, - 709, 1251, 710, 711, 712, 748, 749, 33, 1250, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 12, 265,-32766,-32766,-32766, 104, 105, 106, - 31, 265, 970, 969, 968, 107, 101, 102, 103, 713, - -32766,-32766,-32766, 107, 459,-32766, 583,-32766,-32766,-32766, - -32766,-32766,-32766, 714, 715, 716, 717, 718, 719, 720, - -259,-32766, 783,-32766,-32766,-32766,-32766,-32766, 126, 721, - 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, - 751, 774, 752, 753, 754, 755, 743, 744, 745, 773, - 746, 747, 732, 733, 734, 736, 737, 738, 777, 778, - 779, 780, 781, 782, 739, 740, 741, 742, 772, 763, - 761, 762, 775, 758, 759, 142, 938, 750, 756, 757, - 764, 765, 767, 766, 768, 769, -549,-32766,-32766,-32766, - -549, 760, 771, 770, 48, 49, 50, 492, 51, 52, - 790, 236, 589, -510, 53, 54, 249, 55,-32766, 993, + 131, 132, 133, 569, 134, 135, 0, 722, 723, 724, + 136, 36, 834, 911, 835, 468,-32766,-32766,-32766,-32767, + -32767,-32767,-32767, 100, 101, 102, 103, 104, 1068, 1069, + 1070, 1067, 1066, 1065, 1071, 716, 715,-32766,-32766,-32766, -32766,-32766,-32766,-32766,-32766,-32766,-32767,-32767,-32767,-32767, - -32767, 296,-32767,-32767,-32767,-32767, 99, 100, 101, 102, - 103, 1276, 460, 787, 1277, 821, 298, 822, 274, 482, - 1191, 56, 57, -337, 310, -337, -508, 58, 1171, 59, - 242, 243, 60, 61, 62, 63, 64, 65, 66, 67, - 1035, 26, 264, 68, 416, 493, -510, -510, 325, 1197, - 1198, 494, 349, 794, 1171, 791, 353, 1195, 40, 23, - 495, -510, 496, 793, 497, 487, 498, 11, 358, 499, - 500, 645, 646, -510, 42, 43, 417, 421, 419, 878, - 44, 501, 939, 401, -14, 360, 348, 324, 789, -508, - -508, 412, -507, 675, 502, 503, 504, 427, 428, 47, - 794, 146, 380, 978, -508, 413, 505, 506, 794, 1185, - 1186, 1187, 1188, 1182, 1183, 284, -508, 414, -514, 1247, - 415, 1189, 1184, 980, 981, 1166, 1165, 1167, 285, 821, - 878, 822, 800, 69, 794, 308, 309, 312, 34, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, - 119, 120, -150, -150, -150, -507, -507, 1166, 1165, 1167, - 678, 868, 288, 289, 1021,-32766, 1020, -150, 698, -150, - -507, -150, 147, -150, 244, 445, 446, 352, 138, -108, - 1079, 1081, -507, 418, 312, 621, 622, 148, 73, 125, - 150, -507, 312, 151, -108, -108, 152, 785, -85, 154, - 35, -49, -77, 854, -108, -108, -108, -108, 121, 285, - -32766, 122, 868, 127, 73, 128, 1164, 141, 312, 155, - 878, 156, 157,-32766,-32766,-32766, 158,-32766, 277,-32766, - 878,-32766, 107, -73,-32766, 880, 878, 673, -150,-32766, - -32766,-32766, -71,-32766, -70,-32766,-32766, -69, 129, 1164, - 679,-32766, 392, -512, -507, -507,-32766,-32766,-32766,-32766, - -32766, -68,-32766, 878,-32766, -67, 680,-32766, -66, -507, - -65, -64,-32766,-32766,-32766, 1171, -45, 139,-32766,-32766, - 878, -507, -16, 312,-32766, 392, 880, 246, 673, 72, - -32766, 145,-32766, 682, 1164, 266, 1164, 273, 688, -4, - 878, 691, 868,-32766,-32766,-32766, 877,-32766, 144,-32766, - 689,-32766, 868,-32766,-32766, 275, -512, -512, 868,-32766, - -32766,-32766, 892,-32766, 248,-32766,-32766, 276, 278, 1164, - 1162,-32766, 392, 980, 981, 279,-32766,-32766,-32766,-32766, - -32766, 318,-32766, -512,-32766, 868, 265,-32766, 653, 794, - 46, 143,-32766,-32766,-32766, 794, 666, 785,-32766,-32766, - -32766, 541, 868,-32766,-32766, 392, 1164, 1049, 1166, 1165, - 1167, 1278,-32766,-32766,-32766,-32766, 880,-32766, 673,-32766, - -32766,-32766, 868, 630,-32766, 250, 880, 535, 673,-32766, - -32766,-32766, 924, 635, 673,-32766,-32766, 648, 13, 290, - -108,-32766, 392, 440, 418, 794, 406, 470, 1266,-32766, - 293, 283, 636, 286, 287, -108, -108, 26, 878, 880, - 649, 673, 619, -473, 813, -108, -108, -108, -108, 794, - 285,-32766, 878, 1195, 411, 73, 880, 1164, 673, 312, - 123, 908, 909, 291,-32766,-32766,-32766, 9,-32766, 297, - -32766, 285,-32766, 1202, 793,-32766, 880, 894, 673, -4, - -32766,-32766,-32766, 0, 1019, -463,-32766,-32766, 547, 32, - 245, 1204,-32766, 392, 587, 7, 15, 351, 1192, 38, - -32766, 0, 505, 506, 805, 1185, 1186, 1187, 1188, 1182, - 1183, 39, 695, 696, 859, 948, 925, 1189, 1184, 932, - 868, 922, 933, 857, 920, -262, 1024, 1027, 1028, 71, - 1025, 1026, 309, 312, 868, 1217, -237, -237, -237, 1032, - 30, 1235, 418, 1269, 624, -543, 307, 350, 674, 677, - -236, -236, -236, -108, -108, 681, 418, 26, 683, 684, - 685, 686, 854, -108, -108, -108, -108, -108, -108, 794, - 690, 676, -260, 1195, 692, 855, 854, -108, -108, -108, - -108, 1273, 1275, -108, 816, 815, 824, 901, -108, 940, - -108, 823, 1274, 900, 880, 292, 673, -237, -108, -108, - -108, -108, -108, -108, -108, 902, 899, 1150, 880, 887, - 673, -236, 895, 885, 930, 931, 1272, 1229, 1218, 1236, - 1242, 1245, 0, 506, -541, 1185, 1186, 1187, 1188, 1182, - 1183, -515, -514, -513, 1, 27, 28, 1189, 1184, 37, - 41, 45, 70, -313, -259, 74, 75, 76, 77, 71, - 78, 79, 309, 312, 140, 149, 153, 241, 314, 337, - 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, - 407, 408, 0, 17, 18, 19, 20, 22, 379, 461, - 462, 469, 472, 473, 474, 475, 479, 480, 481, 490, - 660, 1175, 1118, 1193, 995, 1154, -264, -100, 16, 21, - 25, 282, 378, 580, 584, 611, 665, 1122, 1170, 1119, - 1248, 0, -477, 1135, 0, 1196, 0, 312 + -32767, 545, 546,-32766,-32766, 725,-32766,-32766,-32766, 998, + 999, 806, 922, 446, 447, 448, 369, 370, 2, 266, + 137, 395, 729, 730, 731, 732, 413,-32766, 419,-32766, + -32766,-32766,-32766,-32766, 990, 733, 734, 735, 736, 737, + 738, 739, 740, 741, 742, 743, 763, 570, 764, 765, + 766, 767, 755, 756, 335, 336, 758, 759, 744, 745, + 746, 748, 749, 750, 345, 790, 791, 792, 793, 794, + 795, 751, 752, 571, 572, 784, 775, 773, 774, 787, + 770, 771, 282, 419, 573, 574, 769, 575, 576, 577, + 578, 579, 580, 598, -575, 469, 491, 798, 772, 581, + 582, -575, 138,-32766,-32766,-32766, 131, 132, 133, 569, + 134, 135, 1017, 722, 723, 724, 136, 36, 1060,-32766, + -32766,-32766, 1303, 696,-32766, 1304,-32766,-32766,-32766,-32766, + -32766,-32766,-32766, 1068, 1069, 1070, 1067, 1066, 1065, 1071, + -32766, 716, 715, 371, 370, 1258,-32766,-32766,-32766, -572, + 105, 106, 107, 413, 269, 891, -572, 239, 1193, 1192, + 1194, 725,-32766,-32766,-32766, 1046, 108,-32766,-32766,-32766, + -32766, 986, 985, 984, 987, 266, 137, 395, 729, 730, + 731, 732, 12,-32766, 419,-32766,-32766,-32766,-32766, 998, + 999, 733, 734, 735, 736, 737, 738, 739, 740, 741, + 742, 743, 763, 570, 764, 765, 766, 767, 755, 756, + 335, 336, 758, 759, 744, 745, 746, 748, 749, 750, + 345, 790, 791, 792, 793, 794, 795, 751, 752, 571, + 572, 784, 775, 773, 774, 787, 770, 771, 881, 320, + 573, 574, 769, 575, 576, 577, 578, 579, 580,-32766, + 81, 82, 83, -575, 772, 581, 582, -575, 147, 747, + 717, 718, 719, 720, 721, 1278, 722, 723, 724, 760, + 761, 35, 1277, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 996, 269, 149, + -32766,-32766,-32766, 454, 455, 80, 33, -264, -572, 1016, + 108, 319, -572, 893, 725, 682, 803, 127, 998, 999, + 592,-32766, 1044,-32766,-32766,-32766, 809, 150, 726, 727, + 728, 729, 730, 731, 732, -88, 1198, 796, 277, -526, + 282,-32766,-32766,-32766, 733, 734, 735, 736, 737, 738, + 739, 740, 741, 742, 743, 763, 786, 764, 765, 766, + 767, 755, 756, 757, 785, 758, 759, 744, 745, 746, + 748, 749, 750, 789, 790, 791, 792, 793, 794, 795, + 751, 752, 753, 754, 784, 775, 773, 774, 787, 770, + 771, 143, 804, 762, 768, 769, 776, 777, 779, 778, + 780, 781, -314, -526, -526, -193, -192, 772, 783, 782, + 48, 49, 50, 500, 51, 52, 238, 807, -526, -86, + 53, 54, -111, 55, 996, 252,-32766, -111, 800, -111, + -526, 541, -532, -352, 299, -352, 303, -111, -111, -111, + -111, -111, -111, -111, -111, 998, 999, 998, 999, 152, + -32766,-32766,-32766, 1191, 807, 125, 305, 1293, 56, 57, + 102, 103, 104, -111, 58, 1218, 59, 245, 246, 60, + 61, 62, 63, 64, 65, 66, 67, -525, 26, 267, + 68, 435, 501, -328, 808, -86, 1224, 1225, 502, 1189, + 807, 1198, 1230, 292, 1222, 40, 23, 503, 73, 504, + 953, 505, 319, 506, 802, 153, 507, 508, 278, 684, + 279, 42, 43, 436, 366, 365, 891, 44, 509, 34, + 248, -16, -566, 357, 331, 317, -566, 1198, 1193, 1192, + 1194, -527, 510, 511, 512, 332, -524, 1274, 47, 716, + 715, -525, -525, 333, 513, 514, 807, 1212, 1213, 1214, + 1215, 1209, 1210, 291, 359, 283, -525, 284, -314, 1216, + 1211, -193, -192, 1193, 1192, 1194, 292, 891, -525, 363, + -531, 69, 807, 315, 316, 319, 30, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + -153, -153, -153, 638, 24, -527, -527, 687, 378, 881, + -524, -524, 295, 296, 891, -153, 431, -153, 807, -153, + -527, -153, 716, 715, 432, -524, 798, 362, -111, 1105, + 1107, 364, -527, 433, 891, 139, 434, -524, 954, 126, + -524, 319, -111, -111, 688, 813, 380, -529, 11, 834, + 154, 835, 867, -111, -111, -111, -111, 46, 292,-32766, + 881, 654, 655, 73, 689, 1191, 1045, 319, 708, 148, + 398, 156,-32766,-32766,-32766, 31,-32766, -79,-32766, 122, + -32766, 716, 715,-32766, 893, 891, 682, -153,-32766,-32766, + -32766, 716, 715, 891,-32766,-32766, 123, 881, 128, 73, + -32766, 410, 129, 319, -524, -524, 142, 140, -75,-32766, + 157, -529, -529, 319, 26, 691, 158, 881, 159, -524, + 160, 293, 294, 698, 367, 368, 807, -73,-32766, -72, + 1222, -524, 372, 373, 1191, 893, -71, 682, -529, 72, + -70,-32766,-32766,-32766, -69,-32766, -68,-32766, 124,-32766, + 630, 631,-32766, -67, -66, -47, -51,-32766,-32766,-32766, + -18, 146, 270,-32766,-32766, 276, 697, 700, 881,-32766, + 410, 890, 893, 145, 682, 281, 881, 907,-32766, 280, + 513, 514, 285, 1212, 1213, 1214, 1215, 1209, 1210, 325, + 130, 144, 939, 286, 682, 1216, 1211, 108, 269,-32766, + 798, 807,-32766, 662, 639, 1191, 657, 71, 675, 1075, + 316, 319,-32766,-32766,-32766, 1305,-32766, 300,-32766, 628, + -32766, 430, 543,-32766,-32766, 923, 555, 924,-32766,-32766, + -32766, 1229, 549,-32766,-32766,-32766, -4, 891, -490, 1191, + -32766, 410, 644, 893, 298, 682,-32766,-32766,-32766,-32766, + -32766, 893,-32766, 682,-32766, 13, 1231,-32766, 451, 479, + 645, 909,-32766,-32766,-32766,-32766, 658, -480,-32766,-32766, + 0, 1191, 0, 0,-32766, 410, 0, 297,-32766,-32766, + -32766, 304,-32766,-32766,-32766, 0,-32766, 0, 806,-32766, + 0, 0, 0, 474,-32766,-32766,-32766,-32766, 0, 7, + -32766,-32766, 15, 1191, 561, 596,-32766, 410, 1219, 891, + -32766,-32766,-32766, 361,-32766,-32766,-32766, 818,-32766, -267, + 881,-32766, 38, 292, 0, 0,-32766,-32766,-32766, 39, + 705, 706,-32766,-32766, 872, 963, 940, 947,-32766, 410, + 937, 948, 364, 870, 426, 891, 935,-32766, 1049, 290, + 1244, 1052, 1053, -111, -111, 1050, 1051, 1057, -560, 1262, + 1296, 633, 0, 826, -111, -111, -111, -111, 32, 314, + -32766, 360, 683, 686, 690, 692, 1191, 693, 694, 695, + 699, 685, 319,-32766,-32766,-32766, 9,-32766, 702,-32766, + 868,-32766, 881, 1300,-32766, 893, 1302, 682, -4,-32766, + -32766,-32766, 829, 828, 837,-32766,-32766, 916, -242, -242, + -242,-32766, 410, 955, 364, 26, 836, 1301, 915, 917, + -32766, 914, 1177, 900, 910, -111, -111, 807, 881, 898, + 945, 1222, 946, 1299, 1256, 867, -111, -111, -111, -111, + 1245, 1263, 1269, 1272, -241, -241, -241, -558, -532, -531, + 364, -530, 1, 27, 28, 37, 41, 45, 70, 0, + 74, -111, -111, 75, 76, 77, 78, 893, 79, 682, + -242, 867, -111, -111, -111, -111, 141, 151, 155, 244, + 321, 346, 514, 347, 1212, 1213, 1214, 1215, 1209, 1210, + 348, 349, 350, 351, 352, 353, 1216, 1211, 354, 355, + 356, 358, 427, 893, -265, 682, -241, -264, 71, 0, + 17, 316, 319, 18, 19, 20, 22, 397, 470, 471, + 478, 481, 482, 483, 484, 488, 489, 490, 498, 669, + 1202, 1145, 1220, 1019, 1018, 1181, -269, -103, 16, 21, + 25, 289, 396, 589, 593, 620, 674, 1149, 1197, 1146, + 1275, 0, -494, 1162, 0, 1223 ); protected $actionCheck = array( 2, 3, 4, 5, 6, 7, 0, 9, 10, 11, - 12, 13, 1, 116, 117, 73, 1, 9, 10, 11, - 1, 79, 79, 126, 127, 128, 129, 8, 86, 87, - 88, 8, 90, 1, 92, 37, 94, 8, 30, 97, - 32, 33, 34, 101, 102, 103, 104, 9, 10, 11, - 108, 109, 14, 1, 56, 115, 114, 115, 115, 116, - 117, 118, 119, 120, 122, 9, 10, 11, 70, 71, - 72, 73, 74, 75, 76, 135, 136, 79, 115, 116, - 117, 118, 119, 120, 86, 87, 88, 89, 90, 91, + 12, 13, 106, 1, 108, 31, 9, 10, 11, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 116, 117, + 118, 119, 120, 121, 122, 37, 38, 30, 116, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 117, 118, 9, 10, 57, 9, 10, 11, 137, + 138, 155, 128, 129, 130, 131, 106, 107, 8, 71, + 72, 73, 74, 75, 76, 77, 116, 30, 80, 32, + 33, 34, 35, 36, 1, 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, 128, 129, 130, 131, - 8, 115, 134, 135, 136, 137, 138, 139, 140, 141, - 142, 84, 1, 69, 9, 10, 148, 149, 150, 8, - 152, 135, 136, 69, 2, 3, 4, 5, 6, 7, - 162, 9, 10, 11, 12, 13, 9, 10, 11, 73, - 159, 9, 10, 11, 159, 79, 80, 158, 74, 75, - 165, 162, 86, 87, 88, 162, 90, 30, 92, 37, - 94, 162, 30, 97, 32, 33, 34, 35, 102, 103, - 104, 144, 105, 106, 108, 109, 132, 133, 56, 157, - 114, 115, 115, 9, 10, 11, 132, 133, 122, 105, - 106, 147, 70, 71, 72, 73, 74, 75, 76, 115, - 31, 79, 14, 159, 30, 161, 32, 33, 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, - 128, 129, 130, 131, 162, 8, 134, 135, 136, 137, - 138, 139, 140, 141, 142, 96, 9, 10, 11, 158, - 148, 149, 150, 162, 152, 2, 3, 4, 5, 6, - 7, 1, 9, 10, 11, 12, 13, 30, 8, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 8, 56, 9, 10, 11, 52, 53, 54, - 8, 56, 118, 119, 120, 68, 49, 50, 51, 56, - 9, 10, 11, 68, 31, 30, 1, 32, 33, 34, - 35, 36, 37, 70, 71, 72, 73, 74, 75, 76, - 162, 30, 79, 32, 33, 34, 35, 36, 8, 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, 128, 129, 130, 131, 8, 31, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 158, 9, 10, 11, - 162, 148, 149, 150, 2, 3, 4, 5, 6, 7, - 79, 96, 50, 69, 12, 13, 8, 15, 30, 1, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, - 42, 8, 43, 44, 45, 46, 47, 48, 49, 50, - 51, 79, 159, 79, 82, 105, 8, 107, 30, 100, - 1, 49, 50, 105, 8, 107, 69, 55, 1, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 121, 69, 70, 71, 72, 73, 132, 133, 8, 77, - 78, 79, 8, 81, 1, 154, 8, 85, 86, 87, - 88, 147, 90, 153, 92, 105, 94, 107, 8, 97, - 98, 74, 75, 159, 102, 103, 104, 105, 106, 1, - 108, 109, 157, 79, 31, 8, 114, 115, 154, 132, - 133, 8, 69, 159, 122, 123, 124, 105, 106, 69, - 81, 100, 101, 115, 147, 8, 134, 135, 81, 137, - 138, 139, 140, 141, 142, 143, 159, 8, 161, 1, - 8, 149, 150, 135, 136, 153, 154, 155, 156, 105, - 1, 107, 8, 161, 81, 163, 164, 165, 16, 17, - 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 74, 75, 76, 132, 133, 153, 154, 155, - 31, 83, 132, 133, 160, 9, 157, 89, 159, 91, - 147, 93, 14, 95, 37, 105, 106, 147, 159, 126, - 58, 59, 159, 105, 165, 110, 111, 14, 161, 159, - 14, 69, 165, 14, 116, 117, 14, 79, 31, 14, - 14, 31, 31, 125, 126, 127, 128, 129, 16, 156, - 73, 16, 83, 16, 161, 16, 79, 16, 165, 16, - 1, 16, 16, 86, 87, 88, 16, 90, 30, 92, - 1, 94, 68, 31, 97, 157, 1, 159, 160, 102, - 103, 104, 31, 73, 31, 108, 109, 31, 31, 79, - 31, 114, 115, 69, 132, 133, 86, 87, 88, 122, - 90, 31, 92, 1, 94, 31, 31, 97, 31, 147, - 31, 31, 102, 103, 104, 1, 31, 159, 108, 109, - 1, 159, 31, 165, 114, 115, 157, 37, 159, 152, - 73, 31, 122, 31, 79, 31, 79, 31, 31, 0, - 1, 31, 83, 86, 87, 88, 31, 90, 31, 92, - 31, 94, 83, 115, 97, 35, 132, 133, 83, 102, - 103, 104, 37, 73, 37, 108, 109, 35, 35, 79, - 115, 114, 115, 135, 136, 35, 86, 87, 88, 122, - 90, 35, 92, 159, 94, 83, 56, 97, 76, 81, - 69, 69, 102, 103, 104, 81, 91, 79, 108, 109, - 73, 88, 83, 115, 114, 115, 79, 81, 153, 154, - 155, 82, 122, 86, 87, 88, 157, 90, 159, 92, - 84, 94, 83, 89, 97, 37, 157, 84, 159, 102, - 103, 104, 157, 95, 159, 108, 109, 93, 96, 130, - 126, 114, 115, 96, 105, 81, 107, 96, 84, 122, - 113, 112, 99, 132, 133, 116, 117, 69, 1, 157, - 99, 159, 112, 147, 125, 126, 127, 128, 129, 81, - 156, 73, 1, 85, 126, 161, 157, 79, 159, 165, - 159, 126, 126, 131, 86, 87, 88, 148, 90, 130, - 92, 156, 94, 144, 153, 97, 157, 152, 159, 160, - 102, 103, 104, -1, 1, 147, 108, 109, 151, 145, - 146, 144, 114, 115, 151, 147, 147, 147, 158, 157, - 122, -1, 134, 135, 158, 137, 138, 139, 140, 141, - 142, 157, 157, 157, 157, 157, 157, 149, 150, 157, - 83, 157, 157, 157, 157, 162, 157, 157, 157, 161, - 157, 157, 164, 165, 83, 158, 99, 100, 101, 157, - 159, 158, 105, 158, 158, 161, 159, 159, 159, 159, - 99, 100, 101, 116, 117, 159, 105, 69, 159, 159, - 159, 159, 125, 126, 127, 128, 129, 116, 117, 81, - 159, 159, 162, 85, 160, 160, 125, 126, 127, 128, - 129, 160, 160, 100, 160, 160, 160, 160, 105, 160, - 107, 160, 160, 160, 157, 112, 159, 160, 115, 116, - 117, 118, 119, 120, 121, 160, 160, 160, 157, 160, - 159, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, -1, 135, 161, 137, 138, 139, 140, 141, - 142, 161, 161, 161, 161, 161, 161, 149, 150, 161, - 161, 161, 161, 160, 162, 161, 161, 161, 161, 161, - 161, 161, 164, 165, 161, 161, 161, 161, 161, 161, - 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, - 161, 161, -1, 162, 162, 162, 162, 162, 162, 162, - 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, - 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, - 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, - 162, -1, 163, 163, -1, 164, -1, 165 + 132, 133, 30, 80, 136, 137, 138, 139, 140, 141, + 142, 143, 144, 51, 1, 161, 101, 80, 150, 151, + 152, 8, 154, 9, 10, 11, 2, 3, 4, 5, + 6, 7, 164, 9, 10, 11, 12, 13, 123, 9, + 10, 11, 80, 161, 30, 83, 32, 33, 34, 35, + 36, 37, 38, 116, 117, 118, 119, 120, 121, 122, + 30, 37, 38, 106, 107, 1, 9, 10, 11, 1, + 53, 54, 55, 116, 57, 1, 8, 14, 155, 156, + 157, 57, 9, 10, 11, 162, 69, 30, 116, 32, + 33, 119, 120, 121, 122, 71, 72, 73, 74, 75, + 76, 77, 8, 30, 80, 32, 33, 34, 35, 137, + 138, 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, 128, 129, 130, 131, 132, 133, 84, 70, + 136, 137, 138, 139, 140, 141, 142, 143, 144, 9, + 9, 10, 11, 160, 150, 151, 152, 164, 154, 2, + 3, 4, 5, 6, 7, 1, 9, 10, 11, 12, + 13, 30, 8, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 116, 57, 14, + 9, 10, 11, 134, 135, 161, 8, 164, 160, 1, + 69, 167, 164, 159, 57, 161, 80, 8, 137, 138, + 1, 30, 1, 32, 33, 34, 1, 14, 71, 72, + 73, 74, 75, 76, 77, 31, 1, 80, 30, 70, + 30, 9, 10, 11, 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, 128, 129, 130, 131, 132, + 133, 8, 156, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 8, 134, 135, 8, 8, 150, 151, 152, + 2, 3, 4, 5, 6, 7, 97, 82, 149, 31, + 12, 13, 101, 15, 116, 8, 116, 106, 80, 108, + 161, 85, 163, 106, 113, 108, 8, 116, 117, 118, + 119, 120, 121, 122, 123, 137, 138, 137, 138, 14, + 9, 10, 11, 80, 82, 14, 8, 85, 50, 51, + 50, 51, 52, 128, 56, 1, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 70, 70, 71, + 72, 73, 74, 162, 159, 97, 78, 79, 80, 116, + 82, 1, 146, 158, 86, 87, 88, 89, 163, 91, + 31, 93, 167, 95, 156, 14, 98, 99, 35, 161, + 37, 103, 104, 105, 106, 107, 1, 109, 110, 147, + 148, 31, 160, 115, 116, 8, 164, 1, 155, 156, + 157, 70, 124, 125, 126, 8, 70, 1, 70, 37, + 38, 134, 135, 8, 136, 137, 82, 139, 140, 141, + 142, 143, 144, 145, 8, 35, 149, 37, 164, 151, + 152, 164, 164, 155, 156, 157, 158, 1, 161, 8, + 163, 163, 82, 165, 166, 167, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 75, 76, 77, 75, 76, 134, 135, 31, 8, 84, + 134, 135, 134, 135, 1, 90, 8, 92, 82, 94, + 149, 96, 37, 38, 8, 149, 80, 149, 128, 59, + 60, 106, 161, 8, 1, 161, 8, 161, 159, 161, + 70, 167, 117, 118, 31, 8, 106, 70, 108, 106, + 14, 108, 127, 128, 129, 130, 131, 70, 158, 74, + 84, 75, 76, 163, 31, 80, 159, 167, 161, 101, + 102, 14, 87, 88, 89, 14, 91, 31, 93, 16, + 95, 37, 38, 98, 159, 1, 161, 162, 103, 104, + 105, 37, 38, 1, 109, 110, 16, 84, 16, 163, + 115, 116, 16, 167, 134, 135, 16, 161, 31, 124, + 16, 134, 135, 167, 70, 31, 16, 84, 16, 149, + 16, 134, 135, 31, 106, 107, 82, 31, 74, 31, + 86, 161, 106, 107, 80, 159, 31, 161, 161, 154, + 31, 87, 88, 89, 31, 91, 31, 93, 161, 95, + 111, 112, 98, 31, 31, 31, 31, 103, 104, 105, + 31, 31, 31, 109, 110, 31, 31, 31, 84, 115, + 116, 31, 159, 31, 161, 37, 84, 38, 124, 35, + 136, 137, 35, 139, 140, 141, 142, 143, 144, 35, + 31, 70, 159, 37, 161, 151, 152, 69, 57, 74, + 80, 82, 85, 77, 90, 80, 94, 163, 92, 82, + 166, 167, 87, 88, 89, 83, 91, 114, 93, 113, + 95, 128, 85, 98, 116, 128, 153, 128, 103, 104, + 105, 146, 89, 74, 109, 110, 0, 1, 149, 80, + 115, 116, 96, 159, 133, 161, 87, 88, 89, 124, + 91, 159, 93, 161, 95, 97, 146, 98, 97, 97, + 100, 154, 103, 104, 105, 74, 100, 149, 109, 110, + -1, 80, -1, -1, 115, 116, -1, 132, 87, 88, + 89, 132, 91, 124, 93, -1, 95, -1, 155, 98, + -1, -1, -1, 102, 103, 104, 105, 74, -1, 149, + 109, 110, 149, 80, 81, 153, 115, 116, 160, 1, + 87, 88, 89, 149, 91, 124, 93, 160, 95, 164, + 84, 98, 159, 158, -1, -1, 103, 104, 105, 159, + 159, 159, 109, 110, 159, 159, 159, 159, 115, 116, + 159, 159, 106, 159, 108, 1, 159, 124, 159, 113, + 160, 159, 159, 117, 118, 159, 159, 159, 163, 160, + 160, 160, -1, 127, 128, 129, 130, 131, 161, 161, + 74, 161, 161, 161, 161, 161, 80, 161, 161, 161, + 161, 161, 167, 87, 88, 89, 150, 91, 162, 93, + 162, 95, 84, 162, 98, 159, 162, 161, 162, 103, + 104, 105, 162, 162, 162, 109, 110, 162, 100, 101, + 102, 115, 116, 162, 106, 70, 162, 162, 162, 162, + 124, 162, 162, 162, 162, 117, 118, 82, 84, 162, + 162, 86, 162, 162, 162, 127, 128, 129, 130, 131, + 162, 162, 162, 162, 100, 101, 102, 163, 163, 163, + 106, 163, 163, 163, 163, 163, 163, 163, 163, -1, + 163, 117, 118, 163, 163, 163, 163, 159, 163, 161, + 162, 127, 128, 129, 130, 131, 163, 163, 163, 163, + 163, 163, 137, 163, 139, 140, 141, 142, 143, 144, + 163, 163, 163, 163, 163, 163, 151, 152, 163, 163, + 163, 163, 163, 159, 164, 161, 162, 164, 163, -1, + 164, 166, 167, 164, 164, 164, 164, 164, 164, 164, + 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, + 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, + 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, + 164, -1, 165, 165, -1, 166 ); protected $actionBase = array( - 0, -2, 152, 558, 779, 897, 911, 499, 484, 414, - 834, 303, 303, -57, 303, 303, 699, 742, 742, 759, - 742, 609, 715, 709, 709, 709, 617, 617, 617, 617, - -58, -58, 96, 697, 730, 767, 650, 838, 838, 838, - 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, - 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, - 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, - 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, - 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, - 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, - 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, - 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, - 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, - 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, - 838, 838, 838, 838, 838, 838, 838, 838, 838, 838, - 838, 838, 838, 838, 838, 838, 838, 838, 838, 52, - 405, 365, 666, 999, 1005, 1001, 1006, 997, 996, 1000, - 1002, 1007, 916, 917, 757, 918, 919, 920, 921, 1003, - 846, 998, 1004, 287, 287, 287, 287, 287, 287, 287, - 287, 287, 287, 287, 287, 287, 287, 287, 287, 287, - 287, 287, 287, 287, 287, 287, 287, 287, 287, 636, - 38, 135, 56, 56, 56, 56, 56, 56, 56, 56, - 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, - 56, 56, 157, 157, 157, 204, 828, 828, 8, 602, - 162, 948, 948, 948, 948, 948, 948, 948, 948, 948, - 948, 351, 335, 438, 438, 438, 438, 438, 943, 439, - 439, 439, 439, 533, 754, 507, 468, 399, 398, 307, - 307, 678, 678, 16, 16, 16, 16, -60, -60, -60, - -103, 74, 437, 390, 57, 695, 598, 598, 598, 598, - 695, 695, 695, 695, 807, 1011, 695, 695, 695, 394, - 503, 503, 510, 295, 295, 295, 503, 504, 783, 804, - 504, 804, 15, 412, 728, 97, 114, 288, 728, 664, - 761, 141, 19, 781, 472, 781, 776, 842, 872, 1008, - 234, 793, 914, 801, 915, 84, 651, 994, 994, 994, - 994, 994, 994, 994, 994, 994, 994, 994, 1012, 995, - 381, 1012, 1012, 1012, 555, 381, 104, 477, 381, 786, - 995, 52, 798, 52, 52, 52, 52, 958, 52, 52, - 52, 52, 52, 52, 963, 731, 725, 682, 333, 52, - 405, 11, 11, 489, 32, 11, 11, 11, 11, 52, - 52, 52, 472, 770, 797, 550, 803, 122, 770, 770, - 770, 199, 23, 218, 29, 440, 758, 758, 765, 766, - 933, 933, 758, 748, 758, 766, 940, 758, 765, 765, - 933, 765, 775, 380, 563, 520, 528, 765, 765, 577, - 933, 473, 765, 765, 758, 758, 758, 758, 765, 589, - 758, 458, 427, 758, 758, 765, 765, 749, 746, 799, - 277, 933, 933, 933, 799, 524, 792, 792, 792, 815, - 816, 790, 744, 496, 488, 604, 342, 765, 744, 744, - 758, 540, 790, 744, 790, 744, 785, 744, 744, 744, - 790, 744, 758, 748, 557, 744, 683, 765, 592, 334, - 744, 6, 941, 944, 647, 945, 938, 946, 969, 947, - 949, 849, 956, 939, 950, 935, 934, 755, 672, 675, - 808, 756, 932, 644, 644, 644, 930, 644, 644, 644, - 644, 644, 644, 644, 644, 672, 800, 810, 788, 753, - 959, 677, 679, 789, 875, 1009, 1010, 795, 796, 958, - 989, 953, 802, 681, 975, 960, 874, 847, 961, 962, - 976, 990, 991, 881, 762, 882, 884, 806, 964, 850, - 644, 941, 949, 939, 950, 935, 934, 720, 719, 714, - 717, 710, 696, 691, 693, 740, 923, 844, 837, 963, - 931, 672, 843, 971, 841, 977, 978, 848, 787, 769, - 845, 885, 965, 966, 967, 856, 992, 814, 972, 823, - 979, 791, 886, 980, 981, 982, 983, 887, 859, 860, - 861, 817, 774, 870, 778, 889, 638, 773, 780, 970, - 653, 957, 862, 891, 892, 984, 985, 986, 893, 954, - 818, 973, 784, 974, 942, 819, 822, 656, 760, 772, - 659, 662, 905, 906, 907, 955, 747, 752, 824, 825, - 993, 909, 665, 826, 685, 912, 988, 686, 690, 745, - 871, 809, 777, 782, 968, 750, 827, 913, 829, 830, - 831, 987, 833, 0, 0, 0, 0, 0, 0, 0, + 0, -2, 154, 565, 876, 948, 984, 514, 53, 398, + 837, 307, 307, 67, 307, 307, 653, 724, 724, 732, + 724, 616, 673, 204, 204, 204, 625, 625, 625, 625, + 694, 694, 831, 831, 863, 799, 765, 936, 936, 936, + 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, + 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, + 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, + 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, + 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, + 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, + 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, + 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, + 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, + 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, + 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, + 936, 936, 936, 936, 936, 936, 936, 936, 936, 936, + 936, 375, 519, 369, 701, 1017, 1023, 1019, 1024, 1015, + 1014, 1018, 1020, 1025, 911, 912, 782, 918, 919, 920, + 921, 1021, 841, 1016, 1022, 291, 291, 291, 291, 291, + 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, + 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, + 291, 290, 491, 44, 382, 382, 382, 382, 382, 382, + 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, + 382, 382, 382, 382, 160, 160, 160, 187, 684, 684, + 341, 203, 610, 47, 985, 985, 985, 985, 985, 985, + 985, 985, 985, 985, 144, 144, 7, 7, 7, 7, + 7, 371, -25, -25, -25, -25, 540, 385, 102, 576, + 358, 45, 377, 460, 460, 360, 231, 231, 231, 231, + 231, 231, -78, -78, -78, -78, -78, -66, 319, 457, + -94, 396, 423, 586, 586, 586, 586, 423, 423, 423, + 423, 750, 1029, 423, 423, 423, 511, 516, 516, 518, + 147, 147, 147, 516, 583, 777, 422, 583, 422, 194, + 92, 748, -40, 87, 412, 748, 617, 627, 198, 143, + 773, 658, 773, 1013, 757, 764, 717, 838, 860, 1026, + 800, 908, 806, 910, 219, 686, 1012, 1012, 1012, 1012, + 1012, 1012, 1012, 1012, 1012, 1012, 1012, 855, 552, 1013, + 286, 855, 855, 855, 552, 552, 552, 552, 552, 552, + 552, 552, 552, 552, 679, 286, 568, 626, 286, 794, + 552, 375, 758, 375, 375, 375, 375, 958, 375, 375, + 375, 375, 375, 375, 970, 769, -16, 375, 519, 12, + 12, 547, 83, 12, 12, 12, 12, 375, 375, 375, + 658, 781, 713, 666, 792, 448, 781, 781, 781, 438, + 444, 193, 447, 570, 523, 580, 760, 760, 767, 929, + 929, 760, 759, 760, 767, 934, 760, 929, 805, 359, + 648, 577, 611, 656, 929, 478, 760, 760, 760, 760, + 665, 760, 467, 433, 760, 760, 785, 774, 789, 60, + 929, 929, 929, 789, 596, 751, 751, 751, 811, 812, + 746, 771, 567, 498, 677, 348, 779, 771, 771, 760, + 640, 746, 771, 746, 771, 747, 771, 771, 771, 746, + 771, 760, 759, 585, 771, 734, 668, 224, 771, 6, + 935, 937, 354, 940, 932, 941, 979, 942, 943, 851, + 956, 933, 945, 931, 930, 780, 703, 720, 790, 729, + 928, 768, 768, 768, 925, 768, 768, 768, 768, 768, + 768, 768, 768, 703, 788, 804, 733, 783, 960, 722, + 726, 725, 868, 1027, 1028, 737, 739, 958, 1006, 953, + 803, 730, 992, 967, 866, 848, 968, 969, 993, 1007, + 1008, 871, 761, 874, 880, 797, 971, 852, 768, 935, + 943, 933, 945, 931, 930, 763, 762, 753, 755, 749, + 745, 736, 738, 770, 1009, 924, 835, 830, 970, 926, + 703, 839, 986, 847, 994, 995, 850, 801, 772, 840, + 881, 972, 975, 976, 853, 1010, 810, 989, 795, 996, + 802, 882, 997, 998, 999, 1000, 885, 854, 856, 857, + 815, 754, 980, 786, 891, 335, 787, 796, 978, 363, + 957, 858, 894, 895, 1001, 1002, 1003, 896, 954, 816, + 990, 752, 991, 983, 817, 818, 485, 784, 778, 541, + 676, 897, 899, 900, 955, 775, 766, 821, 822, 1011, + 901, 697, 824, 740, 902, 1005, 742, 744, 756, 859, + 793, 743, 798, 977, 776, 827, 907, 829, 832, 833, + 1004, 836, 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, 0, + 0, 458, 458, 458, 458, 458, 458, 307, 307, 307, + 307, 0, 0, 307, 0, 0, 458, 458, 458, 458, + 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, + 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, + 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, + 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, + 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, + 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, + 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, + 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, + 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, + 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, + 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, + 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, + 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, + 458, 458, 458, 458, 458, 458, 458, 458, 458, 458, + 458, 291, 291, 291, 291, 291, 291, 291, 291, 291, + 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, + 291, 291, 291, 291, 291, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 452, 452, 452, 452, 452, 452, 303, 303, 303, - 303, 0, 0, 303, 0, 0, 452, 452, 452, 452, - 452, 452, 452, 452, 452, 452, 452, 452, 452, 452, - 452, 452, 452, 452, 452, 452, 452, 452, 452, 452, - 452, 452, 452, 452, 452, 452, 452, 452, 452, 452, - 452, 452, 452, 452, 452, 452, 452, 452, 452, 452, - 452, 452, 452, 452, 452, 452, 452, 452, 452, 452, - 452, 452, 452, 452, 452, 452, 452, 452, 452, 452, - 452, 452, 452, 452, 452, 452, 452, 452, 452, 452, - 452, 452, 452, 452, 452, 452, 452, 452, 452, 452, - 452, 452, 452, 452, 452, 452, 452, 452, 452, 452, - 452, 452, 452, 452, 452, 452, 452, 452, 452, 452, - 452, 452, 452, 452, 452, 452, 452, 452, 452, 452, - 452, 452, 452, 452, 452, 452, 452, 452, 452, 452, - 452, 452, 452, 452, 452, 452, 452, 452, 452, 452, - 452, 452, 452, 452, 452, 452, 452, 452, 452, 287, - 287, 287, 287, 287, 287, 287, 287, 287, 287, 287, - 287, 287, 287, 287, 287, 287, 287, 287, 287, 287, - 287, 287, 287, 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, 287, - 287, 287, 287, 287, 287, 287, 287, 287, 287, 287, - 287, 287, 287, 287, 287, 287, 287, 287, 287, 287, - 287, 287, 287, 287, 287, 287, 695, 695, 287, 0, - 287, 695, 695, 695, 695, 695, 695, 695, 695, 695, - 695, 287, 287, 287, 287, 287, 287, 287, 775, 295, - 295, 295, 295, 695, 695, 695, 695, -37, -37, 295, - 295, 695, 695, 695, 695, 695, 695, 695, 695, 695, - 0, 0, 0, 381, 804, 0, 748, 748, 748, 748, - 0, 0, 0, 0, 804, 804, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 381, 804, 0, - 381, 0, 748, 748, 695, 775, 775, 310, 695, 0, - 0, 0, 0, 381, 748, 381, 804, 11, 52, 310, - 0, 481, 481, 481, 481, 0, 472, 775, 775, 775, - 775, 775, 775, 775, 775, 775, 775, 775, 748, 775, - 0, 748, 748, 748, 0, 0, 0, 0, 0, 748, - 765, 0, 933, 0, 0, 0, 0, 758, 0, 0, - 0, 0, 0, 0, 758, 940, 765, 765, 0, 0, - 0, 0, 0, 0, 748, 0, 0, 0, 0, 0, - 0, 0, 0, 644, 787, 0, 787, 0, 644, 644, - 644 + 0, 291, 291, 291, 291, 291, 291, 291, 291, 291, + 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, + 291, 291, 291, 291, 291, 291, 291, 291, 423, 423, + 291, 291, 0, 291, 423, 423, 423, 423, 423, 423, + 423, 423, 423, 423, 291, 291, 291, 291, 291, 291, + 291, 805, 147, 147, 147, 147, 423, 423, 423, 423, + 423, -88, -88, 147, 147, 423, 423, 423, 423, 423, + 423, 423, 423, 423, 423, 423, 423, 0, 0, 0, + 286, 422, 0, 759, 759, 759, 759, 0, 0, 0, + 0, 422, 422, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 286, 422, 0, 286, 0, 759, + 759, 423, 805, 805, 314, 423, 0, 0, 0, 0, + 286, 759, 286, 552, 422, 552, 552, 12, 375, 314, + 608, 608, 608, 608, 0, 658, 805, 805, 805, 805, + 805, 805, 805, 805, 805, 805, 805, 759, 0, 805, + 0, 759, 759, 759, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 759, + 0, 0, 929, 0, 0, 0, 0, 760, 0, 0, + 0, 0, 0, 0, 760, 934, 0, 0, 0, 0, + 0, 0, 759, 0, 0, 0, 0, 0, 0, 0, + 0, 768, 801, 0, 801, 0, 768, 768, 768 ); protected $actionDefault = array( - 3,32767, 100,32767,32767,32767,32767,32767,32767,32767, - 32767,32767, 98,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767, 561, 561, 561, 561, - 241, 100,32767,32767,32767,32767, 437, 356, 356, 356, - 32767,32767, 505, 505, 505, 505, 505, 505,32767,32767, - 32767,32767,32767,32767, 437,32767,32767,32767,32767,32767, + 3,32767, 103,32767,32767,32767,32767,32767,32767,32767, + 32767,32767, 101,32767,32767,32767,32767,32767,32767,32767, + 32767,32767,32767,32767,32767,32767, 578, 578, 578, 578, + 32767,32767, 246, 103,32767,32767, 454, 372, 372, 372, + 32767,32767, 522, 522, 522, 522, 522, 522,32767,32767, + 32767,32767,32767,32767, 454,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,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, 98,32767,32767,32767, - 35, 5, 6, 8, 9, 48, 15,32767,32767,32767, - 32767,32767, 100,32767,32767,32767,32767,32767,32767,32767, + 32767,32767,32767,32767,32767,32767,32767, 101,32767,32767, + 32767, 37, 7, 8, 10, 11, 50, 17, 310,32767, + 32767,32767,32767, 103,32767,32767,32767,32767,32767,32767, 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767, 554,32767,32767,32767,32767,32767,32767,32767, + 32767,32767,32767,32767, 571,32767,32767,32767,32767,32767, 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767, 441, 420, 421, 423, 424, 355, 506, - 560, 298, 557, 354, 143, 310, 300, 229, 301, 245, - 442, 246, 443, 446, 447, 206, 272, 351, 147, 385, - 438, 387, 436, 440, 386, 361, 366, 367, 368, 369, - 370, 371, 372, 373, 374, 375, 376, 377, 378, 359, - 360, 439, 417, 416, 415, 383,32767,32767, 384, 358, - 388,32767,32767,32767,32767,32767,32767,32767,32767, 100, - 32767, 390, 389, 406, 407, 404, 405, 408,32767, 409, - 410, 411, 412,32767,32767,32767,32767, 336, 334, 397, - 398, 289, 289,32767,32767,32767,32767,32767,32767,32767, - 32767, 499, 414,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767, 100,32767, 98, 501, - 380, 382, 469, 392, 393, 391, 362,32767, 476,32767, - 100, 478,32767,32767,32767, 109,32767,32767,32767, 500, - 32767, 507, 507,32767, 462, 98,32767,32767,32767,32767, - 267,32767,32767,32767,32767, 568, 462, 108, 108, 108, - 108, 108, 108, 108, 108, 108, 108, 108,32767, 108, - 32767,32767,32767, 98, 186,32767, 255, 257, 100, 522, - 191,32767, 481,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767, 474, 191, 191,32767,32767, + 32767,32767,32767,32767,32767, 458, 437, 438, 440, 441, + 371, 523, 577, 313, 574, 370, 146, 325, 315, 234, + 316, 250, 459, 251, 460, 463, 464, 211, 279, 367, + 150, 401, 455, 403, 453, 457, 402, 377, 382, 383, + 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, + 394, 375, 376, 456, 434, 433, 432, 399,32767,32767, + 400, 404, 374, 407,32767,32767,32767,32767,32767,32767, + 32767,32767, 103,32767, 405, 406, 423, 424, 421, 422, + 425,32767, 426, 427, 428, 429,32767,32767, 302,32767, + 32767, 351, 349, 414, 415, 302,32767,32767,32767,32767, + 32767,32767,32767,32767,32767,32767,32767,32767, 516, 431, 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767, 462, 402, 136,32767, 136, 507, 394, 395, - 396, 464, 507, 507, 507,32767,32767,32767, 191,32767, - 479, 479, 98, 98, 98, 98, 474,32767, 191, 191, - 32767, 191, 109, 97, 97, 97, 97, 191, 191, 97, - 101, 99, 191, 191,32767,32767,32767,32767, 191, 97, - 32767, 99, 99,32767,32767, 191, 191, 212, 203, 210, - 99,32767, 526, 527, 210, 99, 214, 214, 214, 234, - 234, 453, 291, 99, 97, 99, 99, 191, 291, 291, - 32767, 99, 453, 291, 453, 291, 193, 291, 291, 291, - 453, 291,32767,32767, 99, 291, 205, 191, 97, 97, - 291,32767,32767,32767, 464,32767,32767,32767,32767,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767, 494, - 32767, 511, 524, 400, 401, 403, 509, 425, 426, 427, - 428, 429, 430, 431, 433, 556,32767, 468,32767,32767, - 32767,32767, 309, 566,32767, 566,32767,32767,32767,32767, + 32767,32767,32767, 103,32767, 101, 518, 396, 398, 486, + 409, 410, 408, 378,32767, 493,32767, 103, 495,32767, + 32767,32767, 112,32767,32767,32767, 517,32767, 524, 524, + 32767, 479, 101, 194,32767, 194, 194,32767,32767,32767, + 32767,32767,32767,32767, 585, 479, 111, 111, 111, 111, + 111, 111, 111, 111, 111, 111, 111,32767, 194, 111, + 32767,32767,32767, 101, 194, 194, 194, 194, 194, 194, + 194, 194, 194, 194, 189,32767, 260, 262, 103, 539, + 194,32767, 498,32767,32767,32767,32767,32767,32767,32767, + 32767,32767,32767,32767,32767, 491,32767,32767,32767,32767, 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767, 567,32767, 507,32767,32767,32767,32767, - 399, 7, 74, 41, 42, 50, 56, 485, 486, 487, - 488, 482, 483, 489, 484,32767, 490, 532,32767,32767, - 508, 559,32767,32767,32767,32767,32767,32767, 136,32767, - 32767,32767,32767,32767,32767,32767,32767,32767,32767, 494, - 32767, 134,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767, 507,32767,32767,32767, 286, 288,32767, + 479, 419, 139,32767, 139, 524, 411, 412, 413, 481, + 524, 524, 524, 298, 281,32767,32767,32767,32767, 496, + 496, 101, 101, 101, 101, 491,32767,32767, 112, 100, + 100, 100, 100, 100, 104, 102,32767,32767,32767,32767, + 100,32767, 102, 102,32767,32767, 217, 208, 215, 102, + 32767, 543, 544, 215, 102, 219, 219, 219, 239, 239, + 470, 304, 102, 100, 102, 102, 196, 304, 304,32767, + 102, 470, 304, 470, 304, 198, 304, 304, 304, 470, + 304,32767,32767, 102, 304, 210, 100, 100, 304,32767, + 32767,32767, 481,32767,32767,32767,32767,32767,32767,32767, + 32767,32767,32767,32767,32767,32767,32767, 511,32767, 528, + 541, 417, 418, 420, 526, 442, 443, 444, 445, 446, + 447, 448, 450, 573,32767, 485,32767,32767,32767,32767, + 324, 583,32767, 583,32767,32767,32767,32767,32767,32767, 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767, 507,32767,32767,32767, 274, 276, + 32767, 584,32767, 524,32767,32767,32767,32767, 416, 9, + 76, 43, 44, 52, 58, 502, 503, 504, 505, 499, + 500, 506, 501,32767,32767, 507, 549,32767,32767, 525, + 576,32767,32767,32767,32767,32767,32767, 139,32767,32767, + 32767,32767,32767,32767,32767,32767,32767,32767, 511,32767, + 137,32767,32767,32767,32767,32767,32767,32767,32767,32767, + 32767,32767, 524,32767,32767,32767, 300, 301,32767,32767, 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767,32767, 271,32767,32767, 350,32767,32767, - 32767,32767, 330,32767,32767,32767,32767,32767,32767,32767, - 32767,32767,32767, 149, 149, 3, 3, 312, 149, 149, - 149, 312, 149, 312, 312, 312, 149, 149, 149, 149, - 149, 149, 181, 249, 252, 234, 234, 149, 322, 149 + 32767,32767,32767, 524,32767,32767,32767, 283, 284,32767, + 32767,32767,32767,32767,32767,32767,32767,32767,32767,32767, + 32767,32767,32767, 278,32767,32767, 366,32767,32767,32767, + 32767, 345,32767,32767,32767,32767,32767,32767,32767,32767, + 32767,32767, 152, 152, 3, 3, 327, 152, 152, 152, + 327, 152, 327, 327, 327, 152, 152, 152, 152, 152, + 152, 272, 184, 254, 257, 239, 239, 152, 337, 152 ); protected $goto = array( - 191, 191, 661, 403, 634, 453, 1237, 1238, 397, 300, - 301, 321, 555, 306, 402, 322, 404, 613, 1038, 1039, - 669, 315, 315, 315, 315, 162, 162, 162, 162, 188, - 188, 172, 174, 215, 192, 210, 188, 188, 188, 188, - 188, 189, 189, 189, 189, 189, 189, 183, 184, 185, - 186, 187, 212, 210, 213, 513, 514, 393, 515, 517, - 518, 519, 520, 521, 522, 523, 524, 1065, 163, 164, - 165, 190, 166, 167, 168, 161, 169, 170, 171, 173, - 209, 211, 214, 232, 235, 238, 240, 251, 252, 253, - 254, 255, 256, 257, 259, 260, 261, 262, 269, 270, - 303, 304, 305, 398, 399, 400, 560, 216, 217, 218, - 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 175, 231, 176, 193, 194, 195, 233, 183, - 184, 185, 186, 187, 212, 1065, 196, 177, 178, 179, - 197, 193, 180, 234, 198, 160, 199, 200, 181, 201, - 202, 203, 182, 204, 205, 206, 207, 208, 814, 586, - 600, 603, 604, 605, 606, 625, 626, 627, 671, 811, - 599, 599, 539, 530, 577, 1194, 1194, 1194, 1194, 1194, - 1194, 1194, 1194, 1194, 1194, 280, 280, 280, 280, 997, - 332, 819, 812, 867, 862, 863, 876, 845, 820, 864, - 817, 865, 866, 818, 597, 631, 1144, 897, 788, 870, - 1145, 1148, 898, 1149, 367, 530, 871, 539, 872, 1018, - 1014, 1015, 792, 548, 549, 617, 617, 786, 374, 558, - 1159, 987, 984, 985, 579, 915, 383, 668, 1212, 1212, - 923, 593, 594, 1212, 1212, 1212, 1212, 1212, 1212, 1212, - 1212, 1212, 1212, 904, 975, 982, 983, 1163, 1163, 1163, - 979, 552, 792, 476, 792, 979, 979, 979, 979, 979, - 979, 979, 979, 979, 329, 396, 422, 588, 5, 1163, - 6, 422, 422, 14, 1163, 1163, 1163, 1163, 1160, 1252, - 1163, 1163, 1163, 1244, 1244, 1244, 1244, 944, 802, 363, - 335, 546, 551, 311, 295, 694, 612, 614, 883, 632, - 335, 335, 884, 651, 655, 958, 659, 667, 954, 1161, - 1220, 1221, 1239, 1240, 335, 335, 633, 335, 1113, 1279, - 365, 369, 540, 578, 582, 323, 1262, 1262, 1210, 1210, - 532, 804, 335, 1210, 1210, 1210, 1210, 1210, 1210, 1210, - 1210, 1210, 1210, 1262, 409, 422, 422, 422, 422, 422, - 422, 422, 422, 422, 422, 422, 832, 422, 1265, 373, - 525, 525, 525, 525, 545, 1223, 829, 516, 516, 581, - 966, 592, 516, 516, 516, 516, 516, 516, 516, 516, - 516, 516, 609, 610, 381, 382, 807, 807, 1156, 640, - 654, 641, 1003, 385, 386, 387, 628, 652, 642, 643, - 644, 388, 697, 531, 543, 454, 327, 1263, 1263, 531, - 841, 543, 442, 442, 366, 333, 334, 556, 591, 532, - 1234, 1234, 1234, 442, 1263, 527, 527, 527, 1007, 1048, - 267, 559, 447, 448, 449, 528, 528, 837, 928, 0, - 1270, 1271, 458, 1246, 1246, 1246, 1246, 430, 477, 0, - 478, 0, 917, 917, 917, 917, 485, 827, 430, 911, - 918, 810, 839, 0, 0, 826, 0, 835, 0, 1230, - 0, 0, 0, 947, 921, 921, 919, 921, 693, 486, - 529, 956, 951, 840, 828, 1002, 0, 0, 1006, 1158, - 888, 1053, 0, 807, 0, 0, 0, 0, 926, 596, - 0, 0, 0, 0, 963, 1005, 0, 0, 1232, 1232, - 1005, 0, 831, 0, 637, 942, 0, 0, 0, 0, - 825, 576, 1031, 916, 672, 658, 658, 0, 664, 1029, - 0, 0, 0, 1155, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 1046, 844, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 193, 193, 670, 421, 643, 1022, 1290, 1290, 824, 415, + 307, 308, 328, 563, 313, 420, 329, 422, 622, 801, + 678, 341, 586, 1290, 825, 164, 164, 164, 164, 217, + 194, 190, 190, 174, 176, 212, 190, 190, 190, 190, + 190, 191, 191, 191, 191, 191, 191, 185, 186, 187, + 188, 189, 214, 212, 215, 521, 522, 411, 523, 525, + 526, 527, 528, 529, 530, 531, 532, 1091, 165, 166, + 167, 192, 168, 169, 170, 163, 171, 172, 173, 175, + 211, 213, 216, 234, 237, 240, 241, 243, 254, 255, + 256, 257, 258, 259, 260, 262, 263, 264, 265, 273, + 274, 310, 311, 312, 416, 417, 418, 568, 218, 219, + 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 177, 233, 178, 195, 196, 197, 235, + 185, 186, 187, 188, 189, 214, 1091, 198, 179, 180, + 181, 199, 195, 182, 236, 200, 198, 162, 201, 202, + 183, 203, 204, 205, 184, 206, 207, 208, 209, 210, + 322, 322, 322, 322, 827, 608, 608, 858, 547, 538, + 1186, 1221, 1221, 1221, 1221, 1221, 1221, 1221, 1221, 1221, + 1221, 1239, 1239, 462, 1264, 1265, 799, 1239, 1239, 1239, + 1239, 1239, 1239, 1239, 1239, 1239, 1239, 387, 538, 547, + 556, 557, 394, 566, 588, 602, 603, 832, 938, 880, + 875, 876, 889, 14, 833, 877, 830, 878, 879, 831, + 453, 453, 884, 883, 885, 1187, 250, 250, 560, 453, + 1237, 1237, 815, 1043, 1039, 1040, 1237, 1237, 1237, 1237, + 1237, 1237, 1237, 1237, 1237, 1237, 820, 820, 1188, 1247, + 1248, 247, 247, 247, 247, 249, 251, 342, 343, 339, + 1190, 1190, 997, 1190, 997, 1279, 930, 401, 677, 997, + 997, 997, 997, 997, 997, 997, 997, 997, 997, 997, + 997, 1261, 1261, 414, 1261, 597, 1190, 287, 287, 287, + 287, 1190, 1190, 1190, 1190, 959, 344, 1190, 1190, 1190, + 1271, 1271, 1271, 1271, 606, 640, 344, 344, 1273, 1273, + 1273, 1273, 1063, 1064, 637, 896, 651, 652, 653, 897, + 344, 344, 383, 344, 486, 1306, 487, 535, 535, 5, + 535, 6, 494, 559, 1257, 1140, 540, 524, 524, 344, + 318, 302, 642, 524, 524, 524, 524, 524, 524, 524, + 524, 524, 524, 444, 1266, 1267, 618, 619, 932, 932, + 932, 932, 820, 428, 444, 926, 933, 330, 533, 533, + 533, 533, 1030, 590, 817, 554, 1259, 1259, 1030, 704, + 621, 623, 845, 641, 1250, 805, 393, 660, 664, 973, + 668, 676, 969, 1183, 553, 842, 823, 1289, 1289, 564, + 600, 601, 385, 389, 548, 587, 591, 663, 962, 936, + 936, 934, 936, 703, 1289, 537, 971, 966, 438, 901, + 1079, 981, 1028, 438, 438, 805, 605, 805, 707, 854, + 1292, 978, 463, 539, 551, 1074, 467, 540, 539, 844, + 551, 646, 957, 386, 1171, 912, 1032, 838, 1172, 1175, + 913, 1176, 943, 567, 456, 457, 458, 0, 850, 0, + 1182, 1297, 1298, 253, 253, 0, 399, 400, 0, 0, + 0, 649, 0, 650, 423, 403, 404, 405, 840, 661, + 0, 423, 0, 406, 0, 0, 848, 337, 1009, 1002, + 1006, 1003, 1007, 852, 0, 0, 839, 1185, 495, 0, + 0, 0, 0, 438, 438, 438, 438, 438, 438, 438, + 438, 438, 438, 438, 0, 0, 438, 595, 609, 612, + 613, 614, 615, 634, 635, 636, 680, 853, 841, 1027, + 1031, 585, 1056, 0, 681, 667, 667, 941, 673, 1054, + 0, 0, 0, 0, 0, 271, 0, 0, 0, 0, + 536, 536, 919, 992, 1000, 1004, 1001, 1005, 0, 0, + 931, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 961, 961 + 976, 976, 0, 1072, 857 ); protected $gotoCheck = array( - 41, 41, 71, 64, 64, 160, 160, 160, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, 130, 130, - 8, 22, 22, 22, 22, 41, 41, 41, 41, 41, - 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, - 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, - 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, - 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, - 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, - 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, - 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, - 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, - 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, - 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, - 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, - 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, - 41, 41, 41, 41, 41, 41, 41, 41, 14, 77, - 77, 77, 77, 77, 77, 77, 77, 77, 77, 25, - 102, 102, 74, 74, 116, 102, 102, 102, 102, 102, - 102, 102, 102, 102, 102, 23, 23, 23, 23, 113, - 91, 14, 26, 14, 14, 14, 14, 44, 14, 14, - 14, 14, 14, 14, 54, 54, 76, 76, 6, 14, - 76, 76, 76, 76, 74, 74, 63, 74, 63, 14, - 14, 14, 11, 74, 74, 109, 109, 5, 74, 74, - 19, 109, 109, 109, 74, 87, 87, 87, 154, 154, - 48, 74, 74, 154, 154, 154, 154, 154, 154, 154, - 154, 154, 154, 85, 85, 85, 85, 71, 71, 71, - 71, 156, 11, 74, 11, 71, 71, 71, 71, 71, - 71, 71, 71, 71, 163, 12, 22, 12, 45, 71, - 45, 22, 22, 74, 71, 71, 71, 71, 19, 165, - 71, 71, 71, 8, 8, 8, 8, 97, 19, 60, - 13, 47, 98, 153, 153, 47, 47, 47, 71, 47, - 13, 13, 71, 47, 47, 47, 47, 47, 47, 19, - 19, 19, 162, 162, 13, 13, 62, 13, 137, 13, - 57, 57, 57, 57, 57, 28, 166, 166, 155, 155, - 13, 17, 13, 155, 155, 155, 155, 155, 155, 155, - 155, 155, 155, 166, 106, 22, 22, 22, 22, 22, - 22, 22, 22, 22, 22, 22, 38, 22, 166, 27, - 101, 101, 101, 101, 8, 13, 36, 157, 157, 101, - 104, 8, 157, 157, 157, 157, 157, 157, 157, 157, - 157, 157, 81, 81, 78, 78, 21, 21, 146, 78, - 13, 78, 115, 78, 78, 78, 82, 78, 82, 82, - 82, 78, 93, 8, 8, 143, 78, 167, 167, 8, - 40, 8, 135, 135, 8, 91, 91, 2, 2, 13, - 116, 116, 116, 135, 167, 18, 18, 18, 118, 133, - 23, 8, 8, 8, 8, 23, 23, 8, 90, -1, - 8, 8, 80, 116, 116, 116, 116, 18, 141, -1, - 141, -1, 18, 18, 18, 18, 141, 34, 18, 18, - 18, 24, 34, -1, -1, 34, -1, 8, -1, 116, - -1, -1, -1, 24, 24, 24, 24, 24, 24, 8, - 24, 24, 24, 15, 15, 15, -1, -1, 15, 13, - 16, 16, -1, 21, -1, -1, -1, -1, 15, 16, - -1, -1, -1, -1, 16, 116, -1, -1, 116, 116, - 116, -1, 16, -1, 16, 16, -1, -1, -1, -1, - 16, 7, 7, 15, 7, 7, 7, -1, 7, 7, - -1, -1, -1, 16, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 15, 15, -1, + 42, 42, 72, 65, 65, 119, 173, 173, 26, 65, + 65, 65, 65, 65, 65, 65, 65, 65, 65, 7, + 9, 93, 122, 173, 27, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 23, 23, 23, 23, 15, 104, 104, 45, 75, 75, + 20, 104, 104, 104, 104, 104, 104, 104, 104, 104, + 104, 160, 160, 166, 166, 166, 6, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 75, 75, 75, + 75, 75, 75, 75, 75, 75, 75, 15, 49, 15, + 15, 15, 15, 75, 15, 15, 15, 15, 15, 15, + 141, 141, 64, 15, 64, 20, 5, 5, 162, 141, + 161, 161, 20, 15, 15, 15, 161, 161, 161, 161, + 161, 161, 161, 161, 161, 161, 22, 22, 20, 20, + 20, 5, 5, 5, 5, 5, 5, 93, 93, 169, + 72, 72, 72, 72, 72, 171, 89, 89, 89, 72, + 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, + 72, 122, 122, 13, 122, 13, 72, 24, 24, 24, + 24, 72, 72, 72, 72, 99, 14, 72, 72, 72, + 9, 9, 9, 9, 55, 55, 14, 14, 122, 122, + 122, 122, 136, 136, 84, 72, 84, 84, 84, 72, + 14, 14, 61, 14, 147, 14, 147, 19, 19, 46, + 19, 46, 147, 100, 122, 143, 14, 163, 163, 14, + 159, 159, 63, 163, 163, 163, 163, 163, 163, 163, + 163, 163, 163, 19, 168, 168, 83, 83, 19, 19, + 19, 19, 22, 109, 19, 19, 19, 29, 103, 103, + 103, 103, 122, 103, 18, 48, 122, 122, 122, 48, + 48, 48, 39, 48, 14, 12, 28, 48, 48, 48, + 48, 48, 48, 152, 9, 37, 25, 172, 172, 2, + 2, 9, 58, 58, 58, 58, 58, 14, 25, 25, + 25, 25, 25, 25, 172, 25, 25, 25, 23, 17, + 17, 106, 121, 23, 23, 12, 17, 12, 95, 41, + 172, 17, 149, 9, 9, 139, 82, 14, 9, 17, + 9, 17, 17, 9, 78, 78, 124, 17, 78, 78, + 78, 78, 92, 9, 9, 9, 9, -1, 9, -1, + 17, 9, 9, 5, 5, -1, 80, 80, -1, -1, + -1, 80, -1, 80, 113, 80, 80, 80, 35, 80, + -1, 113, -1, 80, -1, -1, 9, 80, 113, 113, + 113, 113, 113, 35, -1, -1, 35, 14, 9, -1, + -1, -1, -1, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, -1, -1, 23, 79, 79, 79, + 79, 79, 79, 79, 79, 79, 79, 16, 16, 16, + 16, 8, 8, -1, 8, 8, 8, 16, 8, 8, + -1, -1, -1, -1, -1, 24, -1, -1, -1, -1, + 24, 24, 87, 87, 87, 87, 87, 87, -1, -1, + 16, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 101, 101 + 103, 103, -1, 16, 16 ); protected $gotoBase = array( - 0, 0, -248, 0, 0, 214, 199, 524, 7, 0, - 0, -61, -48, 16, -170, 69, 59, 45, 172, -132, - 0, 81, 18, 182, 467, 165, 188, 46, 52, 0, - 0, 0, 0, 0, 117, 0, 51, 0, 56, 0, - 8, -1, 0, 0, 185, -419, 0, -373, 218, 0, - 0, 0, 0, 0, 166, 0, 0, 287, 0, 0, - 259, 0, 89, 198, -233, 0, 0, 0, 0, 0, - 0, -6, 0, 0, -204, 0, -175, -179, -74, 0, - -2, -65, -275, 0, 0, -20, 0, -56, 0, 0, - 34, -270, 0, 32, 0, 0, 0, 266, 261, 0, - 0, 344, -66, 0, 31, 0, 82, 0, 0, -46, - 0, 0, 0, 187, 0, 49, 167, 0, 25, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - -249, 0, 0, 24, 0, 392, 0, 63, 0, 0, - 0, -14, 0, 4, 0, 0, -10, 0, 0, 0, - 0, 0, 0, -5, 2, 102, 234, 141, 0, 0, - -282, 0, -29, 246, 0, 260, 42, 123, 0, 0 + 0, 0, -285, 0, 0, 225, 173, 10, 524, 7, + 0, 0, 95, -47, 5, -174, 87, -33, 71, 61, + -212, 0, -76, 157, 284, 392, 4, 20, 56, 77, + 0, 0, 0, 0, 0, 118, 0, 63, 0, 65, + 0, -2, -1, 0, 0, 155, -378, 0, -308, 186, + 0, 0, 0, 0, 0, 266, 0, 0, 359, 0, + 0, 282, 0, 103, 204, -235, 0, 0, 0, 0, + 0, 0, -6, 0, 0, -167, 0, 0, 45, 170, + -11, 0, -27, -110, -376, 0, 0, 276, 0, -32, + 0, 0, 19, -448, 0, 30, 0, 0, 0, 262, + 292, 0, 0, 342, -73, 0, 62, 0, 0, 88, + 0, 0, 0, 206, 0, 0, 0, 0, 0, 3, + 0, 59, 15, 0, 14, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 41, 0, 0, 1, + 0, 188, 0, 66, 0, 0, 0, -157, 0, 2, + 0, 0, 35, 0, 0, 0, 0, 0, 0, 25, + -57, -8, 201, 99, 0, 0, -111, 0, -7, 231, + 0, 236, 96, -295, 0, 0 ); protected $gotoDefault = array( - -32768, 491, 701, 4, 702, 776, 784, 575, 507, 670, - 328, 601, 394, 1228, 869, 1052, 557, 803, 1172, 1180, - 431, 806, 316, 330, 851, 852, 853, 370, 355, 361, - 368, 623, 602, 471, 838, 425, 830, 463, 833, 424, - 842, 159, 391, 489, 846, 3, 848, 534, 879, 356, - 856, 357, 647, 858, 542, 860, 861, 364, 371, 372, - 1057, 550, 598, 873, 239, 544, 874, 354, 875, 882, - 359, 362, 656, 441, 483, 384, 1033, 585, 620, 437, - 457, 608, 607, 595, 456, 638, 389, 913, 464, 439, - 927, 331, 935, 699, 1064, 615, 466, 943, 616, 950, - 953, 508, 509, 455, 965, 271, 467, 992, 639, 977, - 618, 990, 450, 996, 426, 1004, 1216, 429, 1008, 258, - 1011, 272, 390, 405, 1016, 1017, 8, 1023, 662, 663, - 10, 268, 488, 1047, 657, 423, 1063, 410, 1132, 1134, - 536, 468, 1152, 1151, 650, 484, 1157, 1219, 420, 510, - 451, 302, 511, 294, 319, 299, 526, 281, 320, 512, - 452, 1225, 1233, 317, 29, 1253, 1264, 326, 554, 590 + -32768, 499, 711, 4, 712, 905, 788, 797, 583, 515, + 679, 338, 610, 412, 1255, 882, 1078, 565, 816, 1199, + 1207, 445, 819, 323, 701, 864, 865, 866, 390, 375, + 381, 388, 632, 611, 480, 851, 441, 843, 472, 846, + 440, 855, 161, 409, 497, 859, 3, 861, 542, 892, + 376, 869, 377, 656, 871, 550, 873, 874, 384, 391, + 392, 1083, 558, 607, 886, 242, 552, 887, 374, 888, + 895, 379, 382, 665, 452, 492, 485, 402, 1058, 594, + 629, 449, 466, 617, 616, 604, 465, 424, 407, 928, + 473, 450, 942, 340, 950, 709, 1090, 624, 475, 958, + 625, 965, 968, 516, 517, 464, 980, 268, 983, 476, + 1015, 647, 648, 995, 626, 627, 1013, 459, 584, 1021, + 442, 1029, 1243, 443, 1033, 261, 1036, 275, 408, 425, + 1041, 1042, 8, 1048, 671, 672, 10, 272, 496, 1073, + 666, 439, 1089, 429, 1159, 1161, 544, 477, 1179, 1178, + 659, 493, 1184, 1246, 437, 518, 460, 309, 519, 301, + 326, 306, 534, 288, 327, 520, 461, 1252, 1260, 324, + 29, 1280, 1291, 334, 562, 599 ); protected $ruleToNonTerminal = array( - 0, 1, 3, 3, 2, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, - 6, 6, 6, 7, 7, 8, 9, 10, 10, 10, - 11, 11, 12, 12, 13, 14, 14, 15, 15, 16, - 16, 17, 17, 20, 20, 21, 22, 22, 23, 23, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 28, 28, 29, 29, 31, 33, 33, 27, 35, - 35, 32, 37, 37, 34, 34, 36, 36, 38, 38, - 30, 39, 39, 40, 42, 43, 43, 44, 45, 45, - 47, 46, 46, 46, 46, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 24, - 24, 67, 67, 70, 70, 69, 68, 68, 61, 73, - 73, 74, 74, 75, 75, 76, 76, 25, 25, 26, - 26, 26, 26, 84, 84, 86, 86, 79, 79, 79, - 80, 80, 83, 83, 81, 81, 87, 88, 88, 55, - 55, 63, 63, 66, 66, 66, 65, 89, 89, 90, - 56, 56, 56, 56, 91, 91, 92, 92, 93, 93, - 94, 95, 95, 96, 96, 97, 97, 53, 53, 49, - 49, 99, 51, 51, 100, 50, 50, 52, 52, 62, - 62, 62, 62, 77, 77, 103, 103, 105, 105, 105, - 105, 104, 104, 104, 107, 107, 107, 85, 85, 109, - 109, 109, 108, 108, 110, 110, 111, 111, 111, 106, - 106, 78, 78, 78, 19, 19, 112, 112, 113, 113, - 113, 113, 58, 114, 114, 115, 59, 117, 117, 118, - 118, 119, 119, 82, 120, 120, 120, 120, 120, 120, - 125, 125, 126, 126, 127, 127, 127, 127, 127, 128, - 129, 129, 124, 124, 121, 121, 123, 123, 131, 131, - 130, 130, 130, 130, 130, 130, 122, 132, 132, 134, - 133, 133, 60, 98, 135, 135, 54, 54, 41, 41, - 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, - 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, - 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, - 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, - 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, - 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, - 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, - 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, - 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, - 142, 136, 136, 141, 141, 144, 145, 145, 146, 147, - 147, 147, 18, 18, 71, 71, 71, 71, 137, 137, - 137, 137, 149, 149, 138, 138, 140, 140, 140, 143, - 143, 154, 154, 154, 154, 154, 154, 154, 154, 154, - 155, 155, 102, 157, 157, 157, 157, 139, 139, 139, - 139, 139, 139, 139, 139, 57, 57, 152, 152, 152, - 152, 158, 158, 148, 148, 148, 159, 159, 159, 159, - 159, 159, 72, 72, 64, 64, 64, 64, 116, 116, - 116, 116, 162, 161, 151, 151, 151, 151, 151, 151, - 151, 150, 150, 150, 160, 160, 160, 160, 101, 156, - 164, 164, 163, 163, 165, 165, 165, 165, 165, 165, - 165, 165, 153, 153, 153, 153, 167, 168, 166, 166, - 166, 166, 166, 166, 166, 166, 169, 169, 169, 169 + 0, 1, 3, 3, 2, 5, 5, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, + 7, 7, 7, 7, 7, 7, 8, 8, 9, 10, + 11, 11, 11, 12, 12, 13, 13, 14, 15, 15, + 16, 16, 17, 17, 18, 18, 21, 21, 22, 23, + 23, 24, 24, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 29, 29, 30, 30, 32, 34, + 34, 28, 36, 36, 33, 38, 38, 35, 35, 37, + 37, 39, 39, 31, 40, 40, 41, 43, 44, 44, + 45, 46, 46, 48, 47, 47, 47, 47, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 25, 25, 68, 68, 71, 71, 70, 69, + 69, 62, 74, 74, 75, 75, 76, 76, 77, 77, + 78, 78, 26, 26, 27, 27, 27, 27, 86, 86, + 88, 88, 81, 81, 81, 82, 82, 85, 85, 83, + 83, 89, 90, 90, 56, 56, 64, 64, 67, 67, + 67, 66, 91, 91, 92, 57, 57, 57, 57, 93, + 93, 94, 94, 95, 95, 96, 97, 97, 98, 98, + 99, 99, 54, 54, 50, 50, 101, 52, 52, 102, + 51, 51, 53, 53, 63, 63, 63, 63, 79, 79, + 105, 105, 107, 107, 108, 108, 108, 108, 106, 106, + 106, 110, 110, 110, 110, 87, 87, 113, 113, 113, + 111, 111, 114, 114, 112, 112, 115, 115, 116, 116, + 116, 116, 109, 109, 80, 80, 80, 20, 20, 20, + 118, 117, 117, 119, 119, 119, 119, 59, 120, 120, + 121, 60, 123, 123, 124, 124, 125, 125, 84, 126, + 126, 126, 126, 126, 126, 131, 131, 132, 132, 133, + 133, 133, 133, 133, 134, 135, 135, 130, 130, 127, + 127, 129, 129, 137, 137, 136, 136, 136, 136, 136, + 136, 136, 128, 138, 138, 140, 139, 139, 61, 100, + 141, 141, 55, 55, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 148, 142, 142, + 147, 147, 150, 151, 151, 152, 153, 153, 153, 19, + 19, 72, 72, 72, 72, 143, 143, 143, 143, 155, + 155, 144, 144, 146, 146, 146, 149, 149, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 161, 161, 104, + 163, 163, 163, 163, 145, 145, 145, 145, 145, 145, + 145, 145, 58, 58, 158, 158, 158, 158, 164, 164, + 154, 154, 154, 165, 165, 165, 165, 165, 165, 73, + 73, 65, 65, 65, 65, 122, 122, 122, 122, 168, + 167, 157, 157, 157, 157, 157, 157, 157, 156, 156, + 156, 166, 166, 166, 166, 103, 162, 170, 170, 169, + 169, 171, 171, 171, 171, 171, 171, 171, 171, 159, + 159, 159, 159, 173, 174, 172, 172, 172, 172, 172, + 172, 172, 172, 175, 175, 175, 175 ); protected $ruleToLength = array( @@ -905,55 +918,57 @@ class Php7 extends \PhpParser\ParserAbstract 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, - 1, 1, 2, 1, 3, 4, 1, 2, 0, 1, - 1, 1, 1, 1, 3, 5, 4, 3, 4, 2, - 3, 1, 1, 7, 6, 2, 3, 1, 2, 3, - 1, 2, 3, 1, 1, 3, 1, 3, 1, 2, - 2, 3, 1, 3, 2, 3, 1, 3, 2, 0, - 1, 1, 1, 1, 1, 3, 7, 10, 5, 7, - 9, 5, 3, 3, 3, 3, 3, 3, 1, 2, - 5, 7, 9, 6, 5, 6, 3, 2, 1, 1, - 1, 0, 2, 1, 3, 8, 0, 4, 2, 1, - 3, 0, 1, 0, 1, 3, 1, 8, 9, 8, - 7, 6, 8, 0, 2, 0, 2, 1, 2, 2, - 0, 2, 0, 2, 0, 2, 2, 1, 3, 1, - 4, 1, 4, 1, 1, 4, 2, 1, 3, 3, - 3, 4, 4, 5, 0, 2, 4, 3, 1, 1, - 7, 0, 2, 1, 3, 3, 4, 1, 4, 0, - 2, 5, 0, 2, 6, 0, 2, 0, 3, 1, - 2, 1, 1, 2, 0, 1, 3, 0, 1, 1, - 1, 6, 8, 6, 1, 2, 1, 1, 1, 1, - 1, 1, 3, 3, 3, 3, 1, 2, 1, 0, - 1, 0, 2, 2, 2, 4, 1, 3, 1, 2, - 2, 3, 2, 3, 1, 1, 2, 3, 1, 1, - 3, 2, 0, 1, 5, 5, 10, 3, 5, 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, 2, 3, 1, 0, 1, 1, 3, - 3, 3, 4, 1, 1, 2, 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, 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, 2, 8, 9, 8, 9, 9, 10, 9, 10, - 8, 3, 2, 0, 4, 2, 1, 3, 2, 2, - 2, 4, 1, 1, 1, 1, 1, 1, 1, 1, - 3, 1, 1, 1, 0, 3, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 3, 3, 3, 4, 1, 1, 3, 1, 1, 1, - 1, 1, 3, 2, 3, 0, 1, 1, 3, 1, - 1, 1, 1, 1, 3, 1, 1, 4, 4, 1, - 4, 4, 0, 1, 1, 1, 3, 3, 1, 4, - 2, 2, 1, 3, 1, 4, 4, 3, 3, 3, - 3, 1, 3, 1, 1, 3, 1, 1, 4, 1, - 1, 1, 3, 1, 1, 2, 1, 3, 4, 3, - 2, 0, 2, 2, 1, 2, 1, 1, 1, 4, - 3, 3, 3, 3, 6, 3, 1, 1, 2, 1 + 0, 1, 0, 1, 1, 2, 1, 3, 4, 1, + 2, 0, 1, 1, 1, 1, 1, 3, 5, 4, + 3, 4, 2, 3, 1, 1, 7, 6, 2, 3, + 1, 2, 3, 1, 2, 3, 1, 1, 3, 1, + 3, 1, 2, 2, 3, 1, 3, 2, 3, 1, + 3, 2, 0, 1, 1, 1, 1, 1, 3, 7, + 10, 5, 7, 9, 5, 3, 3, 3, 3, 3, + 3, 1, 2, 5, 7, 9, 6, 5, 6, 3, + 2, 1, 1, 1, 0, 2, 1, 3, 8, 0, + 4, 2, 1, 3, 0, 1, 0, 1, 0, 1, + 3, 1, 8, 9, 8, 7, 6, 8, 0, 2, + 0, 2, 1, 2, 2, 0, 2, 0, 2, 0, + 2, 2, 1, 3, 1, 4, 1, 4, 1, 1, + 4, 2, 1, 3, 3, 3, 4, 4, 5, 0, + 2, 4, 3, 1, 1, 7, 0, 2, 1, 3, + 3, 4, 1, 4, 0, 2, 5, 0, 2, 6, + 0, 2, 0, 3, 1, 2, 1, 1, 2, 0, + 1, 3, 0, 2, 1, 1, 1, 1, 6, 8, + 6, 1, 2, 1, 1, 1, 1, 1, 1, 1, + 3, 3, 3, 3, 3, 3, 3, 3, 1, 2, + 1, 1, 0, 1, 0, 2, 2, 2, 4, 3, + 1, 1, 3, 1, 2, 2, 3, 2, 3, 1, + 1, 2, 3, 1, 1, 3, 2, 0, 1, 5, + 5, 10, 3, 5, 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, 1, 2, 1, 3, 1, 1, 3, 2, 2, + 3, 1, 0, 1, 1, 3, 3, 3, 4, 1, + 1, 2, 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, + 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, 2, 8, + 9, 8, 9, 9, 10, 9, 10, 8, 3, 2, + 0, 4, 2, 1, 3, 2, 2, 2, 4, 1, + 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, + 1, 0, 3, 0, 1, 1, 0, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, + 4, 1, 1, 3, 1, 1, 1, 1, 1, 3, + 2, 3, 0, 1, 1, 3, 1, 1, 1, 1, + 1, 3, 1, 1, 4, 4, 1, 4, 4, 0, + 1, 1, 1, 3, 3, 1, 4, 2, 2, 1, + 3, 1, 4, 4, 3, 3, 3, 3, 1, 3, + 1, 1, 3, 1, 1, 4, 1, 1, 1, 3, + 1, 1, 2, 1, 3, 4, 3, 2, 0, 2, + 2, 1, 2, 1, 1, 1, 4, 3, 3, 3, + 3, 6, 3, 1, 1, 2, 1 ); protected function initReduceCallbacks() { @@ -1209,25 +1224,25 @@ protected function initReduceCallbacks() { $this->semValue = $this->semStack[$stackPos]; }, 83 => function ($stackPos) { - $this->semValue = new Node\Identifier($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = $this->semStack[$stackPos]; }, 84 => function ($stackPos) { - $this->semValue = new Node\Identifier($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = $this->semStack[$stackPos]; }, 85 => function ($stackPos) { - $this->semValue = new Node\Identifier($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = $this->semStack[$stackPos]; }, 86 => function ($stackPos) { $this->semValue = new Node\Identifier($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 87 => function ($stackPos) { - $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = new Node\Identifier($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 88 => function ($stackPos) { - $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = new Node\Identifier($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 89 => function ($stackPos) { - $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = new Node\Identifier($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 90 => function ($stackPos) { $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); @@ -1236,118 +1251,118 @@ protected function initReduceCallbacks() { $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 92 => 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); }, 93 => function ($stackPos) { - $this->semValue = new Name(substr($this->semStack[$stackPos-(1-1)], 1), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 94 => function ($stackPos) { - $this->semValue = new Expr\Variable(substr($this->semStack[$stackPos-(1-1)], 1), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 95 => function ($stackPos) { - /* nothing */ + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 96 => function ($stackPos) { - /* nothing */ + $this->semValue = new Name(substr($this->semStack[$stackPos-(1-1)], 1), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 97 => function ($stackPos) { - /* nothing */ + $this->semValue = new Expr\Variable(substr($this->semStack[$stackPos-(1-1)], 1), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 98 => function ($stackPos) { - $this->emitError(new Error('A trailing comma is not allowed here', $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes)); + /* nothing */ }, 99 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; + /* nothing */ }, 100 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos]; + /* nothing */ }, 101 => function ($stackPos) { - $this->semValue = new Node\Attribute($this->semStack[$stackPos-(1-1)], [], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->emitError(new Error('A trailing comma is not allowed here', $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes)); }, 102 => function ($stackPos) { - $this->semValue = new Node\Attribute($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); + $this->semValue = $this->semStack[$stackPos]; }, 103 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); + $this->semValue = $this->semStack[$stackPos]; }, 104 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + $this->semValue = new Node\Attribute($this->semStack[$stackPos-(1-1)], [], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, 105 => function ($stackPos) { - $this->semValue = new Node\AttributeGroup($this->semStack[$stackPos-(4-2)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); + $this->semValue = new Node\Attribute($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, 106 => function ($stackPos) { $this->semValue = array($this->semStack[$stackPos-(1-1)]); }, 107 => function ($stackPos) { - $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; }, 108 => function ($stackPos) { - $this->semValue = []; + $this->semValue = new Node\AttributeGroup($this->semStack[$stackPos-(4-2)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, 109 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = array($this->semStack[$stackPos-(1-1)]); }, 110 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; }, 111 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; + $this->semValue = []; }, 112 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 113 => function ($stackPos) { - $this->semValue = new Stmt\HaltCompiler($this->lexer->handleHaltCompiler(), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + $this->semValue = $this->semStack[$stackPos-(1-1)]; }, 114 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(1-1)]; + }, + 115 => function ($stackPos) { + $this->semValue = $this->semStack[$stackPos-(1-1)]; + }, + 116 => function ($stackPos) { + $this->semValue = new Stmt\HaltCompiler($this->lexer->handleHaltCompiler(), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + }, + 117 => function ($stackPos) { $this->semValue = new Stmt\Namespace_($this->semStack[$stackPos-(3-2)], null, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); $this->semValue->setAttribute('kind', Stmt\Namespace_::KIND_SEMICOLON); $this->checkNamespace($this->semValue); }, - 115 => function ($stackPos) { + 118 => function ($stackPos) { $this->semValue = new Stmt\Namespace_($this->semStack[$stackPos-(5-2)], $this->semStack[$stackPos-(5-4)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); $this->semValue->setAttribute('kind', Stmt\Namespace_::KIND_BRACED); $this->checkNamespace($this->semValue); }, - 116 => function ($stackPos) { + 119 => function ($stackPos) { $this->semValue = new Stmt\Namespace_(null, $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); $this->semValue->setAttribute('kind', Stmt\Namespace_::KIND_BRACED); $this->checkNamespace($this->semValue); }, - 117 => function ($stackPos) { - $this->semValue = new Stmt\Use_($this->semStack[$stackPos-(3-2)], Stmt\Use_::TYPE_NORMAL, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); - }, - 118 => function ($stackPos) { - $this->semValue = new Stmt\Use_($this->semStack[$stackPos-(4-3)], $this->semStack[$stackPos-(4-2)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); - }, - 119 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; - }, 120 => function ($stackPos) { - $this->semValue = new Stmt\Const_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = new Stmt\Use_($this->semStack[$stackPos-(3-2)], Stmt\Use_::TYPE_NORMAL, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 121 => function ($stackPos) { - $this->semValue = Stmt\Use_::TYPE_FUNCTION; + $this->semValue = new Stmt\Use_($this->semStack[$stackPos-(4-3)], $this->semStack[$stackPos-(4-2)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, 122 => function ($stackPos) { - $this->semValue = Stmt\Use_::TYPE_CONSTANT; + $this->semValue = $this->semStack[$stackPos-(2-1)]; }, 123 => function ($stackPos) { - $this->semValue = new Stmt\GroupUse($this->semStack[$stackPos-(7-3)], $this->semStack[$stackPos-(7-6)], $this->semStack[$stackPos-(7-2)], $this->startAttributeStack[$stackPos-(7-1)] + $this->endAttributes); + $this->semValue = new Stmt\Const_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 124 => function ($stackPos) { - $this->semValue = new Stmt\GroupUse($this->semStack[$stackPos-(6-2)], $this->semStack[$stackPos-(6-5)], Stmt\Use_::TYPE_UNKNOWN, $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); + $this->semValue = Stmt\Use_::TYPE_FUNCTION; }, 125 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; + $this->semValue = Stmt\Use_::TYPE_CONSTANT; }, 126 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + $this->semValue = new Stmt\GroupUse($this->semStack[$stackPos-(7-3)], $this->semStack[$stackPos-(7-6)], $this->semStack[$stackPos-(7-2)], $this->startAttributeStack[$stackPos-(7-1)] + $this->endAttributes); }, 127 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); + $this->semValue = new Stmt\GroupUse($this->semStack[$stackPos-(6-2)], $this->semStack[$stackPos-(6-5)], Stmt\Use_::TYPE_UNKNOWN, $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); }, 128 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(2-1)]; @@ -1368,70 +1383,79 @@ protected function initReduceCallbacks() { $this->semValue = array($this->semStack[$stackPos-(1-1)]); }, 134 => function ($stackPos) { - $this->semValue = new Stmt\UseUse($this->semStack[$stackPos-(1-1)], null, Stmt\Use_::TYPE_UNKNOWN, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); $this->checkUseUse($this->semValue, $stackPos-(1-1)); + $this->semValue = $this->semStack[$stackPos-(2-1)]; }, 135 => function ($stackPos) { - $this->semValue = new Stmt\UseUse($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], Stmt\Use_::TYPE_UNKNOWN, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); $this->checkUseUse($this->semValue, $stackPos-(3-3)); + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; }, 136 => function ($stackPos) { - $this->semValue = new Stmt\UseUse($this->semStack[$stackPos-(1-1)], null, Stmt\Use_::TYPE_UNKNOWN, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); $this->checkUseUse($this->semValue, $stackPos-(1-1)); + $this->semValue = array($this->semStack[$stackPos-(1-1)]); }, 137 => function ($stackPos) { - $this->semValue = new Stmt\UseUse($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], Stmt\Use_::TYPE_UNKNOWN, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); $this->checkUseUse($this->semValue, $stackPos-(3-3)); + $this->semValue = new Stmt\UseUse($this->semStack[$stackPos-(1-1)], null, Stmt\Use_::TYPE_UNKNOWN, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); $this->checkUseUse($this->semValue, $stackPos-(1-1)); }, 138 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(1-1)]; $this->semValue->type = Stmt\Use_::TYPE_NORMAL; + $this->semValue = new Stmt\UseUse($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], Stmt\Use_::TYPE_UNKNOWN, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); $this->checkUseUse($this->semValue, $stackPos-(3-3)); }, 139 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-2)]; $this->semValue->type = $this->semStack[$stackPos-(2-1)]; + $this->semValue = new Stmt\UseUse($this->semStack[$stackPos-(1-1)], null, Stmt\Use_::TYPE_UNKNOWN, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); $this->checkUseUse($this->semValue, $stackPos-(1-1)); }, 140 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; + $this->semValue = new Stmt\UseUse($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], Stmt\Use_::TYPE_UNKNOWN, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); $this->checkUseUse($this->semValue, $stackPos-(3-3)); }, 141 => function ($stackPos) { - $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + $this->semValue = $this->semStack[$stackPos-(1-1)]; $this->semValue->type = Stmt\Use_::TYPE_NORMAL; }, 142 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); + $this->semValue = $this->semStack[$stackPos-(2-2)]; $this->semValue->type = $this->semStack[$stackPos-(2-1)]; }, 143 => function ($stackPos) { - $this->semValue = new Node\Const_($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = $this->semStack[$stackPos-(2-1)]; }, 144 => function ($stackPos) { - $this->semValue = $this->semStack[$stackPos-(2-1)]; + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; }, 145 => 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)]); }, 146 => function ($stackPos) { - $this->semValue = array($this->semStack[$stackPos-(1-1)]); + $this->semValue = new Node\Const_($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, 147 => function ($stackPos) { - $this->semValue = new Node\Const_($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + $this->semValue = $this->semStack[$stackPos-(2-1)]; }, 148 => function ($stackPos) { - if (is_array($this->semStack[$stackPos-(2-2)])) { $this->semValue = array_merge($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)]); } else { $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; }; + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; }, 149 => function ($stackPos) { - $this->semValue = array(); + $this->semValue = array($this->semStack[$stackPos-(1-1)]); }, 150 => function ($stackPos) { + $this->semValue = new Node\Const_($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); + }, + 151 => function ($stackPos) { + if (is_array($this->semStack[$stackPos-(2-2)])) { $this->semValue = array_merge($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)]); } else { $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; }; + }, + 152 => function ($stackPos) { + $this->semValue = array(); + }, + 153 => function ($stackPos) { $startAttributes = $this->lookaheadStartAttributes; if (isset($startAttributes['comments'])) { $nop = new Stmt\Nop($this->createCommentNopAttributes($startAttributes['comments'])); } else { $nop = null; }; if ($nop !== null) { $this->semStack[$stackPos-(1-1)][] = $nop; } $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 151 => function ($stackPos) { + 154 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 152 => function ($stackPos) { + 155 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 153 => function ($stackPos) { + 156 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 154 => function ($stackPos) { + 157 => function ($stackPos) { throw new Error('__HALT_COMPILER() can only be used from the outermost scope', $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 155 => function ($stackPos) { + 158 => function ($stackPos) { if ($this->semStack[$stackPos-(3-2)]) { $this->semValue = $this->semStack[$stackPos-(3-2)]; $attrs = $this->startAttributeStack[$stackPos-(3-1)]; $stmts = $this->semValue; if (!empty($attrs['comments'])) {$stmts[0]->setAttribute('comments', array_merge($attrs['comments'], $stmts[0]->getAttribute('comments', []))); }; @@ -1441,46 +1465,46 @@ protected function initReduceCallbacks() { } }, - 156 => function ($stackPos) { + 159 => function ($stackPos) { $this->semValue = new Stmt\If_($this->semStack[$stackPos-(7-3)], ['stmts' => is_array($this->semStack[$stackPos-(7-5)]) ? $this->semStack[$stackPos-(7-5)] : array($this->semStack[$stackPos-(7-5)]), 'elseifs' => $this->semStack[$stackPos-(7-6)], 'else' => $this->semStack[$stackPos-(7-7)]], $this->startAttributeStack[$stackPos-(7-1)] + $this->endAttributes); }, - 157 => function ($stackPos) { + 160 => function ($stackPos) { $this->semValue = new Stmt\If_($this->semStack[$stackPos-(10-3)], ['stmts' => $this->semStack[$stackPos-(10-6)], 'elseifs' => $this->semStack[$stackPos-(10-7)], 'else' => $this->semStack[$stackPos-(10-8)]], $this->startAttributeStack[$stackPos-(10-1)] + $this->endAttributes); }, - 158 => function ($stackPos) { + 161 => function ($stackPos) { $this->semValue = new Stmt\While_($this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-5)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); }, - 159 => function ($stackPos) { + 162 => function ($stackPos) { $this->semValue = new Stmt\Do_($this->semStack[$stackPos-(7-5)], is_array($this->semStack[$stackPos-(7-2)]) ? $this->semStack[$stackPos-(7-2)] : array($this->semStack[$stackPos-(7-2)]), $this->startAttributeStack[$stackPos-(7-1)] + $this->endAttributes); }, - 160 => function ($stackPos) { + 163 => function ($stackPos) { $this->semValue = new Stmt\For_(['init' => $this->semStack[$stackPos-(9-3)], 'cond' => $this->semStack[$stackPos-(9-5)], 'loop' => $this->semStack[$stackPos-(9-7)], 'stmts' => $this->semStack[$stackPos-(9-9)]], $this->startAttributeStack[$stackPos-(9-1)] + $this->endAttributes); }, - 161 => function ($stackPos) { + 164 => function ($stackPos) { $this->semValue = new Stmt\Switch_($this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-5)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); }, - 162 => function ($stackPos) { + 165 => function ($stackPos) { $this->semValue = new Stmt\Break_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 163 => function ($stackPos) { + 166 => function ($stackPos) { $this->semValue = new Stmt\Continue_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 164 => function ($stackPos) { + 167 => function ($stackPos) { $this->semValue = new Stmt\Return_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 165 => function ($stackPos) { + 168 => function ($stackPos) { $this->semValue = new Stmt\Global_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 166 => function ($stackPos) { + 169 => function ($stackPos) { $this->semValue = new Stmt\Static_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 167 => function ($stackPos) { + 170 => function ($stackPos) { $this->semValue = new Stmt\Echo_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 168 => function ($stackPos) { + 171 => function ($stackPos) { $this->semValue = new Stmt\InlineHTML($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 169 => function ($stackPos) { + 172 => function ($stackPos) { $e = $this->semStack[$stackPos-(2-1)]; if ($e instanceof Expr\Throw_) { @@ -1492,1253 +1516,1295 @@ protected function initReduceCallbacks() { } }, - 170 => function ($stackPos) { + 173 => function ($stackPos) { $this->semValue = new Stmt\Unset_($this->semStack[$stackPos-(5-3)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); }, - 171 => function ($stackPos) { + 174 => function ($stackPos) { $this->semValue = new Stmt\Foreach_($this->semStack[$stackPos-(7-3)], $this->semStack[$stackPos-(7-5)][0], ['keyVar' => null, 'byRef' => $this->semStack[$stackPos-(7-5)][1], 'stmts' => $this->semStack[$stackPos-(7-7)]], $this->startAttributeStack[$stackPos-(7-1)] + $this->endAttributes); }, - 172 => function ($stackPos) { + 175 => function ($stackPos) { $this->semValue = new Stmt\Foreach_($this->semStack[$stackPos-(9-3)], $this->semStack[$stackPos-(9-7)][0], ['keyVar' => $this->semStack[$stackPos-(9-5)], 'byRef' => $this->semStack[$stackPos-(9-7)][1], 'stmts' => $this->semStack[$stackPos-(9-9)]], $this->startAttributeStack[$stackPos-(9-1)] + $this->endAttributes); }, - 173 => function ($stackPos) { + 176 => function ($stackPos) { $this->semValue = new Stmt\Foreach_($this->semStack[$stackPos-(6-3)], new Expr\Error($this->startAttributeStack[$stackPos-(6-4)] + $this->endAttributeStack[$stackPos-(6-4)]), ['stmts' => $this->semStack[$stackPos-(6-6)]], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); }, - 174 => function ($stackPos) { + 177 => function ($stackPos) { $this->semValue = new Stmt\Declare_($this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-5)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); }, - 175 => function ($stackPos) { + 178 => function ($stackPos) { $this->semValue = new Stmt\TryCatch($this->semStack[$stackPos-(6-3)], $this->semStack[$stackPos-(6-5)], $this->semStack[$stackPos-(6-6)], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); $this->checkTryCatch($this->semValue); }, - 176 => function ($stackPos) { + 179 => function ($stackPos) { $this->semValue = new Stmt\Goto_($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 177 => function ($stackPos) { + 180 => function ($stackPos) { $this->semValue = new Stmt\Label($this->semStack[$stackPos-(2-1)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 178 => function ($stackPos) { + 181 => function ($stackPos) { $this->semValue = array(); /* means: no statement */ }, - 179 => function ($stackPos) { + 182 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 180 => function ($stackPos) { + 183 => function ($stackPos) { $startAttributes = $this->startAttributeStack[$stackPos-(1-1)]; if (isset($startAttributes['comments'])) { $this->semValue = new Stmt\Nop($startAttributes + $this->endAttributes); } else { $this->semValue = null; }; if ($this->semValue === null) $this->semValue = array(); /* means: no statement */ }, - 181 => function ($stackPos) { + 184 => function ($stackPos) { $this->semValue = array(); }, - 182 => function ($stackPos) { + 185 => function ($stackPos) { $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; }, - 183 => function ($stackPos) { + 186 => function ($stackPos) { $this->semValue = array($this->semStack[$stackPos-(1-1)]); }, - 184 => function ($stackPos) { + 187 => function ($stackPos) { $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; }, - 185 => function ($stackPos) { + 188 => function ($stackPos) { $this->semValue = new Stmt\Catch_($this->semStack[$stackPos-(8-3)], $this->semStack[$stackPos-(8-4)], $this->semStack[$stackPos-(8-7)], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes); }, - 186 => function ($stackPos) { + 189 => function ($stackPos) { $this->semValue = null; }, - 187 => function ($stackPos) { + 190 => function ($stackPos) { $this->semValue = new Stmt\Finally_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, - 188 => function ($stackPos) { + 191 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(2-1)]; }, - 189 => function ($stackPos) { + 192 => function ($stackPos) { $this->semValue = array($this->semStack[$stackPos-(1-1)]); }, - 190 => function ($stackPos) { + 193 => function ($stackPos) { $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; }, - 191 => function ($stackPos) { + 194 => function ($stackPos) { $this->semValue = false; }, - 192 => function ($stackPos) { + 195 => function ($stackPos) { $this->semValue = true; }, - 193 => function ($stackPos) { + 196 => function ($stackPos) { $this->semValue = false; }, - 194 => function ($stackPos) { + 197 => function ($stackPos) { $this->semValue = true; }, - 195 => function ($stackPos) { + 198 => function ($stackPos) { + $this->semValue = false; + }, + 199 => function ($stackPos) { + $this->semValue = true; + }, + 200 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(3-2)]; }, - 196 => function ($stackPos) { + 201 => function ($stackPos) { $this->semValue = []; }, - 197 => function ($stackPos) { + 202 => function ($stackPos) { $this->semValue = new Stmt\Function_($this->semStack[$stackPos-(8-3)], ['byRef' => $this->semStack[$stackPos-(8-2)], 'params' => $this->semStack[$stackPos-(8-5)], 'returnType' => $this->semStack[$stackPos-(8-7)], 'stmts' => $this->semStack[$stackPos-(8-8)], 'attrGroups' => []], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes); }, - 198 => function ($stackPos) { + 203 => function ($stackPos) { $this->semValue = new Stmt\Function_($this->semStack[$stackPos-(9-4)], ['byRef' => $this->semStack[$stackPos-(9-3)], 'params' => $this->semStack[$stackPos-(9-6)], 'returnType' => $this->semStack[$stackPos-(9-8)], 'stmts' => $this->semStack[$stackPos-(9-9)], 'attrGroups' => $this->semStack[$stackPos-(9-1)]], $this->startAttributeStack[$stackPos-(9-1)] + $this->endAttributes); }, - 199 => function ($stackPos) { + 204 => function ($stackPos) { $this->semValue = new Stmt\Class_($this->semStack[$stackPos-(8-3)], ['type' => $this->semStack[$stackPos-(8-2)], 'extends' => $this->semStack[$stackPos-(8-4)], 'implements' => $this->semStack[$stackPos-(8-5)], 'stmts' => $this->semStack[$stackPos-(8-7)], 'attrGroups' => $this->semStack[$stackPos-(8-1)]], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes); $this->checkClass($this->semValue, $stackPos-(8-3)); }, - 200 => function ($stackPos) { + 205 => function ($stackPos) { $this->semValue = new Stmt\Interface_($this->semStack[$stackPos-(7-3)], ['extends' => $this->semStack[$stackPos-(7-4)], 'stmts' => $this->semStack[$stackPos-(7-6)], 'attrGroups' => $this->semStack[$stackPos-(7-1)]], $this->startAttributeStack[$stackPos-(7-1)] + $this->endAttributes); $this->checkInterface($this->semValue, $stackPos-(7-3)); }, - 201 => function ($stackPos) { + 206 => function ($stackPos) { $this->semValue = new Stmt\Trait_($this->semStack[$stackPos-(6-3)], ['stmts' => $this->semStack[$stackPos-(6-5)], 'attrGroups' => $this->semStack[$stackPos-(6-1)]], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); }, - 202 => function ($stackPos) { + 207 => function ($stackPos) { $this->semValue = new Stmt\Enum_($this->semStack[$stackPos-(8-3)], ['scalarType' => $this->semStack[$stackPos-(8-4)], 'implements' => $this->semStack[$stackPos-(8-5)], 'stmts' => $this->semStack[$stackPos-(8-7)], 'attrGroups' => $this->semStack[$stackPos-(8-1)]], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes); $this->checkEnum($this->semValue, $stackPos-(8-3)); }, - 203 => function ($stackPos) { + 208 => function ($stackPos) { $this->semValue = null; }, - 204 => function ($stackPos) { + 209 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(2-2)]; }, - 205 => function ($stackPos) { + 210 => function ($stackPos) { $this->semValue = null; }, - 206 => function ($stackPos) { + 211 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(2-2)]; }, - 207 => function ($stackPos) { + 212 => function ($stackPos) { $this->semValue = 0; }, - 208 => function ($stackPos) { + 213 => function ($stackPos) { $this->semValue = Stmt\Class_::MODIFIER_ABSTRACT; }, - 209 => function ($stackPos) { + 214 => function ($stackPos) { $this->semValue = Stmt\Class_::MODIFIER_FINAL; }, - 210 => function ($stackPos) { + 215 => function ($stackPos) { $this->semValue = null; }, - 211 => function ($stackPos) { + 216 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(2-2)]; }, - 212 => function ($stackPos) { + 217 => function ($stackPos) { $this->semValue = array(); }, - 213 => function ($stackPos) { + 218 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(2-2)]; }, - 214 => function ($stackPos) { + 219 => function ($stackPos) { $this->semValue = array(); }, - 215 => function ($stackPos) { + 220 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(2-2)]; }, - 216 => function ($stackPos) { + 221 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(2-1)]; }, - 217 => function ($stackPos) { + 222 => function ($stackPos) { $this->semValue = array($this->semStack[$stackPos-(1-1)]); }, - 218 => function ($stackPos) { + 223 => function ($stackPos) { $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; }, - 219 => function ($stackPos) { + 224 => function ($stackPos) { $this->semValue = is_array($this->semStack[$stackPos-(1-1)]) ? $this->semStack[$stackPos-(1-1)] : array($this->semStack[$stackPos-(1-1)]); }, - 220 => function ($stackPos) { + 225 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(4-2)]; }, - 221 => function ($stackPos) { + 226 => function ($stackPos) { $this->semValue = is_array($this->semStack[$stackPos-(1-1)]) ? $this->semStack[$stackPos-(1-1)] : array($this->semStack[$stackPos-(1-1)]); }, - 222 => function ($stackPos) { + 227 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(4-2)]; }, - 223 => function ($stackPos) { + 228 => function ($stackPos) { $this->semValue = is_array($this->semStack[$stackPos-(1-1)]) ? $this->semStack[$stackPos-(1-1)] : array($this->semStack[$stackPos-(1-1)]); }, - 224 => function ($stackPos) { + 229 => function ($stackPos) { $this->semValue = null; }, - 225 => function ($stackPos) { + 230 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(4-2)]; }, - 226 => function ($stackPos) { + 231 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(2-1)]; }, - 227 => function ($stackPos) { + 232 => function ($stackPos) { $this->semValue = array($this->semStack[$stackPos-(1-1)]); }, - 228 => function ($stackPos) { + 233 => function ($stackPos) { $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; }, - 229 => function ($stackPos) { + 234 => function ($stackPos) { $this->semValue = new Stmt\DeclareDeclare($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 230 => function ($stackPos) { + 235 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(3-2)]; }, - 231 => function ($stackPos) { + 236 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(4-3)]; }, - 232 => function ($stackPos) { + 237 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(4-2)]; }, - 233 => function ($stackPos) { + 238 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(5-3)]; }, - 234 => function ($stackPos) { + 239 => function ($stackPos) { $this->semValue = array(); }, - 235 => function ($stackPos) { + 240 => function ($stackPos) { $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; }, - 236 => function ($stackPos) { + 241 => function ($stackPos) { $this->semValue = new Stmt\Case_($this->semStack[$stackPos-(4-2)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, - 237 => function ($stackPos) { + 242 => function ($stackPos) { $this->semValue = new Stmt\Case_(null, $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 238 => function ($stackPos) { + 243 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos]; }, - 239 => function ($stackPos) { + 244 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos]; }, - 240 => function ($stackPos) { + 245 => function ($stackPos) { $this->semValue = new Expr\Match_($this->semStack[$stackPos-(7-3)], $this->semStack[$stackPos-(7-6)], $this->startAttributeStack[$stackPos-(7-1)] + $this->endAttributes); }, - 241 => function ($stackPos) { + 246 => function ($stackPos) { $this->semValue = []; }, - 242 => function ($stackPos) { + 247 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(2-1)]; }, - 243 => function ($stackPos) { + 248 => function ($stackPos) { $this->semValue = array($this->semStack[$stackPos-(1-1)]); }, - 244 => function ($stackPos) { + 249 => function ($stackPos) { $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; }, - 245 => function ($stackPos) { + 250 => function ($stackPos) { $this->semValue = new Node\MatchArm($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 246 => function ($stackPos) { + 251 => function ($stackPos) { $this->semValue = new Node\MatchArm(null, $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, - 247 => function ($stackPos) { + 252 => function ($stackPos) { $this->semValue = is_array($this->semStack[$stackPos-(1-1)]) ? $this->semStack[$stackPos-(1-1)] : array($this->semStack[$stackPos-(1-1)]); }, - 248 => function ($stackPos) { + 253 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(4-2)]; }, - 249 => function ($stackPos) { + 254 => function ($stackPos) { $this->semValue = array(); }, - 250 => function ($stackPos) { + 255 => function ($stackPos) { $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; }, - 251 => function ($stackPos) { + 256 => function ($stackPos) { $this->semValue = new Stmt\ElseIf_($this->semStack[$stackPos-(5-3)], is_array($this->semStack[$stackPos-(5-5)]) ? $this->semStack[$stackPos-(5-5)] : array($this->semStack[$stackPos-(5-5)]), $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); }, - 252 => function ($stackPos) { + 257 => function ($stackPos) { $this->semValue = array(); }, - 253 => function ($stackPos) { + 258 => function ($stackPos) { $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; }, - 254 => function ($stackPos) { + 259 => function ($stackPos) { $this->semValue = new Stmt\ElseIf_($this->semStack[$stackPos-(6-3)], $this->semStack[$stackPos-(6-6)], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); }, - 255 => function ($stackPos) { + 260 => function ($stackPos) { $this->semValue = null; }, - 256 => function ($stackPos) { + 261 => function ($stackPos) { $this->semValue = new Stmt\Else_(is_array($this->semStack[$stackPos-(2-2)]) ? $this->semStack[$stackPos-(2-2)] : array($this->semStack[$stackPos-(2-2)]), $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 257 => function ($stackPos) { + 262 => function ($stackPos) { $this->semValue = null; }, - 258 => function ($stackPos) { + 263 => function ($stackPos) { $this->semValue = new Stmt\Else_($this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 259 => function ($stackPos) { + 264 => function ($stackPos) { $this->semValue = array($this->semStack[$stackPos-(1-1)], false); }, - 260 => function ($stackPos) { + 265 => function ($stackPos) { $this->semValue = array($this->semStack[$stackPos-(2-2)], true); }, - 261 => function ($stackPos) { + 266 => function ($stackPos) { $this->semValue = array($this->semStack[$stackPos-(1-1)], false); }, - 262 => function ($stackPos) { + 267 => function ($stackPos) { $this->semValue = array($this->semStack[$stackPos-(1-1)], false); }, - 263 => function ($stackPos) { + 268 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(2-1)]; }, - 264 => function ($stackPos) { + 269 => function ($stackPos) { $this->semValue = array(); }, - 265 => function ($stackPos) { + 270 => function ($stackPos) { $this->semValue = array($this->semStack[$stackPos-(1-1)]); }, - 266 => function ($stackPos) { + 271 => function ($stackPos) { $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; }, - 267 => function ($stackPos) { + 272 => function ($stackPos) { $this->semValue = 0; }, - 268 => function ($stackPos) { + 273 => 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)]; + }, + 274 => function ($stackPos) { $this->semValue = Stmt\Class_::MODIFIER_PUBLIC; }, - 269 => function ($stackPos) { + 275 => function ($stackPos) { $this->semValue = Stmt\Class_::MODIFIER_PROTECTED; }, - 270 => function ($stackPos) { + 276 => function ($stackPos) { $this->semValue = Stmt\Class_::MODIFIER_PRIVATE; }, - 271 => function ($stackPos) { + 277 => function ($stackPos) { + $this->semValue = Stmt\Class_::MODIFIER_READONLY; + }, + 278 => function ($stackPos) { $this->semValue = new Node\Param($this->semStack[$stackPos-(6-6)], null, $this->semStack[$stackPos-(6-3)], $this->semStack[$stackPos-(6-4)], $this->semStack[$stackPos-(6-5)], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes, $this->semStack[$stackPos-(6-2)], $this->semStack[$stackPos-(6-1)]); $this->checkParam($this->semValue); }, - 272 => function ($stackPos) { + 279 => function ($stackPos) { $this->semValue = new Node\Param($this->semStack[$stackPos-(8-6)], $this->semStack[$stackPos-(8-8)], $this->semStack[$stackPos-(8-3)], $this->semStack[$stackPos-(8-4)], $this->semStack[$stackPos-(8-5)], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes, $this->semStack[$stackPos-(8-2)], $this->semStack[$stackPos-(8-1)]); $this->checkParam($this->semValue); }, - 273 => function ($stackPos) { + 280 => function ($stackPos) { $this->semValue = new Node\Param(new Expr\Error($this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes), null, $this->semStack[$stackPos-(6-3)], $this->semStack[$stackPos-(6-4)], $this->semStack[$stackPos-(6-5)], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes, $this->semStack[$stackPos-(6-2)], $this->semStack[$stackPos-(6-1)]); }, - 274 => function ($stackPos) { + 281 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 275 => function ($stackPos) { + 282 => function ($stackPos) { $this->semValue = new Node\NullableType($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 276 => function ($stackPos) { + 283 => function ($stackPos) { $this->semValue = new Node\UnionType($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 277 => function ($stackPos) { + 284 => function ($stackPos) { + $this->semValue = new Node\IntersectionType($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + }, + 285 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 278 => function ($stackPos) { + 286 => function ($stackPos) { $this->semValue = new Node\Name('static', $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 279 => function ($stackPos) { + 287 => function ($stackPos) { $this->semValue = $this->handleBuiltinTypes($this->semStack[$stackPos-(1-1)]); }, - 280 => function ($stackPos) { + 288 => function ($stackPos) { $this->semValue = new Node\Identifier('array', $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 281 => function ($stackPos) { + 289 => function ($stackPos) { $this->semValue = new Node\Identifier('callable', $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 282 => function ($stackPos) { + 290 => function ($stackPos) { $this->semValue = array($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)]); }, - 283 => function ($stackPos) { + 291 => function ($stackPos) { $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; }, - 284 => function ($stackPos) { + 292 => function ($stackPos) { $this->semValue = array($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)]); }, - 285 => function ($stackPos) { + 293 => function ($stackPos) { $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; }, - 286 => function ($stackPos) { + 294 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)]); + }, + 295 => function ($stackPos) { + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + }, + 296 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)]); + }, + 297 => function ($stackPos) { + $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; + }, + 298 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 287 => function ($stackPos) { + 299 => function ($stackPos) { $this->semValue = new Node\NullableType($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 288 => function ($stackPos) { + 300 => function ($stackPos) { $this->semValue = new Node\UnionType($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 289 => function ($stackPos) { + 301 => function ($stackPos) { + $this->semValue = new Node\IntersectionType($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + }, + 302 => function ($stackPos) { $this->semValue = null; }, - 290 => function ($stackPos) { + 303 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 291 => function ($stackPos) { + 304 => function ($stackPos) { $this->semValue = null; }, - 292 => function ($stackPos) { + 305 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(2-2)]; }, - 293 => function ($stackPos) { + 306 => function ($stackPos) { $this->semValue = null; }, - 294 => function ($stackPos) { + 307 => function ($stackPos) { $this->semValue = array(); }, - 295 => function ($stackPos) { + 308 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(4-2)]; }, - 296 => function ($stackPos) { + 309 => function ($stackPos) { + $this->semValue = array($this->semStack[$stackPos-(3-2)]); + }, + 310 => function ($stackPos) { + $this->semValue = new Node\VariadicPlaceholder($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); + }, + 311 => function ($stackPos) { $this->semValue = array($this->semStack[$stackPos-(1-1)]); }, - 297 => function ($stackPos) { + 312 => function ($stackPos) { $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; }, - 298 => function ($stackPos) { + 313 => function ($stackPos) { $this->semValue = new Node\Arg($this->semStack[$stackPos-(1-1)], false, false, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 299 => function ($stackPos) { + 314 => function ($stackPos) { $this->semValue = new Node\Arg($this->semStack[$stackPos-(2-2)], true, false, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 300 => function ($stackPos) { + 315 => function ($stackPos) { $this->semValue = new Node\Arg($this->semStack[$stackPos-(2-2)], false, true, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 301 => function ($stackPos) { + 316 => function ($stackPos) { $this->semValue = new Node\Arg($this->semStack[$stackPos-(3-3)], false, false, $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes, $this->semStack[$stackPos-(3-1)]); }, - 302 => function ($stackPos) { + 317 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(2-1)]; }, - 303 => function ($stackPos) { + 318 => function ($stackPos) { $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; }, - 304 => function ($stackPos) { + 319 => function ($stackPos) { $this->semValue = array($this->semStack[$stackPos-(1-1)]); }, - 305 => function ($stackPos) { + 320 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 306 => function ($stackPos) { + 321 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(2-1)]; }, - 307 => function ($stackPos) { + 322 => function ($stackPos) { $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; }, - 308 => function ($stackPos) { + 323 => function ($stackPos) { $this->semValue = array($this->semStack[$stackPos-(1-1)]); }, - 309 => function ($stackPos) { + 324 => function ($stackPos) { $this->semValue = new Stmt\StaticVar($this->semStack[$stackPos-(1-1)], null, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 310 => function ($stackPos) { + 325 => function ($stackPos) { $this->semValue = new Stmt\StaticVar($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 311 => function ($stackPos) { + 326 => 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)]; } }, - 312 => function ($stackPos) { + 327 => function ($stackPos) { $this->semValue = array(); }, - 313 => function ($stackPos) { + 328 => function ($stackPos) { $startAttributes = $this->lookaheadStartAttributes; if (isset($startAttributes['comments'])) { $nop = new Stmt\Nop($this->createCommentNopAttributes($startAttributes['comments'])); } else { $nop = null; }; if ($nop !== null) { $this->semStack[$stackPos-(1-1)][] = $nop; } $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 314 => function ($stackPos) { + 329 => function ($stackPos) { $this->semValue = new Stmt\Property($this->semStack[$stackPos-(5-2)], $this->semStack[$stackPos-(5-4)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes, $this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-1)]); $this->checkProperty($this->semValue, $stackPos-(5-2)); }, - 315 => function ($stackPos) { + 330 => function ($stackPos) { $this->semValue = new Stmt\ClassConst($this->semStack[$stackPos-(5-4)], $this->semStack[$stackPos-(5-2)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes, $this->semStack[$stackPos-(5-1)]); $this->checkClassConst($this->semValue, $stackPos-(5-2)); }, - 316 => function ($stackPos) { + 331 => function ($stackPos) { $this->semValue = new Stmt\ClassMethod($this->semStack[$stackPos-(10-5)], ['type' => $this->semStack[$stackPos-(10-2)], 'byRef' => $this->semStack[$stackPos-(10-4)], 'params' => $this->semStack[$stackPos-(10-7)], 'returnType' => $this->semStack[$stackPos-(10-9)], 'stmts' => $this->semStack[$stackPos-(10-10)], 'attrGroups' => $this->semStack[$stackPos-(10-1)]], $this->startAttributeStack[$stackPos-(10-1)] + $this->endAttributes); $this->checkClassMethod($this->semValue, $stackPos-(10-2)); }, - 317 => function ($stackPos) { + 332 => function ($stackPos) { $this->semValue = new Stmt\TraitUse($this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 318 => function ($stackPos) { + 333 => function ($stackPos) { $this->semValue = new Stmt\EnumCase($this->semStack[$stackPos-(5-3)], $this->semStack[$stackPos-(5-4)], $this->semStack[$stackPos-(5-1)], $this->startAttributeStack[$stackPos-(5-1)] + $this->endAttributes); }, - 319 => function ($stackPos) { + 334 => function ($stackPos) { $this->semValue = null; /* will be skipped */ }, - 320 => function ($stackPos) { + 335 => function ($stackPos) { $this->semValue = array(); }, - 321 => function ($stackPos) { + 336 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(3-2)]; }, - 322 => function ($stackPos) { + 337 => function ($stackPos) { $this->semValue = array(); }, - 323 => function ($stackPos) { + 338 => function ($stackPos) { $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; }, - 324 => function ($stackPos) { + 339 => 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); }, - 325 => function ($stackPos) { + 340 => 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); }, - 326 => function ($stackPos) { + 341 => 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); }, - 327 => function ($stackPos) { + 342 => 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); }, - 328 => function ($stackPos) { + 343 => 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); }, - 329 => function ($stackPos) { + 344 => function ($stackPos) { $this->semValue = array($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)]); }, - 330 => function ($stackPos) { + 345 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 331 => function ($stackPos) { + 346 => function ($stackPos) { $this->semValue = array(null, $this->semStack[$stackPos-(1-1)]); }, - 332 => function ($stackPos) { + 347 => function ($stackPos) { $this->semValue = null; }, - 333 => function ($stackPos) { + 348 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 334 => function ($stackPos) { + 349 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 335 => function ($stackPos) { + 350 => function ($stackPos) { $this->semValue = 0; }, - 336 => function ($stackPos) { + 351 => function ($stackPos) { $this->semValue = 0; }, - 337 => function ($stackPos) { + 352 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 338 => function ($stackPos) { + 353 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 339 => function ($stackPos) { + 354 => 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)]; }, - 340 => function ($stackPos) { + 355 => function ($stackPos) { $this->semValue = Stmt\Class_::MODIFIER_PUBLIC; }, - 341 => function ($stackPos) { + 356 => function ($stackPos) { $this->semValue = Stmt\Class_::MODIFIER_PROTECTED; }, - 342 => function ($stackPos) { + 357 => function ($stackPos) { $this->semValue = Stmt\Class_::MODIFIER_PRIVATE; }, - 343 => function ($stackPos) { + 358 => function ($stackPos) { $this->semValue = Stmt\Class_::MODIFIER_STATIC; }, - 344 => function ($stackPos) { + 359 => function ($stackPos) { $this->semValue = Stmt\Class_::MODIFIER_ABSTRACT; }, - 345 => function ($stackPos) { + 360 => function ($stackPos) { $this->semValue = Stmt\Class_::MODIFIER_FINAL; }, - 346 => function ($stackPos) { + 361 => function ($stackPos) { + $this->semValue = Stmt\Class_::MODIFIER_READONLY; + }, + 362 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(2-1)]; }, - 347 => function ($stackPos) { + 363 => function ($stackPos) { $this->semValue = array($this->semStack[$stackPos-(1-1)]); }, - 348 => function ($stackPos) { + 364 => function ($stackPos) { $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; }, - 349 => function ($stackPos) { + 365 => function ($stackPos) { $this->semValue = new Node\VarLikeIdentifier(substr($this->semStack[$stackPos-(1-1)], 1), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 350 => function ($stackPos) { + 366 => function ($stackPos) { $this->semValue = new Stmt\PropertyProperty($this->semStack[$stackPos-(1-1)], null, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 351 => function ($stackPos) { + 367 => function ($stackPos) { $this->semValue = new Stmt\PropertyProperty($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 352 => function ($stackPos) { + 368 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(2-1)]; }, - 353 => function ($stackPos) { + 369 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(2-1)]; }, - 354 => function ($stackPos) { + 370 => function ($stackPos) { $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; }, - 355 => function ($stackPos) { + 371 => function ($stackPos) { $this->semValue = array($this->semStack[$stackPos-(1-1)]); }, - 356 => function ($stackPos) { + 372 => function ($stackPos) { $this->semValue = array(); }, - 357 => function ($stackPos) { + 373 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 358 => function ($stackPos) { + 374 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 359 => function ($stackPos) { + 375 => function ($stackPos) { $this->semValue = new Expr\Assign($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 360 => function ($stackPos) { + 376 => function ($stackPos) { $this->semValue = new Expr\Assign($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 361 => function ($stackPos) { + 377 => function ($stackPos) { $this->semValue = new Expr\Assign($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 362 => function ($stackPos) { + 378 => function ($stackPos) { $this->semValue = new Expr\AssignRef($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, - 363 => function ($stackPos) { + 379 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 364 => function ($stackPos) { + 380 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 365 => function ($stackPos) { + 381 => function ($stackPos) { $this->semValue = new Expr\Clone_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 366 => function ($stackPos) { + 382 => 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); }, - 367 => function ($stackPos) { + 383 => 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); }, - 368 => function ($stackPos) { + 384 => 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); }, - 369 => function ($stackPos) { + 385 => 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); }, - 370 => function ($stackPos) { + 386 => 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); }, - 371 => function ($stackPos) { + 387 => 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); }, - 372 => function ($stackPos) { + 388 => 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); }, - 373 => function ($stackPos) { + 389 => 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); }, - 374 => function ($stackPos) { + 390 => 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); }, - 375 => function ($stackPos) { + 391 => 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); }, - 376 => function ($stackPos) { + 392 => 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); }, - 377 => function ($stackPos) { + 393 => 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); }, - 378 => function ($stackPos) { + 394 => function ($stackPos) { $this->semValue = new Expr\AssignOp\Coalesce($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 379 => function ($stackPos) { + 395 => function ($stackPos) { $this->semValue = new Expr\PostInc($this->semStack[$stackPos-(2-1)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 380 => function ($stackPos) { + 396 => function ($stackPos) { $this->semValue = new Expr\PreInc($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 381 => function ($stackPos) { + 397 => function ($stackPos) { $this->semValue = new Expr\PostDec($this->semStack[$stackPos-(2-1)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 382 => function ($stackPos) { + 398 => function ($stackPos) { $this->semValue = new Expr\PreDec($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 383 => function ($stackPos) { + 399 => 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); }, - 384 => function ($stackPos) { + 400 => 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); }, - 385 => function ($stackPos) { + 401 => 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); }, - 386 => function ($stackPos) { + 402 => 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); }, - 387 => function ($stackPos) { + 403 => 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); }, - 388 => function ($stackPos) { + 404 => 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); }, - 389 => function ($stackPos) { + 405 => 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); }, - 390 => function ($stackPos) { + 406 => 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); + }, + 407 => 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); }, - 391 => function ($stackPos) { + 408 => 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); }, - 392 => function ($stackPos) { + 409 => 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); }, - 393 => function ($stackPos) { + 410 => 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); }, - 394 => function ($stackPos) { + 411 => 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); }, - 395 => function ($stackPos) { + 412 => 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); }, - 396 => function ($stackPos) { + 413 => 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); }, - 397 => function ($stackPos) { + 414 => 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); }, - 398 => function ($stackPos) { + 415 => 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); }, - 399 => function ($stackPos) { + 416 => 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); }, - 400 => function ($stackPos) { + 417 => function ($stackPos) { $this->semValue = new Expr\UnaryPlus($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 401 => function ($stackPos) { + 418 => function ($stackPos) { $this->semValue = new Expr\UnaryMinus($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 402 => function ($stackPos) { + 419 => function ($stackPos) { $this->semValue = new Expr\BooleanNot($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 403 => function ($stackPos) { + 420 => function ($stackPos) { $this->semValue = new Expr\BitwiseNot($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 404 => function ($stackPos) { + 421 => 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); }, - 405 => function ($stackPos) { + 422 => 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); }, - 406 => function ($stackPos) { + 423 => 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); }, - 407 => function ($stackPos) { + 424 => 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); }, - 408 => function ($stackPos) { + 425 => 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); }, - 409 => function ($stackPos) { + 426 => 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); }, - 410 => function ($stackPos) { + 427 => 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); }, - 411 => function ($stackPos) { + 428 => 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); }, - 412 => function ($stackPos) { + 429 => 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); }, - 413 => function ($stackPos) { + 430 => function ($stackPos) { $this->semValue = new Expr\Instanceof_($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 414 => function ($stackPos) { + 431 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(3-2)]; }, - 415 => function ($stackPos) { + 432 => 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); }, - 416 => function ($stackPos) { + 433 => 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); }, - 417 => function ($stackPos) { + 434 => 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); }, - 418 => function ($stackPos) { + 435 => function ($stackPos) { $this->semValue = new Expr\Isset_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, - 419 => function ($stackPos) { + 436 => function ($stackPos) { $this->semValue = new Expr\Empty_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, - 420 => function ($stackPos) { + 437 => function ($stackPos) { $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_INCLUDE, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 421 => function ($stackPos) { + 438 => function ($stackPos) { $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_INCLUDE_ONCE, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 422 => function ($stackPos) { + 439 => function ($stackPos) { $this->semValue = new Expr\Eval_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, - 423 => function ($stackPos) { + 440 => function ($stackPos) { $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_REQUIRE, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 424 => function ($stackPos) { + 441 => function ($stackPos) { $this->semValue = new Expr\Include_($this->semStack[$stackPos-(2-2)], Expr\Include_::TYPE_REQUIRE_ONCE, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 425 => function ($stackPos) { + 442 => function ($stackPos) { $this->semValue = new Expr\Cast\Int_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 426 => function ($stackPos) { + 443 => function ($stackPos) { $attrs = $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes; $attrs['kind'] = $this->getFloatCastKind($this->semStack[$stackPos-(2-1)]); $this->semValue = new Expr\Cast\Double($this->semStack[$stackPos-(2-2)], $attrs); }, - 427 => function ($stackPos) { + 444 => function ($stackPos) { $this->semValue = new Expr\Cast\String_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 428 => function ($stackPos) { + 445 => function ($stackPos) { $this->semValue = new Expr\Cast\Array_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 429 => function ($stackPos) { + 446 => function ($stackPos) { $this->semValue = new Expr\Cast\Object_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 430 => function ($stackPos) { + 447 => function ($stackPos) { $this->semValue = new Expr\Cast\Bool_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 431 => function ($stackPos) { + 448 => function ($stackPos) { $this->semValue = new Expr\Cast\Unset_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 432 => function ($stackPos) { + 449 => 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); }, - 433 => function ($stackPos) { + 450 => function ($stackPos) { $this->semValue = new Expr\ErrorSuppress($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 434 => function ($stackPos) { + 451 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 435 => function ($stackPos) { + 452 => function ($stackPos) { $this->semValue = new Expr\ShellExec($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 436 => function ($stackPos) { + 453 => function ($stackPos) { $this->semValue = new Expr\Print_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 437 => function ($stackPos) { + 454 => function ($stackPos) { $this->semValue = new Expr\Yield_(null, null, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 438 => function ($stackPos) { + 455 => function ($stackPos) { $this->semValue = new Expr\Yield_($this->semStack[$stackPos-(2-2)], null, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 439 => function ($stackPos) { + 456 => function ($stackPos) { $this->semValue = new Expr\Yield_($this->semStack[$stackPos-(4-4)], $this->semStack[$stackPos-(4-2)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, - 440 => function ($stackPos) { + 457 => function ($stackPos) { $this->semValue = new Expr\YieldFrom($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 441 => function ($stackPos) { + 458 => function ($stackPos) { $this->semValue = new Expr\Throw_($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 442 => function ($stackPos) { + 459 => function ($stackPos) { $this->semValue = new Expr\ArrowFunction(['static' => false, 'byRef' => $this->semStack[$stackPos-(8-2)], 'params' => $this->semStack[$stackPos-(8-4)], 'returnType' => $this->semStack[$stackPos-(8-6)], 'expr' => $this->semStack[$stackPos-(8-8)], 'attrGroups' => []], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes); }, - 443 => function ($stackPos) { + 460 => function ($stackPos) { $this->semValue = new Expr\ArrowFunction(['static' => true, 'byRef' => $this->semStack[$stackPos-(9-3)], 'params' => $this->semStack[$stackPos-(9-5)], 'returnType' => $this->semStack[$stackPos-(9-7)], 'expr' => $this->semStack[$stackPos-(9-9)], 'attrGroups' => []], $this->startAttributeStack[$stackPos-(9-1)] + $this->endAttributes); }, - 444 => function ($stackPos) { + 461 => 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)], 'attrGroups' => []], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes); }, - 445 => function ($stackPos) { + 462 => 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)], 'attrGroups' => []], $this->startAttributeStack[$stackPos-(9-1)] + $this->endAttributes); }, - 446 => function ($stackPos) { + 463 => function ($stackPos) { $this->semValue = new Expr\ArrowFunction(['static' => false, 'byRef' => $this->semStack[$stackPos-(9-3)], 'params' => $this->semStack[$stackPos-(9-5)], 'returnType' => $this->semStack[$stackPos-(9-7)], 'expr' => $this->semStack[$stackPos-(9-9)], 'attrGroups' => $this->semStack[$stackPos-(9-1)]], $this->startAttributeStack[$stackPos-(9-1)] + $this->endAttributes); }, - 447 => function ($stackPos) { + 464 => function ($stackPos) { $this->semValue = new Expr\ArrowFunction(['static' => true, 'byRef' => $this->semStack[$stackPos-(10-4)], 'params' => $this->semStack[$stackPos-(10-6)], 'returnType' => $this->semStack[$stackPos-(10-8)], 'expr' => $this->semStack[$stackPos-(10-10)], 'attrGroups' => $this->semStack[$stackPos-(10-1)]], $this->startAttributeStack[$stackPos-(10-1)] + $this->endAttributes); }, - 448 => function ($stackPos) { + 465 => function ($stackPos) { $this->semValue = new Expr\Closure(['static' => false, '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)], 'attrGroups' => $this->semStack[$stackPos-(9-1)]], $this->startAttributeStack[$stackPos-(9-1)] + $this->endAttributes); }, - 449 => function ($stackPos) { + 466 => function ($stackPos) { $this->semValue = new Expr\Closure(['static' => true, 'byRef' => $this->semStack[$stackPos-(10-4)], 'params' => $this->semStack[$stackPos-(10-6)], 'uses' => $this->semStack[$stackPos-(10-8)], 'returnType' => $this->semStack[$stackPos-(10-9)], 'stmts' => $this->semStack[$stackPos-(10-10)], 'attrGroups' => $this->semStack[$stackPos-(10-1)]], $this->startAttributeStack[$stackPos-(10-1)] + $this->endAttributes); }, - 450 => function ($stackPos) { + 467 => function ($stackPos) { $this->semValue = array(new Stmt\Class_(null, ['type' => 0, 'extends' => $this->semStack[$stackPos-(8-4)], 'implements' => $this->semStack[$stackPos-(8-5)], 'stmts' => $this->semStack[$stackPos-(8-7)], 'attrGroups' => $this->semStack[$stackPos-(8-1)]], $this->startAttributeStack[$stackPos-(8-1)] + $this->endAttributes), $this->semStack[$stackPos-(8-3)]); $this->checkClass($this->semValue[0], -1); }, - 451 => function ($stackPos) { + 468 => function ($stackPos) { $this->semValue = new Expr\New_($this->semStack[$stackPos-(3-2)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 452 => function ($stackPos) { + 469 => function ($stackPos) { list($class, $ctorArgs) = $this->semStack[$stackPos-(2-2)]; $this->semValue = new Expr\New_($class, $ctorArgs, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 453 => function ($stackPos) { + 470 => function ($stackPos) { $this->semValue = array(); }, - 454 => function ($stackPos) { + 471 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(4-3)]; }, - 455 => function ($stackPos) { + 472 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(2-1)]; }, - 456 => function ($stackPos) { + 473 => function ($stackPos) { $this->semValue = array($this->semStack[$stackPos-(1-1)]); }, - 457 => function ($stackPos) { + 474 => function ($stackPos) { $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; }, - 458 => function ($stackPos) { + 475 => function ($stackPos) { $this->semValue = new Expr\ClosureUse($this->semStack[$stackPos-(2-2)], $this->semStack[$stackPos-(2-1)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 459 => function ($stackPos) { + 476 => function ($stackPos) { $this->semValue = new Expr\FuncCall($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 460 => function ($stackPos) { + 477 => function ($stackPos) { $this->semValue = new Expr\FuncCall($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 461 => function ($stackPos) { + 478 => 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); }, - 462 => function ($stackPos) { + 479 => function ($stackPos) { $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 463 => function ($stackPos) { + 480 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 464 => function ($stackPos) { + 481 => function ($stackPos) { $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 465 => function ($stackPos) { + 482 => function ($stackPos) { $this->semValue = new Name($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 466 => function ($stackPos) { + 483 => function ($stackPos) { $this->semValue = new Name\FullyQualified(substr($this->semStack[$stackPos-(1-1)], 1), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 467 => function ($stackPos) { + 484 => function ($stackPos) { $this->semValue = new Name\Relative(substr($this->semStack[$stackPos-(1-1)], 10), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 468 => function ($stackPos) { + 485 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 469 => function ($stackPos) { + 486 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 470 => function ($stackPos) { + 487 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(3-2)]; }, - 471 => function ($stackPos) { + 488 => function ($stackPos) { $this->semValue = new Expr\Error($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); $this->errorState = 2; }, - 472 => function ($stackPos) { + 489 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 473 => function ($stackPos) { + 490 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 474 => function ($stackPos) { + 491 => function ($stackPos) { $this->semValue = null; }, - 475 => function ($stackPos) { + 492 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(3-2)]; }, - 476 => function ($stackPos) { + 493 => function ($stackPos) { $this->semValue = array(); }, - 477 => function ($stackPos) { + 494 => function ($stackPos) { $this->semValue = array(new Scalar\EncapsedStringPart(Scalar\String_::parseEscapeSequences($this->semStack[$stackPos-(1-1)], '`'), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes)); }, - 478 => function ($stackPos) { + 495 => 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)]; }, - 479 => function ($stackPos) { + 496 => function ($stackPos) { $this->semValue = array(); }, - 480 => function ($stackPos) { + 497 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 481 => function ($stackPos) { + 498 => function ($stackPos) { $this->semValue = new Expr\ConstFetch($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 482 => function ($stackPos) { + 499 => function ($stackPos) { $this->semValue = new Scalar\MagicConst\Line($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 483 => function ($stackPos) { + 500 => function ($stackPos) { $this->semValue = new Scalar\MagicConst\File($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 484 => function ($stackPos) { + 501 => function ($stackPos) { $this->semValue = new Scalar\MagicConst\Dir($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 485 => function ($stackPos) { + 502 => function ($stackPos) { $this->semValue = new Scalar\MagicConst\Class_($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 486 => function ($stackPos) { + 503 => function ($stackPos) { $this->semValue = new Scalar\MagicConst\Trait_($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 487 => function ($stackPos) { + 504 => function ($stackPos) { $this->semValue = new Scalar\MagicConst\Method($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 488 => function ($stackPos) { + 505 => function ($stackPos) { $this->semValue = new Scalar\MagicConst\Function_($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 489 => function ($stackPos) { + 506 => function ($stackPos) { $this->semValue = new Scalar\MagicConst\Namespace_($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 490 => function ($stackPos) { + 507 => function ($stackPos) { $this->semValue = new Expr\ClassConstFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 491 => function ($stackPos) { + 508 => 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; }, - 492 => function ($stackPos) { + 509 => 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); }, - 493 => function ($stackPos) { + 510 => 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); }, - 494 => function ($stackPos) { + 511 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 495 => function ($stackPos) { + 512 => 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); }, - 496 => function ($stackPos) { + 513 => 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); }, - 497 => function ($stackPos) { + 514 => function ($stackPos) { $this->semValue = $this->parseLNumber($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 498 => function ($stackPos) { + 515 => function ($stackPos) { $this->semValue = new Scalar\DNumber(Scalar\DNumber::parse($this->semStack[$stackPos-(1-1)]), $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 499 => function ($stackPos) { + 516 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 500 => function ($stackPos) { + 517 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 501 => function ($stackPos) { + 518 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 502 => function ($stackPos) { + 519 => 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); }, - 503 => function ($stackPos) { + 520 => 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); }, - 504 => function ($stackPos) { + 521 => 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); }, - 505 => function ($stackPos) { + 522 => function ($stackPos) { $this->semValue = null; }, - 506 => function ($stackPos) { + 523 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 507 => function ($stackPos) { + 524 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 508 => function ($stackPos) { + 525 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(3-2)]; }, - 509 => function ($stackPos) { + 526 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 510 => function ($stackPos) { + 527 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 511 => function ($stackPos) { + 528 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 512 => function ($stackPos) { + 529 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 513 => function ($stackPos) { + 530 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 514 => function ($stackPos) { + 531 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(3-2)]; }, - 515 => function ($stackPos) { + 532 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 516 => function ($stackPos) { + 533 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 517 => function ($stackPos) { + 534 => function ($stackPos) { $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, - 518 => function ($stackPos) { + 535 => function ($stackPos) { $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, - 519 => function ($stackPos) { + 536 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 520 => function ($stackPos) { + 537 => 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); }, - 521 => function ($stackPos) { + 538 => function ($stackPos) { $this->semValue = new Expr\NullsafeMethodCall($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->semStack[$stackPos-(4-4)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, - 522 => function ($stackPos) { + 539 => function ($stackPos) { $this->semValue = null; }, - 523 => function ($stackPos) { + 540 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 524 => function ($stackPos) { + 541 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 525 => function ($stackPos) { + 542 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 526 => function ($stackPos) { + 543 => function ($stackPos) { $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 527 => function ($stackPos) { + 544 => function ($stackPos) { $this->semValue = new Expr\NullsafePropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 528 => function ($stackPos) { + 545 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 529 => function ($stackPos) { + 546 => function ($stackPos) { $this->semValue = new Expr\Variable($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, - 530 => function ($stackPos) { + 547 => function ($stackPos) { $this->semValue = new Expr\Variable($this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 531 => function ($stackPos) { + 548 => function ($stackPos) { $this->semValue = new Expr\Variable(new Expr\Error($this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes), $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); $this->errorState = 2; }, - 532 => function ($stackPos) { + 549 => function ($stackPos) { $var = $this->semStack[$stackPos-(1-1)]->name; $this->semValue = \is_string($var) ? new Node\VarLikeIdentifier($var, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes) : $var; }, - 533 => function ($stackPos) { + 550 => function ($stackPos) { $this->semValue = new Expr\StaticPropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 534 => function ($stackPos) { + 551 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 535 => function ($stackPos) { + 552 => function ($stackPos) { $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, - 536 => function ($stackPos) { + 553 => function ($stackPos) { $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, - 537 => function ($stackPos) { + 554 => function ($stackPos) { $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 538 => function ($stackPos) { + 555 => function ($stackPos) { $this->semValue = new Expr\NullsafePropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 539 => function ($stackPos) { + 556 => function ($stackPos) { $this->semValue = new Expr\StaticPropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 540 => function ($stackPos) { + 557 => function ($stackPos) { $this->semValue = new Expr\StaticPropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 541 => function ($stackPos) { + 558 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 542 => function ($stackPos) { + 559 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(3-2)]; }, - 543 => function ($stackPos) { + 560 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 544 => function ($stackPos) { + 561 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 545 => function ($stackPos) { + 562 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(3-2)]; }, - 546 => function ($stackPos) { + 563 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 547 => function ($stackPos) { + 564 => function ($stackPos) { $this->semValue = new Expr\Error($this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); $this->errorState = 2; }, - 548 => function ($stackPos) { + 565 => function ($stackPos) { $this->semValue = new Expr\List_($this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, - 549 => function ($stackPos) { + 566 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; $end = count($this->semValue)-1; if ($this->semValue[$end] === null) array_pop($this->semValue); }, - 550 => function ($stackPos) { + 567 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos]; }, - 551 => function ($stackPos) { + 568 => function ($stackPos) { /* do nothing -- prevent default action of $$=$this->semStack[$1]. See $551. */ }, - 552 => function ($stackPos) { + 569 => function ($stackPos) { $this->semStack[$stackPos-(3-1)][] = $this->semStack[$stackPos-(3-3)]; $this->semValue = $this->semStack[$stackPos-(3-1)]; }, - 553 => function ($stackPos) { + 570 => function ($stackPos) { $this->semValue = array($this->semStack[$stackPos-(1-1)]); }, - 554 => function ($stackPos) { + 571 => function ($stackPos) { $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(1-1)], null, false, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 555 => function ($stackPos) { + 572 => function ($stackPos) { $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(2-2)], null, true, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 556 => function ($stackPos) { + 573 => function ($stackPos) { $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(1-1)], null, false, $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 557 => function ($stackPos) { + 574 => 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); }, - 558 => function ($stackPos) { + 575 => 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); }, - 559 => function ($stackPos) { + 576 => 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); }, - 560 => function ($stackPos) { + 577 => function ($stackPos) { $this->semValue = new Expr\ArrayItem($this->semStack[$stackPos-(2-2)], null, false, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes, true, $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 561 => function ($stackPos) { + 578 => function ($stackPos) { $this->semValue = null; }, - 562 => function ($stackPos) { + 579 => function ($stackPos) { $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; }, - 563 => function ($stackPos) { + 580 => function ($stackPos) { $this->semStack[$stackPos-(2-1)][] = $this->semStack[$stackPos-(2-2)]; $this->semValue = $this->semStack[$stackPos-(2-1)]; }, - 564 => function ($stackPos) { + 581 => function ($stackPos) { $this->semValue = array($this->semStack[$stackPos-(1-1)]); }, - 565 => function ($stackPos) { + 582 => function ($stackPos) { $this->semValue = array($this->semStack[$stackPos-(2-1)], $this->semStack[$stackPos-(2-2)]); }, - 566 => function ($stackPos) { + 583 => function ($stackPos) { $this->semValue = new Scalar\EncapsedStringPart($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 567 => function ($stackPos) { + 584 => function ($stackPos) { $this->semValue = new Expr\Variable($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 568 => function ($stackPos) { + 585 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, - 569 => function ($stackPos) { + 586 => function ($stackPos) { $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(4-1)], $this->semStack[$stackPos-(4-3)], $this->startAttributeStack[$stackPos-(4-1)] + $this->endAttributes); }, - 570 => function ($stackPos) { + 587 => function ($stackPos) { $this->semValue = new Expr\PropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 571 => function ($stackPos) { + 588 => function ($stackPos) { $this->semValue = new Expr\NullsafePropertyFetch($this->semStack[$stackPos-(3-1)], $this->semStack[$stackPos-(3-3)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 572 => function ($stackPos) { + 589 => function ($stackPos) { $this->semValue = new Expr\Variable($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 573 => function ($stackPos) { + 590 => function ($stackPos) { $this->semValue = new Expr\Variable($this->semStack[$stackPos-(3-2)], $this->startAttributeStack[$stackPos-(3-1)] + $this->endAttributes); }, - 574 => function ($stackPos) { + 591 => function ($stackPos) { $this->semValue = new Expr\ArrayDimFetch($this->semStack[$stackPos-(6-2)], $this->semStack[$stackPos-(6-4)], $this->startAttributeStack[$stackPos-(6-1)] + $this->endAttributes); }, - 575 => function ($stackPos) { + 592 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(3-2)]; }, - 576 => function ($stackPos) { + 593 => function ($stackPos) { $this->semValue = new Scalar\String_($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 577 => function ($stackPos) { + 594 => function ($stackPos) { $this->semValue = $this->parseNumString($this->semStack[$stackPos-(1-1)], $this->startAttributeStack[$stackPos-(1-1)] + $this->endAttributes); }, - 578 => function ($stackPos) { + 595 => function ($stackPos) { $this->semValue = $this->parseNumString('-' . $this->semStack[$stackPos-(2-2)], $this->startAttributeStack[$stackPos-(2-1)] + $this->endAttributes); }, - 579 => function ($stackPos) { + 596 => function ($stackPos) { $this->semValue = $this->semStack[$stackPos-(1-1)]; }, ]; diff --git a/app/vendor/nikic/php-parser/lib/PhpParser/Parser/Tokens.php b/app/vendor/nikic/php-parser/lib/PhpParser/Parser/Tokens.php index ed5ead224..b76a5d94c 100644 --- a/app/vendor/nikic/php-parser/lib/PhpParser/Parser/Tokens.php +++ b/app/vendor/nikic/php-parser/lib/PhpParser/Parser/Tokens.php @@ -35,111 +35,114 @@ final class Tokens const T_COALESCE = 283; const T_BOOLEAN_OR = 284; const T_BOOLEAN_AND = 285; - const T_IS_EQUAL = 286; - const T_IS_NOT_EQUAL = 287; - const T_IS_IDENTICAL = 288; - const T_IS_NOT_IDENTICAL = 289; - const T_SPACESHIP = 290; - const T_IS_SMALLER_OR_EQUAL = 291; - const T_IS_GREATER_OR_EQUAL = 292; - const T_SL = 293; - const T_SR = 294; - const T_INSTANCEOF = 295; - const T_INC = 296; - const T_DEC = 297; - const T_INT_CAST = 298; - const T_DOUBLE_CAST = 299; - const T_STRING_CAST = 300; - const T_ARRAY_CAST = 301; - const T_OBJECT_CAST = 302; - const T_BOOL_CAST = 303; - const T_UNSET_CAST = 304; - const T_POW = 305; - const T_NEW = 306; - const T_CLONE = 307; - const T_EXIT = 308; - const T_IF = 309; - const T_ELSEIF = 310; - const T_ELSE = 311; - const T_ENDIF = 312; - const T_LNUMBER = 313; - const T_DNUMBER = 314; - const T_STRING = 315; - const T_STRING_VARNAME = 316; - const T_VARIABLE = 317; - const T_NUM_STRING = 318; - const T_INLINE_HTML = 319; - const T_ENCAPSED_AND_WHITESPACE = 320; - const T_CONSTANT_ENCAPSED_STRING = 321; - const T_ECHO = 322; - const T_DO = 323; - const T_WHILE = 324; - const T_ENDWHILE = 325; - const T_FOR = 326; - const T_ENDFOR = 327; - const T_FOREACH = 328; - const T_ENDFOREACH = 329; - const T_DECLARE = 330; - const T_ENDDECLARE = 331; - const T_AS = 332; - const T_SWITCH = 333; - const T_MATCH = 334; - const T_ENDSWITCH = 335; - const T_CASE = 336; - const T_DEFAULT = 337; - const T_BREAK = 338; - const T_CONTINUE = 339; - const T_GOTO = 340; - const T_FUNCTION = 341; - const T_FN = 342; - const T_CONST = 343; - const T_RETURN = 344; - const T_TRY = 345; - const T_CATCH = 346; - const T_FINALLY = 347; - const T_USE = 348; - const T_INSTEADOF = 349; - const T_GLOBAL = 350; - const T_STATIC = 351; - const T_ABSTRACT = 352; - const T_FINAL = 353; - const T_PRIVATE = 354; - const T_PROTECTED = 355; - const T_PUBLIC = 356; - const T_VAR = 357; - const T_UNSET = 358; - const T_ISSET = 359; - const T_EMPTY = 360; - const T_HALT_COMPILER = 361; - const T_CLASS = 362; - const T_TRAIT = 363; - const T_INTERFACE = 364; - const T_ENUM = 365; - const T_EXTENDS = 366; - const T_IMPLEMENTS = 367; - const T_OBJECT_OPERATOR = 368; - const T_NULLSAFE_OBJECT_OPERATOR = 369; - const T_LIST = 370; - const T_ARRAY = 371; - const T_CALLABLE = 372; - const T_CLASS_C = 373; - const T_TRAIT_C = 374; - const T_METHOD_C = 375; - const T_FUNC_C = 376; - const T_LINE = 377; - const T_FILE = 378; - const T_START_HEREDOC = 379; - const T_END_HEREDOC = 380; - const T_DOLLAR_OPEN_CURLY_BRACES = 381; - const T_CURLY_OPEN = 382; - const T_PAAMAYIM_NEKUDOTAYIM = 383; - const T_NAMESPACE = 384; - const T_NS_C = 385; - const T_DIR = 386; - const T_NS_SEPARATOR = 387; - const T_ELLIPSIS = 388; - const T_NAME_FULLY_QUALIFIED = 389; - const T_NAME_QUALIFIED = 390; - const T_NAME_RELATIVE = 391; - const T_ATTRIBUTE = 392; + const T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG = 286; + const T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG = 287; + const T_IS_EQUAL = 288; + const T_IS_NOT_EQUAL = 289; + const T_IS_IDENTICAL = 290; + const T_IS_NOT_IDENTICAL = 291; + const T_SPACESHIP = 292; + const T_IS_SMALLER_OR_EQUAL = 293; + const T_IS_GREATER_OR_EQUAL = 294; + const T_SL = 295; + const T_SR = 296; + const T_INSTANCEOF = 297; + const T_INC = 298; + const T_DEC = 299; + const T_INT_CAST = 300; + const T_DOUBLE_CAST = 301; + const T_STRING_CAST = 302; + const T_ARRAY_CAST = 303; + const T_OBJECT_CAST = 304; + const T_BOOL_CAST = 305; + const T_UNSET_CAST = 306; + const T_POW = 307; + const T_NEW = 308; + const T_CLONE = 309; + const T_EXIT = 310; + const T_IF = 311; + const T_ELSEIF = 312; + const T_ELSE = 313; + const T_ENDIF = 314; + const T_LNUMBER = 315; + const T_DNUMBER = 316; + const T_STRING = 317; + const T_STRING_VARNAME = 318; + const T_VARIABLE = 319; + const T_NUM_STRING = 320; + const T_INLINE_HTML = 321; + const T_ENCAPSED_AND_WHITESPACE = 322; + const T_CONSTANT_ENCAPSED_STRING = 323; + const T_ECHO = 324; + const T_DO = 325; + const T_WHILE = 326; + const T_ENDWHILE = 327; + const T_FOR = 328; + const T_ENDFOR = 329; + const T_FOREACH = 330; + const T_ENDFOREACH = 331; + const T_DECLARE = 332; + const T_ENDDECLARE = 333; + const T_AS = 334; + const T_SWITCH = 335; + const T_MATCH = 336; + const T_ENDSWITCH = 337; + const T_CASE = 338; + const T_DEFAULT = 339; + const T_BREAK = 340; + const T_CONTINUE = 341; + const T_GOTO = 342; + const T_FUNCTION = 343; + const T_FN = 344; + const T_CONST = 345; + const T_RETURN = 346; + const T_TRY = 347; + const T_CATCH = 348; + const T_FINALLY = 349; + const T_USE = 350; + const T_INSTEADOF = 351; + const T_GLOBAL = 352; + const T_STATIC = 353; + const T_ABSTRACT = 354; + const T_FINAL = 355; + const T_PRIVATE = 356; + const T_PROTECTED = 357; + const T_PUBLIC = 358; + const T_READONLY = 359; + const T_VAR = 360; + const T_UNSET = 361; + const T_ISSET = 362; + const T_EMPTY = 363; + const T_HALT_COMPILER = 364; + const T_CLASS = 365; + const T_TRAIT = 366; + const T_INTERFACE = 367; + const T_ENUM = 368; + const T_EXTENDS = 369; + const T_IMPLEMENTS = 370; + const T_OBJECT_OPERATOR = 371; + const T_NULLSAFE_OBJECT_OPERATOR = 372; + const T_LIST = 373; + const T_ARRAY = 374; + const T_CALLABLE = 375; + const T_CLASS_C = 376; + const T_TRAIT_C = 377; + const T_METHOD_C = 378; + const T_FUNC_C = 379; + const T_LINE = 380; + const T_FILE = 381; + const T_START_HEREDOC = 382; + const T_END_HEREDOC = 383; + const T_DOLLAR_OPEN_CURLY_BRACES = 384; + const T_CURLY_OPEN = 385; + const T_PAAMAYIM_NEKUDOTAYIM = 386; + const T_NAMESPACE = 387; + const T_NS_C = 388; + const T_DIR = 389; + const T_NS_SEPARATOR = 390; + const T_ELLIPSIS = 391; + const T_NAME_FULLY_QUALIFIED = 392; + const T_NAME_QUALIFIED = 393; + const T_NAME_RELATIVE = 394; + const T_ATTRIBUTE = 395; } diff --git a/app/vendor/nikic/php-parser/lib/PhpParser/ParserAbstract.php b/app/vendor/nikic/php-parser/lib/PhpParser/ParserAbstract.php index c61208b07..5ee5a64bb 100644 --- a/app/vendor/nikic/php-parser/lib/PhpParser/ParserAbstract.php +++ b/app/vendor/nikic/php-parser/lib/PhpParser/ParserAbstract.php @@ -977,6 +977,12 @@ protected function checkClassMethod(ClassMethod $node, $modifierPos) { break; } } + + if ($node->flags & Class_::MODIFIER_READONLY) { + $this->emitError(new Error( + sprintf('Method %s() cannot be readonly', $node->name), + $this->getAttributesAt($modifierPos))); + } } protected function checkClassConst(ClassConst $node, $modifierPos) { @@ -990,9 +996,9 @@ protected function checkClassConst(ClassConst $node, $modifierPos) { "Cannot use 'abstract' as constant modifier", $this->getAttributesAt($modifierPos))); } - if ($node->flags & Class_::MODIFIER_FINAL) { + if ($node->flags & Class_::MODIFIER_READONLY) { $this->emitError(new Error( - "Cannot use 'final' as constant modifier", + "Cannot use 'readonly' as constant modifier", $this->getAttributesAt($modifierPos))); } } diff --git a/app/vendor/nikic/php-parser/lib/PhpParser/PrettyPrinter/Standard.php b/app/vendor/nikic/php-parser/lib/PhpParser/PrettyPrinter/Standard.php index 62d1f34c1..bb70de659 100644 --- a/app/vendor/nikic/php-parser/lib/PhpParser/PrettyPrinter/Standard.php +++ b/app/vendor/nikic/php-parser/lib/PhpParser/PrettyPrinter/Standard.php @@ -33,6 +33,10 @@ protected function pArg(Node\Arg $node) { . $this->p($node->value); } + protected function pVariadicPlaceholder(Node\VariadicPlaceholder $node) { + return '...'; + } + protected function pConst(Node\Const_ $node) { return $node->name . ' = ' . $this->p($node->value); } @@ -45,6 +49,10 @@ protected function pUnionType(Node\UnionType $node) { return $this->pImplode($node->types, '|'); } + protected function pIntersectionType(Node\IntersectionType $node) { + return $this->pImplode($node->types, '&'); + } + protected function pIdentifier(Node\Identifier $node) { return $node->name; } diff --git a/app/vendor/nikic/php-parser/lib/PhpParser/PrettyPrinterAbstract.php b/app/vendor/nikic/php-parser/lib/PhpParser/PrettyPrinterAbstract.php index f453db091..2c7fc3070 100644 --- a/app/vendor/nikic/php-parser/lib/PhpParser/PrettyPrinterAbstract.php +++ b/app/vendor/nikic/php-parser/lib/PhpParser/PrettyPrinterAbstract.php @@ -824,7 +824,11 @@ protected function pArray( return null; } - if ($insertStr === ', ' && $this->isMultiline($origNodes)) { + // We go multiline if the original code was multiline, + // or if it's an array item with a comment above it. + if ($insertStr === ', ' && + ($this->isMultiline($origNodes) || $arrItem->getComments()) + ) { $insertStr = ','; $insertNewline = true; } @@ -842,11 +846,11 @@ protected function pArray( $this->setIndentLevel($lastElemIndentLevel); if ($insertNewline) { + $result .= $insertStr . $this->nl; $comments = $arrItem->getComments(); if ($comments) { - $result .= $this->nl . $this->pComments($comments); + $result .= $this->pComments($comments) . $this->nl; } - $result .= $insertStr . $this->nl; } else { $result .= $insertStr; } @@ -1074,7 +1078,8 @@ protected function pModifiers(int $modifiers) { . ($modifiers & Stmt\Class_::MODIFIER_PRIVATE ? 'private ' : '') . ($modifiers & Stmt\Class_::MODIFIER_STATIC ? 'static ' : '') . ($modifiers & Stmt\Class_::MODIFIER_ABSTRACT ? 'abstract ' : '') - . ($modifiers & Stmt\Class_::MODIFIER_FINAL ? 'final ' : ''); + . ($modifiers & Stmt\Class_::MODIFIER_FINAL ? 'final ' : '') + . ($modifiers & Stmt\Class_::MODIFIER_READONLY ? 'readonly ' : ''); } /** @@ -1123,7 +1128,8 @@ protected function initializeLabelCharMap() { for ($i = 0; $i < 256; $i++) { // Since PHP 7.1 The lower range is 0x80. However, we also want to support code for // older versions. - $this->labelCharMap[chr($i)] = $i >= 0x7f || ctype_alnum($i); + $chr = chr($i); + $this->labelCharMap[$chr] = $i >= 0x7f || ctype_alnum($chr); } } @@ -1341,6 +1347,7 @@ protected function initializeListInsertionMap() { //'Scalar_Encapsed->parts' => '', 'Stmt_Catch->types' => '|', 'UnionType->types' => '|', + 'IntersectionType->types' => '&', 'Stmt_If->elseifs' => ' ', 'Stmt_TryCatch->catches' => ' ', diff --git a/app/vendor/phar-io/manifest/CHANGELOG.md b/app/vendor/phar-io/manifest/CHANGELOG.md index b777a36e5..a403e093c 100644 --- a/app/vendor/phar-io/manifest/CHANGELOG.md +++ b/app/vendor/phar-io/manifest/CHANGELOG.md @@ -2,6 +2,14 @@ All notable changes to phar-io/manifest are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles. +## [2.0.3] - 20.07.2021 + +- Fixed PHP 7.2 / PHP 7.3 incompatibility introduced in previous release + +## [2.0.2] - 20.07.2021 + +- Fixed PHP 8.1 deprecation notice + ## [2.0.1] - 27.06.2020 This release now supports the use of PHP 7.2+ and ^8.0 @@ -18,8 +26,11 @@ This release now requires PHP 7.2+ ### Unreleased -[Unreleased]: https://github.com/phar-io/version/compare/2.0.0...HEAD -[2.0.0]: https://github.com/phar-io/version/compare/1.0.1...2.0.0 -[1.0.3]: https://github.com/phar-io/version/compare/1.0.2...1.0.3 -[1.0.2]: https://github.com/phar-io/version/compare/1.0.1...1.0.2 -[1.0.1]: https://github.com/phar-io/version/compare/1.0.0...1.0.1 +[Unreleased]: https://github.com/phar-io/manifest/compare/2.0.3...HEAD +[2.0.3]: https://github.com/phar-io/manifest/compare/2.0.2...2.0.3 +[2.0.2]: https://github.com/phar-io/manifest/compare/2.0.1...2.0.2 +[2.0.1]: https://github.com/phar-io/manifest/compare/2.0.0...2.0.1 +[2.0.0]: https://github.com/phar-io/manifest/compare/1.0.1...2.0.0 +[1.0.3]: https://github.com/phar-io/manifest/compare/1.0.2...1.0.3 +[1.0.2]: https://github.com/phar-io/manifest/compare/1.0.1...1.0.2 +[1.0.1]: https://github.com/phar-io/manifest/compare/1.0.0...1.0.1 diff --git a/app/vendor/phar-io/manifest/src/xml/ElementCollection.php b/app/vendor/phar-io/manifest/src/xml/ElementCollection.php index 1d13a9160..26d9250f3 100644 --- a/app/vendor/phar-io/manifest/src/xml/ElementCollection.php +++ b/app/vendor/phar-io/manifest/src/xml/ElementCollection.php @@ -24,17 +24,18 @@ public function __construct(DOMNodeList $nodeList) { $this->importNodes($nodeList); } + #[\ReturnTypeWillChange] abstract public function current(); public function next(): void { $this->position++; } - public function key() { + public function key(): int { return $this->position; } - public function valid() { + public function valid(): bool { return $this->position < \count($this->nodes); } diff --git a/app/vendor/phpdocumentor/type-resolver/composer.json b/app/vendor/phpdocumentor/type-resolver/composer.json index 242ecbe39..4dbf6237e 100644 --- a/app/vendor/phpdocumentor/type-resolver/composer.json +++ b/app/vendor/phpdocumentor/type-resolver/composer.json @@ -14,7 +14,8 @@ "phpdocumentor/reflection-common": "^2.0" }, "require-dev": { - "ext-tokenizer": "*" + "ext-tokenizer": "*", + "psalm/phar": "^4.8" }, "autoload": { "psr-4": { diff --git a/app/vendor/phpdocumentor/type-resolver/composer.lock b/app/vendor/phpdocumentor/type-resolver/composer.lock deleted file mode 100644 index 8fa8b8747..000000000 --- a/app/vendor/phpdocumentor/type-resolver/composer.lock +++ /dev/null @@ -1,71 +0,0 @@ -{ - "_readme": [ - "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", - "This file is @generated automatically" - ], - "content-hash": "ee8aea1f755e1772266bc7e041d8ee5b", - "packages": [ - { - "name": "phpdocumentor/reflection-common", - "version": "2.2.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-2.x": "2.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jaap van Otterdijk", - "email": "opensource@ijaap.nl" - } - ], - "description": "Common reflection classes used by phpdocumentor to reflect the code structure", - "homepage": "http://www.phpdoc.org", - "keywords": [ - "FQSEN", - "phpDocumentor", - "phpdoc", - "reflection", - "static analysis" - ], - "time": "2020-06-27T09:03:43+00:00" - } - ], - "packages-dev": [], - "aliases": [], - "minimum-stability": "stable", - "stability-flags": [], - "prefer-stable": false, - "prefer-lowest": false, - "platform": { - "php": "^7.2 || ^8.0" - }, - "platform-dev": { - "ext-tokenizer": "*" - } -} diff --git a/app/vendor/phpdocumentor/type-resolver/phpbench.json b/app/vendor/phpdocumentor/type-resolver/phpbench.json deleted file mode 100644 index ced1ebab4..000000000 --- a/app/vendor/phpdocumentor/type-resolver/phpbench.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "bootstrap": "vendor/autoload.php", - "path": "tests/benchmark", - "extensions": [ - "Jaapio\\Blackfire\\Extension" - ], - "blackfire" : { - "env": "c12030d0-c177-47e2-b466-4994c40dc993" - } -} diff --git a/app/vendor/phpdocumentor/type-resolver/src/FqsenResolver.php b/app/vendor/phpdocumentor/type-resolver/src/FqsenResolver.php index 6447a0159..068fa2085 100644 --- a/app/vendor/phpdocumentor/type-resolver/src/FqsenResolver.php +++ b/app/vendor/phpdocumentor/type-resolver/src/FqsenResolver.php @@ -15,6 +15,7 @@ use InvalidArgumentException; use phpDocumentor\Reflection\Types\Context; + use function explode; use function implode; use function strpos; @@ -29,7 +30,7 @@ class FqsenResolver /** @var string Definition of the NAMESPACE operator in PHP */ private const OPERATOR_NAMESPACE = '\\'; - public function resolve(string $fqsen, ?Context $context = null) : Fqsen + public function resolve(string $fqsen, ?Context $context = null): Fqsen { if ($context === null) { $context = new Context(''); @@ -45,7 +46,7 @@ public function resolve(string $fqsen, ?Context $context = null) : Fqsen /** * Tests whether the given type is a Fully Qualified Structural Element Name. */ - private function isFqsen(string $type) : bool + private function isFqsen(string $type): bool { return strpos($type, self::OPERATOR_NAMESPACE) === 0; } @@ -56,7 +57,7 @@ private function isFqsen(string $type) : bool * * @throws InvalidArgumentException When type is not a valid FQSEN. */ - private function resolvePartialStructuralElementName(string $type, Context $context) : Fqsen + private function resolvePartialStructuralElementName(string $type, Context $context): Fqsen { $typeParts = explode(self::OPERATOR_NAMESPACE, $type, 2); diff --git a/app/vendor/phpdocumentor/type-resolver/src/PseudoType.php b/app/vendor/phpdocumentor/type-resolver/src/PseudoType.php index f94cff5b3..dd91ed798 100644 --- a/app/vendor/phpdocumentor/type-resolver/src/PseudoType.php +++ b/app/vendor/phpdocumentor/type-resolver/src/PseudoType.php @@ -15,5 +15,5 @@ interface PseudoType extends Type { - public function underlyingType() : Type; + public function underlyingType(): Type; } diff --git a/app/vendor/phpdocumentor/type-resolver/src/PseudoTypes/CallableString.php b/app/vendor/phpdocumentor/type-resolver/src/PseudoTypes/CallableString.php new file mode 100644 index 000000000..b69345617 --- /dev/null +++ b/app/vendor/phpdocumentor/type-resolver/src/PseudoTypes/CallableString.php @@ -0,0 +1,39 @@ + Types\String_::class, 'class-string' => Types\ClassString::class, + 'interface-string' => Types\InterfaceString::class, + 'html-escaped-string' => PseudoTypes\HtmlEscapedString::class, + 'lowercase-string' => PseudoTypes\LowercaseString::class, + 'non-empty-lowercase-string' => PseudoTypes\NonEmptyLowercaseString::class, + 'non-empty-string' => PseudoTypes\NonEmptyString::class, + 'numeric-string' => PseudoTypes\NumericString::class, + 'trait-string' => PseudoTypes\TraitString::class, 'int' => Types\Integer::class, 'integer' => Types\Integer::class, + 'positive-int' => PseudoTypes\PositiveInteger::class, 'bool' => Types\Boolean::class, 'boolean' => Types\Boolean::class, 'real' => Types\Float_::class, 'float' => Types\Float_::class, 'double' => Types\Float_::class, - 'object' => Object_::class, + 'object' => Types\Object_::class, 'mixed' => Types\Mixed_::class, - 'array' => Array_::class, + 'array' => Types\Array_::class, + 'array-key' => Types\ArrayKey::class, 'resource' => Types\Resource_::class, 'void' => Types\Void_::class, 'null' => Types\Null_::class, 'scalar' => Types\Scalar::class, 'callback' => Types\Callable_::class, 'callable' => Types\Callable_::class, + 'callable-string' => PseudoTypes\CallableString::class, 'false' => PseudoTypes\False_::class, 'true' => PseudoTypes\True_::class, + 'literal-string' => PseudoTypes\LiteralString::class, 'self' => Types\Self_::class, '$this' => Types\This::class, 'static' => Types\Static_::class, 'parent' => Types\Parent_::class, - 'iterable' => Iterable_::class, + 'iterable' => Types\Iterable_::class, + 'never' => Types\Never_::class, ]; /** @@ -126,7 +142,7 @@ public function __construct(?FqsenResolver $fqsenResolver = null) * * @param string $type The relative or absolute type. */ - public function resolve(string $type, ?Context $context = null) : Type + public function resolve(string $type, ?Context $context = null): Type { $type = trim($type); if (!$type) { @@ -162,7 +178,7 @@ public function resolve(string $type, ?Context $context = null) : Type * @param int $parserContext on of self::PARSER_* constants, indicating * the context where we are in the parsing */ - private function parseTypes(ArrayIterator $tokens, Context $context, int $parserContext) : Type + private function parseTypes(ArrayIterator $tokens, Context $context, int $parserContext): Type { $types = []; $token = ''; @@ -182,11 +198,12 @@ private function parseTypes(ArrayIterator $tokens, Context $context, int $parser ); } - if (!in_array($parserContext, [ - self::PARSER_IN_COMPOUND, - self::PARSER_IN_ARRAY_EXPRESSION, - self::PARSER_IN_COLLECTION_EXPRESSION, - ], true) + if ( + !in_array($parserContext, [ + self::PARSER_IN_COMPOUND, + self::PARSER_IN_ARRAY_EXPRESSION, + self::PARSER_IN_COLLECTION_EXPRESSION, + ], true) ) { throw new RuntimeException( 'Unexpected type separator' @@ -196,11 +213,12 @@ private function parseTypes(ArrayIterator $tokens, Context $context, int $parser $compoundToken = $token; $tokens->next(); } elseif ($token === '?') { - if (!in_array($parserContext, [ - self::PARSER_IN_COMPOUND, - self::PARSER_IN_ARRAY_EXPRESSION, - self::PARSER_IN_COLLECTION_EXPRESSION, - ], true) + if ( + !in_array($parserContext, [ + self::PARSER_IN_COMPOUND, + self::PARSER_IN_ARRAY_EXPRESSION, + self::PARSER_IN_COLLECTION_EXPRESSION, + ], true) ) { throw new RuntimeException( 'Unexpected nullable character' @@ -224,7 +242,7 @@ private function parseTypes(ArrayIterator $tokens, Context $context, int $parser $resolvedType = new Expression($type); $types[] = $resolvedType; - } elseif ($parserContext === self::PARSER_IN_ARRAY_EXPRESSION && $token[0] === ')') { + } elseif ($parserContext === self::PARSER_IN_ARRAY_EXPRESSION && isset($token[0]) && $token[0] === ')') { break; } elseif ($token === '<') { if (count($types) === 0) { @@ -237,13 +255,16 @@ private function parseTypes(ArrayIterator $tokens, Context $context, int $parser if ($classType !== null) { if ((string) $classType === 'class-string') { $types[] = $this->resolveClassString($tokens, $context); + } elseif ((string) $classType === 'interface-string') { + $types[] = $this->resolveInterfaceString($tokens, $context); } else { $types[] = $this->resolveCollection($tokens, $classType, $context); } } $tokens->next(); - } elseif ($parserContext === self::PARSER_IN_COLLECTION_EXPRESSION + } elseif ( + $parserContext === self::PARSER_IN_COLLECTION_EXPRESSION && ($token === '>' || trim($token) === ',') ) { break; @@ -313,13 +334,15 @@ private function parseTypes(ArrayIterator $tokens, Context $context, int $parser * * @psalm-mutation-free */ - private function resolveSingleType(string $type, Context $context) : object + private function resolveSingleType(string $type, Context $context): object { switch (true) { case $this->isKeyword($type): return $this->resolveKeyword($type); + case $this->isFqsen($type): return $this->resolveTypedObject($type); + case $this->isPartialStructuralElementName($type): return $this->resolveTypedObject($type, $context); @@ -339,7 +362,7 @@ private function resolveSingleType(string $type, Context $context) : object * * @psalm-param class-string $typeClassName */ - public function addKeyword(string $keyword, string $typeClassName) : void + public function addKeyword(string $keyword, string $typeClassName): void { if (!class_exists($typeClassName)) { throw new InvalidArgumentException( @@ -348,7 +371,15 @@ public function addKeyword(string $keyword, string $typeClassName) : void ); } - if (!in_array(Type::class, class_implements($typeClassName), true)) { + $interfaces = class_implements($typeClassName); + if ($interfaces === false) { + throw new InvalidArgumentException( + 'The Value Object that needs to be created with a keyword "' . $keyword . '" must be an existing class' + . ' but we could not find the class ' . $typeClassName + ); + } + + if (!in_array(Type::class, $interfaces, true)) { throw new InvalidArgumentException( 'The class "' . $typeClassName . '" must implement the interface "phpDocumentor\Reflection\Type"' ); @@ -364,7 +395,7 @@ public function addKeyword(string $keyword, string $typeClassName) : void * * @psalm-mutation-free */ - private function isKeyword(string $type) : bool + private function isKeyword(string $type): bool { return array_key_exists(strtolower($type), $this->keywords); } @@ -376,9 +407,9 @@ private function isKeyword(string $type) : bool * * @psalm-mutation-free */ - private function isPartialStructuralElementName(string $type) : bool + private function isPartialStructuralElementName(string $type): bool { - return ($type[0] !== self::OPERATOR_NAMESPACE) && !$this->isKeyword($type); + return (isset($type[0]) && $type[0] !== self::OPERATOR_NAMESPACE) && !$this->isKeyword($type); } /** @@ -386,7 +417,7 @@ private function isPartialStructuralElementName(string $type) : bool * * @psalm-mutation-free */ - private function isFqsen(string $type) : bool + private function isFqsen(string $type): bool { return strpos($type, self::OPERATOR_NAMESPACE) === 0; } @@ -396,7 +427,7 @@ private function isFqsen(string $type) : bool * * @psalm-mutation-free */ - private function resolveKeyword(string $type) : Type + private function resolveKeyword(string $type): Type { $className = $this->keywords[strtolower($type)]; @@ -408,7 +439,7 @@ private function resolveKeyword(string $type) : Type * * @psalm-mutation-free */ - private function resolveTypedObject(string $type, ?Context $context = null) : Object_ + private function resolveTypedObject(string $type, ?Context $context = null): Object_ { return new Object_($this->fqsenResolver->resolve($type, $context)); } @@ -418,7 +449,7 @@ private function resolveTypedObject(string $type, ?Context $context = null) : Ob * * @param ArrayIterator $tokens */ - private function resolveClassString(ArrayIterator $tokens, Context $context) : Type + private function resolveClassString(ArrayIterator $tokens, Context $context): Type { $tokens->next(); @@ -446,6 +477,39 @@ private function resolveClassString(ArrayIterator $tokens, Context $context) : T return new ClassString($classType->getFqsen()); } + /** + * Resolves class string + * + * @param ArrayIterator $tokens + */ + private function resolveInterfaceString(ArrayIterator $tokens, Context $context): Type + { + $tokens->next(); + + $classType = $this->parseTypes($tokens, $context, self::PARSER_IN_COLLECTION_EXPRESSION); + + if (!$classType instanceof Object_ || $classType->getFqsen() === null) { + throw new RuntimeException( + $classType . ' is not a interface string' + ); + } + + $token = $tokens->current(); + if ($token !== '>') { + if (empty($token)) { + throw new RuntimeException( + 'interface-string: ">" is missing' + ); + } + + throw new RuntimeException( + 'Unexpected character "' . $token . '", ">" is missing' + ); + } + + return new InterfaceString($classType->getFqsen()); + } + /** * Resolves the collection values and keys * @@ -453,14 +517,16 @@ private function resolveClassString(ArrayIterator $tokens, Context $context) : T * * @return Array_|Iterable_|Collection */ - private function resolveCollection(ArrayIterator $tokens, Type $classType, Context $context) : Type + private function resolveCollection(ArrayIterator $tokens, Type $classType, Context $context): Type { $isArray = ((string) $classType === 'array'); $isIterable = ((string) $classType === 'iterable'); // allow only "array", "iterable" or class name before "<" - if (!$isArray && !$isIterable - && (!$classType instanceof Object_ || $classType->getFqsen() === null)) { + if ( + !$isArray && !$isIterable + && (!$classType instanceof Object_ || $classType->getFqsen() === null) + ) { throw new RuntimeException( $classType . ' is not a collection' ); @@ -478,7 +544,9 @@ private function resolveCollection(ArrayIterator $tokens, Type $classType, Conte if ($isArray) { // check the key type for an "array" collection. We allow only // strings or integers. - if (!$keyType instanceof String_ && + if ( + !$keyType instanceof ArrayKey && + !$keyType instanceof String_ && !$keyType instanceof Integer && !$keyType instanceof Compound ) { @@ -489,7 +557,9 @@ private function resolveCollection(ArrayIterator $tokens, Type $classType, Conte if ($keyType instanceof Compound) { foreach ($keyType->getIterator() as $item) { - if (!$item instanceof String_ && + if ( + !$item instanceof ArrayKey && + !$item instanceof String_ && !$item instanceof Integer ) { throw new RuntimeException( @@ -536,7 +606,7 @@ private function resolveCollection(ArrayIterator $tokens, Type $classType, Conte /** * @psalm-pure */ - private function makeCollectionFromObject(Object_ $object, Type $valueType, ?Type $keyType = null) : Collection + private function makeCollectionFromObject(Object_ $object, Type $valueType, ?Type $keyType = null): Collection { return new Collection($object->getFqsen(), $valueType, $keyType); } diff --git a/app/vendor/phpdocumentor/type-resolver/src/Types/AbstractList.php b/app/vendor/phpdocumentor/type-resolver/src/Types/AbstractList.php index bbea4f141..b674862af 100644 --- a/app/vendor/phpdocumentor/type-resolver/src/Types/AbstractList.php +++ b/app/vendor/phpdocumentor/type-resolver/src/Types/AbstractList.php @@ -48,7 +48,7 @@ public function __construct(?Type $valueType = null, ?Type $keyType = null) /** * Returns the type for the keys of this array. */ - public function getKeyType() : Type + public function getKeyType(): Type { return $this->keyType ?? $this->defaultKeyType; } @@ -56,7 +56,7 @@ public function getKeyType() : Type /** * Returns the value for the keys of this array. */ - public function getValueType() : Type + public function getValueType(): Type { return $this->valueType; } @@ -64,7 +64,7 @@ public function getValueType() : Type /** * Returns a rendered output of the Type as it would be used in a DocBlock. */ - public function __toString() : string + public function __toString(): string { if ($this->keyType) { return 'array<' . $this->keyType . ',' . $this->valueType . '>'; diff --git a/app/vendor/phpdocumentor/type-resolver/src/Types/AggregatedType.php b/app/vendor/phpdocumentor/type-resolver/src/Types/AggregatedType.php index 952229583..472a1cdc6 100644 --- a/app/vendor/phpdocumentor/type-resolver/src/Types/AggregatedType.php +++ b/app/vendor/phpdocumentor/type-resolver/src/Types/AggregatedType.php @@ -15,6 +15,7 @@ use ArrayIterator; use IteratorAggregate; use phpDocumentor\Reflection\Type; + use function array_key_exists; use function implode; @@ -53,7 +54,7 @@ public function __construct(array $types, string $token) /** * Returns the type at the given index. */ - public function get(int $index) : ?Type + public function get(int $index): ?Type { if (!$this->has($index)) { return null; @@ -65,7 +66,7 @@ public function get(int $index) : ?Type /** * Tests if this compound type has a type with the given index. */ - public function has(int $index) : bool + public function has(int $index): bool { return array_key_exists($index, $this->types); } @@ -73,7 +74,7 @@ public function has(int $index) : bool /** * Tests if this compound type contains the given type. */ - public function contains(Type $type) : bool + public function contains(Type $type): bool { foreach ($this->types as $typePart) { // if the type is duplicate; do not add it @@ -88,7 +89,7 @@ public function contains(Type $type) : bool /** * Returns a rendered output of the Type as it would be used in a DocBlock. */ - public function __toString() : string + public function __toString(): string { return implode($this->token, $this->types); } @@ -96,7 +97,7 @@ public function __toString() : string /** * @return ArrayIterator */ - public function getIterator() : ArrayIterator + public function getIterator(): ArrayIterator { return new ArrayIterator($this->types); } @@ -104,7 +105,7 @@ public function getIterator() : ArrayIterator /** * @psalm-suppress ImpureMethodCall */ - private function add(Type $type) : void + private function add(Type $type): void { if ($type instanceof self) { foreach ($type->getIterator() as $subType) { diff --git a/app/vendor/phpdocumentor/type-resolver/src/Types/ArrayKey.php b/app/vendor/phpdocumentor/type-resolver/src/Types/ArrayKey.php new file mode 100644 index 000000000..cf86df007 --- /dev/null +++ b/app/vendor/phpdocumentor/type-resolver/src/Types/ArrayKey.php @@ -0,0 +1,42 @@ +fqsen = $fqsen; } + public function underlyingType(): Type + { + return new String_(); + } + /** * Returns the FQSEN associated with this object. */ - public function getFqsen() : ?Fqsen + public function getFqsen(): ?Fqsen { return $this->fqsen; } @@ -45,7 +51,7 @@ public function getFqsen() : ?Fqsen /** * Returns a rendered output of the Type as it would be used in a DocBlock. */ - public function __toString() : string + public function __toString(): string { if ($this->fqsen === null) { return 'class-string'; diff --git a/app/vendor/phpdocumentor/type-resolver/src/Types/Collection.php b/app/vendor/phpdocumentor/type-resolver/src/Types/Collection.php index 84b4463a6..943cc22e5 100644 --- a/app/vendor/phpdocumentor/type-resolver/src/Types/Collection.php +++ b/app/vendor/phpdocumentor/type-resolver/src/Types/Collection.php @@ -47,7 +47,7 @@ public function __construct(?Fqsen $fqsen, Type $valueType, ?Type $keyType = nul /** * Returns the FQSEN associated with this object. */ - public function getFqsen() : ?Fqsen + public function getFqsen(): ?Fqsen { return $this->fqsen; } @@ -55,7 +55,7 @@ public function getFqsen() : ?Fqsen /** * Returns a rendered output of the Type as it would be used in a DocBlock. */ - public function __toString() : string + public function __toString(): string { $objectType = (string) ($this->fqsen ?? 'object'); diff --git a/app/vendor/phpdocumentor/type-resolver/src/Types/Context.php b/app/vendor/phpdocumentor/type-resolver/src/Types/Context.php index c134d7cfd..79aadaf88 100644 --- a/app/vendor/phpdocumentor/type-resolver/src/Types/Context.php +++ b/app/vendor/phpdocumentor/type-resolver/src/Types/Context.php @@ -50,7 +50,6 @@ final class Context * * @param string $namespace The namespace where this DocBlock resides in. * @param string[] $namespaceAliases List of namespace aliases => Fully Qualified Namespace. - * * @psalm-param array $namespaceAliases */ public function __construct(string $namespace, array $namespaceAliases = []) @@ -77,7 +76,7 @@ public function __construct(string $namespace, array $namespaceAliases = []) /** * Returns the Qualified Namespace Name (thus without `\` in front) where the associated element is in. */ - public function getNamespace() : string + public function getNamespace(): string { return $this->namespace; } @@ -87,10 +86,9 @@ public function getNamespace() : string * the alias for the imported Namespace. * * @return string[] - * * @psalm-return array */ - public function getNamespaceAliases() : array + public function getNamespaceAliases(): array { return $this->namespaceAliases; } diff --git a/app/vendor/phpdocumentor/type-resolver/src/Types/ContextFactory.php b/app/vendor/phpdocumentor/type-resolver/src/Types/ContextFactory.php index 5d09d565e..892ee0f90 100644 --- a/app/vendor/phpdocumentor/type-resolver/src/Types/ContextFactory.php +++ b/app/vendor/phpdocumentor/type-resolver/src/Types/ContextFactory.php @@ -23,6 +23,7 @@ use Reflector; use RuntimeException; use UnexpectedValueException; + use function define; use function defined; use function file_exists; @@ -34,10 +35,13 @@ use function substr; use function token_get_all; use function trim; + use const T_AS; use const T_CLASS; use const T_CURLY_OPEN; use const T_DOLLAR_OPEN_CURLY_BRACES; +use const T_NAME_FULLY_QUALIFIED; +use const T_NAME_QUALIFIED; use const T_NAMESPACE; use const T_NS_SEPARATOR; use const T_STRING; @@ -73,7 +77,7 @@ final class ContextFactory * * @see Context for more information on Contexts. */ - public function createFromReflector(Reflector $reflector) : Context + public function createFromReflector(Reflector $reflector): Context { if ($reflector instanceof ReflectionClass) { //phpcs:ignore SlevomatCodingStandard.Commenting.InlineDocCommentDeclaration.MissingVariable @@ -101,50 +105,43 @@ public function createFromReflector(Reflector $reflector) : Context throw new UnexpectedValueException('Unhandled \Reflector instance given: ' . get_class($reflector)); } - private function createFromReflectionParameter(ReflectionParameter $parameter) : Context + private function createFromReflectionParameter(ReflectionParameter $parameter): Context { $class = $parameter->getDeclaringClass(); if (!$class) { throw new InvalidArgumentException('Unable to get class of ' . $parameter->getName()); } - //phpcs:ignore SlevomatCodingStandard.Commenting.InlineDocCommentDeclaration.MissingVariable - /** @var ReflectionClass $class */ - return $this->createFromReflectionClass($class); } - private function createFromReflectionMethod(ReflectionMethod $method) : Context + private function createFromReflectionMethod(ReflectionMethod $method): Context { - //phpcs:ignore SlevomatCodingStandard.Commenting.InlineDocCommentDeclaration.MissingVariable - /** @var ReflectionClass $class */ $class = $method->getDeclaringClass(); return $this->createFromReflectionClass($class); } - private function createFromReflectionProperty(ReflectionProperty $property) : Context + private function createFromReflectionProperty(ReflectionProperty $property): Context { - //phpcs:ignore SlevomatCodingStandard.Commenting.InlineDocCommentDeclaration.MissingVariable - /** @var ReflectionClass $class */ $class = $property->getDeclaringClass(); return $this->createFromReflectionClass($class); } - private function createFromReflectionClassConstant(ReflectionClassConstant $constant) : Context + private function createFromReflectionClassConstant(ReflectionClassConstant $constant): Context { //phpcs:ignore SlevomatCodingStandard.Commenting.InlineDocCommentDeclaration.MissingVariable - /** @var ReflectionClass $class */ + /** @phpstan-var ReflectionClass $class */ $class = $constant->getDeclaringClass(); return $this->createFromReflectionClass($class); } /** - * @param ReflectionClass $class + * @phpstan-param ReflectionClass $class */ - private function createFromReflectionClass(ReflectionClass $class) : Context + private function createFromReflectionClass(ReflectionClass $class): Context { $fileName = $class->getFileName(); $namespace = $class->getNamespaceName(); @@ -170,7 +167,7 @@ private function createFromReflectionClass(ReflectionClass $class) : Context * this method first normalizes. * @param string $fileContents The file's contents to retrieve the aliases from with the given namespace. */ - public function createForNamespace(string $namespace, string $fileContents) : Context + public function createForNamespace(string $namespace, string $fileContents): Context { $namespace = trim($namespace, '\\'); $useStatements = []; @@ -191,8 +188,10 @@ public function createForNamespace(string $namespace, string $fileContents) : Co $firstBraceFound = false; while ($tokens->valid() && ($braceLevel > 0 || !$firstBraceFound)) { $currentToken = $tokens->current(); - if ($currentToken === '{' - || in_array($currentToken[0], [T_CURLY_OPEN, T_DOLLAR_OPEN_CURLY_BRACES], true)) { + if ( + $currentToken === '{' + || in_array($currentToken[0], [T_CURLY_OPEN, T_DOLLAR_OPEN_CURLY_BRACES], true) + ) { if (!$firstBraceFound) { $firstBraceFound = true; } @@ -227,7 +226,7 @@ public function createForNamespace(string $namespace, string $fileContents) : Co * * @param ArrayIterator $tokens */ - private function parseNamespace(ArrayIterator $tokens) : string + private function parseNamespace(ArrayIterator $tokens): string { // skip to the first string or namespace separator $this->skipToNextStringOrNamespaceSeparator($tokens); @@ -248,10 +247,9 @@ private function parseNamespace(ArrayIterator $tokens) : string * @param ArrayIterator $tokens * * @return string[] - * * @psalm-return array */ - private function parseUseStatement(ArrayIterator $tokens) : array + private function parseUseStatement(ArrayIterator $tokens): array { $uses = []; @@ -273,7 +271,7 @@ private function parseUseStatement(ArrayIterator $tokens) : array * * @param ArrayIterator $tokens */ - private function skipToNextStringOrNamespaceSeparator(ArrayIterator $tokens) : void + private function skipToNextStringOrNamespaceSeparator(ArrayIterator $tokens): void { while ($tokens->valid()) { $currentToken = $tokens->current(); @@ -300,12 +298,11 @@ private function skipToNextStringOrNamespaceSeparator(ArrayIterator $tokens) : v * @param ArrayIterator $tokens * * @return string[] + * @psalm-return array * * @psalm-suppress TypeDoesNotContainType - * - * @psalm-return array */ - private function extractUseStatements(ArrayIterator $tokens) : array + private function extractUseStatements(ArrayIterator $tokens): array { $extractedUseStatements = []; $groupedNs = ''; diff --git a/app/vendor/phpdocumentor/type-resolver/src/Types/Expression.php b/app/vendor/phpdocumentor/type-resolver/src/Types/Expression.php index 4a8ae1fcf..da5f65d59 100644 --- a/app/vendor/phpdocumentor/type-resolver/src/Types/Expression.php +++ b/app/vendor/phpdocumentor/type-resolver/src/Types/Expression.php @@ -36,7 +36,7 @@ public function __construct(Type $valueType) /** * Returns the value for the keys of this array. */ - public function getValueType() : Type + public function getValueType(): Type { return $this->valueType; } @@ -44,7 +44,7 @@ public function getValueType() : Type /** * Returns a rendered output of the Type as it would be used in a DocBlock. */ - public function __toString() : string + public function __toString(): string { return '(' . $this->valueType . ')'; } diff --git a/app/vendor/phpdocumentor/type-resolver/src/Types/Float_.php b/app/vendor/phpdocumentor/type-resolver/src/Types/Float_.php index e70ce7dd5..86138c0e7 100644 --- a/app/vendor/phpdocumentor/type-resolver/src/Types/Float_.php +++ b/app/vendor/phpdocumentor/type-resolver/src/Types/Float_.php @@ -25,7 +25,7 @@ final class Float_ implements Type /** * Returns a rendered output of the Type as it would be used in a DocBlock. */ - public function __toString() : string + public function __toString(): string { return 'float'; } diff --git a/app/vendor/phpdocumentor/type-resolver/src/Types/Integer.php b/app/vendor/phpdocumentor/type-resolver/src/Types/Integer.php index 2cfd7e9e7..10ce3c58c 100644 --- a/app/vendor/phpdocumentor/type-resolver/src/Types/Integer.php +++ b/app/vendor/phpdocumentor/type-resolver/src/Types/Integer.php @@ -20,12 +20,12 @@ * * @psalm-immutable */ -final class Integer implements Type +class Integer implements Type { /** * Returns a rendered output of the Type as it would be used in a DocBlock. */ - public function __toString() : string + public function __toString(): string { return 'int'; } diff --git a/app/vendor/phpdocumentor/type-resolver/src/Types/InterfaceString.php b/app/vendor/phpdocumentor/type-resolver/src/Types/InterfaceString.php new file mode 100644 index 000000000..9836961fd --- /dev/null +++ b/app/vendor/phpdocumentor/type-resolver/src/Types/InterfaceString.php @@ -0,0 +1,56 @@ +fqsen = $fqsen; + } + + /** + * Returns the FQSEN associated with this object. + */ + public function getFqsen(): ?Fqsen + { + return $this->fqsen; + } + + /** + * Returns a rendered output of the Type as it would be used in a DocBlock. + */ + public function __toString(): string + { + if ($this->fqsen === null) { + return 'interface-string'; + } + + return 'interface-string<' . (string) $this->fqsen . '>'; + } +} diff --git a/app/vendor/phpdocumentor/type-resolver/src/Types/Iterable_.php b/app/vendor/phpdocumentor/type-resolver/src/Types/Iterable_.php index a03a7cd3f..1ca069f2e 100644 --- a/app/vendor/phpdocumentor/type-resolver/src/Types/Iterable_.php +++ b/app/vendor/phpdocumentor/type-resolver/src/Types/Iterable_.php @@ -23,7 +23,7 @@ final class Iterable_ extends AbstractList /** * Returns a rendered output of the Type as it would be used in a DocBlock. */ - public function __toString() : string + public function __toString(): string { if ($this->keyType) { return 'iterable<' . $this->keyType . ',' . $this->valueType . '>'; diff --git a/app/vendor/phpdocumentor/type-resolver/src/Types/Mixed_.php b/app/vendor/phpdocumentor/type-resolver/src/Types/Mixed_.php index 2fedff400..56d1b6dab 100644 --- a/app/vendor/phpdocumentor/type-resolver/src/Types/Mixed_.php +++ b/app/vendor/phpdocumentor/type-resolver/src/Types/Mixed_.php @@ -25,7 +25,7 @@ final class Mixed_ implements Type /** * Returns a rendered output of the Type as it would be used in a DocBlock. */ - public function __toString() : string + public function __toString(): string { return 'mixed'; } diff --git a/app/vendor/phpdocumentor/type-resolver/src/Types/Never_.php b/app/vendor/phpdocumentor/type-resolver/src/Types/Never_.php new file mode 100644 index 000000000..40a99c9ad --- /dev/null +++ b/app/vendor/phpdocumentor/type-resolver/src/Types/Never_.php @@ -0,0 +1,35 @@ +realType; } @@ -44,7 +44,7 @@ public function getActualType() : Type /** * Returns a rendered output of the Type as it would be used in a DocBlock. */ - public function __toString() : string + public function __toString(): string { return '?' . $this->realType->__toString(); } diff --git a/app/vendor/phpdocumentor/type-resolver/src/Types/Object_.php b/app/vendor/phpdocumentor/type-resolver/src/Types/Object_.php index 4cfe2a0c3..90dee57ac 100644 --- a/app/vendor/phpdocumentor/type-resolver/src/Types/Object_.php +++ b/app/vendor/phpdocumentor/type-resolver/src/Types/Object_.php @@ -16,6 +16,7 @@ use InvalidArgumentException; use phpDocumentor\Reflection\Fqsen; use phpDocumentor\Reflection\Type; + use function strpos; /** @@ -52,12 +53,12 @@ public function __construct(?Fqsen $fqsen = null) /** * Returns the FQSEN associated with this object. */ - public function getFqsen() : ?Fqsen + public function getFqsen(): ?Fqsen { return $this->fqsen; } - public function __toString() : string + public function __toString(): string { if ($this->fqsen) { return (string) $this->fqsen; diff --git a/app/vendor/phpdocumentor/type-resolver/src/Types/Parent_.php b/app/vendor/phpdocumentor/type-resolver/src/Types/Parent_.php index 08900abce..348385991 100644 --- a/app/vendor/phpdocumentor/type-resolver/src/Types/Parent_.php +++ b/app/vendor/phpdocumentor/type-resolver/src/Types/Parent_.php @@ -27,7 +27,7 @@ final class Parent_ implements Type /** * Returns a rendered output of the Type as it would be used in a DocBlock. */ - public function __toString() : string + public function __toString(): string { return 'parent'; } diff --git a/app/vendor/phpdocumentor/type-resolver/src/Types/Resource_.php b/app/vendor/phpdocumentor/type-resolver/src/Types/Resource_.php index 2d4a794c2..1998ee0ad 100644 --- a/app/vendor/phpdocumentor/type-resolver/src/Types/Resource_.php +++ b/app/vendor/phpdocumentor/type-resolver/src/Types/Resource_.php @@ -25,7 +25,7 @@ final class Resource_ implements Type /** * Returns a rendered output of the Type as it would be used in a DocBlock. */ - public function __toString() : string + public function __toString(): string { return 'resource'; } diff --git a/app/vendor/phpdocumentor/type-resolver/src/Types/Scalar.php b/app/vendor/phpdocumentor/type-resolver/src/Types/Scalar.php index 00ac36914..80241c21e 100644 --- a/app/vendor/phpdocumentor/type-resolver/src/Types/Scalar.php +++ b/app/vendor/phpdocumentor/type-resolver/src/Types/Scalar.php @@ -25,7 +25,7 @@ final class Scalar implements Type /** * Returns a rendered output of the Type as it would be used in a DocBlock. */ - public function __toString() : string + public function __toString(): string { return 'scalar'; } diff --git a/app/vendor/phpdocumentor/type-resolver/src/Types/Self_.php b/app/vendor/phpdocumentor/type-resolver/src/Types/Self_.php index 7fa13fa5e..5096126e5 100644 --- a/app/vendor/phpdocumentor/type-resolver/src/Types/Self_.php +++ b/app/vendor/phpdocumentor/type-resolver/src/Types/Self_.php @@ -27,7 +27,7 @@ final class Self_ implements Type /** * Returns a rendered output of the Type as it would be used in a DocBlock. */ - public function __toString() : string + public function __toString(): string { return 'self'; } diff --git a/app/vendor/phpdocumentor/type-resolver/src/Types/Static_.php b/app/vendor/phpdocumentor/type-resolver/src/Types/Static_.php index 568400ce5..6fe365ff1 100644 --- a/app/vendor/phpdocumentor/type-resolver/src/Types/Static_.php +++ b/app/vendor/phpdocumentor/type-resolver/src/Types/Static_.php @@ -32,7 +32,7 @@ final class Static_ implements Type /** * Returns a rendered output of the Type as it would be used in a DocBlock. */ - public function __toString() : string + public function __toString(): string { return 'static'; } diff --git a/app/vendor/phpdocumentor/type-resolver/src/Types/String_.php b/app/vendor/phpdocumentor/type-resolver/src/Types/String_.php index 6b92e413d..a4bb47f1a 100644 --- a/app/vendor/phpdocumentor/type-resolver/src/Types/String_.php +++ b/app/vendor/phpdocumentor/type-resolver/src/Types/String_.php @@ -20,12 +20,12 @@ * * @psalm-immutable */ -final class String_ implements Type +class String_ implements Type { /** * Returns a rendered output of the Type as it would be used in a DocBlock. */ - public function __toString() : string + public function __toString(): string { return 'string'; } diff --git a/app/vendor/phpdocumentor/type-resolver/src/Types/This.php b/app/vendor/phpdocumentor/type-resolver/src/Types/This.php index 58cb3af05..602fc698f 100644 --- a/app/vendor/phpdocumentor/type-resolver/src/Types/This.php +++ b/app/vendor/phpdocumentor/type-resolver/src/Types/This.php @@ -28,7 +28,7 @@ final class This implements Type /** * Returns a rendered output of the Type as it would be used in a DocBlock. */ - public function __toString() : string + public function __toString(): string { return '$this'; } diff --git a/app/vendor/phpdocumentor/type-resolver/src/Types/Void_.php b/app/vendor/phpdocumentor/type-resolver/src/Types/Void_.php index 5cabad505..23a601d47 100644 --- a/app/vendor/phpdocumentor/type-resolver/src/Types/Void_.php +++ b/app/vendor/phpdocumentor/type-resolver/src/Types/Void_.php @@ -16,7 +16,7 @@ use phpDocumentor\Reflection\Type; /** - * Value Object representing the pseudo-type 'void'. + * Value Object representing the return-type 'void'. * * Void is generally only used when working with return types as it signifies that the method intentionally does not * return any value. @@ -28,7 +28,7 @@ final class Void_ implements Type /** * Returns a rendered output of the Type as it would be used in a DocBlock. */ - public function __toString() : string + public function __toString(): string { return 'void'; } diff --git a/app/vendor/phpspec/prophecy/CHANGES.md b/app/vendor/phpspec/prophecy/CHANGES.md index 30ac3fc68..dac6ab9c5 100644 --- a/app/vendor/phpspec/prophecy/CHANGES.md +++ b/app/vendor/phpspec/prophecy/CHANGES.md @@ -1,3 +1,11 @@ +1.14.0 / 2021/09/16 +=================== + +* [added] Support for static closures in will and should [@ntzm] +* [added] Allow install on PHP 8.1 (with test suite fixes) [@javer] +* [added] Support for the 'never' return type [@ciaranmcnulty] +* [fixed] Better error message when doubling intersection return types [@ciaranmcnulty] + 1.13.0 / 2021/03/17 =================== diff --git a/app/vendor/phpspec/prophecy/LICENSE b/app/vendor/phpspec/prophecy/LICENSE index c8b364711..d5b7cd848 100644 --- a/app/vendor/phpspec/prophecy/LICENSE +++ b/app/vendor/phpspec/prophecy/LICENSE @@ -1,5 +1,5 @@ Copyright (c) 2013 Konstantin Kudryashov - Marcello Duarte +Copyright (c) 2013 Marcello Duarte Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation diff --git a/app/vendor/phpspec/prophecy/composer.json b/app/vendor/phpspec/prophecy/composer.json index de6b7c2b9..129a4cf6c 100644 --- a/app/vendor/phpspec/prophecy/composer.json +++ b/app/vendor/phpspec/prophecy/composer.json @@ -18,7 +18,7 @@ ], "require": { - "php": "^7.2 || ~8.0, <8.1", + "php": "^7.2 || ~8.0, <8.2", "phpdocumentor/reflection-docblock": "^5.2", "sebastian/comparator": "^3.0 || ^4.0", "doctrine/instantiator": "^1.2", @@ -26,7 +26,7 @@ }, "require-dev": { - "phpspec/phpspec": "^6.0", + "phpspec/phpspec": "^6.0 || ^7.0", "phpunit/phpunit": "^8.0 || ^9.0" }, @@ -44,7 +44,7 @@ "extra": { "branch-alias": { - "dev-master": "1.11.x-dev" + "dev-master": "1.x-dev" } } } diff --git a/app/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/ProphecySubjectPatch.php b/app/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/ProphecySubjectPatch.php index 0330ebc85..7573ca50e 100644 --- a/app/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/ProphecySubjectPatch.php +++ b/app/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/ProphecySubjectPatch.php @@ -52,7 +52,7 @@ public function apply(ClassNode $node) continue; } - if ($method->getReturnTypeNode()->isVoid()) { + if (!$method->getReturnTypeNode()->hasReturnStatement()) { $method->setCode( '$this->getProphecy()->makeProphecyMethodCall(__FUNCTION__, func_get_args());' ); diff --git a/app/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/TraversablePatch.php b/app/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/TraversablePatch.php index eea020282..0e2e04700 100644 --- a/app/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/TraversablePatch.php +++ b/app/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/TraversablePatch.php @@ -13,6 +13,7 @@ use Prophecy\Doubler\Generator\Node\ClassNode; use Prophecy\Doubler\Generator\Node\MethodNode; +use Prophecy\Doubler\Generator\Node\ReturnTypeNode; /** * Traversable interface patch. @@ -64,11 +65,25 @@ public function apply(ClassNode $node) { $node->addInterface('Iterator'); - $node->addMethod(new MethodNode('current')); - $node->addMethod(new MethodNode('key')); - $node->addMethod(new MethodNode('next')); - $node->addMethod(new MethodNode('rewind')); - $node->addMethod(new MethodNode('valid')); + $currentMethod = new MethodNode('current'); + (\PHP_VERSION_ID >= 80100) && $currentMethod->setReturnTypeNode(new ReturnTypeNode('mixed')); + $node->addMethod($currentMethod); + + $keyMethod = new MethodNode('key'); + (\PHP_VERSION_ID >= 80100) && $keyMethod->setReturnTypeNode(new ReturnTypeNode('mixed')); + $node->addMethod($keyMethod); + + $nextMethod = new MethodNode('next'); + (\PHP_VERSION_ID >= 80100) && $nextMethod->setReturnTypeNode(new ReturnTypeNode('void')); + $node->addMethod($nextMethod); + + $rewindMethod = new MethodNode('rewind'); + (\PHP_VERSION_ID >= 80100) && $rewindMethod->setReturnTypeNode(new ReturnTypeNode('void')); + $node->addMethod($rewindMethod); + + $validMethod = new MethodNode('valid'); + (\PHP_VERSION_ID >= 80100) && $validMethod->setReturnTypeNode(new ReturnTypeNode('bool')); + $node->addMethod($validMethod); } /** diff --git a/app/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/ClassMirror.php b/app/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/ClassMirror.php index 6b21623b4..5d9cd2d20 100644 --- a/app/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/ClassMirror.php +++ b/app/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/ClassMirror.php @@ -16,6 +16,7 @@ use Prophecy\Exception\InvalidArgumentException; use Prophecy\Exception\Doubler\ClassMirrorException; use ReflectionClass; +use ReflectionIntersectionType; use ReflectionMethod; use ReflectionNamedType; use ReflectionParameter; @@ -151,6 +152,10 @@ private function reflectMethodToNode(ReflectionMethod $method, Node\ClassNode $c $returnTypes = $this->getTypeHints($method->getReturnType(), $method->getDeclaringClass(), $method->getReturnType()->allowsNull()); $node->setReturnTypeNode(new ReturnTypeNode(...$returnTypes)); } + elseif (method_exists($method, 'hasTentativeReturnType') && $method->hasTentativeReturnType()) { + $returnTypes = $this->getTypeHints($method->getTentativeReturnType(), $method->getDeclaringClass(), $method->getTentativeReturnType()->allowsNull()); + $node->setReturnTypeNode(new ReturnTypeNode(...$returnTypes)); + } if (is_array($params = $method->getParameters()) && count($params)) { foreach ($params as $param) { @@ -196,7 +201,7 @@ private function hasDefaultValue(ReflectionParameter $parameter) return true; } - return $parameter->isOptional() || ($parameter->allowsNull() && $parameter->getType()); + return $parameter->isOptional() || ($parameter->allowsNull() && $parameter->getType() && \PHP_VERSION_ID < 80100); } private function getDefaultValue(ReflectionParameter $parameter) @@ -219,6 +224,12 @@ private function getTypeHints(?ReflectionType $type, ?ReflectionClass $class, bo elseif ($type instanceof ReflectionUnionType) { $types = $type->getTypes(); } + elseif ($type instanceof ReflectionIntersectionType) { + throw new ClassMirrorException('Doubling intersection types is not supported', $class); + } + elseif(is_object($type)) { + throw new ClassMirrorException('Unknown reflection type ' . get_class($type), $class); + } $types = array_map( function(string $type) use ($class) { diff --git a/app/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/Node/ReturnTypeNode.php b/app/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/Node/ReturnTypeNode.php index f68853758..5b5824988 100644 --- a/app/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/Node/ReturnTypeNode.php +++ b/app/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/Node/ReturnTypeNode.php @@ -8,11 +8,13 @@ final class ReturnTypeNode extends TypeNodeAbstract { protected function getRealType(string $type): string { - if ($type == 'void') { - return $type; + switch ($type) { + case 'void': + case 'never': + return $type; + default: + return parent::getRealType($type); } - - return parent::getRealType($type); } protected function guardIsValidType() @@ -20,12 +22,24 @@ protected function guardIsValidType() if (isset($this->types['void']) && count($this->types) !== 1) { throw new DoubleException('void cannot be part of a union'); } + if (isset($this->types['never']) && count($this->types) !== 1) { + throw new DoubleException('never cannot be part of a union'); + } parent::guardIsValidType(); } - public function isVoid(): bool + /** + * @deprecated use hasReturnStatement + */ + public function isVoid() { return $this->types == ['void' => 'void']; } + + public function hasReturnStatement(): bool + { + return $this->types !== ['void' => 'void'] + && $this->types !== ['never' => 'never']; + } } diff --git a/app/vendor/phpspec/prophecy/src/Prophecy/Prediction/CallbackPrediction.php b/app/vendor/phpspec/prophecy/src/Prophecy/Prediction/CallbackPrediction.php index 44bc782c8..727931f3d 100644 --- a/app/vendor/phpspec/prophecy/src/Prophecy/Prediction/CallbackPrediction.php +++ b/app/vendor/phpspec/prophecy/src/Prophecy/Prediction/CallbackPrediction.php @@ -16,6 +16,7 @@ use Prophecy\Prophecy\MethodProphecy; use Prophecy\Exception\InvalidArgumentException; use Closure; +use ReflectionFunction; /** * Callback prediction. @@ -56,7 +57,7 @@ public function check(array $calls, ObjectProphecy $object, MethodProphecy $meth { $callback = $this->callback; - if ($callback instanceof Closure && method_exists('Closure', 'bind')) { + if ($callback instanceof Closure && method_exists('Closure', 'bind') && (new ReflectionFunction($callback))->getClosureThis() !== null) { $callback = Closure::bind($callback, $object); } diff --git a/app/vendor/phpspec/prophecy/src/Prophecy/Promise/CallbackPromise.php b/app/vendor/phpspec/prophecy/src/Prophecy/Promise/CallbackPromise.php index 5f406bf7a..f766e6e67 100644 --- a/app/vendor/phpspec/prophecy/src/Prophecy/Promise/CallbackPromise.php +++ b/app/vendor/phpspec/prophecy/src/Prophecy/Promise/CallbackPromise.php @@ -15,6 +15,7 @@ use Prophecy\Prophecy\MethodProphecy; use Prophecy\Exception\InvalidArgumentException; use Closure; +use ReflectionFunction; /** * Callback promise. @@ -57,7 +58,7 @@ public function execute(array $args, ObjectProphecy $object, MethodProphecy $met { $callback = $this->callback; - if ($callback instanceof Closure && method_exists('Closure', 'bind')) { + if ($callback instanceof Closure && method_exists('Closure', 'bind') && (new ReflectionFunction($callback))->getClosureThis() !== null) { $callback = Closure::bind($callback, $object); } diff --git a/app/vendor/phpspec/prophecy/src/Prophecy/Prophecy/MethodProphecy.php b/app/vendor/phpspec/prophecy/src/Prophecy/Prophecy/MethodProphecy.php index c2c1913da..c45c281d7 100644 --- a/app/vendor/phpspec/prophecy/src/Prophecy/Prophecy/MethodProphecy.php +++ b/app/vendor/phpspec/prophecy/src/Prophecy/Prophecy/MethodProphecy.php @@ -73,9 +73,16 @@ public function __construct(ObjectProphecy $objectProphecy, $methodName, $argume $this->withArguments($arguments); } - if (true === $reflectedMethod->hasReturnType()) { + $hasTentativeReturnType = method_exists($reflectedMethod, 'hasTentativeReturnType') + && $reflectedMethod->hasTentativeReturnType(); - $reflectionType = $reflectedMethod->getReturnType(); + if (true === $reflectedMethod->hasReturnType() || $hasTentativeReturnType) { + if ($hasTentativeReturnType) { + $reflectionType = $reflectedMethod->getTentativeReturnType(); + } + else { + $reflectionType = $reflectedMethod->getReturnType(); + } if ($reflectionType instanceof ReflectionNamedType) { $types = [$reflectionType]; diff --git a/app/vendor/phpunit/php-code-coverage/ChangeLog.md b/app/vendor/phpunit/php-code-coverage/ChangeLog.md index 4dc493e29..fe6bcfdec 100644 --- a/app/vendor/phpunit/php-code-coverage/ChangeLog.md +++ b/app/vendor/phpunit/php-code-coverage/ChangeLog.md @@ -2,6 +2,12 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles. +## [9.2.7] - 2021-09-17 + +### Fixed + +* [#860](https://github.com/sebastianbergmann/php-code-coverage/pull/860): Empty value for `XDEBUG_MODE` environment variable is not handled correctly + ## [9.2.6] - 2021-03-28 ### Fixed @@ -214,6 +220,36 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](htt * This component is no longer supported on PHP 7.2 +## [7.0.15] - 2021-07-26 + +### Changed + +* Bumped required version of php-token-stream + +## [7.0.14] - 2020-12-02 + +### Changed + +* [#837](https://github.com/sebastianbergmann/php-code-coverage/issues/837): Allow version 4 of php-token-stream + +## [7.0.13] - 2020-11-30 + +### Changed + +* Changed PHP version constraint in `composer.json` from `^7.2` to `>=7.2` to allow installation of this version of this library on PHP 8. However, this version of this library does not work on PHP 8. PHPUnit 8.5, which uses this version of this library, does not call into this library and instead shows a message that code coverage functionality is not available for PHPUnit 8.5 on PHP 8. + +## [7.0.12] - 2020-11-27 + +### Added + +* [#834](https://github.com/sebastianbergmann/php-code-coverage/issues/834): Support `XDEBUG_MODE` environment variable + +## [7.0.11] - 2020-11-27 + +### Added + +* Support for Xdebug 3 + ## [7.0.10] - 2019-11-20 ### Fixed @@ -293,37 +329,7 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](htt * This component is no longer supported on PHP 7.1 -## [6.1.4] - 2018-10-31 - -### Fixed - -* [#650](https://github.com/sebastianbergmann/php-code-coverage/issues/650): Wasted screen space in HTML code coverage report - -## [6.1.3] - 2018-10-23 - -### Changed - -* Use `^3.1` of `sebastian/environment` again due to [regression](https://github.com/sebastianbergmann/environment/issues/31) - -## [6.1.2] - 2018-10-23 - -### Fixed - -* [#645](https://github.com/sebastianbergmann/php-code-coverage/pull/645): Crash that can occur when php-token-stream parses invalid files - -## [6.1.1] - 2018-10-18 - -### Changed - -* This component now allows `^4` of `sebastian/environment` - -## [6.1.0] - 2018-10-16 - -### Changed - -* Class names are now abbreviated (unqualified name shown, fully qualified name shown on hover) in the file view of the HTML report -* Update HTML report to Bootstrap 4 - +[9.2.7]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.2.6...9.2.7 [9.2.6]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.2.5...9.2.6 [9.2.5]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.2.4...9.2.5 [9.2.4]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.2.3...9.2.4 @@ -347,6 +353,11 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](htt [8.0.2]: https://github.com/sebastianbergmann/php-code-coverage/compare/8.0.1...8.0.2 [8.0.1]: https://github.com/sebastianbergmann/php-code-coverage/compare/8.0.0...8.0.1 [8.0.0]: https://github.com/sebastianbergmann/php-code-coverage/compare/7.0.10...8.0.0 +[7.0.15]: https://github.com/sebastianbergmann/php-code-coverage/compare/7.0.14...7.0.15 +[7.0.14]: https://github.com/sebastianbergmann/php-code-coverage/compare/7.0.13...7.0.14 +[7.0.13]: https://github.com/sebastianbergmann/php-code-coverage/compare/7.0.12...7.0.13 +[7.0.12]: https://github.com/sebastianbergmann/php-code-coverage/compare/7.0.11...7.0.12 +[7.0.11]: https://github.com/sebastianbergmann/php-code-coverage/compare/7.0.10...7.0.11 [7.0.10]: https://github.com/sebastianbergmann/php-code-coverage/compare/7.0.9...7.0.10 [7.0.9]: https://github.com/sebastianbergmann/php-code-coverage/compare/7.0.8...7.0.9 [7.0.8]: https://github.com/sebastianbergmann/php-code-coverage/compare/7.0.7...7.0.8 @@ -358,9 +369,3 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](htt [7.0.2]: https://github.com/sebastianbergmann/php-code-coverage/compare/7.0.1...7.0.2 [7.0.1]: https://github.com/sebastianbergmann/php-code-coverage/compare/7.0.0...7.0.1 [7.0.0]: https://github.com/sebastianbergmann/php-code-coverage/compare/6.1.4...7.0.0 -[6.1.4]: https://github.com/sebastianbergmann/php-code-coverage/compare/6.1.3...6.1.4 -[6.1.3]: https://github.com/sebastianbergmann/php-code-coverage/compare/6.1.2...6.1.3 -[6.1.2]: https://github.com/sebastianbergmann/php-code-coverage/compare/6.1.1...6.1.2 -[6.1.1]: https://github.com/sebastianbergmann/php-code-coverage/compare/6.1.0...6.1.1 -[6.1.0]: https://github.com/sebastianbergmann/php-code-coverage/compare/6.0...6.1.0 - diff --git a/app/vendor/phpunit/php-code-coverage/composer.json b/app/vendor/phpunit/php-code-coverage/composer.json index fbc108118..898484ffb 100644 --- a/app/vendor/phpunit/php-code-coverage/composer.json +++ b/app/vendor/phpunit/php-code-coverage/composer.json @@ -32,7 +32,7 @@ "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.10.2", + "nikic/php-parser": "^4.12.0", "phpunit/php-file-iterator": "^3.0.3", "phpunit/php-text-template": "^2.0.2", "sebastian/code-unit-reverse-lookup": "^2.0.2", diff --git a/app/vendor/phpunit/php-code-coverage/src/CodeCoverage.php b/app/vendor/phpunit/php-code-coverage/src/CodeCoverage.php index 314bd968a..6445c6d27 100644 --- a/app/vendor/phpunit/php-code-coverage/src/CodeCoverage.php +++ b/app/vendor/phpunit/php-code-coverage/src/CodeCoverage.php @@ -240,9 +240,9 @@ public function stop(bool $append = true, $linesToBeCovered = [], array $linesTo * @param PhptTestCase|string|TestCase $id * @param array|false $linesToBeCovered * - * @throws UnintentionallyCoveredCodeException - * @throws TestIdMissingException * @throws ReflectionException + * @throws TestIdMissingException + * @throws UnintentionallyCoveredCodeException */ public function append(RawCodeCoverageData $rawData, $id = null, bool $append = true, $linesToBeCovered = [], array $linesToBeUsed = []): void { @@ -436,8 +436,8 @@ public function detectsDeadCode(): bool * * @param array|false $linesToBeCovered * - * @throws UnintentionallyCoveredCodeException * @throws ReflectionException + * @throws UnintentionallyCoveredCodeException */ private function applyCoversAnnotationFilter(RawCodeCoverageData $rawData, $linesToBeCovered, array $linesToBeUsed): void { @@ -543,8 +543,8 @@ private function processUncoveredFilesFromFilter(): void } /** - * @throws UnintentionallyCoveredCodeException * @throws ReflectionException + * @throws UnintentionallyCoveredCodeException */ private function performUnintentionallyCoveredCodeCheck(RawCodeCoverageData $data, array $linesToBeCovered, array $linesToBeUsed): void { diff --git a/app/vendor/phpunit/php-code-coverage/src/Driver/Driver.php b/app/vendor/phpunit/php-code-coverage/src/Driver/Driver.php index b8961113e..dc2de68f4 100644 --- a/app/vendor/phpunit/php-code-coverage/src/Driver/Driver.php +++ b/app/vendor/phpunit/php-code-coverage/src/Driver/Driver.php @@ -71,9 +71,9 @@ abstract class Driver * @throws NoCodeCoverageDriverAvailableException * @throws PcovNotAvailableException * @throws PhpdbgNotAvailableException - * @throws XdebugNotAvailableException * @throws Xdebug2NotEnabledException * @throws Xdebug3NotEnabledException + * @throws XdebugNotAvailableException * * @deprecated Use DriverSelector::forLineCoverage() instead */ @@ -84,9 +84,9 @@ public static function forLineCoverage(Filter $filter): self /** * @throws NoCodeCoverageDriverWithPathCoverageSupportAvailableException - * @throws XdebugNotAvailableException * @throws Xdebug2NotEnabledException * @throws Xdebug3NotEnabledException + * @throws XdebugNotAvailableException * * @deprecated Use DriverSelector::forLineAndPathCoverage() instead */ diff --git a/app/vendor/phpunit/php-code-coverage/src/Driver/Selector.php b/app/vendor/phpunit/php-code-coverage/src/Driver/Selector.php index 709e9bc04..936ee8981 100644 --- a/app/vendor/phpunit/php-code-coverage/src/Driver/Selector.php +++ b/app/vendor/phpunit/php-code-coverage/src/Driver/Selector.php @@ -22,9 +22,9 @@ final class Selector * @throws NoCodeCoverageDriverAvailableException * @throws PcovNotAvailableException * @throws PhpdbgNotAvailableException - * @throws XdebugNotAvailableException * @throws Xdebug2NotEnabledException * @throws Xdebug3NotEnabledException + * @throws XdebugNotAvailableException */ public function forLineCoverage(Filter $filter): Driver { @@ -55,9 +55,9 @@ public function forLineCoverage(Filter $filter): Driver /** * @throws NoCodeCoverageDriverWithPathCoverageSupportAvailableException - * @throws XdebugNotAvailableException * @throws Xdebug2NotEnabledException * @throws Xdebug3NotEnabledException + * @throws XdebugNotAvailableException */ public function forLineAndPathCoverage(Filter $filter): Driver { diff --git a/app/vendor/phpunit/php-code-coverage/src/Driver/Xdebug2Driver.php b/app/vendor/phpunit/php-code-coverage/src/Driver/Xdebug2Driver.php index a7238442d..74cbbfbcd 100644 --- a/app/vendor/phpunit/php-code-coverage/src/Driver/Xdebug2Driver.php +++ b/app/vendor/phpunit/php-code-coverage/src/Driver/Xdebug2Driver.php @@ -39,9 +39,9 @@ final class Xdebug2Driver extends Driver private $pathCoverageIsMixedCoverage; /** - * @throws XdebugNotAvailableException * @throws WrongXdebugVersionException * @throws Xdebug2NotEnabledException + * @throws XdebugNotAvailableException */ public function __construct(Filter $filter) { diff --git a/app/vendor/phpunit/php-code-coverage/src/Driver/Xdebug3Driver.php b/app/vendor/phpunit/php-code-coverage/src/Driver/Xdebug3Driver.php index b85bfab0e..b85db4034 100644 --- a/app/vendor/phpunit/php-code-coverage/src/Driver/Xdebug3Driver.php +++ b/app/vendor/phpunit/php-code-coverage/src/Driver/Xdebug3Driver.php @@ -35,9 +35,9 @@ final class Xdebug3Driver extends Driver { /** - * @throws XdebugNotAvailableException * @throws WrongXdebugVersionException * @throws Xdebug3NotEnabledException + * @throws XdebugNotAvailableException */ public function __construct(Filter $filter) { @@ -56,7 +56,7 @@ public function __construct(Filter $filter) $mode = getenv('XDEBUG_MODE'); - if ($mode === false) { + if ($mode === false || $mode === '') { $mode = ini_get('xdebug.mode'); } diff --git a/app/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer.php b/app/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer.php index df2753a56..fe285b186 100644 --- a/app/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer.php +++ b/app/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer.php @@ -11,7 +11,6 @@ use function array_pop; use function count; -use function phpversion; use function sprintf; use function str_repeat; use function substr_count; @@ -305,29 +304,11 @@ private function runtimeString(): string { $runtime = new Runtime; - $buffer = sprintf( + return sprintf( '%s %s', $runtime->getVendorUrl(), $runtime->getName(), $runtime->getVersion() ); - - if ($runtime->hasPHPDBGCodeCoverage()) { - return $buffer; - } - - if ($runtime->hasPCOV()) { - $buffer .= sprintf( - ' with PCOV %s', - phpversion('pcov') - ); - } elseif ($runtime->hasXdebug()) { - $buffer .= sprintf( - ' with Xdebug %s', - phpversion('xdebug') - ); - } - - return $buffer; } } diff --git a/app/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/File.php b/app/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/File.php index 09c1ae7bd..88dbfa669 100644 --- a/app/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/File.php +++ b/app/vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/File.php @@ -1136,6 +1136,14 @@ private static function keywordTokens(): array self::$keywordTokens[constant('T_MATCH')] = true; } + if (defined('T_ENUM')) { + self::$keywordTokens[constant('T_ENUM')] = true; + } + + if (defined('T_READONLY')) { + self::$keywordTokens[constant('T_READONLY')] = true; + } + return self::$keywordTokens; } } diff --git a/app/vendor/phpunit/php-code-coverage/src/Version.php b/app/vendor/phpunit/php-code-coverage/src/Version.php index 9a2dd3297..0a1d70461 100644 --- a/app/vendor/phpunit/php-code-coverage/src/Version.php +++ b/app/vendor/phpunit/php-code-coverage/src/Version.php @@ -22,7 +22,7 @@ final class Version public static function id(): string { if (self::$version === null) { - self::$version = (new VersionId('9.2.6', dirname(__DIR__)))->getVersion(); + self::$version = (new VersionId('9.2.7', dirname(__DIR__)))->getVersion(); } return self::$version; diff --git a/app/vendor/phpunit/phpunit/ChangeLog-8.5.md b/app/vendor/phpunit/phpunit/ChangeLog-8.5.md index eb78b2d88..55a77a64f 100644 --- a/app/vendor/phpunit/phpunit/ChangeLog-8.5.md +++ b/app/vendor/phpunit/phpunit/ChangeLog-8.5.md @@ -2,6 +2,35 @@ All notable changes of the PHPUnit 8.5 release series are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles. +## [8.5.21] - 2021-09-25 + +### Changed + +* PHPUnit no longer converts PHP deprecations to exceptions by default (configure `convertDeprecationsToExceptions="true"` to enable this) +* The PHPUnit XML configuration file generator now configures `convertDeprecationsToExceptions="true"` + +### Fixed + +* [#4772](https://github.com/sebastianbergmann/phpunit/pull/4772): TestDox HTML report not displayed correctly when browser has custom colour settings + +## [8.5.20] - 2021-08-31 + +### Fixed + +* [#4751](https://github.com/sebastianbergmann/phpunit/issues/4751): Configuration validation fails when using brackets in glob pattern + +## [8.5.19] - 2021-07-31 + +### Fixed + +* [#4740](https://github.com/sebastianbergmann/phpunit/issues/4740): `phpunit.phar` does not work with PHP 8.1 + +## [8.5.18] - 2021-07-19 + +### Fixed + +* [#4720](https://github.com/sebastianbergmann/phpunit/issues/4720): PHPUnit does not verify its own PHP extension requirements + ## [8.5.17] - 2021-06-23 ### Changed @@ -149,6 +178,10 @@ All notable changes of the PHPUnit 8.5 release series are documented in this fil * [#3967](https://github.com/sebastianbergmann/phpunit/issues/3967): Cannot double interface that extends interface that extends `\Throwable` * [#3968](https://github.com/sebastianbergmann/phpunit/pull/3968): Test class run in a separate PHP process are passing when `exit` called inside +[8.5.21]: https://github.com/sebastianbergmann/phpunit/compare/8.5.20...8.5.21 +[8.5.20]: https://github.com/sebastianbergmann/phpunit/compare/8.5.19...8.5.20 +[8.5.19]: https://github.com/sebastianbergmann/phpunit/compare/8.5.18...8.5.19 +[8.5.18]: https://github.com/sebastianbergmann/phpunit/compare/8.5.17...8.5.18 [8.5.17]: https://github.com/sebastianbergmann/phpunit/compare/8.5.16...8.5.17 [8.5.16]: https://github.com/sebastianbergmann/phpunit/compare/8.5.15...8.5.16 [8.5.15]: https://github.com/sebastianbergmann/phpunit/compare/8.5.14...8.5.15 diff --git a/app/vendor/phpunit/phpunit/ChangeLog-9.5.md b/app/vendor/phpunit/phpunit/ChangeLog-9.5.md index 2b1eacddb..f82676823 100644 --- a/app/vendor/phpunit/phpunit/ChangeLog-9.5.md +++ b/app/vendor/phpunit/phpunit/ChangeLog-9.5.md @@ -2,6 +2,37 @@ All notable changes of the PHPUnit 9.5 release series are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles. +## [9.5.10] - 2021-09-25 + +### Changed + +* PHPUnit no longer converts PHP deprecations to exceptions by default (configure `convertDeprecationsToExceptions="true"` to enable this) +* The PHPUnit XML configuration file generator now configures `convertDeprecationsToExceptions="true"` + +### Fixed + +* [#4772](https://github.com/sebastianbergmann/phpunit/pull/4772): TestDox HTML report not displayed correctly when browser has custom colour settings + +## [9.5.9] - 2021-08-31 + +### Fixed + +* [#4750](https://github.com/sebastianbergmann/phpunit/issues/4750): Automatic return value generation leads to invalid (and superfluous) test double code generation when a stubbed method returns `*|false` +* [#4751](https://github.com/sebastianbergmann/phpunit/issues/4751): Configuration validation fails when using brackets in glob pattern + +## [9.5.8] - 2021-07-31 + +### Fixed + +* [#4740](https://github.com/sebastianbergmann/phpunit/issues/4740): `phpunit.phar` does not work with PHP 8.1 + +## [9.5.7] - 2021-07-19 + +### Fixed + +* [#4720](https://github.com/sebastianbergmann/phpunit/issues/4720): PHPUnit does not verify its own PHP extension requirements +* [#4735](https://github.com/sebastianbergmann/phpunit/issues/4735): Automated return value generation does not work for stubbed methods that return `*|false` + ## [9.5.6] - 2021-06-23 ### Changed @@ -60,6 +91,10 @@ All notable changes of the PHPUnit 9.5 release series are documented in this fil * [#4535](https://github.com/sebastianbergmann/phpunit/issues/4535): `getMockFromWsdl()` does not handle methods that do not have parameters correctly +[9.5.10]: https://github.com/sebastianbergmann/phpunit/compare/9.5.9...9.5.10 +[9.5.9]: https://github.com/sebastianbergmann/phpunit/compare/9.5.8...9.5.9 +[9.5.8]: https://github.com/sebastianbergmann/phpunit/compare/9.5.7...9.5.8 +[9.5.7]: https://github.com/sebastianbergmann/phpunit/compare/9.5.6...9.5.7 [9.5.6]: https://github.com/sebastianbergmann/phpunit/compare/9.5.5...9.5.6 [9.5.5]: https://github.com/sebastianbergmann/phpunit/compare/9.5.4...9.5.5 [9.5.4]: https://github.com/sebastianbergmann/phpunit/compare/9.5.3...9.5.4 diff --git a/app/vendor/phpunit/phpunit/composer.json b/app/vendor/phpunit/phpunit/composer.json index 0db2e30db..e18dfb920 100644 --- a/app/vendor/phpunit/phpunit/composer.json +++ b/app/vendor/phpunit/phpunit/composer.json @@ -30,10 +30,10 @@ "ext-xmlwriter": "*", "doctrine/instantiator": "^1.3.1", "myclabs/deep-copy": "^1.10.1", - "phar-io/manifest": "^2.0.1", + "phar-io/manifest": "^2.0.3", "phar-io/version": "^3.0.2", "phpspec/prophecy": "^1.12.1", - "phpunit/php-code-coverage": "^9.2.3", + "phpunit/php-code-coverage": "^9.2.7", "phpunit/php-file-iterator": "^3.0.5", "phpunit/php-invoker": "^3.1.1", "phpunit/php-text-template": "^2.0.3", diff --git a/app/vendor/phpunit/phpunit/phpunit b/app/vendor/phpunit/phpunit/phpunit index 0c0831bad..396825d38 100755 --- a/app/vendor/phpunit/phpunit/phpunit +++ b/app/vendor/phpunit/phpunit/phpunit @@ -38,6 +38,22 @@ if (version_compare('7.3.0', PHP_VERSION, '>')) { die(1); } +foreach (['dom', 'json', 'libxml', 'mbstring', 'tokenizer', 'xml', 'xmlwriter'] as $extension) { + if (extension_loaded($extension)) { + continue; + } + + fwrite( + STDERR, + sprintf( + 'PHPUnit requires the "%s" extension.' . PHP_EOL, + $extension + ) + ); + + die(1); +} + if (!ini_get('date.timezone')) { ini_set('date.timezone', 'UTC'); } diff --git a/app/vendor/phpunit/phpunit/phpunit.xsd b/app/vendor/phpunit/phpunit/phpunit.xsd index 3785d21fe..cf44e8a49 100644 --- a/app/vendor/phpunit/phpunit/phpunit.xsd +++ b/app/vendor/phpunit/phpunit/phpunit.xsd @@ -135,7 +135,7 @@ - + @@ -213,7 +213,7 @@ - + @@ -252,7 +252,7 @@ - + @@ -280,7 +280,7 @@ - + diff --git a/app/vendor/phpunit/phpunit/schema/8.5.xsd b/app/vendor/phpunit/phpunit/schema/8.5.xsd index 29cfcf2be..5881bafec 100644 --- a/app/vendor/phpunit/phpunit/schema/8.5.xsd +++ b/app/vendor/phpunit/phpunit/schema/8.5.xsd @@ -165,7 +165,7 @@ - + @@ -282,7 +282,7 @@ - + @@ -310,7 +310,7 @@ - + diff --git a/app/vendor/phpunit/phpunit/schema/9.2.xsd b/app/vendor/phpunit/phpunit/schema/9.2.xsd index 97e86d3ab..883f21bc0 100644 --- a/app/vendor/phpunit/phpunit/schema/9.2.xsd +++ b/app/vendor/phpunit/phpunit/schema/9.2.xsd @@ -163,7 +163,7 @@ - + @@ -282,7 +282,7 @@ - + @@ -310,7 +310,7 @@ - + diff --git a/app/vendor/phpunit/phpunit/src/Framework/Constraint/Operator/BinaryOperator.php b/app/vendor/phpunit/phpunit/src/Framework/Constraint/Operator/BinaryOperator.php index 4588e7c07..11c86b526 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/Constraint/Operator/BinaryOperator.php +++ b/app/vendor/phpunit/phpunit/src/Framework/Constraint/Operator/BinaryOperator.php @@ -37,7 +37,8 @@ public static function fromConstraints(Constraint ...$constraints): self */ public function setConstraints(array $constraints): void { - $this->constraints = array_map(function ($constraint): Constraint { + $this->constraints = array_map(function ($constraint): Constraint + { return $this->checkConstraint($constraint); }, array_values($constraints)); } diff --git a/app/vendor/phpunit/phpunit/src/Framework/Constraint/Operator/LogicalNot.php b/app/vendor/phpunit/phpunit/src/Framework/Constraint/Operator/LogicalNot.php index a89d6780d..7560ce2a1 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/Constraint/Operator/LogicalNot.php +++ b/app/vendor/phpunit/phpunit/src/Framework/Constraint/Operator/LogicalNot.php @@ -50,7 +50,8 @@ public static function negate(string $string): string preg_match('/(\'[\w\W]*\')([\w\W]*)("[\w\W]*")/i', $string, $matches); - $positives = array_map(static function (string $s) { + $positives = array_map(static function (string $s) + { return '/\\b' . preg_quote($s, '/') . '/'; }, $positives); diff --git a/app/vendor/phpunit/phpunit/src/Framework/Constraint/Operator/LogicalXor.php b/app/vendor/phpunit/phpunit/src/Framework/Constraint/Operator/LogicalXor.php index 157643f82..fbdb479bc 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/Constraint/Operator/LogicalXor.php +++ b/app/vendor/phpunit/phpunit/src/Framework/Constraint/Operator/LogicalXor.php @@ -53,7 +53,8 @@ public function matches($other): bool return array_reduce( $constraints, - static function (bool $matches, Constraint $constraint) use ($other): bool { + static function (bool $matches, Constraint $constraint) use ($other): bool + { return $matches xor $constraint->evaluate($other, '', true); }, $initial->evaluate($other, '', true) diff --git a/app/vendor/phpunit/phpunit/src/Framework/ExecutionOrderDependency.php b/app/vendor/phpunit/phpunit/src/Framework/ExecutionOrderDependency.php index 8ba5b242d..09c343c16 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/ExecutionOrderDependency.php +++ b/app/vendor/phpunit/phpunit/src/Framework/ExecutionOrderDependency.php @@ -74,7 +74,8 @@ public static function filterInvalid(array $dependencies): array return array_values( array_filter( $dependencies, - static function (self $d) { + static function (self $d) + { return $d->isValid(); } ) @@ -90,7 +91,8 @@ static function (self $d) { public static function mergeUnique(array $existing, array $additional): array { $existingTargets = array_map( - static function ($dependency) { + static function ($dependency) + { return $dependency->getTarget(); }, $existing @@ -126,7 +128,8 @@ public static function diff(array $left, array $right): array $diff = []; $rightTargets = array_map( - static function ($dependency) { + static function ($dependency) + { return $dependency->getTarget(); }, $right diff --git a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/InvocationMocker.php b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/InvocationMocker.php index 3f8312afc..89b1e31ab 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/InvocationMocker.php +++ b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Builder/InvocationMocker.php @@ -235,7 +235,8 @@ public function method($constraint): self } $configurableMethodNames = array_map( - static function (ConfigurableMethod $configurable) { + static function (ConfigurableMethod $configurable) + { return strtolower($configurable->getName()); }, $this->configurableMethods diff --git a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/CannotUseAddMethodsException.php b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/CannotUseAddMethodsException.php index 12fa8b5c1..0698870bc 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/CannotUseAddMethodsException.php +++ b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/CannotUseAddMethodsException.php @@ -20,7 +20,7 @@ public function __construct(string $type, string $methodName) { parent::__construct( sprintf( - 'Trying to set mock method "%s" with addMethods(), but it exists in class "%s". Use onlyMethods() for methods that exist in the class', + 'Trying to configure method "%s" with addMethods(), but it exists in class "%s". Use onlyMethods() for methods that exist in the class', $methodName, $type ) diff --git a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/CannotUseOnlyMethodsException.php b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/CannotUseOnlyMethodsException.php index 95c302b3c..35a29b731 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/CannotUseOnlyMethodsException.php +++ b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/CannotUseOnlyMethodsException.php @@ -20,7 +20,7 @@ public function __construct(string $type, string $methodName) { parent::__construct( sprintf( - 'Trying to set mock method "%s" with onlyMethods, but it does not exist in class "%s". Use addMethods() for methods that do not exist in the class', + 'Trying to configure method "%s" with onlyMethods(), but it does not exist in class "%s". Use addMethods() for methods that do not exist in the class', $methodName, $type ) diff --git a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ClassIsFinalException.php b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ClassIsFinalException.php index 9b11f8c08..e648f0263 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ClassIsFinalException.php +++ b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/ClassIsFinalException.php @@ -20,7 +20,7 @@ public function __construct(string $className) { parent::__construct( sprintf( - 'Class "%s" is declared "final" and cannot be mocked', + 'Class "%s" is declared "final" and cannot be doubled', $className ) ); diff --git a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/DuplicateMethodException.php b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/DuplicateMethodException.php index 6eb421774..864523acb 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/DuplicateMethodException.php +++ b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/DuplicateMethodException.php @@ -23,7 +23,7 @@ public function __construct(array $methods) { parent::__construct( sprintf( - 'Cannot stub or mock using a method list that contains duplicates: "%s" (duplicate: "%s")', + 'Cannot double using a method list that contains duplicates: "%s" (duplicate: "%s")', implode(', ', $methods), implode(', ', array_unique(array_diff_assoc($methods, array_unique($methods)))) ) diff --git a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/IncompatibleReturnValueException.php b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/IncompatibleReturnValueException.php index 1bacc3516..00febaf56 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/IncompatibleReturnValueException.php +++ b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/IncompatibleReturnValueException.php @@ -23,7 +23,7 @@ public function __construct(ConfigurableMethod $method, $value) { parent::__construct( sprintf( - 'Method %s may not return value of type %s, its return declaration is "%s"', + 'Method %s may not return value of type %s, its declared return type is "%s"', $method->getName(), is_object($value) ? get_class($value) : gettype($value), $method->getReturnTypeDeclaration() diff --git a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/InvalidMethodNameException.php b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/InvalidMethodNameException.php index 5d85290fa..d2444cf12 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/InvalidMethodNameException.php +++ b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/InvalidMethodNameException.php @@ -20,7 +20,7 @@ public function __construct(string $method) { parent::__construct( sprintf( - 'Cannot stub or mock method with invalid name "%s"', + 'Cannot double method with invalid name "%s"', $method ) ); diff --git a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Invocation.php b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Invocation.php index 57b2c4721..392938347 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/MockObject/Invocation.php +++ b/app/vendor/phpunit/phpunit/src/Framework/MockObject/Invocation.php @@ -23,6 +23,7 @@ use PHPUnit\Util\Type; use SebastianBergmann\Exporter\Exporter; use stdClass; +use Throwable; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit @@ -117,68 +118,105 @@ public function getParameters(): array public function generateReturnValue() { if ($this->isReturnTypeNullable || $this->proxiedCall) { - return; + return null; } - $returnType = $this->returnType; - - if (strpos($returnType, '|') !== false) { - $types = explode('|', $returnType); - $returnType = $types[0]; + $union = false; - foreach ($types as $type) { - if ($type === 'null') { - return; - } - } + if (strpos($this->returnType, '|') !== false) { + $types = explode('|', $this->returnType); + $union = true; + } else { + $types = [$this->returnType]; } - switch (strtolower($returnType)) { - case '': - case 'void': - return; + $types = array_map('strtolower', $types); - case 'string': - return ''; + if (in_array('', $types, true) || + in_array('null', $types, true) || + in_array('mixed', $types, true) || + in_array('void', $types, true)) { + return null; + } - case 'float': - return 0.0; + if (in_array('false', $types, true) || + in_array('bool', $types, true)) { + return false; + } - case 'int': - return 0; + if (in_array('float', $types, true)) { + return 0.0; + } - case 'bool': - return false; + if (in_array('int', $types, true)) { + return 0; + } - case 'array': - return []; + if (in_array('string', $types, true)) { + return ''; + } - case 'static': - return (new Instantiator)->instantiate(get_class($this->object)); + if (in_array('array', $types, true)) { + return []; + } - case 'object': - return new stdClass; + if (in_array('static', $types, true)) { + try { + return (new Instantiator)->instantiate(get_class($this->object)); + } catch (Throwable $t) { + throw new RuntimeException( + $t->getMessage(), + (int) $t->getCode(), + $t + ); + } + } - case 'callable': - case 'closure': - return static function (): void { - }; + if (in_array('object', $types, true)) { + return new stdClass; + } - case 'traversable': - case 'generator': - case 'iterable': - $generator = static function (): \Generator { - yield from []; - }; + if (in_array('callable', $types, true) || + in_array('closure', $types, true)) { + return static function (): void + { + }; + } - return $generator(); + if (in_array('traversable', $types, true) || + in_array('generator', $types, true) || + in_array('iterable', $types, true)) { + $generator = static function (): \Generator + { + yield from []; + }; - case 'mixed': - return null; + return $generator(); + } - default: + if (!$union) { + try { return (new Generator)->getMock($this->returnType, [], [], '', false); + } catch (Throwable $t) { + throw new RuntimeException( + sprintf( + 'Return value for %s::%s() cannot be generated: %s', + $this->className, + $this->methodName, + $t->getMessage(), + ), + (int) $t->getCode(), + ); + } } + + throw new RuntimeException( + sprintf( + 'Return value for %s::%s() cannot be generated because the declared return type is a union, please configure a return value for this method', + $this->className, + $this->methodName + ) + ); } public function toString(): string diff --git a/app/vendor/phpunit/phpunit/src/Framework/TestCase.php b/app/vendor/phpunit/phpunit/src/Framework/TestCase.php index 281bce08c..abe809f7e 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/TestCase.php +++ b/app/vendor/phpunit/phpunit/src/Framework/TestCase.php @@ -1744,7 +1744,8 @@ protected function createPartialMock(string $originalClassName, array $methods): $mockedMethodsThatDontExist = array_filter( $methods, - static function (string $method) use ($reflector) { + static function (string $method) use ($reflector) + { return !$reflector->hasMethod($method); } ); diff --git a/app/vendor/phpunit/phpunit/src/Framework/TestResult.php b/app/vendor/phpunit/phpunit/src/Framework/TestResult.php index fc00628f1..78a14657f 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/TestResult.php +++ b/app/vendor/phpunit/phpunit/src/Framework/TestResult.php @@ -109,7 +109,7 @@ final class TestResult implements Countable /** * @var bool */ - private $convertDeprecationsToExceptions = true; + private $convertDeprecationsToExceptions = false; /** * @var bool diff --git a/app/vendor/phpunit/phpunit/src/Framework/TestSuite.php b/app/vendor/phpunit/phpunit/src/Framework/TestSuite.php index 16422562c..601744c81 100644 --- a/app/vendor/phpunit/phpunit/src/Framework/TestSuite.php +++ b/app/vendor/phpunit/phpunit/src/Framework/TestSuite.php @@ -563,7 +563,8 @@ public function getName(): string public function getGroups(): array { return array_map( - static function ($key): string { + static function ($key): string + { return (string) $key; }, array_keys($this->groups) diff --git a/app/vendor/phpunit/phpunit/src/Runner/TestSuiteSorter.php b/app/vendor/phpunit/phpunit/src/Runner/TestSuiteSorter.php index fcf2cdbb4..64ad845cf 100644 --- a/app/vendor/phpunit/phpunit/src/Runner/TestSuiteSorter.php +++ b/app/vendor/phpunit/phpunit/src/Runner/TestSuiteSorter.php @@ -237,7 +237,8 @@ private function sortDefectsFirst(array $tests): array /** * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ - function ($left, $right) { + function ($left, $right) + { return $this->cmpDefectPriorityAndTime($left, $right); } ); @@ -252,7 +253,8 @@ private function sortByDuration(array $tests): array /** * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ - function ($left, $right) { + function ($left, $right) + { return $this->cmpDuration($left, $right); } ); @@ -267,7 +269,8 @@ private function sortBySize(array $tests): array /** * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ - function ($left, $right) { + function ($left, $right) + { return $this->cmpSize($left, $right); } ); diff --git a/app/vendor/phpunit/phpunit/src/Runner/Version.php b/app/vendor/phpunit/phpunit/src/Runner/Version.php index c8be9e3e9..4c8da4682 100644 --- a/app/vendor/phpunit/phpunit/src/Runner/Version.php +++ b/app/vendor/phpunit/phpunit/src/Runner/Version.php @@ -41,7 +41,7 @@ public static function id(): string } if (self::$version === '') { - self::$version = (new VersionId('9.5.6', dirname(__DIR__, 2)))->getVersion(); + self::$version = (new VersionId('9.5.10', dirname(__DIR__, 2)))->getVersion(); } return self::$version; diff --git a/app/vendor/phpunit/phpunit/src/TextUI/Help.php b/app/vendor/phpunit/phpunit/src/TextUI/Help.php index 7c5d51c79..084f2a218 100644 --- a/app/vendor/phpunit/phpunit/src/TextUI/Help.php +++ b/app/vendor/phpunit/phpunit/src/TextUI/Help.php @@ -243,7 +243,8 @@ private function writeWithColor(): void $arg = Color::colorize('fg-green', str_pad($option['arg'], $this->maxArgLength)); $arg = preg_replace_callback( '/(<[^>]+>)/', - static function ($matches) { + static function ($matches) + { return Color::colorize('fg-cyan', $matches[0]); }, $arg diff --git a/app/vendor/phpunit/phpunit/src/TextUI/TestRunner.php b/app/vendor/phpunit/phpunit/src/TextUI/TestRunner.php index b4e1450c2..b649dd3fd 100644 --- a/app/vendor/phpunit/phpunit/src/TextUI/TestRunner.php +++ b/app/vendor/phpunit/phpunit/src/TextUI/TestRunner.php @@ -248,8 +248,8 @@ public function run(TestSuite $suite, array $arguments = [], array $warnings = [ unset($listener, $listenerNeeded); - if (!$arguments['convertDeprecationsToExceptions']) { - $result->convertDeprecationsToExceptions(false); + if ($arguments['convertDeprecationsToExceptions']) { + $result->convertDeprecationsToExceptions(true); } if (!$arguments['convertErrorsToExceptions']) { @@ -1101,7 +1101,7 @@ private function handleConfiguration(array &$arguments): void $arguments['cacheResult'] = $arguments['cacheResult'] ?? true; $arguments['colors'] = $arguments['colors'] ?? DefaultResultPrinter::COLOR_DEFAULT; $arguments['columns'] = $arguments['columns'] ?? 80; - $arguments['convertDeprecationsToExceptions'] = $arguments['convertDeprecationsToExceptions'] ?? true; + $arguments['convertDeprecationsToExceptions'] = $arguments['convertDeprecationsToExceptions'] ?? false; $arguments['convertErrorsToExceptions'] = $arguments['convertErrorsToExceptions'] ?? true; $arguments['convertNoticesToExceptions'] = $arguments['convertNoticesToExceptions'] ?? true; $arguments['convertWarningsToExceptions'] = $arguments['convertWarningsToExceptions'] ?? true; @@ -1174,7 +1174,8 @@ private function processSuiteFilters(TestSuite $suite, array $arguments): void $filterFactory->addFilter( new ReflectionClass(IncludeGroupFilterIterator::class), array_map( - static function (string $name): string { + static function (string $name): string + { return '__phpunit_covers_' . $name; }, $arguments['testsCovering'] @@ -1186,7 +1187,8 @@ static function (string $name): string { $filterFactory->addFilter( new ReflectionClass(IncludeGroupFilterIterator::class), array_map( - static function (string $name): string { + static function (string $name): string + { return '__phpunit_uses_' . $name; }, $arguments['testsUsing'] diff --git a/app/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Generator.php b/app/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Generator.php index bc66b610a..cc77b1a3c 100644 --- a/app/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Generator.php +++ b/app/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Generator.php @@ -30,6 +30,7 @@ final class Generator beStrictAboutCoversAnnotation="true" beStrictAboutOutputDuringTests="true" beStrictAboutTodoAnnotatedTests="true" + convertDeprecationsToExceptions="true" failOnRisky="true" failOnWarning="true" verbose="true"> diff --git a/app/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Loader.php b/app/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Loader.php index 63e20bd85..d705a6056 100644 --- a/app/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Loader.php +++ b/app/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Loader.php @@ -1035,7 +1035,7 @@ private function phpunit(string $filename, DOMDocument $document): PHPUnit $this->getBooleanAttribute($document->documentElement, 'noInteraction', false), $this->getBooleanAttribute($document->documentElement, 'verbose', false), $this->getBooleanAttribute($document->documentElement, 'reverseDefectList', false), - $this->getBooleanAttribute($document->documentElement, 'convertDeprecationsToExceptions', true), + $this->getBooleanAttribute($document->documentElement, 'convertDeprecationsToExceptions', false), $this->getBooleanAttribute($document->documentElement, 'convertErrorsToExceptions', true), $this->getBooleanAttribute($document->documentElement, 'convertNoticesToExceptions', true), $this->getBooleanAttribute($document->documentElement, 'convertWarningsToExceptions', true), diff --git a/app/vendor/phpunit/phpunit/src/Util/Annotation/DocBlock.php b/app/vendor/phpunit/phpunit/src/Util/Annotation/DocBlock.php index 2929b4d2d..6aa069602 100644 --- a/app/vendor/phpunit/phpunit/src/Util/Annotation/DocBlock.php +++ b/app/vendor/phpunit/phpunit/src/Util/Annotation/DocBlock.php @@ -534,7 +534,8 @@ private static function extractAnnotationsFromReflector(Reflector $reflector): a $annotations = array_merge( $annotations, ...array_map( - static function (ReflectionClass $trait): array { + static function (ReflectionClass $trait): array + { return self::parseDocBlock((string) $trait->getDocComment()); }, array_values($reflector->getTraits()) diff --git a/app/vendor/phpunit/phpunit/src/Util/Color.php b/app/vendor/phpunit/phpunit/src/Util/Color.php index a756953b6..b96eb4747 100644 --- a/app/vendor/phpunit/phpunit/src/Util/Color.php +++ b/app/vendor/phpunit/phpunit/src/Util/Color.php @@ -116,7 +116,8 @@ public static function colorizePath(string $path, ?string $prevPath = null, bool $last = count($path) - 1; $path[$last] = preg_replace_callback( '/([\-_\.]+|phpt$)/', - static function ($matches) { + static function ($matches) + { return self::dim($matches[0]); }, $path[$last] @@ -139,7 +140,8 @@ public static function visualizeWhitespace(string $buffer, bool $visualizeEOL = { $replaceMap = $visualizeEOL ? self::WHITESPACE_EOL_MAP : self::WHITESPACE_MAP; - return preg_replace_callback('/\s+/', static function ($matches) use ($replaceMap) { + return preg_replace_callback('/\s+/', static function ($matches) use ($replaceMap) + { return self::dim(strtr($matches[0], $replaceMap)); }, $buffer); } diff --git a/app/vendor/phpunit/phpunit/src/Util/ErrorHandler.php b/app/vendor/phpunit/phpunit/src/Util/ErrorHandler.php index 61dbbbc13..f8566347e 100644 --- a/app/vendor/phpunit/phpunit/src/Util/ErrorHandler.php +++ b/app/vendor/phpunit/phpunit/src/Util/ErrorHandler.php @@ -57,7 +57,8 @@ final class ErrorHandler public static function invokeIgnoringWarnings(callable $callable) { set_error_handler( - static function ($errorNumber, $errorString) { + static function ($errorNumber, $errorString) + { if ($errorNumber === E_WARNING) { return; } diff --git a/app/vendor/phpunit/phpunit/src/Util/PHP/AbstractPhpProcess.php b/app/vendor/phpunit/phpunit/src/Util/PHP/AbstractPhpProcess.php index b5de7144f..8706ae1a1 100644 --- a/app/vendor/phpunit/phpunit/src/Util/PHP/AbstractPhpProcess.php +++ b/app/vendor/phpunit/phpunit/src/Util/PHP/AbstractPhpProcess.php @@ -275,7 +275,8 @@ private function processChildResult(Test $test, TestResult $result, string $stdo /** * @throws ErrorException */ - static function ($errno, $errstr, $errfile, $errline): void { + static function ($errno, $errstr, $errfile, $errline): void + { throw new ErrorException($errstr, $errno, $errno, $errfile, $errline); } ); diff --git a/app/vendor/phpunit/phpunit/src/Util/RegularExpression.php b/app/vendor/phpunit/phpunit/src/Util/RegularExpression.php index 167b9215c..db1dae922 100644 --- a/app/vendor/phpunit/phpunit/src/Util/RegularExpression.php +++ b/app/vendor/phpunit/phpunit/src/Util/RegularExpression.php @@ -22,7 +22,8 @@ final class RegularExpression public static function safeMatch(string $pattern, string $subject) { return ErrorHandler::invokeIgnoringWarnings( - static function () use ($pattern, $subject) { + static function () use ($pattern, $subject) + { return preg_match($pattern, $subject); } ); diff --git a/app/vendor/phpunit/phpunit/src/Util/TestDox/CliTestDoxPrinter.php b/app/vendor/phpunit/phpunit/src/Util/TestDox/CliTestDoxPrinter.php index 7c0fc1174..def16c398 100644 --- a/app/vendor/phpunit/phpunit/src/Util/TestDox/CliTestDoxPrinter.php +++ b/app/vendor/phpunit/phpunit/src/Util/TestDox/CliTestDoxPrinter.php @@ -301,7 +301,8 @@ protected function formatTestResultMessage(Throwable $t, array $result, ?string if ($this->colors) { $color = self::STATUS_STYLES[$result['status']]['color'] ?? ''; - $prefix = array_map(static function ($p) use ($color) { + $prefix = array_map(static function ($p) use ($color) + { return Color::colorize($color, $p); }, self::PREFIX_DECORATED); } diff --git a/app/vendor/phpunit/phpunit/src/Util/TestDox/HtmlResultPrinter.php b/app/vendor/phpunit/phpunit/src/Util/TestDox/HtmlResultPrinter.php index d2bcbe527..013d1de81 100644 --- a/app/vendor/phpunit/phpunit/src/Util/TestDox/HtmlResultPrinter.php +++ b/app/vendor/phpunit/phpunit/src/Util/TestDox/HtmlResultPrinter.php @@ -32,6 +32,8 @@ final class HtmlResultPrinter extends ResultPrinter font-variant-ligatures: common-ligatures; font-kerning: normal; margin-left: 2em; + background-color: #ffffff; + color: #000000; } body > ul > li { diff --git a/app/vendor/phpunit/phpunit/src/Util/TestDox/NamePrettifier.php b/app/vendor/phpunit/phpunit/src/Util/TestDox/NamePrettifier.php index 630bdd821..eb839acfa 100644 --- a/app/vendor/phpunit/phpunit/src/Util/TestDox/NamePrettifier.php +++ b/app/vendor/phpunit/phpunit/src/Util/TestDox/NamePrettifier.php @@ -147,7 +147,8 @@ public function prettifyTestCase(TestCase $test): string $annotationWithPlaceholders = false; - $callback = static function (string $variable): string { + $callback = static function (string $variable): string + { return sprintf('/%s(?=\b)/', preg_quote($variable, '/')); }; @@ -318,7 +319,8 @@ private function mapTestMethodParameterNamesToProvidedDataValues(TestCase $test) } if ($this->useColor) { - $providedData = array_map(static function ($value) { + $providedData = array_map(static function ($value) + { return Color::colorize('fg-cyan', Color::visualizeWhitespace((string) $value, true)); }, $providedData); } diff --git a/app/vendor/phpunit/phpunit/src/Util/TestDox/TestDoxPrinter.php b/app/vendor/phpunit/phpunit/src/Util/TestDox/TestDoxPrinter.php index e3ae8c93f..bd64785c9 100644 --- a/app/vendor/phpunit/phpunit/src/Util/TestDox/TestDoxPrinter.php +++ b/app/vendor/phpunit/phpunit/src/Util/TestDox/TestDoxPrinter.php @@ -377,7 +377,8 @@ protected function prefixLines(string $prefix, string $message): string return implode( PHP_EOL, array_map( - static function (string $text) use ($prefix) { + static function (string $text) use ($prefix) + { return ' ' . $prefix . ($text ? ' ' . $text : ''); }, preg_split('/\r\n|\r|\n/', $message) diff --git a/app/vendor/phpunit/phpunit/src/Util/TestDox/XmlResultPrinter.php b/app/vendor/phpunit/phpunit/src/Util/TestDox/XmlResultPrinter.php index 551c7d431..911604e06 100644 --- a/app/vendor/phpunit/phpunit/src/Util/TestDox/XmlResultPrinter.php +++ b/app/vendor/phpunit/phpunit/src/Util/TestDox/XmlResultPrinter.php @@ -161,7 +161,8 @@ public function endTest(Test $test, float $time): void $groups = array_filter( $test->getGroups(), - static function ($group) { + static function ($group) + { return !($group === 'small' || $group === 'medium' || $group === 'large' || strpos($group, '__phpunit_') === 0); } ); diff --git a/app/vendor/phpunit/phpunit/src/Util/VersionComparisonOperator.php b/app/vendor/phpunit/phpunit/src/Util/VersionComparisonOperator.php index ab65dbf35..175ecd2d1 100644 --- a/app/vendor/phpunit/phpunit/src/Util/VersionComparisonOperator.php +++ b/app/vendor/phpunit/phpunit/src/Util/VersionComparisonOperator.php @@ -31,7 +31,7 @@ public function __construct(string $operator) } /** - * @return '<'|'lt'|'<='|'le'|'>'|'gt'|'>='|'ge'|'=='|'='|'eq'|'!='|'<>'|'ne' + * @return '!='|'<'|'<='|'<>'|'='|'=='|'>'|'>='|'eq'|'ge'|'gt'|'le'|'lt'|'ne' */ public function asString(): string { diff --git a/app/vendor/phpunit/phpunit/src/Util/XdebugFilterScriptGenerator.php b/app/vendor/phpunit/phpunit/src/Util/XdebugFilterScriptGenerator.php index 4a57528cc..8b10d4152 100644 --- a/app/vendor/phpunit/phpunit/src/Util/XdebugFilterScriptGenerator.php +++ b/app/vendor/phpunit/phpunit/src/Util/XdebugFilterScriptGenerator.php @@ -28,7 +28,8 @@ final class XdebugFilterScriptGenerator public function generate(FilterConfiguration $filter): string { $files = array_map( - static function ($item) { + static function ($item) + { return sprintf( " '%s'", $item diff --git a/app/vendor/psy/psysh/src/CodeCleaner/PassableByReferencePass.php b/app/vendor/psy/psysh/src/CodeCleaner/PassableByReferencePass.php index 0ce154904..8d7a8bfaa 100644 --- a/app/vendor/psy/psysh/src/CodeCleaner/PassableByReferencePass.php +++ b/app/vendor/psy/psysh/src/CodeCleaner/PassableByReferencePass.php @@ -14,6 +14,7 @@ use PhpParser\Node; use PhpParser\Node\Expr; use PhpParser\Node\Expr\Array_; +use PhpParser\Node\Expr\ArrayDimFetch; use PhpParser\Node\Expr\ClassConstFetch; use PhpParser\Node\Expr\FuncCall; use PhpParser\Node\Expr\MethodCall; @@ -81,7 +82,8 @@ private function isPassableByReference(Node $arg) $arg->value instanceof Variable || $arg->value instanceof FuncCall || $arg->value instanceof MethodCall || - $arg->value instanceof StaticCall; + $arg->value instanceof StaticCall || + $arg->value instanceof ArrayDimFetch; } /** diff --git a/app/vendor/psy/psysh/src/ExecutionLoopClosure.php b/app/vendor/psy/psysh/src/ExecutionLoopClosure.php index 0ee316fb7..aadef7337 100644 --- a/app/vendor/psy/psysh/src/ExecutionLoopClosure.php +++ b/app/vendor/psy/psysh/src/ExecutionLoopClosure.php @@ -33,7 +33,7 @@ public function __construct(Shell $__psysh__) // Restore execution scope variables \extract($__psysh__->getScopeVariables(false)); - do { + while (true) { $__psysh__->beforeLoop(); try { @@ -96,7 +96,7 @@ public function __construct(Shell $__psysh__) } $__psysh__->afterLoop(); - } while (true); + } }); } } diff --git a/app/vendor/psy/psysh/src/Output/ShellOutput.php b/app/vendor/psy/psysh/src/Output/ShellOutput.php index 5b8931bba..e23666029 100644 --- a/app/vendor/psy/psysh/src/Output/ShellOutput.php +++ b/app/vendor/psy/psysh/src/Output/ShellOutput.php @@ -195,6 +195,8 @@ private function initFormatters() // Types $formatter->setStyle('number', new OutputFormatterStyle('magenta')); + $formatter->setStyle('integer', new OutputFormatterStyle('magenta')); + $formatter->setStyle('float', new OutputFormatterStyle('yellow')); $formatter->setStyle('string', new OutputFormatterStyle('green')); $formatter->setStyle('bool', new OutputFormatterStyle('cyan')); $formatter->setStyle('keyword', new OutputFormatterStyle('yellow')); diff --git a/app/vendor/psy/psysh/src/Readline/Libedit.php b/app/vendor/psy/psysh/src/Readline/Libedit.php index 7818e413f..6c788d901 100644 --- a/app/vendor/psy/psysh/src/Readline/Libedit.php +++ b/app/vendor/psy/psysh/src/Readline/Libedit.php @@ -91,7 +91,7 @@ public function writeHistory() * * @param string $line The history line to parse * - * @return string | null + * @return string|null */ protected function parseHistoryLine($line) { diff --git a/app/vendor/psy/psysh/src/Shell.php b/app/vendor/psy/psysh/src/Shell.php index 240516e03..1e5ce90a4 100644 --- a/app/vendor/psy/psysh/src/Shell.php +++ b/app/vendor/psy/psysh/src/Shell.php @@ -48,7 +48,7 @@ */ class Shell extends Application { - const VERSION = 'v0.10.8'; + const VERSION = 'v0.10.9'; const PROMPT = '>>> '; const BUFF_PROMPT = '... '; @@ -1346,7 +1346,7 @@ protected function hasCommand($input) /** * Get the current input prompt. * - * @return string | null + * @return string|null */ protected function getPrompt() { diff --git a/app/vendor/psy/psysh/src/VarDumper/Presenter.php b/app/vendor/psy/psysh/src/VarDumper/Presenter.php index 24dd6033d..2e294ac1e 100644 --- a/app/vendor/psy/psysh/src/VarDumper/Presenter.php +++ b/app/vendor/psy/psysh/src/VarDumper/Presenter.php @@ -33,6 +33,8 @@ class Presenter ]; private $styles = [ 'num' => 'number', + 'integer' => 'integer', + 'float' => 'float', 'const' => 'const', 'str' => 'string', 'cchr' => 'default', diff --git a/app/vendor/psy/psysh/src/functions.php b/app/vendor/psy/psysh/src/functions.php index e36825d2e..0f78d04ae 100644 --- a/app/vendor/psy/psysh/src/functions.php +++ b/app/vendor/psy/psysh/src/functions.php @@ -331,12 +331,12 @@ function bin() { return function () { if (!isset($_SERVER['PSYSH_IGNORE_ENV']) || !$_SERVER['PSYSH_IGNORE_ENV']) { - if (\defined('HHVM_VERSION_ID') && \HHVM_VERSION_ID < 31800) { + if (\defined('HHVM_VERSION_ID') && HHVM_VERSION_ID < 31800) { \fwrite(\STDERR, 'HHVM 3.18 or higher is required. You can set the environment variable PSYSH_IGNORE_ENV=1 to override this restriction and proceed anyway.'.\PHP_EOL); exit(1); } - if (\defined('HHVM_VERSION_ID') && \HHVM_VERSION_ID > 39999) { + if (\defined('HHVM_VERSION_ID') && HHVM_VERSION_ID > 39999) { \fwrite(\STDERR, 'HHVM 4 or higher is not supported. You can set the environment variable PSYSH_IGNORE_ENV=1 to override this restriction and proceed anyway.'.\PHP_EOL); exit(1); } diff --git a/app/vendor/robmorgan/phinx/app/web.php b/app/vendor/robmorgan/phinx/app/web.php index e015c7f8f..a837621f0 100644 --- a/app/vendor/robmorgan/phinx/app/web.php +++ b/app/vendor/robmorgan/phinx/app/web.php @@ -63,8 +63,8 @@ } // Get the environment and target version parameters. -$env = isset($_GET['e']) ? $_GET['e'] : null; -$target = isset($_GET['t']) ? $_GET['t'] : null; +$env = $_GET['e'] ?? null; +$target = $_GET['t'] ?? null; // Check if debugging is enabled. $debug = !empty($_GET['debug']) && filter_var($_GET['debug'], FILTER_VALIDATE_BOOLEAN); diff --git a/app/vendor/robmorgan/phinx/composer.json b/app/vendor/robmorgan/phinx/composer.json index f456f0599..8a1b680d8 100644 --- a/app/vendor/robmorgan/phinx/composer.json +++ b/app/vendor/robmorgan/phinx/composer.json @@ -36,7 +36,7 @@ "ext-pdo": "*", "phpunit/phpunit": "^8.5|^9.3", "sebastian/comparator": ">=1.2.3", - "cakephp/cakephp-codesniffer": "^3.0", + "cakephp/cakephp-codesniffer": "^4.0", "symfony/yaml": "^3.4|^4.0|^5.0" }, "autoload": { diff --git a/app/vendor/robmorgan/phinx/docs/en/migrations.rst b/app/vendor/robmorgan/phinx/docs/en/migrations.rst index 73825e94c..1413abab2 100644 --- a/app/vendor/robmorgan/phinx/docs/en/migrations.rst +++ b/app/vendor/robmorgan/phinx/docs/en/migrations.rst @@ -799,9 +799,12 @@ update set an action to be triggered when the row is updated (use with ``CURRE timezone enable or disable the ``with time zone`` option for ``time`` and ``timestamp`` columns *(only applies to Postgres)* ======== =========== -You can add ``created_at`` and ``updated_at`` timestamps to a table using the ``addTimestamps()`` method. This method also -allows you to supply alternative names. The optional third argument allows you to change the ``timezone`` option for the -columns being added. Additionally, you can use the ``addTimestampsWithTimezone()`` method, which is an alias to +You can add ``created_at`` and ``updated_at`` timestamps to a table using the ``addTimestamps()`` method. This method accepts +three arguments, where the first two allow setting alternative names for the columns while the third argument allows you to +enable the ``timezone`` option for the columns. The defaults for these arguments are ``created_at``, ``updated_at``, and ``true`` +respectively. For the first and second argument, if you provide ``null``, then the default name will be used, and if you provide +``false``, then that column will not be created. Please note that attempting to set both to ``false`` will throw a +``\RuntimeException``. Additionally, you can use the ``addTimestampsWithTimezone()`` method, which is an alias to ``addTimestamps()`` that will always set the third argument to ``true`` (see examples below). The ``created_at`` column will have a default set to ``CURRENT_TIMESTAMP``. For MySQL only, ``update_at`` column will have update set to ``CURRENT_TIMESTAMP``. @@ -831,6 +834,12 @@ have a default set to ``CURRENT_TIMESTAMP``. For MySQL only, ``update_at`` colum // The two lines below do the same, the second one is simply cleaner. $table = $this->table('books')->addTimestamps(null, 'amended_at', true)->create(); $table = $this->table('users')->addTimestampsWithTimezone(null, 'amended_at')->create(); + + // Only add the created_at column to the table + $table = $this->table('books')->addTimestamps(null, false); + // Only add the updated_at column to the table + $table = $this->table('users')->addTimestamps(false); + // Note, setting both false will throw a \RuntimeError } } diff --git a/app/vendor/robmorgan/phinx/phpstan-baseline.neon b/app/vendor/robmorgan/phinx/phpstan-baseline.neon new file mode 100644 index 000000000..584611b45 --- /dev/null +++ b/app/vendor/robmorgan/phinx/phpstan-baseline.neon @@ -0,0 +1,7 @@ +parameters: + ignoreErrors: + - + message: "#^Call to function is_subclass_of\\(\\) with non\\-empty\\-string and 'Phinx\\\\\\\\Migration…' will always evaluate to false\\.$#" + count: 1 + path: src/Phinx/Console/Command/Create.php + diff --git a/app/vendor/robmorgan/phinx/src/Phinx/Config/Config.php b/app/vendor/robmorgan/phinx/src/Phinx/Config/Config.php index f20271438..025b8ddd8 100644 --- a/app/vendor/robmorgan/phinx/src/Phinx/Config/Config.php +++ b/app/vendor/robmorgan/phinx/src/Phinx/Config/Config.php @@ -59,9 +59,7 @@ public function __construct(array $configArray, $configFilePath = null) * Create a new instance of the config class using a Yaml file path. * * @param string $configFilePath Path to the Yaml File - * * @throws \RuntimeException - * * @return \Phinx\Config\Config */ public static function fromYaml($configFilePath) @@ -89,16 +87,14 @@ public static function fromYaml($configFilePath) * Create a new instance of the config class using a JSON file path. * * @param string $configFilePath Path to the JSON File - * * @throws \RuntimeException - * * @return \Phinx\Config\Config */ public static function fromJson($configFilePath) { if (!function_exists('json_decode')) { // @codeCoverageIgnoreStart - throw new RuntimeException("Need to install JSON PHP extension to use JSON config"); + throw new RuntimeException('Need to install JSON PHP extension to use JSON config'); // @codeCoverageIgnoreEnd } @@ -117,16 +113,14 @@ public static function fromJson($configFilePath) * Create a new instance of the config class using a PHP file path. * * @param string $configFilePath Path to the PHP File - * * @throws \RuntimeException - * * @return \Phinx\Config\Config */ public static function fromPhp($configFilePath) { ob_start(); /** @noinspection PhpIncludeInspection */ - $configArray = include($configFilePath); + $configArray = include $configFilePath; // Hide console output ob_end_clean(); @@ -192,7 +186,7 @@ public function getEnvironment($name) */ public function hasEnvironment($name) { - return ($this->getEnvironment($name) !== null); + return $this->getEnvironment($name) !== null; } /** @@ -267,7 +261,6 @@ public function getConfigFilePath() /** * @inheritDoc - * * @throws \UnexpectedValueException */ public function getMigrationPaths() @@ -287,7 +280,6 @@ public function getMigrationPaths() * Gets the base class name for migrations. * * @param bool $dropNamespace Return the base migration class name without the namespace. - * * @return string */ public function getMigrationBaseClassName($dropNamespace = true) @@ -299,7 +291,6 @@ public function getMigrationBaseClassName($dropNamespace = true) /** * @inheritDoc - * * @throws \UnexpectedValueException */ public function getSeedPaths() @@ -424,7 +415,6 @@ public function getBootstrapFile() * Replace tokens in the specified array. * * @param array $arr Array to replace - * * @return array */ protected function replaceTokens(array $arr) @@ -453,7 +443,6 @@ protected function replaceTokens(array $arr) * * @param array $arr Array to recurse * @param string[] $tokens Array of tokens to search for - * * @return array */ protected function recurseArrayForTokens($arr, $tokens) @@ -481,7 +470,6 @@ protected function recurseArrayForTokens($arr, $tokens) * Parse a database-agnostic DSN into individual options. * * @param array $options Options - * * @return array */ protected function parseAgnosticDsn(array $options) @@ -499,9 +487,8 @@ protected function parseAgnosticDsn(array $options) /** * {@inheritDoc} * - * @param mixed $id - * @param mixed $value - * + * @param mixed $id ID + * @param mixed $value Value * @return void */ public function offsetSet($id, $value) @@ -512,10 +499,8 @@ public function offsetSet($id, $value) /** * {@inheritDoc} * - * @param mixed $id - * + * @param mixed $id ID * @throws \InvalidArgumentException - * * @return mixed */ public function offsetGet($id) @@ -530,8 +515,7 @@ public function offsetGet($id) /** * {@inheritDoc} * - * @param mixed $id - * + * @param mixed $id ID * @return bool */ public function offsetExists($id) @@ -542,8 +526,7 @@ public function offsetExists($id) /** * {@inheritDoc} * - * @param mixed $id - * + * @param mixed $id ID * @return void */ public function offsetUnset($id) diff --git a/app/vendor/robmorgan/phinx/src/Phinx/Config/ConfigInterface.php b/app/vendor/robmorgan/phinx/src/Phinx/Config/ConfigInterface.php index 4b69a1bfa..93c313899 100644 --- a/app/vendor/robmorgan/phinx/src/Phinx/Config/ConfigInterface.php +++ b/app/vendor/robmorgan/phinx/src/Phinx/Config/ConfigInterface.php @@ -33,7 +33,6 @@ public function getEnvironments(); * doesn't exist. * * @param string $name Environment Name - * * @return array|null */ public function getEnvironment($name); @@ -42,7 +41,6 @@ public function getEnvironment($name); * Does the specified environment exist in the configuration file? * * @param string $name Environment Name - * * @return bool */ public function hasEnvironment($name); @@ -51,7 +49,6 @@ public function hasEnvironment($name); * Gets the default environment name. * * @throws \RuntimeException - * * @return string */ public function getDefaultEnvironment(); @@ -60,7 +57,6 @@ public function getDefaultEnvironment(); * Get the aliased value from a supplied alias. * * @param string $alias Alias - * * @return string|null */ public function getAlias($alias); @@ -146,7 +142,6 @@ public function getBootstrapFile(); * Gets the base class name for migrations. * * @param bool $dropNamespace Return the base migration class name without the namespace. - * * @return string */ public function getMigrationBaseClassName($dropNamespace = true); diff --git a/app/vendor/robmorgan/phinx/src/Phinx/Config/NamespaceAwareInterface.php b/app/vendor/robmorgan/phinx/src/Phinx/Config/NamespaceAwareInterface.php index ea92cfbd8..b6f5e083c 100644 --- a/app/vendor/robmorgan/phinx/src/Phinx/Config/NamespaceAwareInterface.php +++ b/app/vendor/robmorgan/phinx/src/Phinx/Config/NamespaceAwareInterface.php @@ -19,7 +19,6 @@ interface NamespaceAwareInterface * Get Migration Namespace associated with path. * * @param string $path Path - * * @return string|null */ public function getMigrationNamespaceByPath($path); @@ -28,7 +27,6 @@ public function getMigrationNamespaceByPath($path); * Get Seed Namespace associated with path. * * @param string $path Path - * * @return string|null */ public function getSeedNamespaceByPath($path); diff --git a/app/vendor/robmorgan/phinx/src/Phinx/Config/NamespaceAwareTrait.php b/app/vendor/robmorgan/phinx/src/Phinx/Config/NamespaceAwareTrait.php index 688ec40c1..53f751643 100644 --- a/app/vendor/robmorgan/phinx/src/Phinx/Config/NamespaceAwareTrait.php +++ b/app/vendor/robmorgan/phinx/src/Phinx/Config/NamespaceAwareTrait.php @@ -34,7 +34,6 @@ abstract public function getSeedPaths(); * * @param string $needle Needle * @param string[] $haystack Haystack - * * @return string|null */ protected function searchNamespace($needle, $haystack) @@ -51,7 +50,6 @@ protected function searchNamespace($needle, $haystack) * Get Migration Namespace associated with path. * * @param string $path Path - * * @return string|null */ public function getMigrationNamespaceByPath($path) @@ -65,7 +63,6 @@ public function getMigrationNamespaceByPath($path) * Get Seed Namespace associated with path. * * @param string $path Path - * * @return string|null */ public function getSeedNamespaceByPath($path) diff --git a/app/vendor/robmorgan/phinx/src/Phinx/Console/Command/AbstractCommand.php b/app/vendor/robmorgan/phinx/src/Phinx/Console/Command/AbstractCommand.php index 573592053..516965838 100644 --- a/app/vendor/robmorgan/phinx/src/Phinx/Console/Command/AbstractCommand.php +++ b/app/vendor/robmorgan/phinx/src/Phinx/Console/Command/AbstractCommand.php @@ -60,18 +60,21 @@ abstract class AbstractCommand extends Command /** * Exit code for when command executes successfully + * * @var int */ public const CODE_SUCCESS = 0; /** * Exit code for when command hits a non-recoverable error during execution + * * @var int */ public const CODE_ERROR = 1; /** * Exit code for when status command is run and there are missing migrations + * * @var int */ public const CODE_STATUS_MISSING = 2; @@ -79,6 +82,7 @@ abstract class AbstractCommand extends Command /** * Exit code for when status command is run and there are no missing migations, * but does have down migrations + * * @var int */ public const CODE_STATUS_DOWN = 3; @@ -99,7 +103,6 @@ protected function configure() * * @param \Symfony\Component\Console\Input\InputInterface $input Input * @param \Symfony\Component\Console\Output\OutputInterface $output Output - * * @return void */ public function bootstrap(InputInterface $input, OutputInterface $output) @@ -112,7 +115,8 @@ public function bootstrap(InputInterface $input, OutputInterface $output) $this->loadManager($input, $output); - if ($bootstrap = $this->getConfig()->getBootstrapFile()) { + $bootstrap = $this->getConfig()->getBootstrapFile(); + if ($bootstrap) { $output->writeln('using bootstrap ' . Util::relativePath($bootstrap) . ' '); Util::loadPhpFile($bootstrap, $input, $output, $this); } @@ -143,7 +147,6 @@ public function bootstrap(InputInterface $input, OutputInterface $output) * Sets the config. * * @param \Phinx\Config\ConfigInterface $config Config - * * @return $this */ public function setConfig(ConfigInterface $config) @@ -167,7 +170,6 @@ public function getConfig() * Sets the database adapter. * * @param \Phinx\Db\Adapter\AdapterInterface $adapter Adapter - * * @return $this */ public function setAdapter(AdapterInterface $adapter) @@ -191,7 +193,6 @@ public function getAdapter() * Sets the migration manager. * * @param \Phinx\Migration\Manager $manager Manager - * * @return $this */ public function setManager(Manager $manager) @@ -215,7 +216,6 @@ public function getManager() * Returns config file path * * @param \Symfony\Component\Console\Input\InputInterface $input Input - * * @return string */ protected function locateConfigFile(InputInterface $input) @@ -257,9 +257,7 @@ protected function locateConfigFile(InputInterface $input) * * @param \Symfony\Component\Console\Input\InputInterface $input Input * @param \Symfony\Component\Console\Output\OutputInterface $output Output - * * @throws \InvalidArgumentException - * * @return void */ protected function loadConfig(InputInterface $input, OutputInterface $output) @@ -313,7 +311,6 @@ protected function loadConfig(InputInterface $input, OutputInterface $output) * * @param \Symfony\Component\Console\Input\InputInterface $input Input * @param \Symfony\Component\Console\Output\OutputInterface $output Output - * * @return void */ protected function loadManager(InputInterface $input, OutputInterface $output) @@ -336,9 +333,7 @@ protected function loadManager(InputInterface $input, OutputInterface $output) * Verify that the migration directory exists and is writable. * * @param string $path Path - * * @throws \InvalidArgumentException - * * @return void */ protected function verifyMigrationDirectory($path) @@ -362,9 +357,7 @@ protected function verifyMigrationDirectory($path) * Verify that the seed directory exists and is writable. * * @param string $path Path - * * @throws \InvalidArgumentException - * * @return void */ protected function verifySeedDirectory($path) diff --git a/app/vendor/robmorgan/phinx/src/Phinx/Console/Command/Breakpoint.php b/app/vendor/robmorgan/phinx/src/Phinx/Console/Command/Breakpoint.php index 61e9f9383..7230d72d6 100644 --- a/app/vendor/robmorgan/phinx/src/Phinx/Console/Command/Breakpoint.php +++ b/app/vendor/robmorgan/phinx/src/Phinx/Console/Command/Breakpoint.php @@ -53,9 +53,7 @@ protected function configure() * * @param \Symfony\Component\Console\Input\InputInterface $input Input * @param \Symfony\Component\Console\Output\OutputInterface $output Output - * * @throws \InvalidArgumentException - * * @return int integer 0 on success, or an error code. */ protected function execute(InputInterface $input, OutputInterface $output) diff --git a/app/vendor/robmorgan/phinx/src/Phinx/Console/Command/Create.php b/app/vendor/robmorgan/phinx/src/Phinx/Console/Command/Create.php index fc0dd1838..b63b17a12 100644 --- a/app/vendor/robmorgan/phinx/src/Phinx/Console/Command/Create.php +++ b/app/vendor/robmorgan/phinx/src/Phinx/Console/Command/Create.php @@ -74,7 +74,6 @@ protected function getCreateMigrationDirectoryQuestion() * Get the question that allows the user to select which migration path to use. * * @param string[] $paths Paths - * * @return \Symfony\Component\Console\Question\ChoiceQuestion */ protected function getSelectMigrationPathQuestion(array $paths) @@ -87,9 +86,7 @@ protected function getSelectMigrationPathQuestion(array $paths) * * @param \Symfony\Component\Console\Input\InputInterface $input Input * @param \Symfony\Component\Console\Output\OutputInterface $output Output - * * @throws \Exception - * * @return string */ protected function getMigrationPath(InputInterface $input, OutputInterface $output) @@ -135,10 +132,8 @@ protected function getMigrationPath(InputInterface $input, OutputInterface $outp * * @param \Symfony\Component\Console\Input\InputInterface $input Input * @param \Symfony\Component\Console\Output\OutputInterface $output Output - * * @throws \RuntimeException * @throws \InvalidArgumentException - * * @return int 0 on success */ protected function execute(InputInterface $input, OutputInterface $output) @@ -167,7 +162,7 @@ protected function execute(InputInterface $input, OutputInterface $output) $className = $input->getArgument('name'); if ($className === null) { $currentTimestamp = Util::getCurrentTimestamp(); - $className = "V" . $currentTimestamp; + $className = 'V' . $currentTimestamp; $fileName = $currentTimestamp . '.php'; } else { if (!Util::isValidPhinxClassName($className)) { @@ -184,7 +179,7 @@ protected function execute(InputInterface $input, OutputInterface $output) if (!Util::isUniqueMigrationClassName($className, $path)) { throw new InvalidArgumentException(sprintf( 'The migration class name "%s%s" already exists', - $namespace ? ($namespace . '\\') : '', + $namespace ? $namespace . '\\' : '', $className )); } diff --git a/app/vendor/robmorgan/phinx/src/Phinx/Console/Command/Init.php b/app/vendor/robmorgan/phinx/src/Phinx/Console/Command/Init.php index 11cfd67d1..d5cf9a961 100644 --- a/app/vendor/robmorgan/phinx/src/Phinx/Console/Command/Init.php +++ b/app/vendor/robmorgan/phinx/src/Phinx/Console/Command/Init.php @@ -61,7 +61,6 @@ protected function configure() * * @param \Symfony\Component\Console\Input\InputInterface $input Interface implemented by all input classes. * @param \Symfony\Component\Console\Output\OutputInterface $output Interface implemented by all output classes. - * * @return int 0 on success */ protected function execute(InputInterface $input, OutputInterface $output) @@ -80,9 +79,7 @@ protected function execute(InputInterface $input, OutputInterface $output) * * @param \Symfony\Component\Console\Input\InputInterface $input Interface implemented by all input classes. * @param string $format Format to resolve for - * * @throws \InvalidArgumentException - * * @return string */ protected function resolvePath(InputInterface $input, $format) @@ -133,10 +130,8 @@ protected function resolvePath(InputInterface $input, $format) * * @param string $path Config file's path. * @param string $format Format to use for config file - * * @throws \InvalidArgumentException * @throws \RuntimeException - * * @return void */ protected function writeConfig($path, $format = AbstractCommand::FORMAT_DEFAULT) diff --git a/app/vendor/robmorgan/phinx/src/Phinx/Console/Command/ListAliases.php b/app/vendor/robmorgan/phinx/src/Phinx/Console/Command/ListAliases.php index 35764ab06..2c791e7ab 100644 --- a/app/vendor/robmorgan/phinx/src/Phinx/Console/Command/ListAliases.php +++ b/app/vendor/robmorgan/phinx/src/Phinx/Console/Command/ListAliases.php @@ -36,7 +36,6 @@ protected function configure() * * @param \Symfony\Component\Console\Input\InputInterface $input Input * @param \Symfony\Component\Console\Output\OutputInterface $output Output - * * @return int 0 on success */ protected function execute(InputInterface $input, OutputInterface $output) diff --git a/app/vendor/robmorgan/phinx/src/Phinx/Console/Command/Migrate.php b/app/vendor/robmorgan/phinx/src/Phinx/Console/Command/Migrate.php index b10a00917..684e30ac6 100644 --- a/app/vendor/robmorgan/phinx/src/Phinx/Console/Command/Migrate.php +++ b/app/vendor/robmorgan/phinx/src/Phinx/Console/Command/Migrate.php @@ -55,7 +55,6 @@ protected function configure() * * @param \Symfony\Component\Console\Input\InputInterface $input Input * @param \Symfony\Component\Console\Output\OutputInterface $output Output - * * @return int integer 0 on success, or an error code. */ protected function execute(InputInterface $input, OutputInterface $output) diff --git a/app/vendor/robmorgan/phinx/src/Phinx/Console/Command/Rollback.php b/app/vendor/robmorgan/phinx/src/Phinx/Console/Command/Rollback.php index 4932e19b3..3be48af83 100644 --- a/app/vendor/robmorgan/phinx/src/Phinx/Console/Command/Rollback.php +++ b/app/vendor/robmorgan/phinx/src/Phinx/Console/Command/Rollback.php @@ -63,7 +63,6 @@ protected function configure() * * @param \Symfony\Component\Console\Input\InputInterface $input Input * @param \Symfony\Component\Console\Output\OutputInterface $output Output - * * @return int integer 0 on success, or an error code. */ protected function execute(InputInterface $input, OutputInterface $output) @@ -134,9 +133,7 @@ protected function execute(InputInterface $input, OutputInterface $output) * Get Target from Date * * @param string $date The date to convert to a target. - * * @throws \InvalidArgumentException - * * @return string The target */ public function getTargetFromDate($date) diff --git a/app/vendor/robmorgan/phinx/src/Phinx/Console/Command/SeedCreate.php b/app/vendor/robmorgan/phinx/src/Phinx/Console/Command/SeedCreate.php index d93ace754..a91024121 100644 --- a/app/vendor/robmorgan/phinx/src/Phinx/Console/Command/SeedCreate.php +++ b/app/vendor/robmorgan/phinx/src/Phinx/Console/Command/SeedCreate.php @@ -63,7 +63,6 @@ protected function getCreateSeedDirectoryQuestion() * Get the question that allows the user to select which seed path to use. * * @param string[] $paths Paths - * * @return \Symfony\Component\Console\Question\ChoiceQuestion */ protected function getSelectSeedPathQuestion(array $paths) @@ -76,9 +75,7 @@ protected function getSelectSeedPathQuestion(array $paths) * * @param \Symfony\Component\Console\Input\InputInterface $input Input * @param \Symfony\Component\Console\Output\OutputInterface $output Output - * * @throws \Exception - * * @return string */ protected function getSeedPath(InputInterface $input, OutputInterface $output) @@ -124,10 +121,8 @@ protected function getSeedPath(InputInterface $input, OutputInterface $output) * * @param \Symfony\Component\Console\Input\InputInterface $input Input * @param \Symfony\Component\Console\Output\OutputInterface $output Output - * * @throws \RuntimeException * @throws \InvalidArgumentException - * * @return int 0 on success */ protected function execute(InputInterface $input, OutputInterface $output) diff --git a/app/vendor/robmorgan/phinx/src/Phinx/Console/Command/SeedRun.php b/app/vendor/robmorgan/phinx/src/Phinx/Console/Command/SeedRun.php index 9b104f934..996009848 100644 --- a/app/vendor/robmorgan/phinx/src/Phinx/Console/Command/SeedRun.php +++ b/app/vendor/robmorgan/phinx/src/Phinx/Console/Command/SeedRun.php @@ -49,7 +49,6 @@ protected function configure() * * @param \Symfony\Component\Console\Input\InputInterface $input Input * @param \Symfony\Component\Console\Output\OutputInterface $output Output - * * @return int integer 0 on success, or an error code. */ protected function execute(InputInterface $input, OutputInterface $output) diff --git a/app/vendor/robmorgan/phinx/src/Phinx/Console/Command/Status.php b/app/vendor/robmorgan/phinx/src/Phinx/Console/Command/Status.php index 06e99713e..9288f780f 100644 --- a/app/vendor/robmorgan/phinx/src/Phinx/Console/Command/Status.php +++ b/app/vendor/robmorgan/phinx/src/Phinx/Console/Command/Status.php @@ -48,7 +48,6 @@ protected function configure() * * @param \Symfony\Component\Console\Input\InputInterface $input Input * @param \Symfony\Component\Console\Output\OutputInterface $output Output - * * @return int 0 if all migrations are up, or an error code */ protected function execute(InputInterface $input, OutputInterface $output) @@ -75,7 +74,7 @@ protected function execute(InputInterface $input, OutputInterface $output) $output->writeln('using format ' . $format); } - $output->writeln('ordering by ' . $this->getConfig()->getVersionOrder() . " time"); + $output->writeln('ordering by ' . $this->getConfig()->getVersionOrder() . ' time'); // print the status $result = $this->getManager()->printStatus($environment, $format); diff --git a/app/vendor/robmorgan/phinx/src/Phinx/Console/Command/Test.php b/app/vendor/robmorgan/phinx/src/Phinx/Console/Command/Test.php index 76de7f748..bfd1fc4c9 100644 --- a/app/vendor/robmorgan/phinx/src/Phinx/Console/Command/Test.php +++ b/app/vendor/robmorgan/phinx/src/Phinx/Console/Command/Test.php @@ -53,9 +53,7 @@ protected function configure() * * @param \Symfony\Component\Console\Input\InputInterface $input Input * @param \Symfony\Component\Console\Output\OutputInterface $output Output - * * @throws \InvalidArgumentException - * * @return int 0 on success */ protected function execute(InputInterface $input, OutputInterface $output) diff --git a/app/vendor/robmorgan/phinx/src/Phinx/Console/PhinxApplication.php b/app/vendor/robmorgan/phinx/src/Phinx/Console/PhinxApplication.php index 3d3604814..bd72ebf14 100644 --- a/app/vendor/robmorgan/phinx/src/Phinx/Console/PhinxApplication.php +++ b/app/vendor/robmorgan/phinx/src/Phinx/Console/PhinxApplication.php @@ -54,7 +54,6 @@ public function __construct() * * @param \Symfony\Component\Console\Input\InputInterface $input An Input instance * @param \Symfony\Component\Console\Output\OutputInterface $output An Output instance - * * @return int 0 if everything went fine, or an error code */ public function doRun(InputInterface $input, OutputInterface $output) diff --git a/app/vendor/robmorgan/phinx/src/Phinx/Db/Action/AddColumn.php b/app/vendor/robmorgan/phinx/src/Phinx/Db/Action/AddColumn.php index 0a9310047..fadf2dd3e 100644 --- a/app/vendor/robmorgan/phinx/src/Phinx/Db/Action/AddColumn.php +++ b/app/vendor/robmorgan/phinx/src/Phinx/Db/Action/AddColumn.php @@ -38,7 +38,6 @@ public function __construct(Table $table, Column $column) * @param string $columnName The column name * @param mixed $type The column type * @param mixed $options The column options - * * @return \Phinx\Db\Action\AddColumn */ public static function build(Table $table, $columnName, $type = null, $options = []) diff --git a/app/vendor/robmorgan/phinx/src/Phinx/Db/Action/AddForeignKey.php b/app/vendor/robmorgan/phinx/src/Phinx/Db/Action/AddForeignKey.php index 3b5e3ade5..1e0cc7714 100644 --- a/app/vendor/robmorgan/phinx/src/Phinx/Db/Action/AddForeignKey.php +++ b/app/vendor/robmorgan/phinx/src/Phinx/Db/Action/AddForeignKey.php @@ -41,7 +41,6 @@ public function __construct(Table $table, ForeignKey $fk) * @param string|string[] $referencedColumns The columns in the referenced table * @param array $options Extra options for the foreign key * @param string|null $name The name of the foreign key - * * @return \Phinx\Db\Action\AddForeignKey */ public static function build(Table $table, $columns, $referencedTable, $referencedColumns = ['id'], array $options = [], $name = null) diff --git a/app/vendor/robmorgan/phinx/src/Phinx/Db/Action/AddIndex.php b/app/vendor/robmorgan/phinx/src/Phinx/Db/Action/AddIndex.php index 7902562e5..c68012e09 100644 --- a/app/vendor/robmorgan/phinx/src/Phinx/Db/Action/AddIndex.php +++ b/app/vendor/robmorgan/phinx/src/Phinx/Db/Action/AddIndex.php @@ -38,7 +38,6 @@ public function __construct(Table $table, Index $index) * @param \Phinx\Db\Table\Table $table The table to add the index to * @param mixed $columns The columns to index * @param array $options Additional options for the index creation - * * @return \Phinx\Db\Action\AddIndex */ public static function build(Table $table, $columns, array $options = []) diff --git a/app/vendor/robmorgan/phinx/src/Phinx/Db/Action/ChangeColumn.php b/app/vendor/robmorgan/phinx/src/Phinx/Db/Action/ChangeColumn.php index dfe63f781..bdc62a3bc 100644 --- a/app/vendor/robmorgan/phinx/src/Phinx/Db/Action/ChangeColumn.php +++ b/app/vendor/robmorgan/phinx/src/Phinx/Db/Action/ChangeColumn.php @@ -53,7 +53,6 @@ public function __construct(Table $table, $columnName, Column $column) * @param mixed $columnName The name of the column to change * @param mixed $type The type of the column * @param mixed $options Additional options for the column - * * @return \Phinx\Db\Action\ChangeColumn */ public static function build(Table $table, $columnName, $type = null, $options = []) diff --git a/app/vendor/robmorgan/phinx/src/Phinx/Db/Action/DropForeignKey.php b/app/vendor/robmorgan/phinx/src/Phinx/Db/Action/DropForeignKey.php index 2898a1f68..01be8dfc6 100644 --- a/app/vendor/robmorgan/phinx/src/Phinx/Db/Action/DropForeignKey.php +++ b/app/vendor/robmorgan/phinx/src/Phinx/Db/Action/DropForeignKey.php @@ -38,7 +38,6 @@ public function __construct(Table $table, ForeignKey $foreignKey) * @param \Phinx\Db\Table\Table $table The table to delete the foreign key from * @param string|string[] $columns The columns participating in the foreign key * @param string|null $constraint The constraint name - * * @return \Phinx\Db\Action\DropForeignKey */ public static function build(Table $table, $columns, $constraint = null) diff --git a/app/vendor/robmorgan/phinx/src/Phinx/Db/Action/DropIndex.php b/app/vendor/robmorgan/phinx/src/Phinx/Db/Action/DropIndex.php index b45b01386..49ff940a8 100644 --- a/app/vendor/robmorgan/phinx/src/Phinx/Db/Action/DropIndex.php +++ b/app/vendor/robmorgan/phinx/src/Phinx/Db/Action/DropIndex.php @@ -37,7 +37,6 @@ public function __construct(Table $table, Index $index) * * @param \Phinx\Db\Table\Table $table The table where the index is * @param string[] $columns the indexed columns - * * @return \Phinx\Db\Action\DropIndex */ public static function build(Table $table, array $columns = []) @@ -54,7 +53,6 @@ public static function build(Table $table, array $columns = []) * * @param \Phinx\Db\Table\Table $table The table where the index is * @param string $name The name of the index - * * @return \Phinx\Db\Action\DropIndex */ public static function buildFromName(Table $table, $name) diff --git a/app/vendor/robmorgan/phinx/src/Phinx/Db/Action/RemoveColumn.php b/app/vendor/robmorgan/phinx/src/Phinx/Db/Action/RemoveColumn.php index 70ece6375..cb92942cd 100644 --- a/app/vendor/robmorgan/phinx/src/Phinx/Db/Action/RemoveColumn.php +++ b/app/vendor/robmorgan/phinx/src/Phinx/Db/Action/RemoveColumn.php @@ -37,7 +37,6 @@ public function __construct(Table $table, Column $column) * * @param \Phinx\Db\Table\Table $table The table where the column is * @param mixed $columnName The name of the column to drop - * * @return \Phinx\Db\Action\RemoveColumn */ public static function build(Table $table, $columnName) diff --git a/app/vendor/robmorgan/phinx/src/Phinx/Db/Action/RenameColumn.php b/app/vendor/robmorgan/phinx/src/Phinx/Db/Action/RenameColumn.php index db7721f70..53ffc44b3 100644 --- a/app/vendor/robmorgan/phinx/src/Phinx/Db/Action/RenameColumn.php +++ b/app/vendor/robmorgan/phinx/src/Phinx/Db/Action/RenameColumn.php @@ -47,7 +47,6 @@ public function __construct(Table $table, Column $column, $newName) * @param \Phinx\Db\Table\Table $table The table where the column is * @param mixed $columnName The name of the column to be changed * @param mixed $newName The new name for the column - * * @return \Phinx\Db\Action\RenameColumn */ public static function build(Table $table, $columnName, $newName) diff --git a/app/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/AbstractAdapter.php b/app/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/AbstractAdapter.php index 28a94f606..371a1c79a 100644 --- a/app/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/AbstractAdapter.php +++ b/app/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/AbstractAdapter.php @@ -58,7 +58,7 @@ abstract class AbstractAdapter implements AdapterInterface * @param \Symfony\Component\Console\Input\InputInterface|null $input Input Interface * @param \Symfony\Component\Console\Output\OutputInterface|null $output Output Interface */ - public function __construct(array $options, InputInterface $input = null, OutputInterface $output = null) + public function __construct(array $options, ?InputInterface $input = null, ?OutputInterface $output = null) { $this->setOptions($options); if ($input !== null) { @@ -158,7 +158,6 @@ public function getOutput() /** * @inheritDoc - * * @return array */ public function getVersions() @@ -182,7 +181,6 @@ public function getSchemaTableName() * Sets the schema table name. * * @param string $schemaTableName Schema Table Name - * * @return $this */ public function setSchemaTableName($schemaTableName) @@ -298,9 +296,7 @@ public function hasSchemaTable() /** * @inheritDoc - * * @throws \InvalidArgumentException - * * @return void */ public function createSchemaTable() @@ -353,14 +349,13 @@ public function isDryRunEnabled() /** @var \Symfony\Component\Console\Input\InputInterface|null $input */ $input = $this->getInput(); - return ($input && $input->hasOption('dry-run')) ? (bool)$input->getOption('dry-run') : false; + return $input && $input->hasOption('dry-run') ? (bool)$input->getOption('dry-run') : false; } /** * Adds user-created tables (e.g. not phinxlog) to a cached list * * @param string $tableName The name of the table - * * @return void */ protected function addCreatedTable($tableName) @@ -376,7 +371,6 @@ protected function addCreatedTable($tableName) * * @param string $tableName Original name of the table * @param string $newTableName New name of the table - * * @return void */ protected function updateCreatedTableName($tableName, $newTableName) @@ -393,7 +387,6 @@ protected function updateCreatedTableName($tableName, $newTableName) * Removes table from the cached created list * * @param string $tableName The name of the table - * * @return void */ protected function removeCreatedTable($tableName) @@ -409,7 +402,6 @@ protected function removeCreatedTable($tableName) * Check if the table is in the cached list of created tables * * @param string $tableName The name of the table - * * @return bool */ protected function hasCreatedTable($tableName) diff --git a/app/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/AdapterFactory.php b/app/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/AdapterFactory.php index 74eedd7d8..09327e3d7 100644 --- a/app/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/AdapterFactory.php +++ b/app/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/AdapterFactory.php @@ -65,9 +65,7 @@ public static function instance() * * @param string $name Name * @param string $class Class - * * @throws \RuntimeException - * * @return $this */ public function registerAdapter($name, $class) @@ -87,9 +85,7 @@ public function registerAdapter($name, $class) * Get an adapter class by name. * * @param string $name Name - * * @throws \RuntimeException - * * @return string */ protected function getClass($name) @@ -109,7 +105,6 @@ protected function getClass($name) * * @param string $name Name * @param array $options Options - * * @return \Phinx\Db\Adapter\AdapterInterface */ public function getAdapter($name, array $options) @@ -124,9 +119,7 @@ public function getAdapter($name, array $options) * * @param string $name Name * @param string $class Class - * * @throws \RuntimeException - * * @return $this */ public function registerWrapper($name, $class) @@ -146,9 +139,7 @@ public function registerWrapper($name, $class) * Get a wrapper class by name. * * @param string $name Name - * * @throws \RuntimeException - * * @return string */ protected function getWrapperClass($name) @@ -168,7 +159,6 @@ protected function getWrapperClass($name) * * @param string $name Name * @param \Phinx\Db\Adapter\AdapterInterface $adapter Adapter - * * @return \Phinx\Db\Adapter\AdapterInterface */ public function getWrapper($name, AdapterInterface $adapter) diff --git a/app/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/AdapterInterface.php b/app/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/AdapterInterface.php index 0700922c6..d8cdc5b7e 100644 --- a/app/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/AdapterInterface.php +++ b/app/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/AdapterInterface.php @@ -56,6 +56,7 @@ interface AdapterInterface public const PHINX_TYPE_POLYGON = 'polygon'; // only for mysql so far + public const PHINX_TYPE_MEDIUM_INTEGER = 'mediuminteger'; public const PHINX_TYPE_ENUM = 'enum'; public const PHINX_TYPE_SET = 'set'; public const PHINX_TYPE_YEAR = 'year'; @@ -85,7 +86,6 @@ public function getVersionLog(); * Set adapter configuration options. * * @param array $options Options - * * @return \Phinx\Db\Adapter\AdapterInterface */ public function setOptions(array $options); @@ -101,7 +101,6 @@ public function getOptions(); * Check if an option has been set. * * @param string $name Name - * * @return bool */ public function hasOption($name); @@ -110,7 +109,6 @@ public function hasOption($name); * Get a single adapter option, or null if the option does not exist. * * @param string $name Name - * * @return mixed */ public function getOption($name); @@ -119,7 +117,6 @@ public function getOption($name); * Sets the console input. * * @param \Symfony\Component\Console\Input\InputInterface $input Input - * * @return \Phinx\Db\Adapter\AdapterInterface */ public function setInput(InputInterface $input); @@ -135,7 +132,6 @@ public function getInput(); * Sets the console output. * * @param \Symfony\Component\Console\Output\OutputInterface $output Output - * * @return \Phinx\Db\Adapter\AdapterInterface */ public function setOutput(OutputInterface $output); @@ -164,7 +160,6 @@ public function getColumnForType($columnName, $type, array $options); * @param string $direction Direction * @param string $startTime Start Time * @param string $endTime End Time - * * @return \Phinx\Db\Adapter\AdapterInterface */ public function migrated(MigrationInterface $migration, $direction, $startTime, $endTime); @@ -173,7 +168,6 @@ public function migrated(MigrationInterface $migration, $direction, $startTime, * Toggle a migration breakpoint. * * @param \Phinx\Migration\MigrationInterface $migration Migration - * * @return \Phinx\Db\Adapter\AdapterInterface */ public function toggleBreakpoint(MigrationInterface $migration); @@ -189,7 +183,6 @@ public function resetAllBreakpoints(); * Set a migration breakpoint. * * @param \Phinx\Migration\MigrationInterface $migration The migration target for the breakpoint set - * * @return \Phinx\Db\Adapter\AdapterInterface */ public function setBreakpoint(MigrationInterface $migration); @@ -198,7 +191,6 @@ public function setBreakpoint(MigrationInterface $migration); * Unset a migration breakpoint. * * @param \Phinx\Migration\MigrationInterface $migration The migration target for the breakpoint unset - * * @return \Phinx\Db\Adapter\AdapterInterface */ public function unsetBreakpoint(MigrationInterface $migration); @@ -207,7 +199,6 @@ public function unsetBreakpoint(MigrationInterface $migration); * Does the schema table exist? * * @deprecated use hasTable instead. - * * @return bool */ public function hasSchemaTable(); @@ -230,7 +221,6 @@ public function getAdapterType(); * Initializes the database connection. * * @throws \RuntimeException When the requested database driver is not installed. - * * @return void */ public function connect(); @@ -274,7 +264,6 @@ public function rollbackTransaction(); * Executes a SQL statement and returns the number of affected rows. * * @param string $sql SQL - * * @return int */ public function execute($sql); @@ -284,7 +273,6 @@ public function execute($sql); * * @param \Phinx\Db\Table\Table $table The table to execute the actions for * @param \Phinx\Db\Action\Action[] $actions The table to execute the actions for - * * @return void */ public function executeActions(Table $table, array $actions); @@ -302,7 +290,6 @@ public function getQueryBuilder(); * The return type depends on the underlying adapter being used. * * @param string $sql SQL - * * @return mixed */ public function query($sql); @@ -311,7 +298,6 @@ public function query($sql); * Executes a query and returns only one row as an array. * * @param string $sql SQL - * * @return array|false */ public function fetchRow($sql); @@ -320,7 +306,6 @@ public function fetchRow($sql); * Executes a query and returns an array of rows. * * @param string $sql SQL - * * @return array */ public function fetchAll($sql); @@ -330,7 +315,6 @@ public function fetchAll($sql); * * @param \Phinx\Db\Table\Table $table Table where to insert data * @param array $row Row - * * @return void */ public function insert(Table $table, $row); @@ -340,7 +324,6 @@ public function insert(Table $table, $row); * * @param \Phinx\Db\Table\Table $table Table where to insert data * @param array $rows Rows - * * @return void */ public function bulkinsert(Table $table, $rows); @@ -349,7 +332,6 @@ public function bulkinsert(Table $table, $rows); * Quotes a table name for use in a query. * * @param string $tableName Table name - * * @return string */ public function quoteTableName($tableName); @@ -358,7 +340,6 @@ public function quoteTableName($tableName); * Quotes a column name for use in a query. * * @param string $columnName Table name - * * @return string */ public function quoteColumnName($columnName); @@ -367,7 +348,6 @@ public function quoteColumnName($columnName); * Checks to see if a table exists. * * @param string $tableName Table name - * * @return bool */ public function hasTable($tableName); @@ -378,7 +358,6 @@ public function hasTable($tableName); * @param \Phinx\Db\Table\Table $table Table * @param \Phinx\Db\Table\Column[] $columns List of columns in the table * @param \Phinx\Db\Table\Index[] $indexes List of indexes for the table - * * @return void */ public function createTable(Table $table, array $columns = [], array $indexes = []); @@ -387,7 +366,6 @@ public function createTable(Table $table, array $columns = [], array $indexes = * Truncates the specified table * * @param string $tableName Table name - * * @return void */ public function truncateTable($tableName); @@ -396,7 +374,6 @@ public function truncateTable($tableName); * Returns table columns * * @param string $tableName Table name - * * @return \Phinx\Db\Table\Column[] */ public function getColumns($tableName); @@ -406,7 +383,6 @@ public function getColumns($tableName); * * @param string $tableName Table name * @param string $columnName Column name - * * @return bool */ public function hasColumn($tableName, $columnName); @@ -416,7 +392,6 @@ public function hasColumn($tableName, $columnName); * * @param string $tableName Table name * @param string|string[] $columns Column(s) - * * @return bool */ public function hasIndex($tableName, $columns); @@ -426,7 +401,6 @@ public function hasIndex($tableName, $columns); * * @param string $tableName Table name * @param string $indexName Index name - * * @return bool */ public function hasIndexByName($tableName, $indexName); @@ -437,7 +411,6 @@ public function hasIndexByName($tableName, $indexName); * @param string $tableName Table name * @param string|string[] $columns Column(s) * @param string|null $constraint Constraint name - * * @return bool */ public function hasPrimaryKey($tableName, $columns, $constraint = null); @@ -448,7 +421,6 @@ public function hasPrimaryKey($tableName, $columns, $constraint = null); * @param string $tableName Table name * @param string|string[] $columns Column(s) * @param string|null $constraint Constraint name - * * @return bool */ public function hasForeignKey($tableName, $columns, $constraint = null); @@ -464,7 +436,6 @@ public function getColumnTypes(); * Checks that the given column is of a supported type. * * @param \Phinx\Db\Table\Column $column Column - * * @return bool */ public function isValidColumnType(Column $column); @@ -474,7 +445,6 @@ public function isValidColumnType(Column $column); * * @param string $type Type * @param int|null $limit Limit - * * @return array */ public function getSqlType($type, $limit = null); @@ -484,7 +454,6 @@ public function getSqlType($type, $limit = null); * * @param string $name Database Name * @param array $options Options - * * @return void */ public function createDatabase($name, $options = []); @@ -493,7 +462,6 @@ public function createDatabase($name, $options = []); * Checks to see if a database exists. * * @param string $name Database Name - * * @return bool */ public function hasDatabase($name); @@ -502,7 +470,6 @@ public function hasDatabase($name); * Drops the specified database. * * @param string $name Database Name - * * @return void */ public function dropDatabase($name); @@ -512,7 +479,6 @@ public function dropDatabase($name); * if there is no support for it. * * @param string $schemaName Schema Name - * * @return void */ public function createSchema($schemaName = 'public'); @@ -522,7 +488,6 @@ public function createSchema($schemaName = 'public'); * if there is no support for it. * * @param string $schemaName Schema name - * * @return void */ public function dropSchema($schemaName); @@ -531,7 +496,6 @@ public function dropSchema($schemaName); * Cast a value to a boolean appropriate for the adapter. * * @param mixed $value The value to be cast - * * @return mixed */ public function castToBool($value); diff --git a/app/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/DirectActionInterface.php b/app/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/DirectActionInterface.php index d3ba41012..358c4c1f2 100644 --- a/app/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/DirectActionInterface.php +++ b/app/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/DirectActionInterface.php @@ -23,7 +23,6 @@ interface DirectActionInterface * * @param string $tableName Table name * @param string $newName New Name - * * @return void */ public function renameTable($tableName, $newName); @@ -32,7 +31,6 @@ public function renameTable($tableName, $newName); * Drops the specified database table. * * @param string $tableName Table name - * * @return void */ public function dropTable($tableName); @@ -42,7 +40,6 @@ public function dropTable($tableName); * * @param \Phinx\Db\Table\Table $table Table * @param string|string[]|null $newColumns Column name(s) to belong to the primary key, or null to drop the key - * * @return void */ public function changePrimaryKey(Table $table, $newColumns); @@ -52,7 +49,6 @@ public function changePrimaryKey(Table $table, $newColumns); * * @param \Phinx\Db\Table\Table $table Table * @param string|null $newComment New comment string, or null to drop the comment - * * @return void */ public function changeComment(Table $table, $newComment); @@ -62,7 +58,6 @@ public function changeComment(Table $table, $newComment); * * @param \Phinx\Db\Table\Table $table Table * @param \Phinx\Db\Table\Column $column Column - * * @return void */ public function addColumn(Table $table, Column $column); @@ -73,7 +68,6 @@ public function addColumn(Table $table, Column $column); * @param string $tableName Table name * @param string $columnName Column Name * @param string $newColumnName New Column Name - * * @return void */ public function renameColumn($tableName, $columnName, $newColumnName); @@ -84,7 +78,6 @@ public function renameColumn($tableName, $columnName, $newColumnName); * @param string $tableName Table name * @param string $columnName Column Name * @param \Phinx\Db\Table\Column $newColumn New Column - * * @return void */ public function changeColumn($tableName, $columnName, Column $newColumn); @@ -94,7 +87,6 @@ public function changeColumn($tableName, $columnName, Column $newColumn); * * @param string $tableName Table name * @param string $columnName Column Name - * * @return void */ public function dropColumn($tableName, $columnName); @@ -104,7 +96,6 @@ public function dropColumn($tableName, $columnName); * * @param \Phinx\Db\Table\Table $table Table * @param \Phinx\Db\Table\Index $index Index - * * @return void */ public function addIndex(Table $table, Index $index); @@ -114,7 +105,6 @@ public function addIndex(Table $table, Index $index); * * @param string $tableName the name of the table * @param mixed $columns Column(s) - * * @return void */ public function dropIndex($tableName, $columns); @@ -124,7 +114,6 @@ public function dropIndex($tableName, $columns); * * @param string $tableName The table name where the index is * @param string $indexName The name of the index - * * @return void */ public function dropIndexByName($tableName, $indexName); @@ -134,7 +123,6 @@ public function dropIndexByName($tableName, $indexName); * * @param \Phinx\Db\Table\Table $table The table to add the foreign key to * @param \Phinx\Db\Table\ForeignKey $foreignKey The foreign key to add - * * @return void */ public function addForeignKey(Table $table, ForeignKey $foreignKey); @@ -145,7 +133,6 @@ public function addForeignKey(Table $table, ForeignKey $foreignKey); * @param string $tableName The table to drop the foreign key from * @param string[] $columns Column(s) * @param string|null $constraint Constraint name - * * @return void */ public function dropForeignKey($tableName, $columns, $constraint = null); diff --git a/app/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/MysqlAdapter.php b/app/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/MysqlAdapter.php index 88750f0de..1b2b19062 100644 --- a/app/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/MysqlAdapter.php +++ b/app/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/MysqlAdapter.php @@ -38,6 +38,7 @@ class MysqlAdapter extends PdoAdapter self::PHINX_TYPE_TINYBLOB, self::PHINX_TYPE_MEDIUMBLOB, self::PHINX_TYPE_LONGBLOB, + self::PHINX_TYPE_MEDIUM_INTEGER, ]; /** @@ -47,6 +48,7 @@ class MysqlAdapter extends PdoAdapter self::PHINX_TYPE_INTEGER => true, self::PHINX_TYPE_TINY_INTEGER => true, self::PHINX_TYPE_SMALL_INTEGER => true, + self::PHINX_TYPE_MEDIUM_INTEGER => true, self::PHINX_TYPE_BIG_INTEGER => true, self::PHINX_TYPE_FLOAT => true, self::PHINX_TYPE_DECIMAL => true, @@ -84,7 +86,6 @@ class MysqlAdapter extends PdoAdapter * * @throws \RuntimeException * @throws \InvalidArgumentException - * * @return void */ public function connect() @@ -225,7 +226,6 @@ public function hasTable($tableName) /** * @param string $schema The table schema * @param string $tableName The table name - * * @return bool */ protected function hasTableWithSchema($schema, $tableName) @@ -268,7 +268,7 @@ public function createTable(Table $table, array $columns = [], array $indexes = $column = new Column(); $column->setName($options['id']) ->setType('integer') - ->setSigned(isset($options['signed']) ? $options['signed'] : true) + ->setSigned($options['signed'] ?? true) ->setIdentity(true); if (isset($options['limit'])) { @@ -384,9 +384,7 @@ protected function getChangeCommentInstructions(Table $table, $newComment) $instructions = new AlterInstructions(); // passing 'null' is to remove table comment - $newComment = ($newComment !== null) - ? $newComment - : ''; + $newComment = $newComment ?? ''; $sql = sprintf(' COMMENT=%s ', $this->getConnection()->quote($newComment)); $instructions->addAlter($sql); @@ -499,8 +497,7 @@ protected function getAddColumnInstructions(Table $table, Column $column) /** * Exposes the MySQL syntax to arrange a column `FIRST`. * - * @param Column $column The column being altered. - * + * @param \Phinx\Db\Table\Column $column The column being altered. * @return string The appropriate SQL fragment. */ protected function afterClause(Column $column) @@ -528,7 +525,7 @@ protected function getRenameColumnInstructions($tableName, $columnName, $newColu foreach ($rows as $row) { if (strcasecmp($row['Field'], $columnName) === 0) { - $null = ($row['Null'] === 'NO') ? 'NOT NULL' : 'NULL'; + $null = $row['Null'] === 'NO' ? 'NOT NULL' : 'NULL'; $comment = isset($row['Comment']) ? ' COMMENT ' . '\'' . addslashes($row['Comment']) . '\'' : ''; $extra = ' ' . strtoupper($row['Extra']); if (($row['Default'] !== null)) { @@ -583,7 +580,6 @@ protected function getDropColumnInstructions($tableName, $columnName) * Get an array of indexes from a particular table. * * @param string $tableName Table name - * * @return array */ protected function getIndexes($tableName) @@ -731,7 +727,7 @@ public function hasPrimaryKey($tableName, $columns, $constraint = null) } if ($constraint) { - return ($primaryKey['constraint'] === $constraint); + return $primaryKey['constraint'] === $constraint; } else { if (is_string($columns)) { $columns = [$columns]; // str to array @@ -746,7 +742,6 @@ public function hasPrimaryKey($tableName, $columns, $constraint = null) * Get the primary key from a particular table. * * @param string $tableName Table name - * * @return array */ public function getPrimaryKey($tableName) @@ -758,7 +753,7 @@ public function getPrimaryKey($tableName) k.COLUMN_NAME FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS t JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE k - USING(CONSTRAINT_NAME,TABLE_NAME) + USING(CONSTRAINT_NAME,TABLE_SCHEMA,TABLE_NAME) WHERE t.CONSTRAINT_TYPE='PRIMARY KEY' AND t.TABLE_SCHEMA='%s' AND t.TABLE_NAME='%s'", @@ -807,7 +802,6 @@ public function hasForeignKey($tableName, $columns, $constraint = null) * Get an array of foreign keys from a particular table. * * @param string $tableName Table name - * * @return array */ protected function getForeignKeys($tableName) @@ -1006,6 +1000,10 @@ public function getSqlType($type, $limit = null) return $this->getSqlType(static::PHINX_TYPE_BLOB, $limit ?: static::BLOB_LONG); case static::PHINX_TYPE_BIT: return ['name' => 'bit', 'limit' => $limit ?: 64]; + case static::PHINX_TYPE_BIG_INTEGER: + return ['name' => 'bigint', 'limit' => $limit ?: 20]; + case static::PHINX_TYPE_MEDIUM_INTEGER: + return ['name' => 'mediumint', 'limit' => $limit ?: 8]; case static::PHINX_TYPE_SMALL_INTEGER: return ['name' => 'smallint', 'limit' => $limit ?: 6]; case static::PHINX_TYPE_TINY_INTEGER: @@ -1023,6 +1021,7 @@ public function getSqlType($type, $limit = null) $limits = [ 'tinyint' => 4, 'smallint' => 6, + 'mediumint' => 8, 'int' => 11, 'bigint' => 20, ]; @@ -1041,8 +1040,6 @@ public function getSqlType($type, $limit = null) } return ['name' => 'int', 'limit' => $limit]; - case static::PHINX_TYPE_BIG_INTEGER: - return ['name' => 'bigint', 'limit' => $limit ?: 20]; case static::PHINX_TYPE_BOOLEAN: return ['name' => 'tinyint', 'limit' => 1]; case static::PHINX_TYPE_UUID: @@ -1062,11 +1059,8 @@ public function getSqlType($type, $limit = null) * Returns Phinx type by SQL type * * @internal param string $sqlType SQL type - * * @param string $sqlTypeDef SQL Type definition - * * @throws \Phinx\Db\Adapter\UnsupportedColumnTypeException - * * @return array Phinx type */ public function getPhinxType($sqlTypeDef) @@ -1114,7 +1108,7 @@ public function getPhinxType($sqlTypeDef) $limit = static::INT_SMALL; break; case 'mediumint': - $type = static::PHINX_TYPE_INTEGER; + $type = static::PHINX_TYPE_MEDIUM_INTEGER; $limit = static::INT_MEDIUM; break; case 'int': @@ -1193,7 +1187,7 @@ public function getPhinxType($sqlTypeDef) ]; if ($type === static::PHINX_TYPE_ENUM || $type === static::PHINX_TYPE_SET) { - $values = trim($matches[6], "()"); + $values = trim($matches[6], '()'); $phinxType['values'] = []; $opened = false; $escaped = false; @@ -1209,7 +1203,7 @@ public function getPhinxType($sqlTypeDef) && ($i + 1) < $valuesLength && ( $char === "'" && $values[$i + 1] === "'" - || $char === "\\" && $values[$i + 1] === "\\" + || $char === '\\' && $values[$i + 1] === '\\' ) ) { $escaped = true; @@ -1217,12 +1211,12 @@ public function getPhinxType($sqlTypeDef) $phinxType['values'][] = $value; $value = ''; $opened = false; - } elseif (($char === "'" || $char === "\\") && $opened && $escaped) { + } elseif (($char === "'" || $char === '\\') && $opened && $escaped) { $value .= $char; $escaped = false; $wasEscaped = true; } elseif ($opened) { - if ($values[$i - 1] === "\\" && !$wasEscaped) { + if ($values[$i - 1] === '\\' && !$wasEscaped) { if ($char === 'n') { $char = "\n"; } elseif ($char === 'r') { @@ -1296,7 +1290,6 @@ public function dropDatabase($name) * Gets the MySQL Column Definition for a Column object. * * @param \Phinx\Db\Table\Column $column Column - * * @return string */ protected function getColumnSqlDefinition(Column $column) @@ -1312,13 +1305,15 @@ protected function getColumnSqlDefinition(Column $column) } elseif (isset($sqlType['limit'])) { $def .= '(' . $sqlType['limit'] . ')'; } - if (($values = $column->getValues()) && is_array($values)) { - $def .= "(" . implode(", ", array_map(function ($value) { + + $values = $column->getValues(); + if ($values && is_array($values)) { + $def .= '(' . implode(', ', array_map(function ($value) { // we special case NULL as it's not actually allowed an enum value, // and we want MySQL to issue an error on the create statement, but // quote coerces it to an empty string, which will not error return $value === null ? 'NULL' : $this->getConnection()->quote($value); - }, $values)) . ")"; + }, $values)) . ')'; } $def .= $column->getEncoding() ? ' CHARACTER SET ' . $column->getEncoding() : ''; @@ -1357,7 +1352,6 @@ protected function getColumnSqlDefinition(Column $column) * Gets the MySQL Index Definition for an Index object. * * @param \Phinx\Db\Table\Index $index Index - * * @return string */ protected function getIndexSqlDefinition(Index $index) @@ -1415,7 +1409,6 @@ protected function getIndexSqlDefinition(Index $index) * Gets the MySQL Foreign Key Definition for an ForeignKey object. * * @param \Phinx\Db\Table\ForeignKey $foreignKey Foreign key - * * @return string */ protected function getForeignKeySqlDefinition(ForeignKey $foreignKey) @@ -1448,7 +1441,6 @@ protected function getForeignKeySqlDefinition(ForeignKey $foreignKey) * Describes a database table. This is a MySQL adapter specific method. * * @param string $tableName Table name - * * @return array */ public function describeTable($tableName) diff --git a/app/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/PdoAdapter.php b/app/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/PdoAdapter.php index 883ef0a30..b42b1b06b 100644 --- a/app/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/PdoAdapter.php +++ b/app/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/PdoAdapter.php @@ -50,7 +50,6 @@ abstract class PdoAdapter extends AbstractAdapter implements DirectActionInterfa * Writes a message to stdout if verbose output is on * * @param string $message The message to show - * * @return void */ protected function verboseLog($message) @@ -120,7 +119,6 @@ public function setOptions(array $options) * Sets the database connection. * * @param \PDO $connection Connection - * * @return \Phinx\Db\Adapter\AdapterInterface */ public function setConnection(PDO $connection) @@ -214,7 +212,6 @@ public function getQueryBuilder() * Executes a query and returns PDOStatement. * * @param string $sql SQL - * * @return \PDOStatement */ public function query($sql) @@ -270,7 +267,6 @@ public function insert(Table $table, $row) * Quotes a database value. * * @param mixed $value The value to quote - * * @return mixed */ protected function quoteValue($value) @@ -290,7 +286,6 @@ protected function quoteValue($value) * Quotes a database string. * * @param string $value The string to quote - * * @return string */ protected function quoteString($value) @@ -484,7 +479,6 @@ public function unsetBreakpoint(MigrationInterface $migration) * * @param \Phinx\Migration\MigrationInterface $migration The migration target for the breakpoint * @param bool $state The required state of the breakpoint - * * @return \Phinx\Db\Adapter\AdapterInterface */ protected function markBreakpoint(MigrationInterface $migration, $state) @@ -508,7 +502,6 @@ protected function markBreakpoint(MigrationInterface $migration, $state) * {@inheritDoc} * * @throws \BadMethodCallException - * * @return void */ public function createSchema($schemaName = 'public') @@ -520,7 +513,6 @@ public function createSchema($schemaName = 'public') * {@inheritDoc} * * @throws \BadMethodCallException - * * @return void */ public function dropSchema($name) @@ -574,9 +566,7 @@ public function castToBool($value) * Retrieve a database connection attribute * * @see http://php.net/manual/en/pdo.getattribute.php - * * @param int $attribute One of the PDO::ATTR_* constants - * * @return mixed */ public function getAttribute($attribute) @@ -589,7 +579,6 @@ public function getAttribute($attribute) * * @param mixed $default Default value * @param string|null $columnType column type added - * * @return string */ protected function getDefaultValueDefinition($default, $columnType = null) @@ -611,7 +600,6 @@ protected function getDefaultValueDefinition($default, $columnType = null) * * @param string $tableName The table name to use in the ALTER statement * @param \Phinx\Db\Util\AlterInstructions $instructions The object containing the alter sequence - * * @return void */ protected function executeAlterSteps($tableName, AlterInstructions $instructions) @@ -634,7 +622,6 @@ public function addColumn(Table $table, Column $column) * * @param \Phinx\Db\Table\Table $table Table * @param \Phinx\Db\Table\Column $column Column - * * @return \Phinx\Db\Util\AlterInstructions */ abstract protected function getAddColumnInstructions(Table $table, Column $column); @@ -654,7 +641,6 @@ public function renameColumn($tableName, $columnName, $newColumnName) * @param string $tableName Table name * @param string $columnName Column Name * @param string $newColumnName New Column Name - * * @return \Phinx\Db\Util\AlterInstructions */ abstract protected function getRenameColumnInstructions($tableName, $columnName, $newColumnName); @@ -674,7 +660,6 @@ public function changeColumn($tableName, $columnName, Column $newColumn) * @param string $tableName Table name * @param string $columnName Column Name * @param \Phinx\Db\Table\Column $newColumn New Column - * * @return \Phinx\Db\Util\AlterInstructions */ abstract protected function getChangeColumnInstructions($tableName, $columnName, Column $newColumn); @@ -693,7 +678,6 @@ public function dropColumn($tableName, $columnName) * * @param string $tableName Table name * @param string $columnName Column Name - * * @return \Phinx\Db\Util\AlterInstructions */ abstract protected function getDropColumnInstructions($tableName, $columnName); @@ -712,7 +696,6 @@ public function addIndex(Table $table, Index $index) * * @param \Phinx\Db\Table\Table $table Table * @param \Phinx\Db\Table\Index $index Index - * * @return \Phinx\Db\Util\AlterInstructions */ abstract protected function getAddIndexInstructions(Table $table, Index $index); @@ -731,7 +714,6 @@ public function dropIndex($tableName, $columns) * * @param string $tableName The name of of the table where the index is * @param mixed $columns Column(s) - * * @return \Phinx\Db\Util\AlterInstructions */ abstract protected function getDropIndexByColumnsInstructions($tableName, $columns); @@ -750,7 +732,6 @@ public function dropIndexByName($tableName, $indexName) * * @param string $tableName The table name whe the index is * @param string $indexName The name of the index - * * @return \Phinx\Db\Util\AlterInstructions */ abstract protected function getDropIndexByNameInstructions($tableName, $indexName); @@ -792,7 +773,6 @@ public function dropForeignKey($tableName, $columns, $constraint = null) * * @param string $tableName The table where the foreign key constraint is * @param string $constraint Constraint name - * * @return \Phinx\Db\Util\AlterInstructions */ abstract protected function getDropForeignKeyInstructions($tableName, $constraint); @@ -802,7 +782,6 @@ abstract protected function getDropForeignKeyInstructions($tableName, $constrain * * @param string $tableName The table where the foreign key constraint is * @param string[] $columns The list of column names - * * @return \Phinx\Db\Util\AlterInstructions */ abstract protected function getDropForeignKeyByColumnsInstructions($tableName, $columns); @@ -820,7 +799,6 @@ public function dropTable($tableName) * Returns the instructions to drop the specified database table. * * @param string $tableName Table name - * * @return \Phinx\Db\Util\AlterInstructions */ abstract protected function getDropTableInstructions($tableName); @@ -839,7 +817,6 @@ public function renameTable($tableName, $newTableName) * * @param string $tableName Table name * @param string $newTableName New Name - * * @return \Phinx\Db\Util\AlterInstructions */ abstract protected function getRenameTableInstructions($tableName, $newTableName); @@ -858,7 +835,6 @@ public function changePrimaryKey(Table $table, $newColumns) * * @param \Phinx\Db\Table\Table $table Table * @param string|string[]|null $newColumns Column name(s) to belong to the primary key, or null to drop the key - * * @return \Phinx\Db\Util\AlterInstructions */ abstract protected function getChangePrimaryKeyInstructions(Table $table, $newColumns); @@ -877,7 +853,6 @@ public function changeComment(Table $table, $newComment) * * @param \Phinx\Db\Table\Table $table Table * @param string|null $newComment New comment string, or null to drop the comment - * * @return \Phinx\Db\Util\AlterInstructions */ abstract protected function getChangeCommentInstructions(Table $table, $newComment); @@ -886,7 +861,6 @@ abstract protected function getChangeCommentInstructions(Table $table, $newComme * {@inheritDoc} * * @throws \InvalidArgumentException - * * @return void */ public function executeActions(Table $table, array $actions) @@ -895,19 +869,19 @@ public function executeActions(Table $table, array $actions) foreach ($actions as $action) { switch (true) { - case ($action instanceof AddColumn): + case $action instanceof AddColumn: $instructions->merge($this->getAddColumnInstructions($table, $action->getColumn())); break; - case ($action instanceof AddIndex): + case $action instanceof AddIndex: $instructions->merge($this->getAddIndexInstructions($table, $action->getIndex())); break; - case ($action instanceof AddForeignKey): + case $action instanceof AddForeignKey: $instructions->merge($this->getAddForeignKeyInstructions($table, $action->getForeignKey())); break; - case ($action instanceof ChangeColumn): + case $action instanceof ChangeColumn: $instructions->merge($this->getChangeColumnInstructions( $table->getName(), $action->getColumnName(), @@ -915,48 +889,48 @@ public function executeActions(Table $table, array $actions) )); break; - case ($action instanceof DropForeignKey && !$action->getForeignKey()->getConstraint()): + case $action instanceof DropForeignKey && !$action->getForeignKey()->getConstraint(): $instructions->merge($this->getDropForeignKeyByColumnsInstructions( $table->getName(), $action->getForeignKey()->getColumns() )); break; - case ($action instanceof DropForeignKey && $action->getForeignKey()->getConstraint()): + case $action instanceof DropForeignKey && $action->getForeignKey()->getConstraint(): $instructions->merge($this->getDropForeignKeyInstructions( $table->getName(), $action->getForeignKey()->getConstraint() )); break; - case ($action instanceof DropIndex && $action->getIndex()->getName() !== null): + case $action instanceof DropIndex && $action->getIndex()->getName() !== null: $instructions->merge($this->getDropIndexByNameInstructions( $table->getName(), $action->getIndex()->getName() )); break; - case ($action instanceof DropIndex && $action->getIndex()->getName() == null): + case $action instanceof DropIndex && $action->getIndex()->getName() == null: $instructions->merge($this->getDropIndexByColumnsInstructions( $table->getName(), $action->getIndex()->getColumns() )); break; - case ($action instanceof DropTable): + case $action instanceof DropTable: $instructions->merge($this->getDropTableInstructions( $table->getName() )); break; - case ($action instanceof RemoveColumn): + case $action instanceof RemoveColumn: $instructions->merge($this->getDropColumnInstructions( $table->getName(), $action->getColumn()->getName() )); break; - case ($action instanceof RenameColumn): + case $action instanceof RenameColumn: $instructions->merge($this->getRenameColumnInstructions( $table->getName(), $action->getColumn()->getName(), @@ -964,21 +938,21 @@ public function executeActions(Table $table, array $actions) )); break; - case ($action instanceof RenameTable): + case $action instanceof RenameTable: $instructions->merge($this->getRenameTableInstructions( $table->getName(), $action->getNewName() )); break; - case ($action instanceof ChangePrimaryKey): + case $action instanceof ChangePrimaryKey: $instructions->merge($this->getChangePrimaryKeyInstructions( $table, $action->getNewColumns() )); break; - case ($action instanceof ChangeComment): + case $action instanceof ChangeComment: $instructions->merge($this->getChangeCommentInstructions( $table, $action->getNewComment() diff --git a/app/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/PostgresAdapter.php b/app/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/PostgresAdapter.php index f0700d0ea..67d0842c5 100644 --- a/app/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/PostgresAdapter.php +++ b/app/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/PostgresAdapter.php @@ -47,7 +47,6 @@ class PostgresAdapter extends PdoAdapter * * @throws \RuntimeException * @throws \InvalidArgumentException - * * @return void */ public function connect() @@ -141,7 +140,6 @@ public function rollbackTransaction() * Quotes a schema name for use in a query. * * @param string $schemaName Schema Name - * * @return string */ public function quoteSchemaName($schemaName) @@ -333,7 +331,7 @@ protected function getChangeCommentInstructions(Table $table, $newComment) $instructions = new AlterInstructions(); // passing 'null' is to remove table comment - $newComment = ($newComment !== null) + $newComment = $newComment !== null ? $this->getConnection()->quote($newComment) : 'NULL'; $sql = sprintf( @@ -540,26 +538,38 @@ protected function getRenameColumnInstructions($tableName, $columnName, $newColu protected function getChangeColumnInstructions($tableName, $columnName, Column $newColumn) { $instructions = new AlterInstructions(); - + if ($newColumn->getType() === 'boolean') { + $sql = sprintf('ALTER COLUMN %s DROP DEFAULT', $this->quoteColumnName($columnName)); + $instructions->addAlter($sql); + } $sql = sprintf( 'ALTER COLUMN %s TYPE %s', $this->quoteColumnName($columnName), $this->getColumnSqlDefinition($newColumn) ); - if (in_array($newColumn->getType(), ['smallinteger', 'integer', 'biginteger'], true)) { $sql .= sprintf( ' USING (%s::bigint)', $this->quoteColumnName($columnName) ); } - + if ($newColumn->getType() === 'uuid') { + $sql .= sprintf( + ' USING (%s::uuid)', + $this->quoteColumnName($columnName) + ); + } //NULL and DEFAULT cannot be set while changing column type $sql = preg_replace('/ NOT NULL/', '', $sql); $sql = preg_replace('/ NULL/', '', $sql); //If it is set, DEFAULT is the last definition $sql = preg_replace('/DEFAULT .*/', '', $sql); - + if ($newColumn->getType() === 'boolean') { + $sql .= sprintf( + ' USING (CASE WHEN %s=0 THEN FALSE ELSE TRUE END)', + $this->quoteColumnName($columnName) + ); + } $instructions->addAlter($sql); // process null @@ -625,7 +635,6 @@ protected function getDropColumnInstructions($tableName, $columnName) * Get an array of indexes from a particular table. * * @param string $tableName Table name - * * @return array */ protected function getIndexes($tableName) @@ -770,7 +779,7 @@ public function hasPrimaryKey($tableName, $columns, $constraint = null) } if ($constraint) { - return ($primaryKey['constraint'] === $constraint); + return $primaryKey['constraint'] === $constraint; } else { if (is_string($columns)) { $columns = [$columns]; // str to array @@ -785,7 +794,6 @@ public function hasPrimaryKey($tableName, $columns, $constraint = null) * Get the primary key from a particular table. * * @param string $tableName Table name - * * @return array */ public function getPrimaryKey($tableName) @@ -848,7 +856,6 @@ public function hasForeignKey($tableName, $columns, $constraint = null) * Get an array of foreign keys from a particular table. * * @param string $tableName Table name - * * @return array */ protected function getForeignKeys($tableName) @@ -1020,9 +1027,7 @@ public function getSqlType($type, $limit = null) * Returns Phinx type by SQL type * * @param string $sqlType SQL type - * * @throws \Phinx\Db\Adapter\UnsupportedColumnTypeException - * * @return string Phinx type */ public function getPhinxType($sqlType) @@ -1125,7 +1130,6 @@ public function dropDatabase($name) * * @param mixed $default default value * @param string|null $columnType column type added - * * @return string */ protected function getDefaultValueDefinition($default, $columnType = null) @@ -1145,7 +1149,6 @@ protected function getDefaultValueDefinition($default, $columnType = null) * Gets the PostgreSQL Column Definition for a Column object. * * @param \Phinx\Db\Table\Column $column Column - * * @return string */ protected function getColumnSqlDefinition(Column $column) @@ -1212,13 +1215,12 @@ protected function getColumnSqlDefinition(Column $column) * * @param \Phinx\Db\Table\Column $column Column * @param string $tableName Table name - * * @return string */ protected function getColumnCommentSqlDefinition(Column $column, $tableName) { // passing 'null' is to remove column comment - $comment = (strcasecmp($column->getComment(), 'NULL') !== 0) + $comment = strcasecmp($column->getComment(), 'NULL') !== 0 ? $this->getConnection()->quote($column->getComment()) : 'NULL'; @@ -1235,7 +1237,6 @@ protected function getColumnCommentSqlDefinition(Column $column, $tableName) * * @param \Phinx\Db\Table\Index $index Index * @param string $tableName Table name - * * @return string */ protected function getIndexSqlDefinition(Index $index, $tableName) @@ -1276,7 +1277,6 @@ protected function getIndexSqlDefinition(Index $index, $tableName) * * @param \Phinx\Db\Table\ForeignKey $foreignKey Foreign key * @param string $tableName Table name - * * @return string */ protected function getForeignKeySqlDefinition(ForeignKey $foreignKey, $tableName) @@ -1337,7 +1337,6 @@ public function getVersionLog() * Creates the specified schema. * * @param string $schemaName Schema Name - * * @return void */ public function createSchema($schemaName = 'public') @@ -1351,7 +1350,6 @@ public function createSchema($schemaName = 'public') * Checks to see if a schema exists. * * @param string $schemaName Schema Name - * * @return bool */ public function hasSchema($schemaName) @@ -1371,7 +1369,6 @@ public function hasSchema($schemaName) * Drops the specified schema table. * * @param string $schemaName Schema name - * * @return void */ public function dropSchema($schemaName) @@ -1431,14 +1428,13 @@ public function getColumnTypes() public function isValidColumnType(Column $column) { // If not a standard column type, maybe it is array type? - return (parent::isValidColumnType($column) || $this->isArrayType($column->getType())); + return parent::isValidColumnType($column) || $this->isArrayType($column->getType()); } /** * Check if the given column is an array of a valid type. * * @param string $columnType Column type - * * @return bool */ protected function isArrayType($columnType) @@ -1454,7 +1450,6 @@ protected function isArrayType($columnType) /** * @param string $tableName Table name - * * @return array */ protected function getSchemaName($tableName) diff --git a/app/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/ProxyAdapter.php b/app/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/ProxyAdapter.php index 3816fd628..e41d9e2e4 100644 --- a/app/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/ProxyAdapter.php +++ b/app/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/ProxyAdapter.php @@ -64,7 +64,6 @@ public function executeActions(Table $table, array $actions) * Gets an array of the recorded commands in reverse. * * @throws \Phinx\Migration\IrreversibleMigrationException if a command cannot be reversed. - * * @return \Phinx\Db\Plan\Intent */ public function getInvertedCommands() diff --git a/app/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/SQLiteAdapter.php b/app/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/SQLiteAdapter.php index 665fd9bbe..d797b750b 100644 --- a/app/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/SQLiteAdapter.php +++ b/app/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/SQLiteAdapter.php @@ -129,7 +129,6 @@ class SQLiteAdapter extends PdoAdapter * Indicates whether the database library version is at least the specified version * * @param string $ver The version to check against e.g. '3.28.0' - * * @return bool */ public function databaseVersionAtLeast($ver) @@ -144,7 +143,6 @@ public function databaseVersionAtLeast($ver) * * @throws \RuntimeException * @throws \InvalidArgumentException - * * @return void */ public function connect() @@ -256,7 +254,6 @@ public function quoteColumnName($columnName) /** * @param string $tableName Table name * @param bool $quoted Whether to return the schema name and table name escaped and quoted. If quoted, the schema (if any) will also be appended with a dot - * * @return array */ protected function getSchemaName($tableName, $quoted = false) @@ -282,7 +279,6 @@ protected function getSchemaName($tableName, $quoted = false) * * @param string $tableName The table to query * @param string $pragma The pragma to query - * * @return array */ protected function getTableInfo($tableName, $pragma = 'table_info') @@ -298,7 +294,6 @@ protected function getTableInfo($tableName, $pragma = 'table_info') * If no schema was specified and the table does not exist the "main" schema is returned * * @param string $tableName The name of the table to find - * * @return array */ protected function resolveTable($tableName) @@ -524,7 +519,6 @@ public function truncateTable($tableName) * * @param mixed $v The default-value expression to interpret * @param string $t The Phinx type of the column - * * @return mixed */ protected function parseDefaultValue($v, $t) @@ -597,7 +591,6 @@ protected function parseDefaultValue($v, $t) * The process of finding an identity column is somewhat convoluted as SQLite has no direct way of querying whether a given column is an alias for the table's row ID * * @param string $tableName The name of the table - * * @return string|null */ protected function resolveIdentity($tableName) @@ -728,7 +721,6 @@ protected function getAddColumnInstructions(Table $table, Column $column) * Returns the original CREATE statement for the give table * * @param string $tableName The table name to get the create statement for - * * @return string */ protected function getDeclaringSql($tableName) @@ -773,7 +765,6 @@ protected function getDeclaringIndexSql($tableName, $indexName) * @param string $tmpTableName The tmp table name where the data is stored * @param string[] $writeColumns The list of columns in the target table * @param string[] $selectColumns The list of columns in the tmp table - * * @return void */ protected function copyDataToNewTable($tableName, $tmpTableName, $writeColumns, $selectColumns) @@ -794,7 +785,6 @@ protected function copyDataToNewTable($tableName, $tmpTableName, $writeColumns, * * @param \Phinx\Db\Util\AlterInstructions $instructions The instructions to modify * @param string $tableName The table name to copy the data to - * * @return \Phinx\Db\Util\AlterInstructions */ protected function copyAndDropTmpTable($instructions, $tableName) @@ -827,9 +817,7 @@ protected function copyAndDropTmpTable($instructions, $tableName) * @param string $tableName The table to modify * @param string|false $columnName The column name that is about to change * @param string|false $newColumnName Optionally the new name for the column - * * @throws \InvalidArgumentException - * * @return array */ protected function calculateNewTableColumns($tableName, $columnName, $newColumnName) @@ -874,7 +862,6 @@ protected function calculateNewTableColumns($tableName, $columnName, $newColumnN * create-copy-drop strategy * * @param string $tableName The table to modify - * * @return \Phinx\Db\Util\AlterInstructions */ protected function beginAlterByCopyTable($tableName) @@ -997,7 +984,6 @@ protected function getDropColumnInstructions($tableName, $columnName) * Get an array of indexes from a particular table. * * @param string $tableName Table name - * * @return array */ protected function getIndexes($tableName) @@ -1023,7 +1009,6 @@ protected function getIndexes($tableName) * * @param string $tableName The table to which the index belongs * @param string|string[] $columns The columns of the index - * * @return array */ protected function resolveIndex($tableName, $columns) @@ -1162,7 +1147,6 @@ public function hasPrimaryKey($tableName, $columns, $constraint = null) * Get the primary key from a particular table. * * @param string $tableName Table name - * * @return string[] */ protected function getPrimaryKey($tableName) @@ -1211,7 +1195,6 @@ public function hasForeignKey($tableName, $columns, $constraint = null) * Get an array of foreign keys from a particular table. * * @param string $tableName Table name - * * @return array */ protected function getForeignKeys($tableName) @@ -1233,7 +1216,6 @@ protected function getForeignKeys($tableName) /** * @param \Phinx\Db\Table\Table $table The Table * @param string $column Column Name - * * @return \Phinx\Db\Util\AlterInstructions */ protected function getAddPrimaryKeyInstructions(Table $table, $column) @@ -1277,7 +1259,6 @@ protected function getAddPrimaryKeyInstructions(Table $table, $column) /** * @param \Phinx\Db\Table\Table $table Table * @param string $column Column Name - * * @return \Phinx\Db\Util\AlterInstructions */ protected function getDropPrimaryKeyInstructions($table, $column) @@ -1420,9 +1401,9 @@ public function getSqlType($type, $limit = null) $typeLC = strtolower($type); if ($type instanceof Literal) { $name = $type; - } elseif (isset(self::$supportedColumnTypes[$typeLC])) { - $name = self::$supportedColumnTypes[$typeLC]; - } elseif (in_array($typeLC, self::$unsupportedColumnTypes, true)) { + } elseif (isset(static::$supportedColumnTypes[$typeLC])) { + $name = static::$supportedColumnTypes[$typeLC]; + } elseif (in_array($typeLC, static::$unsupportedColumnTypes, true)) { throw new UnsupportedColumnTypeException('Column type "' . $type . '" is not supported by SQLite.'); } else { throw new UnsupportedColumnTypeException('Column type "' . $type . '" is not known by SQLite.'); @@ -1435,7 +1416,6 @@ public function getSqlType($type, $limit = null) * Returns Phinx type by SQL type * * @param string|null $sqlTypeDef SQL Type definition - * * @return array */ public function getPhinxType($sqlTypeDef) @@ -1459,13 +1439,13 @@ public function getPhinxType($sqlTypeDef) // the type is a MySQL-style boolean $name = static::PHINX_TYPE_BOOLEAN; $limit = null; - } elseif (isset(self::$supportedColumnTypes[$typeLC])) { + } elseif (isset(static::$supportedColumnTypes[$typeLC])) { // the type is an explicitly supported type $name = $typeLC; - } elseif (isset(self::$supportedColumnTypeAliases[$typeLC])) { + } elseif (isset(static::$supportedColumnTypeAliases[$typeLC])) { // the type is an alias for a supported type - $name = self::$supportedColumnTypeAliases[$typeLC]; - } elseif (in_array($typeLC, self::$unsupportedColumnTypes, true)) { + $name = static::$supportedColumnTypeAliases[$typeLC]; + } elseif (in_array($typeLC, static::$unsupportedColumnTypes, true)) { // unsupported but known types are passed through lowercased, and without appended affinity $name = Literal::from($typeLC); } else { @@ -1516,7 +1496,6 @@ public function dropDatabase($name) * Gets the SQLite Column Definition for a Column object. * * @param \Phinx\Db\Table\Column $column Column - * * @return string */ protected function getColumnSqlDefinition(Column $column) @@ -1552,7 +1531,6 @@ protected function getColumnSqlDefinition(Column $column) * Gets the comment Definition for a Column object. * * @param \Phinx\Db\Table\Column $column Column - * * @return string */ protected function getCommentDefinition(Column $column) @@ -1569,7 +1547,6 @@ protected function getCommentDefinition(Column $column) * * @param \Phinx\Db\Table\Table $table Table * @param \Phinx\Db\Table\Index $index Index - * * @return string */ protected function getIndexSqlDefinition(Table $table, Index $index) @@ -1605,7 +1582,6 @@ public function getColumnTypes() * Gets the SQLite Foreign Key Definition for an ForeignKey object. * * @param \Phinx\Db\Table\ForeignKey $foreignKey Foreign key - * * @return string */ protected function getForeignKeySqlDefinition(ForeignKey $foreignKey) diff --git a/app/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/SqlServerAdapter.php b/app/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/SqlServerAdapter.php index 760568fff..d9751087e 100644 --- a/app/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/SqlServerAdapter.php +++ b/app/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/SqlServerAdapter.php @@ -56,7 +56,6 @@ class SqlServerAdapter extends PdoAdapter * {@inheritDoc} * * @throws \InvalidArgumentException - * * @return void */ public function connect() @@ -115,7 +114,6 @@ public function connect() * * @throws \InvalidArgumentException * @throws \RuntimeException - * * @return void */ protected function connectDblib() @@ -336,7 +334,6 @@ protected function getChangePrimaryKeyInstructions(Table $table, $newColumns) * @inheritDoc * * SqlServer does not implement this functionality, and so will always throw an exception if used. - * * @throws \BadMethodCallException */ protected function getChangeCommentInstructions(Table $table, $newComment) @@ -349,7 +346,6 @@ protected function getChangeCommentInstructions(Table $table, $newComment) * * @param \Phinx\Db\Table\Column $column Column * @param string $tableName Table name - * * @return string */ protected function getColumnCommentSqlDefinition(Column $column, $tableName) @@ -357,7 +353,7 @@ protected function getColumnCommentSqlDefinition(Column $column, $tableName) // passing 'null' is to remove column comment $currentComment = $this->getColumnComment($tableName, $column->getName()); - $comment = (strcasecmp($column->getComment(), 'NULL') !== 0) ? $this->getConnection()->quote($column->getComment()) : '\'\''; + $comment = strcasecmp($column->getComment(), 'NULL') !== 0 ? $this->getConnection()->quote($column->getComment()) : '\'\''; $command = $currentComment === false ? 'sp_addextendedproperty' : 'sp_updateextendedproperty'; return sprintf( @@ -412,7 +408,6 @@ public function truncateTable($tableName) /** * @param string $tableName Table name * @param string $columnName Column name - * * @return string|false */ public function getColumnComment($tableName, $columnName) @@ -483,7 +478,6 @@ public function getColumns($tableName) /** * @param string $default Default - * * @return int|string|null */ protected function parseDefault($default) @@ -573,7 +567,6 @@ protected function getRenameColumnInstructions($tableName, $columnName, $newColu * * @param string $tableName The table where the column is * @param \Phinx\Db\Table\Column $newColumn The column to alter - * * @return \Phinx\Db\Util\AlterInstructions */ protected function getChangeDefault($tableName, Column $newColumn) @@ -662,7 +655,6 @@ protected function getDropColumnInstructions($tableName, $columnName) /** * @param string $tableName Table name * @param string|null $columnName Column name - * * @return \Phinx\Db\Util\AlterInstructions */ protected function getDropDefaultConstraint($tableName, $columnName) @@ -679,7 +671,6 @@ protected function getDropDefaultConstraint($tableName, $columnName) /** * @param string $tableName Table name * @param string $columnName Column name - * * @return string|false */ protected function getDefaultConstraint($tableName, $columnName) @@ -714,7 +705,6 @@ protected function getDefaultConstraint($tableName, $columnName) /** * @param int $tableId Table ID * @param int $indexId Index ID - * * @return array */ protected function getIndexColums($tableId, $indexId) @@ -738,7 +728,6 @@ protected function getIndexColums($tableId, $indexId) * Get an array of indexes from a particular table. * * @param string $tableName Table name - * * @return array */ public function getIndexes($tableName) @@ -882,7 +871,7 @@ public function hasPrimaryKey($tableName, $columns, $constraint = null) } if ($constraint) { - return ($primaryKey['constraint'] === $constraint); + return $primaryKey['constraint'] === $constraint; } if (is_string($columns)) { @@ -897,7 +886,6 @@ public function hasPrimaryKey($tableName, $columns, $constraint = null) * Get the primary key from a particular table. * * @param string $tableName Table name - * * @return array */ public function getPrimaryKey($tableName) @@ -957,7 +945,6 @@ public function hasForeignKey($tableName, $columns, $constraint = null) * Get an array of foreign keys from a particular table. * * @param string $tableName Table name - * * @return array */ protected function getForeignKeys($tableName) @@ -1107,11 +1094,8 @@ public function getSqlType($type, $limit = null) * Returns Phinx type by SQL type * * @internal param string $sqlType SQL type - * * @param string $sqlType SQL Type definition - * * @throws \Phinx\Db\Adapter\UnsupportedColumnTypeException - * * @return string Phinx type */ public function getPhinxType($sqlType) @@ -1212,7 +1196,6 @@ public function dropDatabase($name) * * @param \Phinx\Db\Table\Column $column Column * @param bool $create Create column flag - * * @return string */ protected function getColumnSqlDefinition(Column $column, $create = true) @@ -1306,7 +1289,6 @@ protected function getIndexSqlDefinition(Index $index, $tableName) * * @param \Phinx\Db\Table\ForeignKey $foreignKey Foreign key * @param string $tableName Table name - * * @return string */ protected function getForeignKeySqlDefinition(ForeignKey $foreignKey, $tableName) @@ -1340,7 +1322,6 @@ public function getColumnTypes() * @param string $direction Direction * @param string $startTime Start Time * @param string $endTime End Time - * * @return \Phinx\Db\Adapter\AdapterInterface */ public function migrated(MigrationInterface $migration, $direction, $startTime, $endTime) diff --git a/app/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/TablePrefixAdapter.php b/app/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/TablePrefixAdapter.php index a157bd203..d6c8f6e6a 100644 --- a/app/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/TablePrefixAdapter.php +++ b/app/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/TablePrefixAdapter.php @@ -69,7 +69,6 @@ public function createTable(Table $table, array $columns = [], array $indexes = * {@inheritDoc} * * @throws \BadMethodCallException - * * @return void */ public function changePrimaryKey(Table $table, $newColumns) @@ -90,7 +89,6 @@ public function changePrimaryKey(Table $table, $newColumns) * {@inheritDoc} * * @throws \BadMethodCallException - * * @return void */ public function changeComment(Table $table, $newComment) @@ -111,7 +109,6 @@ public function changeComment(Table $table, $newComment) * {@inheritDoc} * * @throws \BadMethodCallException - * * @return void */ public function renameTable($tableName, $newTableName) @@ -130,7 +127,6 @@ public function renameTable($tableName, $newTableName) * {@inheritDoc} * * @throws \BadMethodCallException - * * @return void */ public function dropTable($tableName) @@ -176,7 +172,6 @@ public function hasColumn($tableName, $columnName) * {@inheritDoc} * * @throws \BadMethodCallException - * * @return void */ public function addColumn(Table $table, Column $column) @@ -194,7 +189,6 @@ public function addColumn(Table $table, Column $column) * {@inheritDoc} * * @throws \BadMethodCallException - * * @return void */ public function renameColumn($tableName, $columnName, $newColumnName) @@ -211,7 +205,6 @@ public function renameColumn($tableName, $columnName, $newColumnName) * {@inheritDoc} * * @throws \BadMethodCallException - * * @return void */ public function changeColumn($tableName, $columnName, Column $newColumn) @@ -228,7 +221,6 @@ public function changeColumn($tableName, $columnName, Column $newColumn) * {@inheritDoc} * * @throws \BadMethodCallException - * * @return void */ public function dropColumn($tableName, $columnName) @@ -265,7 +257,6 @@ public function hasIndexByName($tableName, $indexName) * {@inheritDoc} * * @throws \BadMethodCallException - * * @return void */ public function addIndex(Table $table, Index $index) @@ -282,7 +273,6 @@ public function addIndex(Table $table, Index $index) * {@inheritDoc} * * @throws \BadMethodCallException - * * @return void */ public function dropIndex($tableName, $columns) @@ -299,7 +289,6 @@ public function dropIndex($tableName, $columns) * {@inheritDoc} * * @throws \BadMethodCallException - * * @return void */ public function dropIndexByName($tableName, $indexName) @@ -336,7 +325,6 @@ public function hasForeignKey($tableName, $columns, $constraint = null) * {@inheritDoc} * * @throws \BadMethodCallException - * * @return void */ public function addForeignKey(Table $table, ForeignKey $foreignKey) @@ -354,7 +342,6 @@ public function addForeignKey(Table $table, ForeignKey $foreignKey) * {@inheritDoc} * * @throws \BadMethodCallException - * * @return void */ public function dropForeignKey($tableName, $columns, $constraint = null) @@ -411,7 +398,6 @@ public function getSuffix() * Applies the prefix and suffix to the table name. * * @param string $tableName Table name - * * @return string */ public function getAdapterTableName($tableName) @@ -423,7 +409,6 @@ public function getAdapterTableName($tableName) * {@inheritDoc} * * @throws \InvalidArgumentException - * * @return void */ public function executeActions(Table $table, array $actions) @@ -433,15 +418,15 @@ public function executeActions(Table $table, array $actions) foreach ($actions as $k => $action) { switch (true) { - case ($action instanceof AddColumn): + case $action instanceof AddColumn: $actions[$k] = new AddColumn($adapterTable, $action->getColumn()); break; - case ($action instanceof AddIndex): + case $action instanceof AddIndex: $actions[$k] = new AddIndex($adapterTable, $action->getIndex()); break; - case ($action instanceof AddForeignKey): + case $action instanceof AddForeignKey: $foreignKey = clone $action->getForeignKey(); $refTable = $foreignKey->getReferencedTable(); $refTableName = $this->getAdapterTableName($refTable->getName()); @@ -449,39 +434,39 @@ public function executeActions(Table $table, array $actions) $actions[$k] = new AddForeignKey($adapterTable, $foreignKey); break; - case ($action instanceof ChangeColumn): + case $action instanceof ChangeColumn: $actions[$k] = new ChangeColumn($adapterTable, $action->getColumnName(), $action->getColumn()); break; - case ($action instanceof DropForeignKey): + case $action instanceof DropForeignKey: $actions[$k] = new DropForeignKey($adapterTable, $action->getForeignKey()); break; - case ($action instanceof DropIndex): + case $action instanceof DropIndex: $actions[$k] = new DropIndex($adapterTable, $action->getIndex()); break; - case ($action instanceof DropTable): + case $action instanceof DropTable: $actions[$k] = new DropTable($adapterTable); break; - case ($action instanceof RemoveColumn): + case $action instanceof RemoveColumn: $actions[$k] = new RemoveColumn($adapterTable, $action->getColumn()); break; - case ($action instanceof RenameColumn): + case $action instanceof RenameColumn: $actions[$k] = new RenameColumn($adapterTable, $action->getColumn(), $action->getNewName()); break; - case ($action instanceof RenameTable): + case $action instanceof RenameTable: $actions[$k] = new RenameTable($adapterTable, $action->getNewName()); break; - case ($action instanceof ChangePrimaryKey): + case $action instanceof ChangePrimaryKey: $actions[$k] = new ChangePrimaryKey($adapterTable, $action->getNewColumns()); break; - case ($action instanceof ChangeComment): + case $action instanceof ChangeComment: $actions[$k] = new ChangeComment($adapterTable, $action->getNewComment()); break; diff --git a/app/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/TimedOutputAdapter.php b/app/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/TimedOutputAdapter.php index d94848367..dab3ac10d 100644 --- a/app/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/TimedOutputAdapter.php +++ b/app/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/TimedOutputAdapter.php @@ -49,7 +49,6 @@ public function startCommandTimer() * * @param string $command Command Name * @param array $args Command Args - * * @return void */ public function writeCommand($command, $args = []) @@ -119,7 +118,6 @@ public function createTable(Table $table, array $columns = [], array $indexes = * {@inheritDoc} * * @throws \BadMethodCallException - * * @return void */ public function changePrimaryKey(Table $table, $newColumns) @@ -138,7 +136,6 @@ public function changePrimaryKey(Table $table, $newColumns) * {@inheritDoc} * * @throws \BadMethodCallException - * * @return void */ public function changeComment(Table $table, $newComment) @@ -157,7 +154,6 @@ public function changeComment(Table $table, $newComment) * {@inheritDoc} * * @throws \BadMethodCallException - * * @return void */ public function renameTable($tableName, $newTableName) @@ -176,7 +172,6 @@ public function renameTable($tableName, $newTableName) * {@inheritDoc} * * @throws \BadMethodCallException - * * @return void */ public function dropTable($tableName) @@ -206,7 +201,6 @@ public function truncateTable($tableName) * {@inheritDoc} * * @throws \BadMethodCallException - * * @return void */ public function addColumn(Table $table, Column $column) @@ -232,7 +226,6 @@ public function addColumn(Table $table, Column $column) * {@inheritDoc} * * @throws \BadMethodCallException - * * @return void */ public function renameColumn($tableName, $columnName, $newColumnName) @@ -251,7 +244,6 @@ public function renameColumn($tableName, $columnName, $newColumnName) * {@inheritDoc} * * @throws \BadMethodCallException - * * @return void */ public function changeColumn($tableName, $columnName, Column $newColumn) @@ -270,7 +262,6 @@ public function changeColumn($tableName, $columnName, Column $newColumn) * {@inheritDoc} * * @throws \BadMethodCallException - * * @return void */ public function dropColumn($tableName, $columnName) @@ -289,7 +280,6 @@ public function dropColumn($tableName, $columnName) * {@inheritDoc} * * @throws \BadMethodCallException - * * @return void */ public function addIndex(Table $table, Index $index) @@ -308,7 +298,6 @@ public function addIndex(Table $table, Index $index) * {@inheritDoc} * * @throws \BadMethodCallException - * * @return void */ public function dropIndex($tableName, $columns) @@ -327,7 +316,6 @@ public function dropIndex($tableName, $columns) * {@inheritDoc} * * @throws \BadMethodCallException - * * @return void */ public function dropIndexByName($tableName, $indexName) @@ -346,7 +334,6 @@ public function dropIndexByName($tableName, $indexName) * {@inheritDoc} * * @throws \BadMethodCallException - * * @return void */ public function addForeignKey(Table $table, ForeignKey $foreignKey) @@ -365,7 +352,6 @@ public function addForeignKey(Table $table, ForeignKey $foreignKey) * {@inheritDoc} * * @throws \BadMethodCallException - * * @return void */ public function dropForeignKey($tableName, $columns, $constraint = null) diff --git a/app/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/WrapperInterface.php b/app/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/WrapperInterface.php index 81608bc83..5c3fa0173 100644 --- a/app/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/WrapperInterface.php +++ b/app/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/WrapperInterface.php @@ -25,7 +25,6 @@ public function __construct(AdapterInterface $adapter); * Sets the database adapter to proxy commands to. * * @param \Phinx\Db\Adapter\AdapterInterface $adapter Adapter - * * @return \Phinx\Db\Adapter\AdapterInterface */ public function setAdapter(AdapterInterface $adapter); @@ -34,7 +33,6 @@ public function setAdapter(AdapterInterface $adapter); * Gets the database adapter. * * @throws \RuntimeException if the adapter has not been set - * * @return \Phinx\Db\Adapter\AdapterInterface */ public function getAdapter(); diff --git a/app/vendor/robmorgan/phinx/src/Phinx/Db/Plan/AlterTable.php b/app/vendor/robmorgan/phinx/src/Phinx/Db/Plan/AlterTable.php index c04168200..a2d8bdfd9 100644 --- a/app/vendor/robmorgan/phinx/src/Phinx/Db/Plan/AlterTable.php +++ b/app/vendor/robmorgan/phinx/src/Phinx/Db/Plan/AlterTable.php @@ -43,7 +43,6 @@ public function __construct(Table $table) * Adds another action to the collection * * @param \Phinx\Db\Action\Action $action The action to add - * * @return void */ public function addAction(Action $action) diff --git a/app/vendor/robmorgan/phinx/src/Phinx/Db/Plan/Intent.php b/app/vendor/robmorgan/phinx/src/Phinx/Db/Plan/Intent.php index 920e3982a..5545d6e1d 100644 --- a/app/vendor/robmorgan/phinx/src/Phinx/Db/Plan/Intent.php +++ b/app/vendor/robmorgan/phinx/src/Phinx/Db/Plan/Intent.php @@ -25,7 +25,6 @@ class Intent * Adds a new action to the collection * * @param \Phinx\Db\Action\Action $action The action to add - * * @return void */ public function addAction(Action $action) @@ -47,7 +46,6 @@ public function getActions() * Merges another Intent object with this one * * @param \Phinx\Db\Plan\Intent $another The other intent to merge in - * * @return void */ public function merge(Intent $another) diff --git a/app/vendor/robmorgan/phinx/src/Phinx/Db/Plan/NewTable.php b/app/vendor/robmorgan/phinx/src/Phinx/Db/Plan/NewTable.php index b2648a0ef..ca2487253 100644 --- a/app/vendor/robmorgan/phinx/src/Phinx/Db/Plan/NewTable.php +++ b/app/vendor/robmorgan/phinx/src/Phinx/Db/Plan/NewTable.php @@ -51,7 +51,6 @@ public function __construct(Table $table) * Adds a column to the collection * * @param \Phinx\Db\Table\Column $column The column description - * * @return void */ public function addColumn(Column $column) @@ -63,7 +62,6 @@ public function addColumn(Column $column) * Adds an index to the collection * * @param \Phinx\Db\Table\Index $index The index description - * * @return void */ public function addIndex(Index $index) diff --git a/app/vendor/robmorgan/phinx/src/Phinx/Db/Plan/Plan.php b/app/vendor/robmorgan/phinx/src/Phinx/Db/Plan/Plan.php index 62e5dc64c..820d42d4c 100644 --- a/app/vendor/robmorgan/phinx/src/Phinx/Db/Plan/Plan.php +++ b/app/vendor/robmorgan/phinx/src/Phinx/Db/Plan/Plan.php @@ -90,7 +90,6 @@ public function __construct(Intent $intent) * Parses the given Intent and creates the separate steps to execute * * @param \Phinx\Db\Action\Action[] $actions The actions to use for the plan - * * @return void */ protected function createPlan($actions) @@ -139,7 +138,6 @@ protected function inverseUpdatesSequence() * Executes this plan using the given AdapterInterface * * @param \Phinx\Db\Adapter\AdapterInterface $executor The executor object for the plan - * * @return void */ public function execute(AdapterInterface $executor) @@ -159,7 +157,6 @@ public function execute(AdapterInterface $executor) * Executes the inverse plan (rollback the actions) with the given AdapterInterface:w * * @param \Phinx\Db\Adapter\AdapterInterface $executor The executor object for the plan - * * @return void */ public function executeInverse(AdapterInterface $executor) @@ -197,7 +194,7 @@ protected function resolveConflicts() foreach ($this->columnRemoves as $columnRemove) { foreach ($columnRemove->getActions() as $action) { if ($action instanceof RemoveColumn) { - list($this->indexes) = $this->forgetDropIndex( + [$this->indexes] = $this->forgetDropIndex( $action->getTable(), [$action->getColumn()->getName()], $this->indexes @@ -252,7 +249,6 @@ function (DropForeignKey $a, AddForeignKey $b) { * * @param \Phinx\Db\Table\Table $table The table to find in the list of actions * @param \Phinx\Db\Plan\AlterTable[] $actions The actions to transform - * * @return \Phinx\Db\Plan\AlterTable[] The list of actions without actions for the given table */ protected function forgetTable(Table $table, $actions) @@ -274,7 +270,6 @@ protected function forgetTable(Table $table, $actions) * given AlterTable. * * @param \Phinx\Db\Plan\AlterTable $alter The collection of actions to inspect - * * @return \Phinx\Db\Plan\AlterTable The updated AlterTable object. This function * has the side effect of changing the `$this->indexes` property. */ @@ -285,7 +280,7 @@ protected function remapContraintAndIndexConflicts(AlterTable $alter) foreach ($alter->getActions() as $action) { $newAlter->addAction($action); if ($action instanceof DropForeignKey) { - list($this->indexes, $dropIndexActions) = $this->forgetDropIndex( + [$this->indexes, $dropIndexActions] = $this->forgetDropIndex( $action->getTable(), $action->getForeignKey()->getColumns(), $this->indexes @@ -305,7 +300,6 @@ protected function remapContraintAndIndexConflicts(AlterTable $alter) * @param \Phinx\Db\Table\Table $table The table to find in the list of actions * @param string[] $columns The column names to match * @param \Phinx\Db\Plan\AlterTable[] $actions The actions to transform - * * @return array A tuple containing the list of actions without actions for dropping the index * and a list of drop index actions that were removed. */ @@ -338,7 +332,6 @@ protected function forgetDropIndex(Table $table, array $columns, array $actions) * @param \Phinx\Db\Table\Table $table The table to find in the list of actions * @param string[] $columns The column names to match * @param \Phinx\Db\Plan\AlterTable[] $actions The actions to transform - * * @return array A tuple containing the list of actions without actions for removing the column * and a list of remove column actions that were removed. */ @@ -369,7 +362,6 @@ protected function forgetRemoveColumn(Table $table, array $columns, array $actio * Collects all table creation actions from the given intent * * @param \Phinx\Db\Action\Action[] $actions The actions to parse - * * @return void */ protected function gatherCreates($actions) @@ -402,7 +394,6 @@ protected function gatherCreates($actions) * Collects all alter table actions from the given intent * * @param \Phinx\Db\Action\Action[] $actions The actions to parse - * * @return void */ protected function gatherUpdates($actions) @@ -467,7 +458,6 @@ protected function gatherTableMoves($actions) * Collects all index creation and drops from the given intent * * @param \Phinx\Db\Action\Action[] $actions The actions to parse - * * @return void */ protected function gatherIndexes($actions) @@ -494,7 +484,6 @@ protected function gatherIndexes($actions) * Collects all foreign key creation and drops from the given intent * * @param \Phinx\Db\Action\Action[] $actions The actions to parse - * * @return void */ protected function gatherConstraints($actions) diff --git a/app/vendor/robmorgan/phinx/src/Phinx/Db/Plan/Solver/ActionSplitter.php b/app/vendor/robmorgan/phinx/src/Phinx/Db/Plan/Solver/ActionSplitter.php index 16fc3e9b8..6617c8a9b 100644 --- a/app/vendor/robmorgan/phinx/src/Phinx/Db/Plan/Solver/ActionSplitter.php +++ b/app/vendor/robmorgan/phinx/src/Phinx/Db/Plan/Solver/ActionSplitter.php @@ -64,7 +64,6 @@ public function __construct($conflictClass, $conflictClassDual, callable $confli * based on the constructor parameters. * * @param \Phinx\Db\Plan\AlterTable $alter The collection of actions to inspect - * * @return \Phinx\Db\Plan\AlterTable[] A list of AlterTable that can be executed without * this type of conflict */ diff --git a/app/vendor/robmorgan/phinx/src/Phinx/Db/Table.php b/app/vendor/robmorgan/phinx/src/Phinx/Db/Table.php index 6a0965971..256a4c279 100644 --- a/app/vendor/robmorgan/phinx/src/Phinx/Db/Table.php +++ b/app/vendor/robmorgan/phinx/src/Phinx/Db/Table.php @@ -58,7 +58,7 @@ class Table * @param array $options Options * @param \Phinx\Db\Adapter\AdapterInterface|null $adapter Database Adapter */ - public function __construct($name, $options = [], AdapterInterface $adapter = null) + public function __construct($name, $options = [], ?AdapterInterface $adapter = null) { $this->table = new TableValue($name, $options); $this->actions = new Intent(); @@ -102,7 +102,6 @@ public function getTable() * Sets the database adapter. * * @param \Phinx\Db\Adapter\AdapterInterface $adapter Database Adapter - * * @return $this */ public function setAdapter(AdapterInterface $adapter) @@ -116,7 +115,6 @@ public function setAdapter(AdapterInterface $adapter) * Gets the database adapter. * * @throws \RuntimeException - * * @return \Phinx\Db\Adapter\AdapterInterface|null */ public function getAdapter() @@ -164,7 +162,6 @@ public function drop() * Renames the database table. * * @param string $newTableName New Table Name - * * @return $this */ public function rename($newTableName) @@ -178,7 +175,6 @@ public function rename($newTableName) * Changes the primary key of the database table. * * @param string|string[]|null $columns Column name(s) to belong to the primary key, or null to drop the key - * * @return $this */ public function changePrimaryKey($columns) @@ -188,11 +184,22 @@ public function changePrimaryKey($columns) return $this; } + /** + * Checks to see if a primary key exists. + * + * @param string|string[] $columns Column(s) + * @param string|null $constraint Constraint names + * @return bool + */ + public function hasPrimaryKey($columns, $constraint = null) + { + return $this->getAdapter()->hasPrimaryKey($this->getName(), $columns, $constraint); + } + /** * Changes the comment of the database table. * * @param string|null $comment New comment string, or null to drop the comment - * * @return $this */ public function changeComment($comment) @@ -216,7 +223,6 @@ public function getColumns() * Gets a table column if it exists. * * @param string $name Column name - * * @return \Phinx\Db\Table\Column|null */ public function getColumn($name) @@ -235,7 +241,6 @@ function ($column) use ($name) { * Sets an array of data to be inserted. * * @param array $data Data - * * @return $this */ public function setData($data) @@ -287,9 +292,7 @@ public function reset() * @param string|\Phinx\Db\Table\Column $columnName Column Name * @param string|\Phinx\Util\Literal|null $type Column Type * @param array $options Column Options - * * @throws \InvalidArgumentException - * * @return $this */ public function addColumn($columnName, $type = null, $options = []) @@ -318,7 +321,6 @@ public function addColumn($columnName, $type = null, $options = []) * Remove a table column. * * @param string $columnName Column Name - * * @return $this */ public function removeColumn($columnName) @@ -334,7 +336,6 @@ public function removeColumn($columnName) * * @param string $oldName Old Column Name * @param string $newName New Column Name - * * @return $this */ public function renameColumn($oldName, $newName) @@ -351,7 +352,6 @@ public function renameColumn($oldName, $newName) * @param string $columnName Column Name * @param string|\Phinx\Db\Table\Column|\Phinx\Util\Literal $newColumnType New Column Type * @param array $options Options - * * @return $this */ public function changeColumn($columnName, $newColumnType, array $options = []) @@ -370,7 +370,6 @@ public function changeColumn($columnName, $newColumnType, array $options = []) * Checks to see if a column exists. * * @param string $columnName Column Name - * * @return bool */ public function hasColumn($columnName) @@ -385,7 +384,6 @@ public function hasColumn($columnName) * * @param string|array|\Phinx\Db\Table\Index $columns Table Column(s) * @param array $options Index Options - * * @return $this */ public function addIndex($columns, array $options = []) @@ -400,7 +398,6 @@ public function addIndex($columns, array $options = []) * Removes the given index from a table. * * @param string|string[] $columns Columns - * * @return $this */ public function removeIndex($columns) @@ -415,7 +412,6 @@ public function removeIndex($columns) * Removes the given index identified by its name from a table. * * @param string $name Index name - * * @return $this */ public function removeIndexByName($name) @@ -430,7 +426,6 @@ public function removeIndexByName($name) * Checks to see if an index exists. * * @param string|string[] $columns Columns - * * @return bool */ public function hasIndex($columns) @@ -442,7 +437,6 @@ public function hasIndex($columns) * Checks to see if an index specified by name exists. * * @param string $indexName Index name - * * @return bool */ public function hasIndexByName($indexName) @@ -460,7 +454,6 @@ public function hasIndexByName($indexName) * @param string|\Phinx\Db\Table\Table $referencedTable Referenced Table * @param string|string[] $referencedColumns Referenced Columns * @param array $options Options - * * @return $this */ public function addForeignKey($columns, $referencedTable, $referencedColumns = ['id'], $options = []) @@ -482,7 +475,6 @@ public function addForeignKey($columns, $referencedTable, $referencedColumns = [ * @param string|\Phinx\Db\Table\Table $referencedTable Referenced Table * @param string|string[] $referencedColumns Referenced Columns * @param array $options Options - * * @return $this */ public function addForeignKeyWithName($name, $columns, $referencedTable, $referencedColumns = ['id'], $options = []) @@ -505,7 +497,6 @@ public function addForeignKeyWithName($name, $columns, $referencedTable, $refere * * @param string|string[] $columns Column(s) * @param string|null $constraint Constraint names - * * @return $this */ public function dropForeignKey($columns, $constraint = null) @@ -521,7 +512,6 @@ public function dropForeignKey($columns, $constraint = null) * * @param string|string[] $columns Column(s) * @param string|null $constraint Constraint names - * * @return bool */ public function hasForeignKey($columns, $constraint = null) @@ -532,28 +522,35 @@ public function hasForeignKey($columns, $constraint = null) /** * Add timestamp columns created_at and updated_at to the table. * - * @param string|null $createdAt Alternate name for the created_at column - * @param string|null $updatedAt Alternate name for the updated_at column + * @param string|false|null $createdAt Alternate name for the created_at column + * @param string|false|null $updatedAt Alternate name for the updated_at column * @param bool $withTimezone Whether to set the timezone option on the added columns - * * @return $this */ public function addTimestamps($createdAt = 'created_at', $updatedAt = 'updated_at', $withTimezone = false) { - $createdAt = $createdAt === null ? 'created_at' : $createdAt; - $updatedAt = $updatedAt === null ? 'updated_at' : $updatedAt; - - $this->addColumn($createdAt, 'timestamp', [ - 'default' => 'CURRENT_TIMESTAMP', - 'update' => '', - 'timezone' => $withTimezone, - ]) - ->addColumn($updatedAt, 'timestamp', [ - 'null' => true, - 'default' => null, - 'update' => 'CURRENT_TIMESTAMP', - 'timezone' => $withTimezone, - ]); + $createdAt = $createdAt ?? 'created_at'; + $updatedAt = $updatedAt ?? 'updated_at'; + + if (!$createdAt && !$updatedAt) { + throw new \RuntimeException('Cannot set both created_at and updated_at columns to false'); + } + + if ($createdAt) { + $this->addColumn($createdAt, 'timestamp', [ + 'default' => 'CURRENT_TIMESTAMP', + 'update' => '', + 'timezone' => $withTimezone, + ]); + } + if ($updatedAt) { + $this->addColumn($updatedAt, 'timestamp', [ + 'null' => true, + 'default' => null, + 'update' => 'CURRENT_TIMESTAMP', + 'timezone' => $withTimezone, + ]); + } return $this; } @@ -562,10 +559,8 @@ public function addTimestamps($createdAt = 'created_at', $updatedAt = 'updated_a * Alias that always sets $withTimezone to true * * @see addTimestamps - * * @param string|null $createdAt Alternate name for the created_at column * @param string|null $updatedAt Alternate name for the updated_at column - * * @return $this */ public function addTimestampsWithTimezone($createdAt = null, $updatedAt = null) @@ -584,7 +579,6 @@ public function addTimestampsWithTimezone($createdAt = null, $updatedAt = null) * array("col2" => "value2", "col2" => "anotherValue2"), * ) * or array("col1" => "value1", "col2" => "anotherValue1") - * * @return $this */ public function insert($data) @@ -695,7 +689,6 @@ public function save() * Executes all the pending actions for this table * * @param bool $exists Whether or not the table existed prior to executing this method - * * @return void */ protected function executeActions($exists) diff --git a/app/vendor/robmorgan/phinx/src/Phinx/Db/Table/Column.php b/app/vendor/robmorgan/phinx/src/Phinx/Db/Table/Column.php index 7dbd4c1a4..542ce259a 100644 --- a/app/vendor/robmorgan/phinx/src/Phinx/Db/Table/Column.php +++ b/app/vendor/robmorgan/phinx/src/Phinx/Db/Table/Column.php @@ -9,7 +9,6 @@ use Phinx\Db\Adapter\AdapterInterface; use RuntimeException; -use UnexpectedValueException; /** * This object is based loosely on: http://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/Table.html. @@ -34,6 +33,8 @@ class Column public const UUID = AdapterInterface::PHINX_TYPE_UUID; public const BINARYUUID = AdapterInterface::PHINX_TYPE_BINARYUUID; /** MySQL-only column type */ + public const MEDIUMINTEGER = AdapterInterface::PHINX_TYPE_MEDIUM_INTEGER; + /** MySQL-only column type */ public const ENUM = AdapterInterface::PHINX_TYPE_ENUM; /** MySQL-only column type */ public const SET = AdapterInterface::PHINX_TYPE_STRING; @@ -153,7 +154,6 @@ class Column * Sets the column name. * * @param string $name Name - * * @return $this */ public function setName($name) @@ -177,7 +177,6 @@ public function getName() * Sets the column type. * * @param string|\Phinx\Util\Literal $type Column type - * * @return $this */ public function setType($type) @@ -201,7 +200,6 @@ public function getType() * Sets the column limit. * * @param int $limit Limit - * * @return $this */ public function setLimit($limit) @@ -225,7 +223,6 @@ public function getLimit() * Sets whether the column allows nulls. * * @param bool $null Null - * * @return $this */ public function setNull($null) @@ -259,7 +256,6 @@ public function isNull() * Sets the default column value. * * @param mixed $default Default - * * @return $this */ public function setDefault($default) @@ -283,7 +279,6 @@ public function getDefault() * Sets whether or not the column is an identity column. * * @param bool $identity Identity - * * @return $this */ public function setIdentity($identity) @@ -317,7 +312,6 @@ public function isIdentity() * Sets the name of the column to add this column after. * * @param string $after After - * * @return $this */ public function setAfter($after) @@ -341,7 +335,6 @@ public function getAfter() * Sets the 'ON UPDATE' mysql column function. * * @param string $update On Update function - * * @return $this */ public function setUpdate($update) @@ -368,7 +361,6 @@ public function getUpdate() * and the column could store value from -999.99 to 999.99. * * @param int $precision Number precision - * * @return $this */ public function setPrecision($precision) @@ -415,7 +407,6 @@ public function getIncrement() * Sets the column identity seed. * * @param int $seed Number seed - * * @return $this */ public function setSeed($seed) @@ -429,7 +420,6 @@ public function setSeed($seed) * Sets the column identity increment. * * @param int $increment Number increment - * * @return $this */ public function setIncrement($increment) @@ -446,7 +436,6 @@ public function setIncrement($increment) * and the column could store value from -999.99 to 999.99. * * @param int $scale Number scale - * * @return $this */ public function setScale($scale) @@ -477,7 +466,6 @@ public function getScale() * * @param int $precision Number precision * @param int $scale Number scale - * * @return $this */ public function setPrecisionAndScale($precision, $scale) @@ -492,7 +480,6 @@ public function setPrecisionAndScale($precision, $scale) * Sets the column comment. * * @param string $comment Comment - * * @return $this */ public function setComment($comment) @@ -516,7 +503,6 @@ public function getComment() * Sets whether field should be signed. * * @param bool $signed Signed - * * @return $this */ public function setSigned($signed) @@ -551,7 +537,6 @@ public function isSigned() * Used for date/time columns only! * * @param bool $timezone Timezone - * * @return $this */ public function setTimezone($timezone) @@ -585,7 +570,6 @@ public function isTimezone() * Sets field properties. * * @param array $properties Properties - * * @return $this */ public function setProperties($properties) @@ -609,7 +593,6 @@ public function getProperties() * Sets field values. * * @param string[]|string $values Value(s) - * * @return $this */ public function setValues($values) @@ -636,7 +619,6 @@ public function getValues() * Sets the column collation. * * @param string $collation Collation - * * @return $this */ public function setCollation($collation) @@ -660,7 +642,6 @@ public function getCollation() * Sets the column character set. * * @param string $encoding Encoding - * * @return $this */ public function setEncoding($encoding) @@ -748,9 +729,7 @@ protected function getAliasedOptions() * Utility method that maps an array of column options to this objects methods. * * @param array $options Options - * * @throws \RuntimeException - * * @return $this */ public function setOptions($options) diff --git a/app/vendor/robmorgan/phinx/src/Phinx/Db/Table/ForeignKey.php b/app/vendor/robmorgan/phinx/src/Phinx/Db/Table/ForeignKey.php index 1e438dfe6..4705f3ccd 100644 --- a/app/vendor/robmorgan/phinx/src/Phinx/Db/Table/ForeignKey.php +++ b/app/vendor/robmorgan/phinx/src/Phinx/Db/Table/ForeignKey.php @@ -51,7 +51,6 @@ class ForeignKey * Sets the foreign key columns. * * @param string[]|string $columns Columns - * * @return $this */ public function setColumns($columns) @@ -75,7 +74,6 @@ public function getColumns() * Sets the foreign key referenced table. * * @param \Phinx\Db\Table\Table $table The table this KEY is pointing to - * * @return $this */ public function setReferencedTable(Table $table) @@ -99,7 +97,6 @@ public function getReferencedTable() * Sets the foreign key referenced columns. * * @param string[] $referencedColumns Referenced columns - * * @return $this */ public function setReferencedColumns(array $referencedColumns) @@ -123,7 +120,6 @@ public function getReferencedColumns() * Sets ON DELETE action for the foreign key. * * @param string $onDelete On Delete - * * @return $this */ public function setOnDelete($onDelete) @@ -157,7 +153,6 @@ public function getOnUpdate() * Sets ON UPDATE action for the foreign key. * * @param string $onUpdate On Update - * * @return $this */ public function setOnUpdate($onUpdate) @@ -171,7 +166,6 @@ public function setOnUpdate($onUpdate) * Sets constraint for the foreign key. * * @param string $constraint Constraint - * * @return $this */ public function setConstraint($constraint) @@ -195,9 +189,7 @@ public function getConstraint() * Utility method that maps an array of index options to this objects methods. * * @param array $options Options - * * @throws \RuntimeException - * * @return $this */ public function setOptions($options) @@ -227,9 +219,7 @@ public function setOptions($options) * From passed value checks if it's correct and fixes if needed * * @param string $action Action - * * @throws \InvalidArgumentException - * * @return string */ protected function normalizeAction($action) diff --git a/app/vendor/robmorgan/phinx/src/Phinx/Db/Table/Index.php b/app/vendor/robmorgan/phinx/src/Phinx/Db/Table/Index.php index 79cb61a40..7753e361a 100644 --- a/app/vendor/robmorgan/phinx/src/Phinx/Db/Table/Index.php +++ b/app/vendor/robmorgan/phinx/src/Phinx/Db/Table/Index.php @@ -60,7 +60,6 @@ class Index * Sets the index columns. * * @param string[] $columns Columns - * * @return $this */ public function setColumns($columns) @@ -84,7 +83,6 @@ public function getColumns() * Sets the index type. * * @param string $type Type - * * @return $this */ public function setType($type) @@ -108,7 +106,6 @@ public function getType() * Sets the index name. * * @param string $name Name - * * @return $this */ public function setName($name) @@ -132,7 +129,6 @@ public function getName() * Sets the index limit. * * @param int|array $limit limit value or array of limit value - * * @return $this */ public function setLimit($limit) @@ -202,9 +198,7 @@ public function getInclude() * Utility method that maps an array of index options to this objects methods. * * @param array $options Options - * * @throws \RuntimeException - * * @return $this */ public function setOptions($options) diff --git a/app/vendor/robmorgan/phinx/src/Phinx/Db/Table/Table.php b/app/vendor/robmorgan/phinx/src/Phinx/Db/Table/Table.php index 54049c715..328abd272 100644 --- a/app/vendor/robmorgan/phinx/src/Phinx/Db/Table/Table.php +++ b/app/vendor/robmorgan/phinx/src/Phinx/Db/Table/Table.php @@ -24,7 +24,6 @@ class Table /** * @param string $name The table name * @param array $options The creation options for this table - * * @throws \InvalidArgumentException */ public function __construct($name, array $options = []) @@ -41,7 +40,6 @@ public function __construct($name, array $options = []) * Sets the table name. * * @param string $name The name of the table - * * @return $this */ public function setName($name) @@ -75,7 +73,6 @@ public function getOptions() * Sets the table options * * @param array $options The options for the table creation - * * @return void */ public function setOptions(array $options) diff --git a/app/vendor/robmorgan/phinx/src/Phinx/Db/Util/AlterInstructions.php b/app/vendor/robmorgan/phinx/src/Phinx/Db/Util/AlterInstructions.php index bf4a77344..94497e762 100644 --- a/app/vendor/robmorgan/phinx/src/Phinx/Db/Util/AlterInstructions.php +++ b/app/vendor/robmorgan/phinx/src/Phinx/Db/Util/AlterInstructions.php @@ -39,7 +39,6 @@ public function __construct(array $alterParts = [], array $postSteps = []) * Adds another part to the single ALTER instruction * * @param string $part The SQL snipped to add as part of the ALTER instruction - * * @return void */ public function addAlter($part) @@ -56,7 +55,6 @@ public function addAlter($part) * This allows to keep a single state across callbacks. * * @param string|callable $sql The SQL to run after, or a callable to execute - * * @return void */ public function addPostStep($sql) @@ -88,7 +86,6 @@ public function getPostSteps() * Merges another AlterInstructions object to this one * * @param \Phinx\Db\Util\AlterInstructions $other The other collection of instructions to merge in - * * @return void */ public function merge(AlterInstructions $other) @@ -102,7 +99,6 @@ public function merge(AlterInstructions $other) * * @param string $alterTemplate The template for the alter instruction * @param callable $executor The function to be used to execute all instructions - * * @return void */ public function execute($alterTemplate, callable $executor) diff --git a/app/vendor/robmorgan/phinx/src/Phinx/Migration/AbstractMigration.php b/app/vendor/robmorgan/phinx/src/Phinx/Migration/AbstractMigration.php index 4d4d5845c..76367e524 100644 --- a/app/vendor/robmorgan/phinx/src/Phinx/Migration/AbstractMigration.php +++ b/app/vendor/robmorgan/phinx/src/Phinx/Migration/AbstractMigration.php @@ -70,7 +70,7 @@ abstract class AbstractMigration implements MigrationInterface * @param \Symfony\Component\Console\Input\InputInterface|null $input Input * @param \Symfony\Component\Console\Output\OutputInterface|null $output Output */ - final public function __construct($environment, $version, InputInterface $input = null, OutputInterface $output = null) + final public function __construct($environment, $version, ?InputInterface $input = null, ?OutputInterface $output = null) { $this->environment = $environment; $this->version = $version; @@ -282,9 +282,7 @@ public function table($tableName, $options = []) * A short-hand method to drop the given database table. * * @deprecated since 0.10.0. Use $this->table($tableName)->drop()->save() instead. - * * @param string $tableName Table name - * * @return void */ public function dropTable($tableName) @@ -301,7 +299,6 @@ public function dropTable($tableName) * an `up()` or a `down()` method. * * @param string|null $direction Direction - * * @return void */ public function preFlightCheck($direction = null) @@ -324,9 +321,7 @@ public function preFlightCheck($direction = null) * Right now, the only check is whether all changes were committed * * @param string|null $direction direction of migration - * * @throws \RuntimeException - * * @return void */ public function postFlightCheck($direction = null) diff --git a/app/vendor/robmorgan/phinx/src/Phinx/Migration/AbstractTemplateCreation.php b/app/vendor/robmorgan/phinx/src/Phinx/Migration/AbstractTemplateCreation.php index 8134354e0..213e6353d 100644 --- a/app/vendor/robmorgan/phinx/src/Phinx/Migration/AbstractTemplateCreation.php +++ b/app/vendor/robmorgan/phinx/src/Phinx/Migration/AbstractTemplateCreation.php @@ -26,7 +26,7 @@ abstract class AbstractTemplateCreation implements CreationInterface * @param \Symfony\Component\Console\Input\InputInterface|null $input Input * @param \Symfony\Component\Console\Output\OutputInterface|null $output Output */ - public function __construct(InputInterface $input = null, OutputInterface $output = null) + public function __construct(?InputInterface $input = null, ?OutputInterface $output = null) { if ($input !== null) { $this->setInput($input); diff --git a/app/vendor/robmorgan/phinx/src/Phinx/Migration/CreationInterface.php b/app/vendor/robmorgan/phinx/src/Phinx/Migration/CreationInterface.php index c05d2b4d6..a7c4ef379 100644 --- a/app/vendor/robmorgan/phinx/src/Phinx/Migration/CreationInterface.php +++ b/app/vendor/robmorgan/phinx/src/Phinx/Migration/CreationInterface.php @@ -21,18 +21,16 @@ interface CreationInterface * @param \Symfony\Component\Console\Input\InputInterface|null $input Input * @param \Symfony\Component\Console\Output\OutputInterface|null $output Output */ - public function __construct(InputInterface $input = null, OutputInterface $output = null); + public function __construct(?InputInterface $input = null, ?OutputInterface $output = null); /** * @param \Symfony\Component\Console\Input\InputInterface $input Input - * * @return \Phinx\Migration\CreationInterface */ public function setInput(InputInterface $input); /** * @param \Symfony\Component\Console\Output\OutputInterface $output Output - * * @return \Phinx\Migration\CreationInterface */ public function setOutput(OutputInterface $output); @@ -65,7 +63,6 @@ public function getMigrationTemplate(); * @param string $migrationFilename The name of the newly created migration. * @param string $className The class name. * @param string $baseClassName The name of the base class. - * * @return void */ public function postMigrationCreation($migrationFilename, $className, $baseClassName); diff --git a/app/vendor/robmorgan/phinx/src/Phinx/Migration/Manager.php b/app/vendor/robmorgan/phinx/src/Phinx/Migration/Manager.php index a688b16b6..5a24cb6b7 100644 --- a/app/vendor/robmorgan/phinx/src/Phinx/Migration/Manager.php +++ b/app/vendor/robmorgan/phinx/src/Phinx/Migration/Manager.php @@ -80,9 +80,7 @@ public function __construct(ConfigInterface $config, InputInterface $input, Outp * * @param string $environment environment to print status of * @param string|null $format format to print status in (either text, json, or null) - * * @throws \RuntimeException - * * @return array array indicating if there are any missing or down migrations */ public function printStatus($environment, $format = null) @@ -106,10 +104,10 @@ public function printStatus($environment, $format = null) switch ($this->getConfig()->getVersionOrder()) { case Config::VERSION_ORDER_CREATION_TIME: - $migrationIdAndStartedHeader = "[Migration ID] Started "; + $migrationIdAndStartedHeader = '[Migration ID] Started '; break; case Config::VERSION_ORDER_EXECUTION_TIME: - $migrationIdAndStartedHeader = "Migration ID [Started ]"; + $migrationIdAndStartedHeader = 'Migration ID [Started ]'; break; default: throw new RuntimeException('Invalid version_order configuration option'); @@ -252,7 +250,6 @@ public function printStatus($environment, $format = null) * * @param array $version The missing version to print (in the format returned by Environment.getVersionLog). * @param int $maxNameLength The maximum migration name length. - * * @return void */ protected function printMissingVersion($version, $maxNameLength) @@ -277,7 +274,6 @@ protected function printMissingVersion($version, $maxNameLength) * @param \DateTime $dateTime Date to migrate to * @param bool $fake flag that if true, we just record running the migration, but not actually do the * migration - * * @return void */ public function migrateToDateTime($environment, DateTime $dateTime, $fake = false) @@ -302,7 +298,6 @@ public function migrateToDateTime($environment, DateTime $dateTime, $fake = fals * @param string $environment Environment * @param int|null $version version to migrate to * @param bool $fake flag that if true, we just record running the migration, but not actually do the migration - * * @return void */ public function migrate($environment, $version = null, $fake = false) @@ -365,7 +360,6 @@ public function migrate($environment, $version = null, $fake = false) * @param \Phinx\Migration\MigrationInterface $migration Migration * @param string $direction Direction * @param bool $fake flag that if true, we just record running the migration, but not actually do the migration - * * @return void */ public function executeMigration($name, MigrationInterface $migration, $direction = MigrationInterface::UP, $fake = false) @@ -395,7 +389,6 @@ public function executeMigration($name, MigrationInterface $migration, $directio * * @param string $name Environment Name * @param \Phinx\Seed\SeedInterface $seed Seed - * * @return void */ public function executeSeed($name, SeedInterface $seed) @@ -428,7 +421,6 @@ public function executeSeed($name, SeedInterface $seed) * @param bool $force Force * @param bool $targetMustMatchVersion Target must match version * @param bool $fake Flag that if true, we just record running the migration, but not actually do the migration - * * @return void */ public function rollback($environment, $target = null, $force = false, $targetMustMatchVersion = true, $fake = false) @@ -539,9 +531,7 @@ public function rollback($environment, $target = null, $force = false, $targetMu * * @param string $environment Environment * @param string|null $seed Seeder - * * @throws \InvalidArgumentException - * * @return void */ public function seed($environment, $seed = null) @@ -569,7 +559,6 @@ public function seed($environment, $seed = null) * Sets the environments. * * @param \Phinx\Migration\Manager\Environment[] $environments Environments - * * @return $this */ public function setEnvironments($environments = []) @@ -583,9 +572,7 @@ public function setEnvironments($environments = []) * Gets the manager class for the given environment. * * @param string $name Environment Name - * * @throws \InvalidArgumentException - * * @return \Phinx\Migration\Manager\Environment */ public function getEnvironment($name) @@ -619,7 +606,6 @@ public function getEnvironment($name) * Sets the user defined PSR-11 container * * @param \Psr\Container\ContainerInterface $container Container - * * @return void */ public function setContainer(ContainerInterface $container) @@ -631,7 +617,6 @@ public function setContainer(ContainerInterface $container) * Sets the console input. * * @param \Symfony\Component\Console\Input\InputInterface $input Input - * * @return $this */ public function setInput(InputInterface $input) @@ -655,7 +640,6 @@ public function getInput() * Sets the console output. * * @param \Symfony\Component\Console\Output\OutputInterface $output Output - * * @return $this */ public function setOutput(OutputInterface $output) @@ -679,7 +663,6 @@ public function getOutput() * Sets the database migrations. * * @param \Phinx\Migration\AbstractMigration[] $migrations Migrations - * * @return $this */ public function setMigrations(array $migrations) @@ -694,9 +677,7 @@ public function setMigrations(array $migrations) * order * * @param string $environment Environment - * * @throws \InvalidArgumentException - * * @return \Phinx\Migration\AbstractMigration[] */ public function getMigrations($environment) @@ -811,7 +792,6 @@ protected function getMigrationFiles() * Sets the database seeders. * * @param \Phinx\Seed\AbstractSeed[] $seeds Seeders - * * @return $this */ public function setSeeds(array $seeds) @@ -825,7 +805,6 @@ public function setSeeds(array $seeds) * Get seed dependencies instances from seed dependency array * * @param \Phinx\Seed\AbstractSeed $seed Seed - * * @return \Phinx\Seed\AbstractSeed[] */ protected function getSeedDependenciesInstances(AbstractSeed $seed) @@ -849,7 +828,6 @@ protected function getSeedDependenciesInstances(AbstractSeed $seed) * Order seeds by dependencies * * @param \Phinx\Seed\AbstractSeed[] $seeds Seeds - * * @return \Phinx\Seed\AbstractSeed[] */ protected function orderSeedsByDependencies(array $seeds) @@ -873,7 +851,6 @@ protected function orderSeedsByDependencies(array $seeds) * Gets an array of database seeders. * * @throws \InvalidArgumentException - * * @return \Phinx\Seed\AbstractSeed[] */ public function getSeeds() @@ -957,7 +934,6 @@ protected function getSeedFiles() * Sets the config. * * @param \Phinx\Config\ConfigInterface $config Configuration Object - * * @return $this */ public function setConfig(ConfigInterface $config) @@ -982,7 +958,6 @@ public function getConfig() * * @param string $environment Environment name * @param int|null $version Version - * * @return void */ public function toggleBreakpoint($environment, $version) @@ -996,7 +971,6 @@ public function toggleBreakpoint($environment, $version) * @param string $environment The required environment * @param int|null $version The version of the target migration * @param int $mark The state of the breakpoint as defined by self::BREAKPOINT_xxxx constants. - * * @return void */ protected function markBreakpoint($environment, $version, $mark) @@ -1053,7 +1027,6 @@ protected function markBreakpoint($environment, $version, $mark) * Remove all breakpoints * * @param string $environment The required environment - * * @return void */ public function removeBreakpoints($environment) @@ -1069,7 +1042,6 @@ public function removeBreakpoints($environment) * * @param string $environment The required environment * @param int|null $version The version of the target migration - * * @return void */ public function setBreakpoint($environment, $version) @@ -1082,7 +1054,6 @@ public function setBreakpoint($environment, $version) * * @param string $environment The required environment * @param int|null $version The version of the target migration - * * @return void */ public function unsetBreakpoint($environment, $version) diff --git a/app/vendor/robmorgan/phinx/src/Phinx/Migration/Manager/Environment.php b/app/vendor/robmorgan/phinx/src/Phinx/Migration/Manager/Environment.php index 9620e0dd0..d21817ae4 100644 --- a/app/vendor/robmorgan/phinx/src/Phinx/Migration/Manager/Environment.php +++ b/app/vendor/robmorgan/phinx/src/Phinx/Migration/Manager/Environment.php @@ -69,12 +69,11 @@ public function __construct($name, $options) * @param \Phinx\Migration\MigrationInterface $migration Migration * @param string $direction Direction * @param bool $fake flag that if true, we just record running the migration, but not actually do the migration - * * @return void */ public function executeMigration(MigrationInterface $migration, $direction = MigrationInterface::UP, $fake = false) { - $direction = ($direction === MigrationInterface::UP) ? MigrationInterface::UP : MigrationInterface::DOWN; + $direction = $direction === MigrationInterface::UP ? MigrationInterface::UP : MigrationInterface::DOWN; $migration->setMigratingUp($direction === MigrationInterface::UP); $startTime = time(); @@ -128,7 +127,6 @@ public function executeMigration(MigrationInterface $migration, $direction = Mig * Executes the specified seeder on this environment. * * @param \Phinx\Seed\SeedInterface $seed Seed - * * @return void */ public function executeSeed(SeedInterface $seed) @@ -158,7 +156,6 @@ public function executeSeed(SeedInterface $seed) * Sets the environment's name. * * @param string $name Environment Name - * * @return $this */ public function setName($name) @@ -182,7 +179,6 @@ public function getName() * Sets the environment's options. * * @param array $options Environment Options - * * @return $this */ public function setOptions($options) @@ -206,7 +202,6 @@ public function getOptions() * Sets the console input. * * @param \Symfony\Component\Console\Input\InputInterface $input Input - * * @return $this */ public function setInput(InputInterface $input) @@ -230,7 +225,6 @@ public function getInput() * Sets the console output. * * @param \Symfony\Component\Console\Output\OutputInterface $output Output - * * @return $this */ public function setOutput(OutputInterface $output) @@ -275,7 +269,6 @@ public function getVersionLog() * Sets the current version of the environment. * * @param int $version Environment Version - * * @return $this */ public function setCurrentVersion($version) @@ -311,7 +304,6 @@ public function getCurrentVersion() * Sets the database adapter. * * @param \Phinx\Db\Adapter\AdapterInterface $adapter Database Adapter - * * @return $this */ public function setAdapter(AdapterInterface $adapter) @@ -325,7 +317,6 @@ public function setAdapter(AdapterInterface $adapter) * Gets the database adapter. * * @throws \RuntimeException - * * @return \Phinx\Db\Adapter\AdapterInterface */ public function getAdapter() @@ -386,7 +377,6 @@ public function getAdapter() * Sets the schema table name. * * @param string $schemaTableName Schema Table Name - * * @return $this */ public function setSchemaTableName($schemaTableName) diff --git a/app/vendor/robmorgan/phinx/src/Phinx/Migration/MigrationInterface.php b/app/vendor/robmorgan/phinx/src/Phinx/Migration/MigrationInterface.php index 2dedb3555..537345dca 100644 --- a/app/vendor/robmorgan/phinx/src/Phinx/Migration/MigrationInterface.php +++ b/app/vendor/robmorgan/phinx/src/Phinx/Migration/MigrationInterface.php @@ -42,7 +42,6 @@ interface MigrationInterface * Sets the database adapter. * * @param \Phinx\Db\Adapter\AdapterInterface $adapter Database Adapter - * * @return \Phinx\Migration\MigrationInterface */ public function setAdapter(AdapterInterface $adapter); @@ -58,7 +57,6 @@ public function getAdapter(); * Sets the input object to be used in migration object * * @param \Symfony\Component\Console\Input\InputInterface $input Input - * * @return \Phinx\Migration\MigrationInterface */ public function setInput(InputInterface $input); @@ -74,7 +72,6 @@ public function getInput(); * Sets the output object to be used in migration object * * @param \Symfony\Component\Console\Output\OutputInterface $output Output - * * @return \Phinx\Migration\MigrationInterface */ public function setOutput(OutputInterface $output); @@ -104,7 +101,6 @@ public function getEnvironment(); * Sets the migration version number. * * @param int $version Version - * * @return \Phinx\Migration\MigrationInterface */ public function setVersion($version); @@ -120,7 +116,6 @@ public function getVersion(); * Sets whether this migration is being applied or reverted * * @param bool $isMigratingUp True if the migration is being applied - * * @return \Phinx\Migration\MigrationInterface */ public function setMigratingUp($isMigratingUp); @@ -137,7 +132,6 @@ public function isMigratingUp(); * Executes a SQL statement and returns the number of affected rows. * * @param string $sql SQL - * * @return int */ public function execute($sql); @@ -151,7 +145,6 @@ public function execute($sql); * you can set the return type by the adapter in your current use. * * @param string $sql SQL - * * @return mixed */ public function query($sql); @@ -164,7 +157,6 @@ public function query($sql); * the dry-run settings. * * @see https://api.cakephp.org/3.6/class-Cake.Database.Query.html - * * @return \Cake\Database\Query */ public function getQueryBuilder(); @@ -173,7 +165,6 @@ public function getQueryBuilder(); * Executes a query and returns only one row as an array. * * @param string $sql SQL - * * @return array|false */ public function fetchRow($sql); @@ -182,7 +173,6 @@ public function fetchRow($sql); * Executes a query and returns an array of rows. * * @param string $sql SQL - * * @return array */ public function fetchAll($sql); @@ -191,10 +181,8 @@ public function fetchAll($sql); * Insert data into a table. * * @deprecated since 0.10.0. Use $this->table($tableName)->insert($data)->save() instead. - * * @param string $tableName Table name * @param array $data Data - * * @return void */ public function insert($tableName, $data); @@ -204,7 +192,6 @@ public function insert($tableName, $data); * * @param string $name Database Name * @param array $options Options - * * @return void */ public function createDatabase($name, $options); @@ -213,7 +200,6 @@ public function createDatabase($name, $options); * Drop a database. * * @param string $name Database Name - * * @return void */ public function dropDatabase($name); @@ -222,7 +208,6 @@ public function dropDatabase($name); * Checks to see if a table exists. * * @param string $tableName Table name - * * @return bool */ public function hasTable($tableName); @@ -234,7 +219,6 @@ public function hasTable($tableName); * * @param string $tableName Table name * @param array $options Options - * * @return \Phinx\Db\Table */ public function table($tableName, $options); @@ -244,7 +228,6 @@ public function table($tableName, $options); * if there are potential problems. * * @param string|null $direction Direction - * * @return void */ public function preFlightCheck($direction = null); @@ -255,7 +238,6 @@ public function preFlightCheck($direction = null); * Right now, the only check is whether all changes were committed * * @param string|null $direction direction of migration - * * @return void */ public function postFlightCheck($direction = null); diff --git a/app/vendor/robmorgan/phinx/src/Phinx/Seed/SeedInterface.php b/app/vendor/robmorgan/phinx/src/Phinx/Seed/SeedInterface.php index 2165fdb22..a0c49440c 100644 --- a/app/vendor/robmorgan/phinx/src/Phinx/Seed/SeedInterface.php +++ b/app/vendor/robmorgan/phinx/src/Phinx/Seed/SeedInterface.php @@ -39,7 +39,6 @@ public function run(); * Sets the database adapter. * * @param \Phinx\Db\Adapter\AdapterInterface $adapter Database Adapter - * * @return \Phinx\Seed\SeedInterface */ public function setAdapter(AdapterInterface $adapter); @@ -55,7 +54,6 @@ public function getAdapter(); * Sets the input object to be used in migration object * * @param \Symfony\Component\Console\Input\InputInterface $input Input - * * @return \Phinx\Seed\SeedInterface */ public function setInput(InputInterface $input); @@ -71,7 +69,6 @@ public function getInput(); * Sets the output object to be used in migration object * * @param \Symfony\Component\Console\Output\OutputInterface $output Output - * * @return \Phinx\Seed\SeedInterface */ public function setOutput(OutputInterface $output); @@ -94,7 +91,6 @@ public function getName(); * Executes a SQL statement and returns the number of affected rows. * * @param string $sql SQL - * * @return int */ public function execute($sql); @@ -108,7 +104,6 @@ public function execute($sql); * you can set the return type by the adapter in your current use. * * @param string $sql SQL - * * @return mixed */ public function query($sql); @@ -117,7 +112,6 @@ public function query($sql); * Executes a query and returns only one row as an array. * * @param string $sql SQL - * * @return array|false */ public function fetchRow($sql); @@ -126,7 +120,6 @@ public function fetchRow($sql); * Executes a query and returns an array of rows. * * @param string $sql SQL - * * @return array */ public function fetchAll($sql); @@ -136,7 +129,6 @@ public function fetchAll($sql); * * @param string $tableName Table name * @param array $data Data - * * @return void */ public function insert($tableName, $data); @@ -145,7 +137,6 @@ public function insert($tableName, $data); * Checks to see if a table exists. * * @param string $tableName Table name - * * @return bool */ public function hasTable($tableName); @@ -157,7 +148,6 @@ public function hasTable($tableName); * * @param string $tableName Table name * @param array $options Options - * * @return \Phinx\Db\Table */ public function table($tableName, $options); diff --git a/app/vendor/robmorgan/phinx/src/Phinx/Util/Expression.php b/app/vendor/robmorgan/phinx/src/Phinx/Util/Expression.php index 147ae9af5..352dab483 100644 --- a/app/vendor/robmorgan/phinx/src/Phinx/Util/Expression.php +++ b/app/vendor/robmorgan/phinx/src/Phinx/Util/Expression.php @@ -32,7 +32,6 @@ public function __toString() /** * @param string $value The expression - * * @return self */ public static function from($value) diff --git a/app/vendor/robmorgan/phinx/src/Phinx/Util/Literal.php b/app/vendor/robmorgan/phinx/src/Phinx/Util/Literal.php index 37da08a40..6ffbe5912 100644 --- a/app/vendor/robmorgan/phinx/src/Phinx/Util/Literal.php +++ b/app/vendor/robmorgan/phinx/src/Phinx/Util/Literal.php @@ -32,7 +32,6 @@ public function __toString() /** * @param string $value The literal's value - * * @return self */ public static function from($value) diff --git a/app/vendor/robmorgan/phinx/src/Phinx/Util/Util.php b/app/vendor/robmorgan/phinx/src/Phinx/Util/Util.php index 61659a3d4..6ac7a7b42 100644 --- a/app/vendor/robmorgan/phinx/src/Phinx/Util/Util.php +++ b/app/vendor/robmorgan/phinx/src/Phinx/Util/Util.php @@ -56,7 +56,6 @@ public static function getCurrentTimestamp() * Gets an array of all the existing migration class names. * * @param string $path Path - * * @return string[] */ public static function getExistingMigrationClassNames($path) @@ -84,7 +83,6 @@ public static function getExistingMigrationClassNames($path) * Get the version from the beginning of a file name. * * @param string $fileName File Name - * * @return string */ public static function getVersionFromFileName($fileName) @@ -101,7 +99,6 @@ public static function getVersionFromFileName($fileName) * '12345678901234_limit_resource_names_to_30_chars.php'. * * @param string $className Class Name - * * @return string */ public static function mapClassNameToFileName($className) @@ -120,7 +117,6 @@ public static function mapClassNameToFileName($className) * names like 'CreateUserTable'. * * @param string $fileName File Name - * * @return string */ public static function mapFileNameToClassName(string $fileName): string @@ -129,7 +125,7 @@ public static function mapFileNameToClassName(string $fileName): string if (preg_match(static::MIGRATION_FILE_NAME_PATTERN, $fileName, $matches)) { $fileName = $matches[1]; } elseif (preg_match(static::MIGRATION_FILE_NAME_NO_NAME_PATTERN, $fileName)) { - return "V" . substr($fileName, 0, strlen($fileName) - 4); + return 'V' . substr($fileName, 0, strlen($fileName) - 4); } $className = str_replace('_', '', ucwords($fileName, '_')); @@ -149,7 +145,6 @@ public static function mapFileNameToClassName(string $fileName): string * * @param string $className Class Name * @param string $path Path - * * @return bool */ public static function isUniqueMigrationClassName($className, $path) @@ -168,7 +163,6 @@ public static function isUniqueMigrationClassName($className, $path) * Single words are not allowed on their own. * * @param string $className Class Name - * * @return bool */ public static function isValidPhinxClassName($className) @@ -180,22 +174,18 @@ public static function isValidPhinxClassName($className) * Check if a migration file name is valid. * * @param string $fileName File Name - * * @return bool */ public static function isValidMigrationFileName(string $fileName): bool { - return ( - (bool)preg_match(static::MIGRATION_FILE_NAME_PATTERN, $fileName) - || (bool)preg_match(static::MIGRATION_FILE_NAME_NO_NAME_PATTERN, $fileName) - ); + return (bool)preg_match(static::MIGRATION_FILE_NAME_PATTERN, $fileName) + || (bool)preg_match(static::MIGRATION_FILE_NAME_NO_NAME_PATTERN, $fileName); } /** * Check if a seed file name is valid. * * @param string $fileName File Name - * * @return bool */ public static function isValidSeedFileName($fileName) @@ -207,7 +197,6 @@ public static function isValidSeedFileName($fileName) * Expands a set of paths with curly braces (if supported by the OS). * * @param string[] $paths Paths - * * @return string[] */ public static function globAll(array $paths) @@ -225,7 +214,6 @@ public static function globAll(array $paths) * Expands a path with curly braces (if supported by the OS). * * @param string $path Path - * * @return string[] */ public static function glob($path) @@ -240,9 +228,7 @@ public static function glob($path) * @param \Symfony\Component\Console\Input\InputInterface|null $input Input * @param \Symfony\Component\Console\Output\OutputInterface|null $output Output * @param \Phinx\Console\Command\AbstractCommand|mixed|null $context Context - * * @throws \Exception - * * @return string */ public static function loadPhpFile($filename, ?InputInterface $input = null, ?OutputInterface $output = null, $context = null) @@ -275,13 +261,12 @@ public static function loadPhpFile($filename, ?InputInterface $input = null, ?Ou * Given an array of paths, return all unique PHP files that are in them * * @param string|string[] $paths Path or array of paths to get .php files. - * * @return string[] */ public static function getFiles($paths) { $files = static::globAll(array_map(function ($path) { - return $path . DIRECTORY_SEPARATOR . "*.php"; + return $path . DIRECTORY_SEPARATOR . '*.php'; }, (array)$paths)); // glob() can return the same file multiple times // This will cause the migration to fail with a diff --git a/app/vendor/robmorgan/phinx/src/Phinx/Wrapper/TextWrapper.php b/app/vendor/robmorgan/phinx/src/Phinx/Wrapper/TextWrapper.php index c5538b9c2..afa137dfd 100644 --- a/app/vendor/robmorgan/phinx/src/Phinx/Wrapper/TextWrapper.php +++ b/app/vendor/robmorgan/phinx/src/Phinx/Wrapper/TextWrapper.php @@ -68,7 +68,6 @@ public function getExitCode() * Returns the output from running the "status" command. * * @param string|null $env environment name (optional) - * * @return string */ public function getStatus($env = null) @@ -95,7 +94,6 @@ public function getStatus($env = null) * * @param string|null $env environment name (optional) * @param string|null $target target version (optional) - * * @return string */ public function getMigrate($env = null, $target = null) @@ -123,7 +121,6 @@ public function getMigrate($env = null, $target = null) * @param string|null $env Environment name * @param string|null $target Target version * @param string[]|string|null $seed Array of seed names or seed name - * * @return string */ public function getSeed($env = null, $target = null, $seed = null) @@ -154,7 +151,6 @@ public function getSeed($env = null, $target = null, $seed = null) * * @param string|null $env Environment name (optional) * @param mixed $target Target version, or 0 (zero) fully revert (optional) - * * @return string */ public function getRollback($env = null, $target = null) @@ -182,7 +178,6 @@ public function getRollback($env = null, $target = null) * Check option from options array * * @param string $key Key - * * @return bool */ protected function hasOption($key) @@ -194,7 +189,6 @@ protected function hasOption($key) * Get option from options array * * @param string $key Key - * * @return string|null */ protected function getOption($key) @@ -211,7 +205,6 @@ protected function getOption($key) * * @param string $key Key * @param string $value Value - * * @return $this */ public function setOption($key, $value) @@ -225,7 +218,6 @@ public function setOption($key, $value) * Execute a command, capturing output and storing the exit code. * * @param array $command Command - * * @return string */ protected function executeRun(array $command) diff --git a/app/vendor/seld/phar-utils/src/Timestamps.php b/app/vendor/seld/phar-utils/src/Timestamps.php index 73a4beeb0..ebf6e817e 100644 --- a/app/vendor/seld/phar-utils/src/Timestamps.php +++ b/app/vendor/seld/phar-utils/src/Timestamps.php @@ -28,11 +28,11 @@ public function __construct($file) * * The PHAR signature can then be produced in a reproducible manner. * - * @param int|DateTime|string $timestamp Date string or DateTime or unix timestamp to use + * @param int|\DateTimeInterface|string $timestamp Date string or DateTime or unix timestamp to use */ public function updateTimestamps($timestamp = null) { - if ($timestamp instanceof \DateTime) { + if ($timestamp instanceof \DateTime || $timestamp instanceof \DateTimeInterface) { $timestamp = $timestamp->getTimestamp(); } elseif (is_string($timestamp)) { $timestamp = strtotime($timestamp); diff --git a/app/vendor/symfony/config/Definition/ArrayNode.php b/app/vendor/symfony/config/Definition/ArrayNode.php index d7930b232..601d2da9a 100644 --- a/app/vendor/symfony/config/Definition/ArrayNode.php +++ b/app/vendor/symfony/config/Definition/ArrayNode.php @@ -32,9 +32,9 @@ class ArrayNode extends BaseNode implements PrototypeNodeInterface protected $removeExtraKeys = true; protected $normalizeKeys = true; - public function setNormalizeKeys($normalizeKeys) + public function setNormalizeKeys(bool $normalizeKeys) { - $this->normalizeKeys = (bool) $normalizeKeys; + $this->normalizeKeys = $normalizeKeys; } /** @@ -55,7 +55,7 @@ protected function preNormalize($value) $normalized = []; foreach ($value as $k => $v) { - if (false !== strpos($k, '-') && false === strpos($k, '_') && !\array_key_exists($normalizedKey = str_replace('-', '_', $k), $value)) { + if (str_contains($k, '-') && !str_contains($k, '_') && !\array_key_exists($normalizedKey = str_replace('-', '_', $k), $value)) { $normalized[$normalizedKey] = $v; } else { $normalized[$k] = $v; @@ -184,7 +184,7 @@ public function getDefaultValue() public function addChild(NodeInterface $node) { $name = $node->getName(); - if (!\strlen($name)) { + if ('' === $name) { throw new \InvalidArgumentException('Child nodes must be named.'); } if (isset($this->children[$name])) { diff --git a/app/vendor/symfony/config/Definition/BaseNode.php b/app/vendor/symfony/config/Definition/BaseNode.php index db1955e96..e945ea3bf 100644 --- a/app/vendor/symfony/config/Definition/BaseNode.php +++ b/app/vendor/symfony/config/Definition/BaseNode.php @@ -47,7 +47,7 @@ abstract class BaseNode implements NodeInterface */ public function __construct(?string $name, NodeInterface $parent = null, string $pathSeparator = self::DEFAULT_PATH_SEPARATOR) { - if (false !== strpos($name = (string) $name, $pathSeparator)) { + if (str_contains($name = (string) $name, $pathSeparator)) { throw new \InvalidArgumentException('The name must not contain ".'.$pathSeparator.'".'); } @@ -187,8 +187,6 @@ public function addEquivalentValue($originalValue, $equivalentValue) /** * Set this node as required. - * - * @param bool $boolean Required node */ public function setRequired(bool $boolean) { @@ -544,7 +542,7 @@ private static function resolvePlaceholderValue($value) } foreach (self::$placeholderUniquePrefixes as $placeholderUniquePrefix) { - if (0 === strpos($value, $placeholderUniquePrefix)) { + if (str_starts_with($value, $placeholderUniquePrefix)) { return []; } } diff --git a/app/vendor/symfony/config/Definition/Builder/NodeDefinition.php b/app/vendor/symfony/config/Definition/Builder/NodeDefinition.php index 0d9c91fea..cee551b42 100644 --- a/app/vendor/symfony/config/Definition/Builder/NodeDefinition.php +++ b/app/vendor/symfony/config/Definition/Builder/NodeDefinition.php @@ -105,8 +105,6 @@ public function end() /** * Creates the node. * - * @param bool $forceRootNode Whether to force this node as the root node - * * @return NodeInterface */ public function getNode(bool $forceRootNode = false) diff --git a/app/vendor/symfony/config/Definition/Exception/InvalidConfigurationException.php b/app/vendor/symfony/config/Definition/Exception/InvalidConfigurationException.php index fcaaf4943..ceb5e239b 100644 --- a/app/vendor/symfony/config/Definition/Exception/InvalidConfigurationException.php +++ b/app/vendor/symfony/config/Definition/Exception/InvalidConfigurationException.php @@ -22,7 +22,7 @@ class InvalidConfigurationException extends Exception private $path; private $containsHints = false; - public function setPath($path) + public function setPath(string $path) { $this->path = $path; } diff --git a/app/vendor/symfony/config/Loader/FileLoader.php b/app/vendor/symfony/config/Loader/FileLoader.php index 2351f13ed..4e1b46c4e 100644 --- a/app/vendor/symfony/config/Loader/FileLoader.php +++ b/app/vendor/symfony/config/Loader/FileLoader.php @@ -72,7 +72,7 @@ public function getLocator() */ public function import($resource, string $type = null, bool $ignoreErrors = false, string $sourceResource = null, $exclude = null) { - if (\is_string($resource) && \strlen($resource) !== ($i = strcspn($resource, '*?{[')) && false === strpos($resource, "\n")) { + if (\is_string($resource) && \strlen($resource) !== ($i = strcspn($resource, '*?{[')) && !str_contains($resource, "\n")) { $excluded = []; foreach ((array) $exclude as $pattern) { foreach ($this->glob($pattern, true, $_, false, true) as $path => $info) { @@ -82,7 +82,7 @@ public function import($resource, string $type = null, bool $ignoreErrors = fals } $ret = []; - $isSubpath = 0 !== $i && false !== strpos(substr($resource, 0, $i), '/'); + $isSubpath = 0 !== $i && str_contains(substr($resource, 0, $i), '/'); foreach ($this->glob($resource, false, $_, $ignoreErrors || !$isSubpath, false, $excluded) as $path => $info) { if (null !== $res = $this->doImport($path, 'glob' === $type ? null : $type, $ignoreErrors, $sourceResource)) { $ret[] = $res; @@ -106,7 +106,7 @@ protected function glob(string $pattern, bool $recursive, &$resource = null, boo if (\strlen($pattern) === $i = strcspn($pattern, '*?{[')) { $prefix = $pattern; $pattern = ''; - } elseif (0 === $i || false === strpos(substr($pattern, 0, $i), '/')) { + } elseif (0 === $i || !str_contains(substr($pattern, 0, $i), '/')) { $prefix = '.'; $pattern = '/'.$pattern; } else { diff --git a/app/vendor/symfony/config/Resource/ClassExistenceResource.php b/app/vendor/symfony/config/Resource/ClassExistenceResource.php index ad172038e..3acb6d01d 100644 --- a/app/vendor/symfony/config/Resource/ClassExistenceResource.php +++ b/app/vendor/symfony/config/Resource/ClassExistenceResource.php @@ -42,9 +42,6 @@ public function __construct(string $resource, bool $exists = null) } } - /** - * {@inheritdoc} - */ public function __toString(): string { return $this->resource; diff --git a/app/vendor/symfony/config/Resource/ComposerResource.php b/app/vendor/symfony/config/Resource/ComposerResource.php index b8bf57761..f552f80ac 100644 --- a/app/vendor/symfony/config/Resource/ComposerResource.php +++ b/app/vendor/symfony/config/Resource/ComposerResource.php @@ -35,9 +35,6 @@ public function getVendors(): array return array_keys($this->vendors); } - /** - * {@inheritdoc} - */ public function __toString(): string { return __CLASS__; @@ -58,7 +55,7 @@ private static function refresh() self::$runtimeVendors = []; foreach (get_declared_classes() as $class) { - if ('C' === $class[0] && 0 === strpos($class, 'ComposerAutoloaderInit')) { + if ('C' === $class[0] && str_starts_with($class, 'ComposerAutoloaderInit')) { $r = new \ReflectionClass($class); $v = \dirname($r->getFileName(), 2); if (is_file($v.'/composer/installed.json')) { diff --git a/app/vendor/symfony/config/Resource/DirectoryResource.php b/app/vendor/symfony/config/Resource/DirectoryResource.php index 1a28881f3..a7501095a 100644 --- a/app/vendor/symfony/config/Resource/DirectoryResource.php +++ b/app/vendor/symfony/config/Resource/DirectoryResource.php @@ -39,9 +39,6 @@ public function __construct(string $resource, string $pattern = null) } } - /** - * {@inheritdoc} - */ public function __toString(): string { return md5(serialize([$this->resource, $this->pattern])); @@ -84,7 +81,7 @@ public function isFresh(int $timestamp): bool // always monitor directories for changes, except the .. entries // (otherwise deleted files wouldn't get detected) - if ($file->isDir() && '/..' === substr($file, -3)) { + if ($file->isDir() && str_ends_with($file, '/..')) { continue; } diff --git a/app/vendor/symfony/config/Resource/FileExistenceResource.php b/app/vendor/symfony/config/Resource/FileExistenceResource.php index ca2d2c3f7..0151905aa 100644 --- a/app/vendor/symfony/config/Resource/FileExistenceResource.php +++ b/app/vendor/symfony/config/Resource/FileExistenceResource.php @@ -36,9 +36,6 @@ public function __construct(string $resource) $this->exists = file_exists($resource); } - /** - * {@inheritdoc} - */ public function __toString(): string { return $this->resource; diff --git a/app/vendor/symfony/config/Resource/FileResource.php b/app/vendor/symfony/config/Resource/FileResource.php index 4274d07ba..e502caece 100644 --- a/app/vendor/symfony/config/Resource/FileResource.php +++ b/app/vendor/symfony/config/Resource/FileResource.php @@ -41,9 +41,6 @@ public function __construct(string $resource) } } - /** - * {@inheritdoc} - */ public function __toString(): string { return $this->resource; diff --git a/app/vendor/symfony/config/Resource/GlobResource.php b/app/vendor/symfony/config/Resource/GlobResource.php index c77e837c2..2ac06986d 100644 --- a/app/vendor/symfony/config/Resource/GlobResource.php +++ b/app/vendor/symfony/config/Resource/GlobResource.php @@ -60,9 +60,6 @@ public function getPrefix(): string return $this->prefix; } - /** - * {@inheritdoc} - */ public function __toString(): string { return 'glob.'.$this->prefix.(int) $this->recursive.$this->pattern.(int) $this->forExclusion.implode("\0", $this->excludedPrefixes); @@ -110,10 +107,10 @@ public function getIterator(): \Traversable $prefix = str_replace('\\', '/', $this->prefix); $paths = null; - if (0 !== strpos($this->prefix, 'phar://') && false === strpos($this->pattern, '/**/')) { - if ($this->globBrace || false === strpos($this->pattern, '{')) { + if (!str_starts_with($this->prefix, 'phar://') && !str_contains($this->pattern, '/**/')) { + if ($this->globBrace || !str_contains($this->pattern, '{')) { $paths = glob($this->prefix.$this->pattern, \GLOB_NOSORT | $this->globBrace); - } elseif (false === strpos($this->pattern, '\\') || !preg_match('/\\\\[,{}]/', $this->pattern)) { + } elseif (!str_contains($this->pattern, '\\') || !preg_match('/\\\\[,{}]/', $this->pattern)) { foreach ($this->expandGlob($this->pattern) as $p) { $paths[] = glob($this->prefix.$p, \GLOB_NOSORT); } @@ -226,7 +223,7 @@ private function expandGlob(string $pattern): array $j = 0; foreach ($patterns as $i => $p) { - if (false !== strpos($p, '{')) { + if (str_contains($p, '{')) { $p = $this->expandGlob($p); array_splice($paths, $i + $j, 1, $p); $j += \count($p) - 1; diff --git a/app/vendor/symfony/config/Resource/ReflectionClassResource.php b/app/vendor/symfony/config/Resource/ReflectionClassResource.php index 4bc6903cd..61e8d71d0 100644 --- a/app/vendor/symfony/config/Resource/ReflectionClassResource.php +++ b/app/vendor/symfony/config/Resource/ReflectionClassResource.php @@ -85,7 +85,7 @@ private function loadFiles(\ReflectionClass $class) $file = $class->getFileName(); if (false !== $file && is_file($file)) { foreach ($this->excludedVendors as $vendor) { - if (0 === strpos($file, $vendor) && false !== strpbrk(substr($file, \strlen($vendor), 1), '/'.\DIRECTORY_SEPARATOR)) { + if (str_starts_with($file, $vendor) && false !== strpbrk(substr($file, \strlen($vendor), 1), '/'.\DIRECTORY_SEPARATOR)) { $file = false; break; } diff --git a/app/vendor/symfony/config/Resource/ResourceInterface.php b/app/vendor/symfony/config/Resource/ResourceInterface.php index d98fd427a..9a0cd9a47 100644 --- a/app/vendor/symfony/config/Resource/ResourceInterface.php +++ b/app/vendor/symfony/config/Resource/ResourceInterface.php @@ -26,8 +26,6 @@ interface ResourceInterface * to be identical for different ResourceInterface instances referring to the same * resource; and it should be unlikely to collide with that of other, unrelated * resource instances. - * - * @return string A string representation unique to the underlying Resource */ public function __toString(); } diff --git a/app/vendor/symfony/config/ResourceCheckerConfigCache.php b/app/vendor/symfony/config/ResourceCheckerConfigCache.php index 190ab991a..d47370132 100644 --- a/app/vendor/symfony/config/ResourceCheckerConfigCache.php +++ b/app/vendor/symfony/config/ResourceCheckerConfigCache.php @@ -181,7 +181,7 @@ private function safelyUnserialize(string $file) /** * @internal */ - public static function handleUnserializeCallback($class) + public static function handleUnserializeCallback(string $class) { trigger_error('Class not found: '.$class); } diff --git a/app/vendor/symfony/config/composer.json b/app/vendor/symfony/config/composer.json index b99d04c7d..a014fd272 100644 --- a/app/vendor/symfony/config/composer.json +++ b/app/vendor/symfony/config/composer.json @@ -20,7 +20,7 @@ "symfony/deprecation-contracts": "^2.1", "symfony/filesystem": "^4.4|^5.0", "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-php80": "^1.15", + "symfony/polyfill-php80": "^1.16", "symfony/polyfill-php81": "^1.22" }, "require-dev": { diff --git a/app/vendor/symfony/console/Application.php b/app/vendor/symfony/console/Application.php index 9cdcef88c..769c65d63 100644 --- a/app/vendor/symfony/console/Application.php +++ b/app/vendor/symfony/console/Application.php @@ -819,7 +819,7 @@ protected function doRenderThrowable(\Throwable $e, OutputInterface $output): vo $len = 0; } - if (false !== strpos($message, "@anonymous\0")) { + if (str_contains($message, "@anonymous\0")) { $message = preg_replace_callback('/[a-zA-Z_\x7f-\xff][\\\\a-zA-Z0-9_\x7f-\xff]*+@anonymous\x00.*?\.php(?:0x?|:[0-9]++\$)[0-9a-fA-F]++/', function ($m) { return class_exists($m[0], false) ? (get_parent_class($m[0]) ?: key(class_implements($m[0])) ?: 'class').'@anonymous' : $m[0]; }, $message); @@ -947,7 +947,7 @@ protected function doRunCommand(Command $command, InputInterface $input, OutputI } } - if ($command instanceof SignalableCommandInterface) { + if ($command instanceof SignalableCommandInterface && ($this->signalsToDispatchEvent || $command->getSubscribedSignals())) { if (!$this->signalRegistry) { throw new RuntimeException('Unable to subscribe to signal events. Make sure that the `pcntl` extension is installed and that "pcntl_*" functions are not disabled by your php.ini\'s "disable_functions" directive.'); } @@ -1119,7 +1119,7 @@ private function findAlternatives(string $name, iterable $collection): array } $lev = levenshtein($subname, $parts[$i]); - if ($lev <= \strlen($subname) / 3 || '' !== $subname && false !== strpos($parts[$i], $subname)) { + if ($lev <= \strlen($subname) / 3 || '' !== $subname && str_contains($parts[$i], $subname)) { $alternatives[$collectionName] = $exists ? $alternatives[$collectionName] + $lev : $lev; } elseif ($exists) { $alternatives[$collectionName] += $threshold; @@ -1129,7 +1129,7 @@ private function findAlternatives(string $name, iterable $collection): array foreach ($collection as $item) { $lev = levenshtein($name, $item); - if ($lev <= \strlen($name) / 3 || false !== strpos($item, $name)) { + if ($lev <= \strlen($name) / 3 || str_contains($item, $name)) { $alternatives[$item] = isset($alternatives[$item]) ? $alternatives[$item] - $lev : $lev; } } @@ -1147,7 +1147,7 @@ private function findAlternatives(string $name, iterable $collection): array */ public function setDefaultCommand(string $commandName, bool $isSingleCommand = false) { - $this->defaultCommand = $commandName; + $this->defaultCommand = explode('|', ltrim($commandName, '|'))[0]; if ($isSingleCommand) { // Ensure the command exist diff --git a/app/vendor/symfony/console/Command/Command.php b/app/vendor/symfony/console/Command/Command.php index 71bf5d7c3..3b09d99f4 100644 --- a/app/vendor/symfony/console/Command/Command.php +++ b/app/vendor/symfony/console/Command/Command.php @@ -420,8 +420,8 @@ public function getNativeDefinition() /** * Adds an argument. * - * @param int|null $mode The argument mode: InputArgument::REQUIRED or InputArgument::OPTIONAL - * @param string|string[]|null $default The default value (for InputArgument::OPTIONAL mode only) + * @param int|null $mode The argument mode: InputArgument::REQUIRED or InputArgument::OPTIONAL + * @param mixed $default The default value (for InputArgument::OPTIONAL mode only) * * @throws InvalidArgumentException When argument mode is not valid * @@ -440,9 +440,9 @@ public function addArgument(string $name, int $mode = null, string $description /** * Adds an option. * - * @param string|array|null $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts - * @param int|null $mode The option mode: One of the InputOption::VALUE_* constants - * @param string|string[]|bool|null $default The default value (must be null for InputOption::VALUE_NONE) + * @param string|array|null $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts + * @param int|null $mode The option mode: One of the InputOption::VALUE_* constants + * @param mixed $default The default value (must be null for InputOption::VALUE_NONE) * * @throws InvalidArgumentException If option mode is invalid or incompatible * @@ -508,7 +508,7 @@ public function getName() * @param bool $hidden Whether or not the command should be hidden from the list of commands * The default value will be true in Symfony 6.0 * - * @return Command The current instance + * @return $this * * @final since Symfony 5.1 */ @@ -652,7 +652,7 @@ public function getSynopsis(bool $short = false) */ public function addUsage(string $usage) { - if (0 !== strpos($usage, $this->name)) { + if (!str_starts_with($usage, $this->name)) { $usage = sprintf('%s %s', $this->name, $usage); } diff --git a/app/vendor/symfony/console/Descriptor/Descriptor.php b/app/vendor/symfony/console/Descriptor/Descriptor.php index 2ecc59e4e..a3648301f 100644 --- a/app/vendor/symfony/console/Descriptor/Descriptor.php +++ b/app/vendor/symfony/console/Descriptor/Descriptor.php @@ -34,7 +34,7 @@ abstract class Descriptor implements DescriptorInterface /** * {@inheritdoc} */ - public function describe(OutputInterface $output, $object, array $options = []) + public function describe(OutputInterface $output, object $object, array $options = []) { $this->output = $output; diff --git a/app/vendor/symfony/console/Descriptor/DescriptorInterface.php b/app/vendor/symfony/console/Descriptor/DescriptorInterface.php index e3184a6a5..ebea30367 100644 --- a/app/vendor/symfony/console/Descriptor/DescriptorInterface.php +++ b/app/vendor/symfony/console/Descriptor/DescriptorInterface.php @@ -20,10 +20,5 @@ */ interface DescriptorInterface { - /** - * Describes an object if supported. - * - * @param object $object - */ - public function describe(OutputInterface $output, $object, array $options = []); + public function describe(OutputInterface $output, object $object, array $options = []); } diff --git a/app/vendor/symfony/console/Descriptor/MarkdownDescriptor.php b/app/vendor/symfony/console/Descriptor/MarkdownDescriptor.php index 04d6c8a76..21ceca6c2 100644 --- a/app/vendor/symfony/console/Descriptor/MarkdownDescriptor.php +++ b/app/vendor/symfony/console/Descriptor/MarkdownDescriptor.php @@ -31,7 +31,7 @@ class MarkdownDescriptor extends Descriptor /** * {@inheritdoc} */ - public function describe(OutputInterface $output, $object, array $options = []) + public function describe(OutputInterface $output, object $object, array $options = []) { $decorated = $output->isDecorated(); $output->setDecorated(false); diff --git a/app/vendor/symfony/console/Event/ConsoleErrorEvent.php b/app/vendor/symfony/console/Event/ConsoleErrorEvent.php index 25d9b8812..57d9b38ba 100644 --- a/app/vendor/symfony/console/Event/ConsoleErrorEvent.php +++ b/app/vendor/symfony/console/Event/ConsoleErrorEvent.php @@ -53,6 +53,6 @@ public function setExitCode(int $exitCode): void public function getExitCode(): int { - return null !== $this->exitCode ? $this->exitCode : (\is_int($this->error->getCode()) && 0 !== $this->error->getCode() ? $this->error->getCode() : 1); + return $this->exitCode ?? (\is_int($this->error->getCode()) && 0 !== $this->error->getCode() ? $this->error->getCode() : 1); } } diff --git a/app/vendor/symfony/console/Event/ConsoleEvent.php b/app/vendor/symfony/console/Event/ConsoleEvent.php index 89ab64559..4e00f7c73 100644 --- a/app/vendor/symfony/console/Event/ConsoleEvent.php +++ b/app/vendor/symfony/console/Event/ConsoleEvent.php @@ -28,7 +28,7 @@ class ConsoleEvent extends Event private $input; private $output; - public function __construct(Command $command = null, InputInterface $input, OutputInterface $output) + public function __construct(?Command $command, InputInterface $input, OutputInterface $output) { $this->command = $command; $this->input = $input; diff --git a/app/vendor/symfony/console/Formatter/OutputFormatter.php b/app/vendor/symfony/console/Formatter/OutputFormatter.php index 52ca23273..80d59b3b4 100644 --- a/app/vendor/symfony/console/Formatter/OutputFormatter.php +++ b/app/vendor/symfony/console/Formatter/OutputFormatter.php @@ -52,7 +52,7 @@ public static function escape(string $text) */ public static function escapeTrailingBackslash(string $text): string { - if ('\\' === substr($text, -1)) { + if (str_ends_with($text, '\\')) { $len = \strlen($text); $text = rtrim($text, '\\'); $text = str_replace("\0", '', $text); @@ -178,7 +178,7 @@ public function formatAndWrap(?string $message, int $width) $output .= $this->applyCurrentStyle(substr($message, $offset), $output, $width, $currentLineLength); - if (false !== strpos($output, "\0")) { + if (str_contains($output, "\0")) { return strtr($output, ["\0" => '\\', '\\<' => '<']); } diff --git a/app/vendor/symfony/console/Helper/Helper.php b/app/vendor/symfony/console/Helper/Helper.php index 881b4dc4f..cfcbbd9a1 100644 --- a/app/vendor/symfony/console/Helper/Helper.php +++ b/app/vendor/symfony/console/Helper/Helper.php @@ -42,7 +42,7 @@ public function getHelperSet() /** * Returns the length of a string, using mb_strwidth if it is available. * - * @deprecated since 5.3 + * @deprecated since Symfony 5.3 * * @return int The length of the string */ @@ -154,7 +154,7 @@ public static function formatMemory(int $memory) } /** - * @deprecated since 5.3 + * @deprecated since Symfony 5.3 */ public static function strlenWithoutDecoration(OutputFormatterInterface $formatter, ?string $string) { @@ -170,7 +170,7 @@ public static function removeDecoration(OutputFormatterInterface $formatter, ?st // remove <...> formatting $string = $formatter->format($string ?? ''); // remove already formatted characters - $string = preg_replace("/\033\[[^m]*m/", '', $string); + $string = preg_replace("/\033\[[^m]*m/", '', $string ?? ''); $formatter->setDecorated($isDecorated); return $string; diff --git a/app/vendor/symfony/console/Helper/HelperSet.php b/app/vendor/symfony/console/Helper/HelperSet.php index 5c08a7606..679dceab1 100644 --- a/app/vendor/symfony/console/Helper/HelperSet.php +++ b/app/vendor/symfony/console/Helper/HelperSet.php @@ -89,8 +89,9 @@ public function getCommand() } /** - * @return Helper[] + * @return \Traversable */ + #[\ReturnTypeWillChange] public function getIterator() { return new \ArrayIterator($this->helpers); diff --git a/app/vendor/symfony/console/Helper/ProgressBar.php b/app/vendor/symfony/console/Helper/ProgressBar.php index 91fba2b58..1c03a1d96 100644 --- a/app/vendor/symfony/console/Helper/ProgressBar.php +++ b/app/vendor/symfony/console/Helper/ProgressBar.php @@ -482,8 +482,10 @@ private function overwrite(string $message): void } $this->output->clear($lineCount); } else { - if ($this->formatLineCount > 0) { - $this->cursor->moveUp($this->formatLineCount); + for ($i = 0; $i < $this->formatLineCount; ++$i) { + $this->cursor->moveToColumn(1); + $this->cursor->clearLine(); + $this->cursor->moveUp(); } $this->cursor->moveToColumn(1); diff --git a/app/vendor/symfony/console/Helper/QuestionHelper.php b/app/vendor/symfony/console/Helper/QuestionHelper.php index becd54019..fd9095928 100644 --- a/app/vendor/symfony/console/Helper/QuestionHelper.php +++ b/app/vendor/symfony/console/Helper/QuestionHelper.php @@ -311,7 +311,7 @@ private function autocomplete(OutputInterface $output, Question $question, $inpu $matches = array_filter( $autocomplete($ret), function ($match) use ($ret) { - return '' === $ret || 0 === strpos($match, $ret); + return '' === $ret || str_starts_with($match, $ret); } ); $numMatches = \count($matches); @@ -348,7 +348,7 @@ function ($match) use ($ret) { foreach ($autocomplete($ret) as $value) { // If typed characters match the beginning chunk of value (e.g. [AcmeDe]moBundle) - if (0 === strpos($value, $tempRet)) { + if (str_starts_with($value, $tempRet)) { $matches[$numMatches++] = $value; } } @@ -374,12 +374,12 @@ function ($match) use ($ret) { private function mostRecentlyEnteredValue(string $entered): string { // Determine the most recent value that the user entered - if (false === strpos($entered, ',')) { + if (!str_contains($entered, ',')) { return $entered; } $choices = explode(',', $entered); - if (\strlen($lastChoice = trim($choices[\count($choices) - 1])) > 0) { + if ('' !== $lastChoice = trim($choices[\count($choices) - 1])) { return $lastChoice; } @@ -504,7 +504,7 @@ private function isInteractiveInput($inputStream): bool * @param resource $inputStream The handler resource * @param Question $question The question being asked * - * @return string|bool The input received, false in case input could not be read + * @return string|false The input received, false in case input could not be read */ private function readInput($inputStream, Question $question) { diff --git a/app/vendor/symfony/console/Helper/SymfonyQuestionHelper.php b/app/vendor/symfony/console/Helper/SymfonyQuestionHelper.php index fd9b703fc..01f94aba4 100644 --- a/app/vendor/symfony/console/Helper/SymfonyQuestionHelper.php +++ b/app/vendor/symfony/console/Helper/SymfonyQuestionHelper.php @@ -100,7 +100,7 @@ protected function writeError(OutputInterface $output, \Exception $error) private function getEofShortcut(): string { - if (false !== strpos(\PHP_OS, 'WIN')) { + if ('Windows' === \PHP_OS_FAMILY) { return 'Ctrl+Z then Enter'; } diff --git a/app/vendor/symfony/console/Helper/Table.php b/app/vendor/symfony/console/Helper/Table.php index a592cdff5..15c515e99 100644 --- a/app/vendor/symfony/console/Helper/Table.php +++ b/app/vendor/symfony/console/Helper/Table.php @@ -362,6 +362,7 @@ public function render() $isHeader = !$this->horizontal; $isFirstRow = $this->horizontal; + $hasTitle = (bool) $this->headerTitle; foreach ($rows as $row) { if ($divider === $row) { $isHeader = false; @@ -379,12 +380,13 @@ public function render() } if ($isHeader || $isFirstRow) { - if ($isFirstRow) { - $this->renderRowSeparator(self::SEPARATOR_TOP_BOTTOM); - $isFirstRow = false; - } else { - $this->renderRowSeparator(self::SEPARATOR_TOP, $this->headerTitle, $this->style->getHeaderTitleFormat()); - } + $this->renderRowSeparator( + $isHeader ? self::SEPARATOR_TOP : self::SEPARATOR_TOP_BOTTOM, + $hasTitle ? $this->headerTitle : null, + $hasTitle ? $this->style->getHeaderTitleFormat() : null + ); + $isFirstRow = false; + $hasTitle = false; } if ($this->horizontal) { $this->renderRow($row, $this->style->getCellRowFormat(), $this->style->getCellHeaderFormat()); @@ -596,11 +598,11 @@ private function buildTableRows(array $rows): TableRows return new TableRows(function () use ($rows, $unmergedRows): \Traversable { foreach ($rows as $rowKey => $row) { - yield $this->fillCells($row); + yield $row instanceof TableSeparator ? $row : $this->fillCells($row); if (isset($unmergedRows[$rowKey])) { - foreach ($unmergedRows[$rowKey] as $unmergedRow) { - yield $this->fillCells($unmergedRow); + foreach ($unmergedRows[$rowKey] as $row) { + yield $row instanceof TableSeparator ? $row : $this->fillCells($row); } } } @@ -681,7 +683,7 @@ private function fillNextRows(array $rows, int $line): array /** * fill cells for a row that contains colspan > 1. */ - private function fillCells($row) + private function fillCells(iterable $row) { $newRow = []; diff --git a/app/vendor/symfony/console/Input/ArgvInput.php b/app/vendor/symfony/console/Input/ArgvInput.php index 9dd4de780..a33ca3519 100644 --- a/app/vendor/symfony/console/Input/ArgvInput.php +++ b/app/vendor/symfony/console/Input/ArgvInput.php @@ -72,7 +72,7 @@ protected function parse() $this->parseArgument($token); } elseif ($parseOptions && '--' == $token) { $parseOptions = false; - } elseif ($parseOptions && 0 === strpos($token, '--')) { + } elseif ($parseOptions && str_starts_with($token, '--')) { $this->parseLongOption($token); } elseif ($parseOptions && '-' === $token[0] && '-' !== $token) { $this->parseShortOption($token); @@ -264,7 +264,7 @@ public function getFirstArgument() $isOption = false; foreach ($this->tokens as $i => $token) { if ($token && '-' === $token[0]) { - if (false !== strpos($token, '=') || !isset($this->tokens[$i + 1])) { + if (str_contains($token, '=') || !isset($this->tokens[$i + 1])) { continue; } @@ -306,8 +306,8 @@ public function hasParameterOption($values, bool $onlyParams = false) // Options with values: // For long options, test for '--option=' at beginning // For short options, test for '-o' at beginning - $leading = 0 === strpos($value, '--') ? $value.'=' : $value; - if ($token === $value || '' !== $leading && 0 === strpos($token, $leading)) { + $leading = str_starts_with($value, '--') ? $value.'=' : $value; + if ($token === $value || '' !== $leading && str_starts_with($token, $leading)) { return true; } } @@ -337,8 +337,8 @@ public function getParameterOption($values, $default = false, bool $onlyParams = // Options with values: // For long options, test for '--option=' at beginning // For short options, test for '-o' at beginning - $leading = 0 === strpos($value, '--') ? $value.'=' : $value; - if ('' !== $leading && 0 === strpos($token, $leading)) { + $leading = str_starts_with($value, '--') ? $value.'=' : $value; + if ('' !== $leading && str_starts_with($token, $leading)) { return substr($token, \strlen($leading)); } } diff --git a/app/vendor/symfony/console/Input/ArrayInput.php b/app/vendor/symfony/console/Input/ArrayInput.php index 89a7f113f..c65161484 100644 --- a/app/vendor/symfony/console/Input/ArrayInput.php +++ b/app/vendor/symfony/console/Input/ArrayInput.php @@ -133,9 +133,9 @@ protected function parse() if ('--' === $key) { return; } - if (0 === strpos($key, '--')) { + if (str_starts_with($key, '--')) { $this->addLongOption(substr($key, 2), $value); - } elseif (0 === strpos($key, '-')) { + } elseif (str_starts_with($key, '-')) { $this->addShortOption(substr($key, 1), $value); } else { $this->addArgument($key, $value); diff --git a/app/vendor/symfony/console/Input/Input.php b/app/vendor/symfony/console/Input/Input.php index 3b054c4b6..d37460ed3 100644 --- a/app/vendor/symfony/console/Input/Input.php +++ b/app/vendor/symfony/console/Input/Input.php @@ -128,7 +128,7 @@ public function setArgument(string $name, $value) /** * {@inheritdoc} */ - public function hasArgument($name) + public function hasArgument(string $name) { return $this->definition->hasArgument($name); } diff --git a/app/vendor/symfony/console/Input/InputArgument.php b/app/vendor/symfony/console/Input/InputArgument.php index 140c86d0e..085aca5a7 100644 --- a/app/vendor/symfony/console/Input/InputArgument.php +++ b/app/vendor/symfony/console/Input/InputArgument.php @@ -31,10 +31,10 @@ class InputArgument private $description; /** - * @param string $name The argument name - * @param int|null $mode The argument mode: self::REQUIRED or self::OPTIONAL - * @param string $description A description text - * @param string|string[]|null $default The default value (for self::OPTIONAL mode only) + * @param string $name The argument name + * @param int|null $mode The argument mode: self::REQUIRED or self::OPTIONAL + * @param string $description A description text + * @param string|bool|int|float|array|null $default The default value (for self::OPTIONAL mode only) * * @throws InvalidArgumentException When argument mode is not valid */ @@ -86,7 +86,7 @@ public function isArray() /** * Sets the default value. * - * @param string|string[]|null $default The default value + * @param string|bool|int|float|array|null $default * * @throws LogicException When incorrect default value is given */ @@ -110,7 +110,7 @@ public function setDefault($default = null) /** * Returns the default value. * - * @return string|string[]|null The default value + * @return string|bool|int|float|array|null */ public function getDefault() { diff --git a/app/vendor/symfony/console/Input/InputDefinition.php b/app/vendor/symfony/console/Input/InputDefinition.php index f8f8d250f..fcbfd5271 100644 --- a/app/vendor/symfony/console/Input/InputDefinition.php +++ b/app/vendor/symfony/console/Input/InputDefinition.php @@ -186,9 +186,7 @@ public function getArgumentRequiredCount() } /** - * Gets the default values. - * - * @return array An array of default values + * @return array */ public function getArgumentDefaults() { @@ -329,9 +327,7 @@ public function getOptionForShortcut(string $shortcut) } /** - * Gets an array of default values. - * - * @return array An array of all default values + * @return array */ public function getOptionDefaults() { diff --git a/app/vendor/symfony/console/Input/InputInterface.php b/app/vendor/symfony/console/Input/InputInterface.php index f6ad722a0..d01da852f 100644 --- a/app/vendor/symfony/console/Input/InputInterface.php +++ b/app/vendor/symfony/console/Input/InputInterface.php @@ -51,9 +51,9 @@ public function hasParameterOption($values, bool $onlyParams = false); * Does not necessarily return the correct result for short options * when multiple flags are combined in the same option. * - * @param string|array $values The value(s) to look for in the raw parameters (can be an array) - * @param mixed $default The default value to return if no result is found - * @param bool $onlyParams Only check real parameters, skip those following an end of options (--) signal + * @param string|array $values The value(s) to look for in the raw parameters (can be an array) + * @param string|bool|int|float|array|null $default The default value to return if no result is found + * @param bool $onlyParams Only check real parameters, skip those following an end of options (--) signal * * @return mixed The option value */ @@ -76,14 +76,14 @@ public function validate(); /** * Returns all the given arguments merged with the default values. * - * @return array + * @return array */ public function getArguments(); /** * Returns the argument value for a given argument name. * - * @return string|string[]|null The argument value + * @return mixed * * @throws InvalidArgumentException When argument given doesn't exist */ @@ -92,7 +92,7 @@ public function getArgument(string $name); /** * Sets an argument value by name. * - * @param string|string[]|null $value The argument value + * @param mixed $value The argument value * * @throws InvalidArgumentException When argument given doesn't exist */ @@ -101,23 +101,21 @@ public function setArgument(string $name, $value); /** * Returns true if an InputArgument object exists by name or position. * - * @param string|int $name The InputArgument name or position - * * @return bool true if the InputArgument object exists, false otherwise */ - public function hasArgument($name); + public function hasArgument(string $name); /** * Returns all the given options merged with the default values. * - * @return array + * @return array */ public function getOptions(); /** * Returns the option value for a given option name. * - * @return string|string[]|bool|null The option value + * @return mixed * * @throws InvalidArgumentException When option given doesn't exist */ @@ -126,7 +124,7 @@ public function getOption(string $name); /** * Sets an option value by name. * - * @param string|string[]|bool|null $value The option value + * @param mixed $value The option value * * @throws InvalidArgumentException When option given doesn't exist */ diff --git a/app/vendor/symfony/console/Input/InputOption.php b/app/vendor/symfony/console/Input/InputOption.php index 04fd788a9..72b1b74de 100644 --- a/app/vendor/symfony/console/Input/InputOption.php +++ b/app/vendor/symfony/console/Input/InputOption.php @@ -53,17 +53,17 @@ class InputOption private $description; /** - * @param string $name The option name - * @param string|array|null $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts - * @param int|null $mode The option mode: One of the VALUE_* constants - * @param string $description A description text - * @param string|string[]|bool|null $default The default value (must be null for self::VALUE_NONE) + * @param string $name The option name + * @param string|array|null $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts + * @param int|null $mode The option mode: One of the VALUE_* constants + * @param string $description A description text + * @param string|bool|int|float|array|null $default The default value (must be null for self::VALUE_NONE) * * @throws InvalidArgumentException If option mode is invalid or incompatible */ public function __construct(string $name, $shortcut = null, int $mode = null, string $description = '', $default = null) { - if (0 === strpos($name, '--')) { + if (str_starts_with($name, '--')) { $name = substr($name, 2); } @@ -175,11 +175,7 @@ public function isNegatable(): bool } /** - * Sets the default value. - * - * @param string|string[]|bool|null $default The default value - * - * @throws LogicException When incorrect default value is given + * @param string|bool|int|float|array|null $default */ public function setDefault($default = null) { @@ -201,7 +197,7 @@ public function setDefault($default = null) /** * Returns the default value. * - * @return string|string[]|bool|null The default value + * @return string|bool|int|float|array|null */ public function getDefault() { diff --git a/app/vendor/symfony/console/Input/StringInput.php b/app/vendor/symfony/console/Input/StringInput.php index 2625514ef..eb5c07fdd 100644 --- a/app/vendor/symfony/console/Input/StringInput.php +++ b/app/vendor/symfony/console/Input/StringInput.php @@ -50,9 +50,9 @@ private function tokenize(string $input): array while ($cursor < $length) { if (preg_match('/\s+/A', $input, $match, 0, $cursor)) { } elseif (preg_match('/([^="\'\s]+?)(=?)('.self::REGEX_QUOTED_STRING.'+)/A', $input, $match, 0, $cursor)) { - $tokens[] = $match[1].$match[2].stripcslashes(str_replace(['"\'', '\'"', '\'\'', '""'], '', substr($match[3], 1, \strlen($match[3]) - 2))); + $tokens[] = $match[1].$match[2].stripcslashes(str_replace(['"\'', '\'"', '\'\'', '""'], '', substr($match[3], 1, -1))); } elseif (preg_match('/'.self::REGEX_QUOTED_STRING.'/A', $input, $match, 0, $cursor)) { - $tokens[] = stripcslashes(substr($match[0], 1, \strlen($match[0]) - 2)); + $tokens[] = stripcslashes(substr($match[0], 1, -1)); } elseif (preg_match('/'.self::REGEX_STRING.'/A', $input, $match, 0, $cursor)) { $tokens[] = stripcslashes($match[1]); } else { diff --git a/app/vendor/symfony/console/Logger/ConsoleLogger.php b/app/vendor/symfony/console/Logger/ConsoleLogger.php index 4a0315656..c9ee03561 100644 --- a/app/vendor/symfony/console/Logger/ConsoleLogger.php +++ b/app/vendor/symfony/console/Logger/ConsoleLogger.php @@ -104,7 +104,7 @@ public function hasErrored() */ private function interpolate(string $message, array $context): string { - if (false === strpos($message, '{')) { + if (!str_contains($message, '{')) { return $message; } diff --git a/app/vendor/symfony/console/Output/ConsoleSectionOutput.php b/app/vendor/symfony/console/Output/ConsoleSectionOutput.php index 30ddf9496..8f1649758 100644 --- a/app/vendor/symfony/console/Output/ConsoleSectionOutput.php +++ b/app/vendor/symfony/console/Output/ConsoleSectionOutput.php @@ -92,7 +92,7 @@ public function addContent(string $input) /** * {@inheritdoc} */ - protected function doWrite($message, $newline) + protected function doWrite(string $message, bool $newline) { if (!$this->isDecorated()) { parent::doWrite($message, $newline); diff --git a/app/vendor/symfony/console/Output/Output.php b/app/vendor/symfony/console/Output/Output.php index 1b01472cd..f939f06c6 100644 --- a/app/vendor/symfony/console/Output/Output.php +++ b/app/vendor/symfony/console/Output/Output.php @@ -163,7 +163,7 @@ public function write($messages, bool $newline = false, int $options = self::OUT break; } - $this->doWrite($message, $newline); + $this->doWrite($message ?? '', $newline); } } diff --git a/app/vendor/symfony/console/Output/TrimmedBufferOutput.php b/app/vendor/symfony/console/Output/TrimmedBufferOutput.php index a03aa835f..5455c5b47 100644 --- a/app/vendor/symfony/console/Output/TrimmedBufferOutput.php +++ b/app/vendor/symfony/console/Output/TrimmedBufferOutput.php @@ -24,12 +24,7 @@ class TrimmedBufferOutput extends Output private $maxLength; private $buffer = ''; - public function __construct( - int $maxLength, - ?int $verbosity = self::VERBOSITY_NORMAL, - bool $decorated = false, - OutputFormatterInterface $formatter = null - ) { + public function __construct(int $maxLength, ?int $verbosity = self::VERBOSITY_NORMAL, bool $decorated = false, OutputFormatterInterface $formatter = null) { if ($maxLength <= 0) { throw new InvalidArgumentException(sprintf('"%s()" expects a strictly positive maxLength. Got %d.', __METHOD__, $maxLength)); } @@ -54,7 +49,7 @@ public function fetch() /** * {@inheritdoc} */ - protected function doWrite($message, $newline) + protected function doWrite(string $message, bool $newline) { $this->buffer .= $message; diff --git a/app/vendor/symfony/console/Question/Question.php b/app/vendor/symfony/console/Question/Question.php index 0b5eefd54..04d2d411d 100644 --- a/app/vendor/symfony/console/Question/Question.php +++ b/app/vendor/symfony/console/Question/Question.php @@ -33,8 +33,8 @@ class Question private $multiline = false; /** - * @param string $question The question to ask to the user - * @param mixed $default The default answer to return if the user enters nothing + * @param string $question The question to ask to the user + * @param string|bool|int|float|null $default The default answer to return if the user enters nothing */ public function __construct(string $question, $default = null) { @@ -55,7 +55,7 @@ public function getQuestion() /** * Returns the default answer. * - * @return mixed + * @return string|bool|int|float|null */ public function getDefault() { @@ -95,13 +95,11 @@ public function isHidden() /** * Sets whether the user response must be hidden or not. * - * @param bool $hidden - * * @return $this * * @throws LogicException In case the autocompleter is also used */ - public function setHidden($hidden) + public function setHidden(bool $hidden) { if ($this->autocompleterCallback) { throw new LogicException('A hidden question cannot use the autocompleter.'); @@ -125,11 +123,9 @@ public function isHiddenFallback() /** * Sets whether to fallback on non-hidden question if the response can not be hidden. * - * @param bool $fallback - * * @return $this */ - public function setHiddenFallback($fallback) + public function setHiddenFallback(bool $fallback) { $this->hiddenFallback = (bool) $fallback; diff --git a/app/vendor/symfony/console/Style/StyleInterface.php b/app/vendor/symfony/console/Style/StyleInterface.php index afb841c0d..38d23b77e 100644 --- a/app/vendor/symfony/console/Style/StyleInterface.php +++ b/app/vendor/symfony/console/Style/StyleInterface.php @@ -85,7 +85,7 @@ public function table(array $headers, array $rows); * * @return mixed */ - public function ask(string $question, ?string $default = null, callable $validator = null); + public function ask(string $question, string $default = null, callable $validator = null); /** * Asks a question with the user input hidden. diff --git a/app/vendor/symfony/console/Style/SymfonyStyle.php b/app/vendor/symfony/console/Style/SymfonyStyle.php index 045e8b606..3e67213e9 100644 --- a/app/vendor/symfony/console/Style/SymfonyStyle.php +++ b/app/vendor/symfony/console/Style/SymfonyStyle.php @@ -59,7 +59,7 @@ public function __construct(InputInterface $input, OutputInterface $output) * * @param string|array $messages The message to write in the block */ - public function block($messages, ?string $type = null, ?string $style = null, string $prefix = ' ', bool $padding = false, bool $escape = true) + public function block($messages, string $type = null, string $style = null, string $prefix = ' ', bool $padding = false, bool $escape = true) { $messages = \is_array($messages) ? array_values($messages) : [$messages]; @@ -264,7 +264,7 @@ public function definitionList(...$list) /** * {@inheritdoc} */ - public function ask(string $question, ?string $default = null, $validator = null) + public function ask(string $question, string $default = null, callable $validator = null) { $question = new Question($question, $default); $question->setValidator($validator); @@ -275,7 +275,7 @@ public function ask(string $question, ?string $default = null, $validator = null /** * {@inheritdoc} */ - public function askHidden(string $question, $validator = null) + public function askHidden(string $question, callable $validator = null) { $question = new Question($question); @@ -288,7 +288,7 @@ public function askHidden(string $question, $validator = null) /** * {@inheritdoc} */ - public function confirm($question, $default = true) + public function confirm(string $question, bool $default = true) { return $this->askQuestion(new ConfirmationQuestion($question, $default)); } @@ -447,7 +447,7 @@ private function autoPrependText(): void { $fetched = $this->bufferedOutput->fetch(); //Prepend new line if last char isn't EOL: - if ("\n" !== substr($fetched, -1)) { + if (!str_ends_with($fetched, "\n")) { $this->newLine(); } } diff --git a/app/vendor/symfony/console/composer.json b/app/vendor/symfony/console/composer.json index fa720142a..7598179c3 100644 --- a/app/vendor/symfony/console/composer.json +++ b/app/vendor/symfony/console/composer.json @@ -20,7 +20,7 @@ "symfony/deprecation-contracts": "^2.1", "symfony/polyfill-mbstring": "~1.0", "symfony/polyfill-php73": "^1.8", - "symfony/polyfill-php80": "^1.15", + "symfony/polyfill-php80": "^1.16", "symfony/service-contracts": "^1.1|^2", "symfony/string": "^5.1" }, @@ -31,10 +31,10 @@ "symfony/lock": "^4.4|^5.0", "symfony/process": "^4.4|^5.0", "symfony/var-dumper": "^4.4|^5.0", - "psr/log": "~1.0" + "psr/log": "^1|^2" }, "provide": { - "psr/log-implementation": "1.0" + "psr/log-implementation": "1.0|2.0" }, "suggest": { "symfony/event-dispatcher": "", @@ -43,6 +43,7 @@ "psr/log": "For using the console logger" }, "conflict": { + "psr/log": ">=3", "symfony/dependency-injection": "<4.4", "symfony/dotenv": "<5.1", "symfony/event-dispatcher": "<4.4", diff --git a/app/vendor/symfony/filesystem/Filesystem.php b/app/vendor/symfony/filesystem/Filesystem.php index aff19d14a..4e70c3222 100644 --- a/app/vendor/symfony/filesystem/Filesystem.php +++ b/app/vendor/symfony/filesystem/Filesystem.php @@ -199,7 +199,7 @@ private static function doRemove(array $files, bool $isRecursive): void throw new IOException(sprintf('Failed to remove directory "%s": ', $file).$lastError); } - } elseif (!self::box('unlink', $file) && (false !== strpos(self::$lastError, 'Permission denied') || file_exists($file))) { + } elseif (!self::box('unlink', $file) && (str_contains(self::$lastError, 'Permission denied') || file_exists($file))) { throw new IOException(sprintf('Failed to remove file "%s": ', $file).self::$lastError); } } @@ -392,7 +392,7 @@ public function hardlink(string $originFile, $targetFiles) private function linkException(string $origin, string $target, string $linkType) { if (self::$lastError) { - if ('\\' === \DIRECTORY_SEPARATOR && false !== strpos(self::$lastError, 'error code(1314)')) { + if ('\\' === \DIRECTORY_SEPARATOR && str_contains(self::$lastError, 'error code(1314)')) { throw new IOException(sprintf('Unable to create "%s" link due to error code 1314: \'A required privilege is not held by the client\'. Do you have the required Administrator-rights?', $linkType), 0, null, $target); } } @@ -714,7 +714,7 @@ public function appendToFile(string $filename, $content) private function toIterable($files): iterable { - return \is_array($files) || $files instanceof \Traversable ? $files : [$files]; + return is_iterable($files) ? $files : [$files]; } /** @@ -751,7 +751,7 @@ private static function box(callable $func, ...$args) /** * @internal */ - public static function handleError($type, $msg) + public static function handleError(int $type, string $msg) { self::$lastError = $msg; } diff --git a/app/vendor/symfony/filesystem/composer.json b/app/vendor/symfony/filesystem/composer.json index c61b78cc8..a6c17a1e5 100644 --- a/app/vendor/symfony/filesystem/composer.json +++ b/app/vendor/symfony/filesystem/composer.json @@ -17,7 +17,8 @@ ], "require": { "php": ">=7.2.5", - "symfony/polyfill-ctype": "~1.8" + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-php80": "^1.16" }, "autoload": { "psr-4": { "Symfony\\Component\\Filesystem\\": "" }, diff --git a/app/vendor/symfony/finder/Finder.php b/app/vendor/symfony/finder/Finder.php index b5a3b964d..c9bd21fe4 100644 --- a/app/vendor/symfony/finder/Finder.php +++ b/app/vendor/symfony/finder/Finder.php @@ -605,6 +605,7 @@ public function in($dirs) * * @throws \LogicException if the in() method has not been called */ + #[\ReturnTypeWillChange] public function getIterator() { if (0 === \count($this->dirs) && 0 === \count($this->iterators)) { @@ -654,7 +655,7 @@ public function append(iterable $iterator) $this->iterators[] = $iterator->getIterator(); } elseif ($iterator instanceof \Iterator) { $this->iterators[] = $iterator; - } elseif ($iterator instanceof \Traversable || \is_array($iterator)) { + } elseif (is_iterable($iterator)) { $it = new \ArrayIterator(); foreach ($iterator as $file) { $file = $file instanceof \SplFileInfo ? $file : new \SplFileInfo($file); @@ -687,6 +688,7 @@ public function hasResults() * * @return int */ + #[\ReturnTypeWillChange] public function count() { return iterator_count($this->getIterator()); diff --git a/app/vendor/symfony/finder/Gitignore.php b/app/vendor/symfony/finder/Gitignore.php index 304aba9e5..491f588ee 100644 --- a/app/vendor/symfony/finder/Gitignore.php +++ b/app/vendor/symfony/finder/Gitignore.php @@ -78,6 +78,6 @@ private static function lineToRegex(string $gitignoreLine): string return ($isAbsolute ? '' : '(?:[^/]+/)*') .$regex - .('/' !== substr($gitignoreLine, -1) ? '(?:$|/)' : ''); + .(!str_ends_with($gitignoreLine, '/') ? '(?:$|/)' : ''); } } diff --git a/app/vendor/symfony/finder/Iterator/CustomFilterIterator.php b/app/vendor/symfony/finder/Iterator/CustomFilterIterator.php index a30bbd0b9..f85cb7bff 100644 --- a/app/vendor/symfony/finder/Iterator/CustomFilterIterator.php +++ b/app/vendor/symfony/finder/Iterator/CustomFilterIterator.php @@ -46,6 +46,7 @@ public function __construct(\Iterator $iterator, array $filters) * * @return bool true if the value should be kept, false otherwise */ + #[\ReturnTypeWillChange] public function accept() { $fileinfo = $this->current(); diff --git a/app/vendor/symfony/finder/Iterator/DateRangeFilterIterator.php b/app/vendor/symfony/finder/Iterator/DateRangeFilterIterator.php index 2e97e00d3..90616f471 100644 --- a/app/vendor/symfony/finder/Iterator/DateRangeFilterIterator.php +++ b/app/vendor/symfony/finder/Iterator/DateRangeFilterIterator.php @@ -38,6 +38,7 @@ public function __construct(\Iterator $iterator, array $comparators) * * @return bool true if the value should be kept, false otherwise */ + #[\ReturnTypeWillChange] public function accept() { $fileinfo = $this->current(); diff --git a/app/vendor/symfony/finder/Iterator/DepthRangeFilterIterator.php b/app/vendor/symfony/finder/Iterator/DepthRangeFilterIterator.php index 18e751d77..e96fefd96 100644 --- a/app/vendor/symfony/finder/Iterator/DepthRangeFilterIterator.php +++ b/app/vendor/symfony/finder/Iterator/DepthRangeFilterIterator.php @@ -38,6 +38,7 @@ public function __construct(\RecursiveIteratorIterator $iterator, int $minDepth * * @return bool true if the value should be kept, false otherwise */ + #[\ReturnTypeWillChange] public function accept() { return $this->getInnerIterator()->getDepth() >= $this->minDepth; diff --git a/app/vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php b/app/vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php index 6a1b291ad..cf9e67877 100644 --- a/app/vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php +++ b/app/vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php @@ -34,7 +34,7 @@ public function __construct(\Iterator $iterator, array $directories) $patterns = []; foreach ($directories as $directory) { $directory = rtrim($directory, '/'); - if (!$this->isRecursive || false !== strpos($directory, '/')) { + if (!$this->isRecursive || str_contains($directory, '/')) { $patterns[] = preg_quote($directory, '#'); } else { $this->excludedDirs[$directory] = true; @@ -52,6 +52,7 @@ public function __construct(\Iterator $iterator, array $directories) * * @return bool True if the value should be kept, false otherwise */ + #[\ReturnTypeWillChange] public function accept() { if ($this->isRecursive && isset($this->excludedDirs[$this->getFilename()]) && $this->isDir()) { @@ -71,11 +72,16 @@ public function accept() /** * @return bool */ + #[\ReturnTypeWillChange] public function hasChildren() { return $this->isRecursive && $this->iterator->hasChildren(); } + /** + * @return self + */ + #[\ReturnTypeWillChange] public function getChildren() { $children = new self($this->iterator->getChildren(), []); diff --git a/app/vendor/symfony/finder/Iterator/FileTypeFilterIterator.php b/app/vendor/symfony/finder/Iterator/FileTypeFilterIterator.php index 0ea2c5088..d054cefb9 100644 --- a/app/vendor/symfony/finder/Iterator/FileTypeFilterIterator.php +++ b/app/vendor/symfony/finder/Iterator/FileTypeFilterIterator.php @@ -39,6 +39,7 @@ public function __construct(\Iterator $iterator, int $mode) * * @return bool true if the value should be kept, false otherwise */ + #[\ReturnTypeWillChange] public function accept() { $fileinfo = $this->current(); diff --git a/app/vendor/symfony/finder/Iterator/FilecontentFilterIterator.php b/app/vendor/symfony/finder/Iterator/FilecontentFilterIterator.php index b26a36848..9493b5e87 100644 --- a/app/vendor/symfony/finder/Iterator/FilecontentFilterIterator.php +++ b/app/vendor/symfony/finder/Iterator/FilecontentFilterIterator.php @@ -24,6 +24,7 @@ class FilecontentFilterIterator extends MultiplePcreFilterIterator * * @return bool true if the value should be kept, false otherwise */ + #[\ReturnTypeWillChange] public function accept() { if (!$this->matchRegexps && !$this->noMatchRegexps) { diff --git a/app/vendor/symfony/finder/Iterator/FilenameFilterIterator.php b/app/vendor/symfony/finder/Iterator/FilenameFilterIterator.php index dedd1ca55..137c2c443 100644 --- a/app/vendor/symfony/finder/Iterator/FilenameFilterIterator.php +++ b/app/vendor/symfony/finder/Iterator/FilenameFilterIterator.php @@ -25,6 +25,7 @@ class FilenameFilterIterator extends MultiplePcreFilterIterator * * @return bool true if the value should be kept, false otherwise */ + #[\ReturnTypeWillChange] public function accept() { return $this->isAccepted($this->current()->getFilename()); diff --git a/app/vendor/symfony/finder/Iterator/PathFilterIterator.php b/app/vendor/symfony/finder/Iterator/PathFilterIterator.php index 67b71f46d..1d09c2674 100644 --- a/app/vendor/symfony/finder/Iterator/PathFilterIterator.php +++ b/app/vendor/symfony/finder/Iterator/PathFilterIterator.php @@ -24,6 +24,7 @@ class PathFilterIterator extends MultiplePcreFilterIterator * * @return bool true if the value should be kept, false otherwise */ + #[\ReturnTypeWillChange] public function accept() { $filename = $this->current()->getRelativePathname(); diff --git a/app/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php b/app/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php index 7616b14a2..a18e6185b 100644 --- a/app/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php +++ b/app/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php @@ -58,6 +58,7 @@ public function __construct(string $path, int $flags, bool $ignoreUnreadableDirs * * @return SplFileInfo File information */ + #[\ReturnTypeWillChange] public function current() { // the logic here avoids redoing the same work in all iterations @@ -82,6 +83,7 @@ public function current() * * @throws AccessDeniedException */ + #[\ReturnTypeWillChange] public function getChildren() { try { @@ -109,7 +111,10 @@ public function getChildren() /** * Do nothing for non rewindable stream. + * + * @return void */ + #[\ReturnTypeWillChange] public function rewind() { if (false === $this->isRewindable()) { diff --git a/app/vendor/symfony/finder/Iterator/SizeRangeFilterIterator.php b/app/vendor/symfony/finder/Iterator/SizeRangeFilterIterator.php index 2aeef67b8..4078f3692 100644 --- a/app/vendor/symfony/finder/Iterator/SizeRangeFilterIterator.php +++ b/app/vendor/symfony/finder/Iterator/SizeRangeFilterIterator.php @@ -38,6 +38,7 @@ public function __construct(\Iterator $iterator, array $comparators) * * @return bool true if the value should be kept, false otherwise */ + #[\ReturnTypeWillChange] public function accept() { $fileinfo = $this->current(); diff --git a/app/vendor/symfony/finder/Iterator/SortableIterator.php b/app/vendor/symfony/finder/Iterator/SortableIterator.php index 74c8db264..04ca8ebf2 100644 --- a/app/vendor/symfony/finder/Iterator/SortableIterator.php +++ b/app/vendor/symfony/finder/Iterator/SortableIterator.php @@ -30,8 +30,7 @@ class SortableIterator implements \IteratorAggregate private $sort; /** - * @param \Traversable $iterator The Iterator to filter - * @param int|callable $sort The sort type (SORT_BY_NAME, SORT_BY_TYPE, or a PHP callback) + * @param int|callable $sort The sort type (SORT_BY_NAME, SORT_BY_TYPE, or a PHP callback) * * @throws \InvalidArgumentException */ @@ -82,6 +81,7 @@ public function __construct(\Traversable $iterator, $sort, bool $reverseOrder = /** * @return \Traversable */ + #[\ReturnTypeWillChange] public function getIterator() { if (1 === $this->sort) { diff --git a/app/vendor/symfony/finder/composer.json b/app/vendor/symfony/finder/composer.json index dc097b3c3..deccde83b 100644 --- a/app/vendor/symfony/finder/composer.json +++ b/app/vendor/symfony/finder/composer.json @@ -16,7 +16,8 @@ } ], "require": { - "php": ">=7.2.5" + "php": ">=7.2.5", + "symfony/polyfill-php80": "^1.16" }, "autoload": { "psr-4": { "Symfony\\Component\\Finder\\": "" }, diff --git a/app/vendor/symfony/polyfill-intl-grapheme/Grapheme.php b/app/vendor/symfony/polyfill-intl-grapheme/Grapheme.php index b42df8e57..572da5df6 100644 --- a/app/vendor/symfony/polyfill-intl-grapheme/Grapheme.php +++ b/app/vendor/symfony/polyfill-intl-grapheme/Grapheme.php @@ -37,6 +37,11 @@ final class Grapheme // This regular expression is a work around for http://bugs.exim.org/1279 public const GRAPHEME_CLUSTER_RX = '(?:\r\n|(?:[ -~\x{200C}\x{200D}]|[ᆨ-ᇹ]+|[ᄀ-ᅟ]*(?:[가개갸걔거게겨계고과괘괴교구궈궤귀규그긔기까깨꺄꺠꺼께껴꼐꼬꽈꽤꾀꾜꾸꿔꿰뀌뀨끄끠끼나내냐냬너네녀녜노놔놰뇌뇨누눠눼뉘뉴느늬니다대댜댸더데뎌뎨도돠돼되됴두둬뒈뒤듀드듸디따때땨떄떠떼뗘뗴또똬뙈뙤뚀뚜뚸뛔뛰뜌뜨띄띠라래랴럐러레려례로롸뢔뢰료루뤄뤠뤼류르릐리마매먀먜머메며몌모뫄뫠뫼묘무뭐뭬뮈뮤므믜미바배뱌뱨버베벼볘보봐봬뵈뵤부붜붸뷔뷰브븨비빠빼뺘뺴뻐뻬뼈뼤뽀뽜뽸뾔뾰뿌뿨쀄쀠쀼쁘쁴삐사새샤섀서세셔셰소솨쇄쇠쇼수숴쉐쉬슈스싀시싸쌔쌰썌써쎄쎠쎼쏘쏴쐐쐬쑈쑤쒀쒜쒸쓔쓰씌씨아애야얘어에여예오와왜외요우워웨위유으의이자재쟈쟤저제져졔조좌좨죄죠주줘줴쥐쥬즈즤지짜째쨔쨰쩌쩨쪄쪠쪼쫘쫴쬐쬬쭈쭤쮀쮜쮸쯔쯰찌차채챠챼처체쳐쳬초촤쵀최쵸추춰췌취츄츠츼치카캐캬컈커케켜켸코콰쾌쾨쿄쿠쿼퀘퀴큐크킈키타태탸턔터테텨톄토톼퇘퇴툐투퉈퉤튀튜트틔티파패퍄퍠퍼페펴폐포퐈퐤푀표푸풔풰퓌퓨프픠피하해햐햬허헤혀혜호화홰회효후훠훼휘휴흐희히]?[ᅠ-ᆢ]+|[가-힣])[ᆨ-ᇹ]*|[ᄀ-ᅟ]+|[^\p{Cc}\p{Cf}\p{Zl}\p{Zp}])[\p{Mn}\p{Me}\x{09BE}\x{09D7}\x{0B3E}\x{0B57}\x{0BBE}\x{0BD7}\x{0CC2}\x{0CD5}\x{0CD6}\x{0D3E}\x{0D57}\x{0DCF}\x{0DDF}\x{200C}\x{200D}\x{1D165}\x{1D16E}-\x{1D172}]*|[\p{Cc}\p{Cf}\p{Zl}\p{Zp}])'; + private const CASE_FOLD = [ + ['µ', 'ſ', "\xCD\x85", 'ς', "\xCF\x90", "\xCF\x91", "\xCF\x95", "\xCF\x96", "\xCF\xB0", "\xCF\xB1", "\xCF\xB5", "\xE1\xBA\x9B", "\xE1\xBE\xBE"], + ['μ', 's', 'ι', 'σ', 'β', 'θ', 'φ', 'π', 'κ', 'ρ', 'ε', "\xE1\xB9\xA1", 'ι'], + ]; + public static function grapheme_extract($s, $size, $type = \GRAPHEME_EXTR_COUNT, $start = 0, &$next = 0) { if (0 > $start) { @@ -222,9 +227,14 @@ private static function grapheme_position($s, $needle, $offset, $mode) // Use the same case folding mode as mbstring does for mb_stripos(). // Stick to SIMPLE case folding to avoid changing the length of the string, which // might result in offsets being shifted. - $mode = \defined('MB_CASE_FOLD_SIMPLE') ? \MB_CASE_FOLD_SIMPLE : \MB_CASE_UPPER; + $mode = \defined('MB_CASE_FOLD_SIMPLE') ? \MB_CASE_FOLD_SIMPLE : \MB_CASE_LOWER; $s = mb_convert_case($s, $mode, 'UTF-8'); $needle = mb_convert_case($needle, $mode, 'UTF-8'); + + if (!\defined('MB_CASE_FOLD_SIMPLE')) { + $s = str_replace(self::CASE_FOLD[0], self::CASE_FOLD[1], $s); + $needle = str_replace(self::CASE_FOLD[0], self::CASE_FOLD[1], $needle); + } } if ($reverse) { $needlePos = strrpos($s, $needle); diff --git a/app/vendor/symfony/polyfill-mbstring/Mbstring.php b/app/vendor/symfony/polyfill-mbstring/Mbstring.php index c31611fb8..b59909563 100644 --- a/app/vendor/symfony/polyfill-mbstring/Mbstring.php +++ b/app/vendor/symfony/polyfill-mbstring/Mbstring.php @@ -69,14 +69,15 @@ final class Mbstring { public const MB_CASE_FOLD = \PHP_INT_MAX; - private static $encodingList = ['ASCII', 'UTF-8']; - private static $language = 'neutral'; - private static $internalEncoding = 'UTF-8'; - private static $caseFold = [ + private const CASE_FOLD = [ ['µ', 'ſ', "\xCD\x85", 'ς', "\xCF\x90", "\xCF\x91", "\xCF\x95", "\xCF\x96", "\xCF\xB0", "\xCF\xB1", "\xCF\xB5", "\xE1\xBA\x9B", "\xE1\xBE\xBE"], ['μ', 's', 'ι', 'σ', 'β', 'θ', 'φ', 'π', 'κ', 'ρ', 'ε', "\xE1\xB9\xA1", 'ι'], ]; + private static $encodingList = ['ASCII', 'UTF-8']; + private static $language = 'neutral'; + private static $internalEncoding = 'UTF-8'; + public static function mb_convert_encoding($s, $toEncoding, $fromEncoding = null) { if (\is_array($fromEncoding) || false !== strpos($fromEncoding, ',')) { @@ -300,7 +301,7 @@ public static function mb_convert_case($s, $mode, $encoding = null) $map = $upper; } else { if (self::MB_CASE_FOLD === $mode) { - $s = str_replace(self::$caseFold[0], self::$caseFold[1], $s); + $s = str_replace(self::CASE_FOLD[0], self::CASE_FOLD[1], $s); } static $lower = null; diff --git a/app/vendor/symfony/polyfill-php80/README.md b/app/vendor/symfony/polyfill-php80/README.md index eaa3050ab..10b8ee49a 100644 --- a/app/vendor/symfony/polyfill-php80/README.md +++ b/app/vendor/symfony/polyfill-php80/README.md @@ -16,7 +16,7 @@ This component provides features added to PHP 8.0 core: - [`get_resource_id`](https://php.net/get_resource_id) More information can be found in the -[main Polyfill README](https://github.com/symfony/polyfill/blob/master/README.md). +[main Polyfill README](https://github.com/symfony/polyfill/blob/main/README.md). License ======= diff --git a/app/vendor/symfony/polyfill-php80/bootstrap.php b/app/vendor/symfony/polyfill-php80/bootstrap.php index 4f791f9e3..e5f7dbc1a 100644 --- a/app/vendor/symfony/polyfill-php80/bootstrap.php +++ b/app/vendor/symfony/polyfill-php80/bootstrap.php @@ -26,13 +26,13 @@ function fdiv(float $num1, float $num2): float { return p\Php80::fdiv($num1, $nu function preg_last_error_msg(): string { return p\Php80::preg_last_error_msg(); } } if (!function_exists('str_contains')) { - function str_contains(string $haystack, string $needle): bool { return p\Php80::str_contains($haystack, $needle); } + function str_contains(?string $haystack, ?string $needle): bool { return p\Php80::str_contains($haystack ?? '', $needle ?? ''); } } if (!function_exists('str_starts_with')) { - function str_starts_with(string $haystack, string $needle): bool { return p\Php80::str_starts_with($haystack, $needle); } + function str_starts_with(?string $haystack, ?string $needle): bool { return p\Php80::str_starts_with($haystack ?? '', $needle ?? ''); } } if (!function_exists('str_ends_with')) { - function str_ends_with(string $haystack, string $needle): bool { return p\Php80::str_ends_with($haystack, $needle); } + function str_ends_with(?string $haystack, ?string $needle): bool { return p\Php80::str_ends_with($haystack ?? '', $needle ?? ''); } } if (!function_exists('get_debug_type')) { function get_debug_type($value): string { return p\Php80::get_debug_type($value); } diff --git a/app/vendor/symfony/process/InputStream.php b/app/vendor/symfony/process/InputStream.php index c86fca868..4f8f71331 100644 --- a/app/vendor/symfony/process/InputStream.php +++ b/app/vendor/symfony/process/InputStream.php @@ -69,6 +69,7 @@ public function isClosed() /** * @return \Traversable */ + #[\ReturnTypeWillChange] public function getIterator() { $this->open = true; diff --git a/app/vendor/symfony/process/Pipes/AbstractPipes.php b/app/vendor/symfony/process/Pipes/AbstractPipes.php index 77636c2a6..2d1458725 100644 --- a/app/vendor/symfony/process/Pipes/AbstractPipes.php +++ b/app/vendor/symfony/process/Pipes/AbstractPipes.php @@ -171,7 +171,7 @@ protected function write(): ?array /** * @internal */ - public function handleError($type, $msg) + public function handleError(int $type, string $msg) { $this->lastError = $msg; } diff --git a/app/vendor/symfony/process/Pipes/UnixPipes.php b/app/vendor/symfony/process/Pipes/UnixPipes.php index 7cb5bab76..58a8da07c 100644 --- a/app/vendor/symfony/process/Pipes/UnixPipes.php +++ b/app/vendor/symfony/process/Pipes/UnixPipes.php @@ -35,6 +35,9 @@ public function __construct(?bool $ttyMode, bool $ptyMode, $input, bool $haveRea parent::__construct($input); } + /** + * @return array + */ public function __sleep() { throw new \BadMethodCallException('Cannot serialize '.__CLASS__); diff --git a/app/vendor/symfony/process/Pipes/WindowsPipes.php b/app/vendor/symfony/process/Pipes/WindowsPipes.php index 3a1ef405f..69768f3d8 100644 --- a/app/vendor/symfony/process/Pipes/WindowsPipes.php +++ b/app/vendor/symfony/process/Pipes/WindowsPipes.php @@ -88,6 +88,9 @@ public function __construct($input, bool $haveReadSupport) parent::__construct($input); } + /** + * @return array + */ public function __sleep() { throw new \BadMethodCallException('Cannot serialize '.__CLASS__); diff --git a/app/vendor/symfony/process/Process.php b/app/vendor/symfony/process/Process.php index 877f16cd3..a541cd66a 100644 --- a/app/vendor/symfony/process/Process.php +++ b/app/vendor/symfony/process/Process.php @@ -195,6 +195,9 @@ public static function fromShellCommandline(string $command, string $cwd = null, return $process; } + /** + * @return array + */ public function __sleep() { throw new \BadMethodCallException('Cannot serialize '.__CLASS__); @@ -617,6 +620,7 @@ public function getIncrementalOutput() * * @return \Generator */ + #[\ReturnTypeWillChange] public function getIterator(int $flags = 0) { $this->readPipesForOutput(__FUNCTION__, false); @@ -1383,7 +1387,7 @@ protected function isSigchildEnabled() ob_start(); phpinfo(\INFO_GENERAL); - return self::$sigchild = false !== strpos(ob_get_clean(), '--enable-sigchild'); + return self::$sigchild = str_contains(ob_get_clean(), '--enable-sigchild'); } /** @@ -1570,7 +1574,7 @@ function ($m) use (&$env, &$varCache, &$varCount, $uid) { if (isset($varCache[$m[0]])) { return $varCache[$m[0]]; } - if (false !== strpos($value = $m[1], "\0")) { + if (str_contains($value = $m[1], "\0")) { $value = str_replace("\0", '?', $value); } if (false === strpbrk($value, "\"%!\n")) { @@ -1631,7 +1635,7 @@ private function escapeArgument(?string $argument): string if ('\\' !== \DIRECTORY_SEPARATOR) { return "'".str_replace("'", "'\\''", $argument)."'"; } - if (false !== strpos($argument, "\0")) { + if (str_contains($argument, "\0")) { $argument = str_replace("\0", '?', $argument); } if (!preg_match('/[\/()%!^"<>&|\s]/', $argument)) { diff --git a/app/vendor/symfony/process/composer.json b/app/vendor/symfony/process/composer.json index d90078c3c..1669eba57 100644 --- a/app/vendor/symfony/process/composer.json +++ b/app/vendor/symfony/process/composer.json @@ -17,7 +17,7 @@ ], "require": { "php": ">=7.2.5", - "symfony/polyfill-php80": "^1.15" + "symfony/polyfill-php80": "^1.16" }, "autoload": { "psr-4": { "Symfony\\Component\\Process\\": "" }, diff --git a/app/vendor/symfony/var-dumper/Caster/ClassStub.php b/app/vendor/symfony/var-dumper/Caster/ClassStub.php index 612a7ca2d..48f848354 100644 --- a/app/vendor/symfony/var-dumper/Caster/ClassStub.php +++ b/app/vendor/symfony/var-dumper/Caster/ClassStub.php @@ -55,7 +55,7 @@ public function __construct(string $identifier, $callable = null) } } - if (false !== strpos($identifier, "@anonymous\0")) { + if (str_contains($identifier, "@anonymous\0")) { $this->value = $identifier = preg_replace_callback('/[a-zA-Z_\x7f-\xff][\\\\a-zA-Z0-9_\x7f-\xff]*+@anonymous\x00.*?\.php(?:0x?|:[0-9]++\$)[0-9a-fA-F]++/', function ($m) { return class_exists($m[0], false) ? (get_parent_class($m[0]) ?: key(class_implements($m[0])) ?: 'class').'@anonymous' : $m[0]; }, $identifier); @@ -65,7 +65,7 @@ public function __construct(string $identifier, $callable = null) $s = ReflectionCaster::castFunctionAbstract($r, [], new Stub(), true, Caster::EXCLUDE_VERBOSE); $s = ReflectionCaster::getSignature($s); - if ('()' === substr($identifier, -2)) { + if (str_ends_with($identifier, '()')) { $this->value = substr_replace($identifier, $s, -2); } else { $this->value .= $s; diff --git a/app/vendor/symfony/var-dumper/Caster/DOMCaster.php b/app/vendor/symfony/var-dumper/Caster/DOMCaster.php index 5644e489f..4dd16e0ee 100644 --- a/app/vendor/symfony/var-dumper/Caster/DOMCaster.php +++ b/app/vendor/symfony/var-dumper/Caster/DOMCaster.php @@ -82,7 +82,7 @@ public static function castLength($dom, array $a, Stub $stub, bool $isNested) return $a; } - public static function castImplementation($dom, array $a, Stub $stub, bool $isNested) + public static function castImplementation(\DOMImplementation $dom, array $a, Stub $stub, bool $isNested) { $a += [ Caster::PREFIX_VIRTUAL.'Core' => '1.0', diff --git a/app/vendor/symfony/var-dumper/Caster/ExceptionCaster.php b/app/vendor/symfony/var-dumper/Caster/ExceptionCaster.php index 437db26d2..baa7a180b 100644 --- a/app/vendor/symfony/var-dumper/Caster/ExceptionCaster.php +++ b/app/vendor/symfony/var-dumper/Caster/ExceptionCaster.php @@ -149,7 +149,7 @@ public static function castTraceStub(TraceStub $trace, array $a, Stub $stub, boo $f = self::castFrameStub($frame, [], $frame, true); if (isset($f[$prefix.'src'])) { foreach ($f[$prefix.'src']->value as $label => $frame) { - if (0 === strpos($label, "\0~collapse=0")) { + if (str_starts_with($label, "\0~collapse=0")) { if ($collapse) { $label = substr_replace($label, '1', 11, 1); } else { @@ -281,7 +281,7 @@ private static function filterExceptionArray(string $xClass, array $a, string $x } unset($a[$xPrefix.'string'], $a[Caster::PREFIX_DYNAMIC.'xdebug_message'], $a[Caster::PREFIX_DYNAMIC.'__destructorException']); - if (isset($a[Caster::PREFIX_PROTECTED.'message']) && false !== strpos($a[Caster::PREFIX_PROTECTED.'message'], "@anonymous\0")) { + if (isset($a[Caster::PREFIX_PROTECTED.'message']) && str_contains($a[Caster::PREFIX_PROTECTED.'message'], "@anonymous\0")) { $a[Caster::PREFIX_PROTECTED.'message'] = preg_replace_callback('/[a-zA-Z_\x7f-\xff][\\\\a-zA-Z0-9_\x7f-\xff]*+@anonymous\x00.*?\.php(?:0x?|:[0-9]++\$)[0-9a-fA-F]++/', function ($m) { return class_exists($m[0], false) ? (get_parent_class($m[0]) ?: key(class_implements($m[0])) ?: 'class').'@anonymous' : $m[0]; }, $a[Caster::PREFIX_PROTECTED.'message']); diff --git a/app/vendor/symfony/var-dumper/Caster/LinkStub.php b/app/vendor/symfony/var-dumper/Caster/LinkStub.php index 0aa076a26..7e0780339 100644 --- a/app/vendor/symfony/var-dumper/Caster/LinkStub.php +++ b/app/vendor/symfony/var-dumper/Caster/LinkStub.php @@ -23,7 +23,7 @@ class LinkStub extends ConstStub private static $vendorRoots; private static $composerRoots; - public function __construct($label, int $line = 0, $href = null) + public function __construct(string $label, int $line = 0, string $href = null) { $this->value = $label; @@ -33,12 +33,12 @@ public function __construct($label, int $line = 0, $href = null) if (!\is_string($href)) { return; } - if (0 === strpos($href, 'file://')) { + if (str_starts_with($href, 'file://')) { if ($href === $label) { $label = substr($label, 7); } $href = substr($href, 7); - } elseif (false !== strpos($href, '://')) { + } elseif (str_contains($href, '://')) { $this->attr['href'] = $href; return; @@ -69,7 +69,7 @@ private function getComposerRoot(string $file, bool &$inVendor) self::$vendorRoots = []; foreach (get_declared_classes() as $class) { - if ('C' === $class[0] && 0 === strpos($class, 'ComposerAutoloaderInit')) { + if ('C' === $class[0] && str_starts_with($class, 'ComposerAutoloaderInit')) { $r = new \ReflectionClass($class); $v = \dirname($r->getFileName(), 2); if (is_file($v.'/composer/installed.json')) { @@ -85,7 +85,7 @@ private function getComposerRoot(string $file, bool &$inVendor) } foreach (self::$vendorRoots as $root) { - if ($inVendor = 0 === strpos($file, $root)) { + if ($inVendor = str_starts_with($file, $root)) { return $root; } } diff --git a/app/vendor/symfony/var-dumper/Caster/MemcachedCaster.php b/app/vendor/symfony/var-dumper/Caster/MemcachedCaster.php index 111b0607e..cfef19acc 100644 --- a/app/vendor/symfony/var-dumper/Caster/MemcachedCaster.php +++ b/app/vendor/symfony/var-dumper/Caster/MemcachedCaster.php @@ -71,7 +71,7 @@ private static function getOptionConstants(): array $optionConstants = []; foreach ($reflectedMemcached->getConstants() as $constantKey => $value) { - if (0 === strpos($constantKey, 'OPT_')) { + if (str_starts_with($constantKey, 'OPT_')) { $optionConstants[$constantKey] = $value; } } diff --git a/app/vendor/symfony/var-dumper/Caster/RdKafkaCaster.php b/app/vendor/symfony/var-dumper/Caster/RdKafkaCaster.php index c3e4eb9f3..db4bba8d3 100644 --- a/app/vendor/symfony/var-dumper/Caster/RdKafkaCaster.php +++ b/app/vendor/symfony/var-dumper/Caster/RdKafkaCaster.php @@ -31,7 +31,7 @@ */ class RdKafkaCaster { - public static function castKafkaConsumer(KafkaConsumer $c, array $a, Stub $stub, $isNested) + public static function castKafkaConsumer(KafkaConsumer $c, array $a, Stub $stub, bool $isNested) { $prefix = Caster::PREFIX_VIRTUAL; @@ -51,7 +51,7 @@ public static function castKafkaConsumer(KafkaConsumer $c, array $a, Stub $stub, return $a; } - public static function castTopic(Topic $c, array $a, Stub $stub, $isNested) + public static function castTopic(Topic $c, array $a, Stub $stub, bool $isNested) { $prefix = Caster::PREFIX_VIRTUAL; @@ -75,7 +75,7 @@ public static function castTopicPartition(TopicPartition $c, array $a) return $a; } - public static function castMessage(Message $c, array $a, Stub $stub, $isNested) + public static function castMessage(Message $c, array $a, Stub $stub, bool $isNested) { $prefix = Caster::PREFIX_VIRTUAL; @@ -86,7 +86,7 @@ public static function castMessage(Message $c, array $a, Stub $stub, $isNested) return $a; } - public static function castConf(Conf $c, array $a, Stub $stub, $isNested) + public static function castConf(Conf $c, array $a, Stub $stub, bool $isNested) { $prefix = Caster::PREFIX_VIRTUAL; @@ -97,7 +97,7 @@ public static function castConf(Conf $c, array $a, Stub $stub, $isNested) return $a; } - public static function castTopicConf(TopicConf $c, array $a, Stub $stub, $isNested) + public static function castTopicConf(TopicConf $c, array $a, Stub $stub, bool $isNested) { $prefix = Caster::PREFIX_VIRTUAL; @@ -108,7 +108,7 @@ public static function castTopicConf(TopicConf $c, array $a, Stub $stub, $isNest return $a; } - public static function castRdKafka(\RdKafka $c, array $a, Stub $stub, $isNested) + public static function castRdKafka(\RdKafka $c, array $a, Stub $stub, bool $isNested) { $prefix = Caster::PREFIX_VIRTUAL; @@ -121,14 +121,14 @@ public static function castRdKafka(\RdKafka $c, array $a, Stub $stub, $isNested) return $a; } - public static function castCollectionMetadata(CollectionMetadata $c, array $a, Stub $stub, $isNested) + public static function castCollectionMetadata(CollectionMetadata $c, array $a, Stub $stub, bool $isNested) { $a += iterator_to_array($c); return $a; } - public static function castTopicMetadata(TopicMetadata $c, array $a, Stub $stub, $isNested) + public static function castTopicMetadata(TopicMetadata $c, array $a, Stub $stub, bool $isNested) { $prefix = Caster::PREFIX_VIRTUAL; @@ -140,7 +140,7 @@ public static function castTopicMetadata(TopicMetadata $c, array $a, Stub $stub, return $a; } - public static function castPartitionMetadata(PartitionMetadata $c, array $a, Stub $stub, $isNested) + public static function castPartitionMetadata(PartitionMetadata $c, array $a, Stub $stub, bool $isNested) { $prefix = Caster::PREFIX_VIRTUAL; @@ -153,7 +153,7 @@ public static function castPartitionMetadata(PartitionMetadata $c, array $a, Stu return $a; } - public static function castBrokerMetadata(BrokerMetadata $c, array $a, Stub $stub, $isNested) + public static function castBrokerMetadata(BrokerMetadata $c, array $a, Stub $stub, bool $isNested) { $prefix = Caster::PREFIX_VIRTUAL; diff --git a/app/vendor/symfony/var-dumper/Caster/ReflectionCaster.php b/app/vendor/symfony/var-dumper/Caster/ReflectionCaster.php index c850e0b1d..1781f469d 100644 --- a/app/vendor/symfony/var-dumper/Caster/ReflectionCaster.php +++ b/app/vendor/symfony/var-dumper/Caster/ReflectionCaster.php @@ -42,7 +42,7 @@ public static function castClosure(\Closure $c, array $a, Stub $stub, bool $isNe $a = static::castFunctionAbstract($c, $a, $stub, $isNested, $filter); - if (false === strpos($c->name, '{closure}')) { + if (!str_contains($c->name, '{closure}')) { $stub->class = isset($a[$prefix.'class']) ? $a[$prefix.'class']->value.'::'.$c->name : $c->name; unset($a[$prefix.'class']); } @@ -102,7 +102,7 @@ public static function castType(\ReflectionType $c, array $a, Stub $stub, bool $ $prefix.'allowsNull' => $c->allowsNull(), $prefix.'isBuiltin' => $c->isBuiltin(), ]; - } elseif ($c instanceof \ReflectionUnionType) { + } elseif ($c instanceof \ReflectionUnionType || $c instanceof \ReflectionIntersectionType) { $a[$prefix.'allowsNull'] = $c->allowsNull(); self::addMap($a, $c, [ 'types' => 'getTypes', @@ -381,7 +381,7 @@ public static function getSignature(array $a) } elseif (\is_array($v)) { $signature .= $v ? '[…'.\count($v).']' : '[]'; } elseif (\is_string($v)) { - $signature .= 10 > \strlen($v) && false === strpos($v, '\\') ? "'{$v}'" : "'…".\strlen($v)."'"; + $signature .= 10 > \strlen($v) && !str_contains($v, '\\') ? "'{$v}'" : "'…".\strlen($v)."'"; } elseif (\is_bool($v)) { $signature .= $v ? 'true' : 'false'; } else { diff --git a/app/vendor/symfony/var-dumper/Caster/ResourceCaster.php b/app/vendor/symfony/var-dumper/Caster/ResourceCaster.php index 6b2ed5223..6ae908524 100644 --- a/app/vendor/symfony/var-dumper/Caster/ResourceCaster.php +++ b/app/vendor/symfony/var-dumper/Caster/ResourceCaster.php @@ -48,7 +48,7 @@ public static function castProcess($process, array $a, Stub $stub, bool $isNeste public static function castStream($stream, array $a, Stub $stub, bool $isNested) { $a = stream_get_meta_data($stream) + static::castStreamContext($stream, $a, $stub, $isNested); - if (isset($a['uri'])) { + if ($a['uri'] ?? false) { $a['uri'] = new LinkStub($a['uri']); } @@ -60,7 +60,7 @@ public static function castStreamContext($stream, array $a, Stub $stub, bool $is return @stream_context_get_params($stream) ?: $a; } - public static function castGd($gd, array $a, Stub $stub, $isNested) + public static function castGd($gd, array $a, Stub $stub, bool $isNested) { $a['size'] = imagesx($gd).'x'.imagesy($gd); $a['trueColor'] = imageistruecolor($gd); diff --git a/app/vendor/symfony/var-dumper/Caster/SplCaster.php b/app/vendor/symfony/var-dumper/Caster/SplCaster.php index 07f053e4a..07f445116 100644 --- a/app/vendor/symfony/var-dumper/Caster/SplCaster.php +++ b/app/vendor/symfony/var-dumper/Caster/SplCaster.php @@ -39,7 +39,7 @@ public static function castArrayIterator(\ArrayIterator $c, array $a, Stub $stub return self::castSplArray($c, $a, $stub, $isNested); } - public static function castHeap(\Iterator $c, array $a, Stub $stub, $isNested) + public static function castHeap(\Iterator $c, array $a, Stub $stub, bool $isNested) { $a += [ Caster::PREFIX_VIRTUAL.'heap' => iterator_to_array(clone $c), @@ -129,7 +129,7 @@ public static function castFileInfo(\SplFileInfo $c, array $a, Stub $stub, bool } } - if (isset($a[$prefix.'realPath'])) { + if ($a[$prefix.'realPath'] ?? false) { $a[$prefix.'realPath'] = new LinkStub($a[$prefix.'realPath']); } diff --git a/app/vendor/symfony/var-dumper/Cloner/AbstractCloner.php b/app/vendor/symfony/var-dumper/Cloner/AbstractCloner.php index 739e06993..ac55da551 100644 --- a/app/vendor/symfony/var-dumper/Cloner/AbstractCloner.php +++ b/app/vendor/symfony/var-dumper/Cloner/AbstractCloner.php @@ -309,7 +309,7 @@ protected function castObject(Stub $stub, bool $isNested) $obj = $stub->value; $class = $stub->class; - if (\PHP_VERSION_ID < 80000 ? "\0" === ($class[15] ?? null) : false !== strpos($class, "@anonymous\0")) { + if (\PHP_VERSION_ID < 80000 ? "\0" === ($class[15] ?? null) : str_contains($class, "@anonymous\0")) { $stub->class = get_debug_type($obj); } if (isset($this->classInfo[$class])) { diff --git a/app/vendor/symfony/var-dumper/Cloner/Data.php b/app/vendor/symfony/var-dumper/Cloner/Data.php index c695a11ae..b17dc55e2 100644 --- a/app/vendor/symfony/var-dumper/Cloner/Data.php +++ b/app/vendor/symfony/var-dumper/Cloner/Data.php @@ -111,6 +111,7 @@ public function getValue($recursive = false) /** * @return int */ + #[\ReturnTypeWillChange] public function count() { return \count($this->getValue()); @@ -119,6 +120,7 @@ public function count() /** * @return \Traversable */ + #[\ReturnTypeWillChange] public function getIterator() { if (!\is_array($value = $this->getValue())) { @@ -150,21 +152,34 @@ public function __isset(string $key) /** * @return bool */ + #[\ReturnTypeWillChange] public function offsetExists($key) { return $this->__isset($key); } + /** + * @return mixed + */ + #[\ReturnTypeWillChange] public function offsetGet($key) { return $this->__get($key); } + /** + * @return void + */ + #[\ReturnTypeWillChange] public function offsetSet($key, $value) { throw new \BadMethodCallException(self::class.' objects are immutable.'); } + /** + * @return void + */ + #[\ReturnTypeWillChange] public function offsetUnset($key) { throw new \BadMethodCallException(self::class.' objects are immutable.'); diff --git a/app/vendor/symfony/var-dumper/Cloner/VarCloner.php b/app/vendor/symfony/var-dumper/Cloner/VarCloner.php index 90d5ac9bc..ad92ac341 100644 --- a/app/vendor/symfony/var-dumper/Cloner/VarCloner.php +++ b/app/vendor/symfony/var-dumper/Cloner/VarCloner.php @@ -66,29 +66,39 @@ protected function doClone($var) // $v is the original value or a stub object in case of hard references if (\PHP_VERSION_ID >= 70400) { - $zvalIsRef = null !== \ReflectionReference::fromArrayElement($vals, $k); + $zvalRef = ($r = \ReflectionReference::fromArrayElement($vals, $k)) ? $r->getId() : null; } else { $refs[$k] = $cookie; - $zvalIsRef = $vals[$k] === $cookie; + $zvalRef = $vals[$k] === $cookie; } - if ($zvalIsRef) { + if ($zvalRef) { $vals[$k] = &$stub; // Break hard references to make $queue completely unset($stub); // independent from the original structure - if ($v instanceof Stub && isset($hardRefs[spl_object_id($v)])) { - $vals[$k] = $refs[$k] = $v; + if (\PHP_VERSION_ID >= 70400 ? null !== $vals[$k] = $hardRefs[$zvalRef] ?? null : $v instanceof Stub && isset($hardRefs[spl_object_id($v)])) { + if (\PHP_VERSION_ID >= 70400) { + $v = $vals[$k]; + } else { + $refs[$k] = $vals[$k] = $v; + } if ($v->value instanceof Stub && (Stub::TYPE_OBJECT === $v->value->type || Stub::TYPE_RESOURCE === $v->value->type)) { ++$v->value->refCount; } ++$v->refCount; continue; } - $refs[$k] = $vals[$k] = new Stub(); - $refs[$k]->value = $v; - $h = spl_object_id($refs[$k]); - $hardRefs[$h] = &$refs[$k]; - $values[$h] = $v; + $vals[$k] = new Stub(); + $vals[$k]->value = $v; $vals[$k]->handle = ++$refsCounter; + + if (\PHP_VERSION_ID >= 70400) { + $hardRefs[$zvalRef] = $vals[$k]; + } else { + $refs[$k] = $vals[$k]; + $h = spl_object_id($refs[$k]); + $hardRefs[$h] = &$refs[$k]; + $values[$h] = $v; + } } // Create $stub when the original value $v can not be used directly // If $v is a nested structure, put that structure in array $a @@ -147,12 +157,17 @@ protected function doClone($var) unset($v[$gid]); $a = []; foreach ($v as $gk => &$gv) { - if ($v === $gv) { + if ($v === $gv && (\PHP_VERSION_ID < 70400 || !isset($hardRefs[\ReflectionReference::fromArrayElement($v, $gk)->getId()]))) { unset($v); $v = new Stub(); $v->value = [$v->cut = \count($gv), Stub::TYPE_ARRAY => 0]; $v->handle = -1; - $gv = &$hardRefs[spl_object_id($v)]; + if (\PHP_VERSION_ID >= 70400) { + $gv = &$a[$gk]; + $hardRefs[\ReflectionReference::fromArrayElement($a, $gk)->getId()] = &$gv; + } else { + $gv = &$hardRefs[spl_object_id($v)]; + } $gv = $v; } @@ -251,10 +266,12 @@ protected function doClone($var) } } - if ($zvalIsRef) { - $refs[$k]->value = $stub; - } else { + if (!$zvalRef) { $vals[$k] = $stub; + } elseif (\PHP_VERSION_ID >= 70400) { + $hardRefs[$zvalRef]->value = $stub; + } else { + $refs[$k]->value = $stub; } } diff --git a/app/vendor/symfony/var-dumper/Dumper/AbstractDumper.php b/app/vendor/symfony/var-dumper/Dumper/AbstractDumper.php index 941f8c68d..6064ea99f 100644 --- a/app/vendor/symfony/var-dumper/Dumper/AbstractDumper.php +++ b/app/vendor/symfony/var-dumper/Dumper/AbstractDumper.php @@ -63,7 +63,7 @@ public function __construct($output = null, string $charset = null, int $flags = */ public function setOutput($output) { - $prev = null !== $this->outputStream ? $this->outputStream : $this->lineDumper; + $prev = $this->outputStream ?? $this->lineDumper; if (\is_callable($output)) { $this->outputStream = null; diff --git a/app/vendor/symfony/var-dumper/Dumper/CliDumper.php b/app/vendor/symfony/var-dumper/Dumper/CliDumper.php index ab919e155..c1539ee05 100644 --- a/app/vendor/symfony/var-dumper/Dumper/CliDumper.php +++ b/app/vendor/symfony/var-dumper/Dumper/CliDumper.php @@ -150,7 +150,7 @@ public function dumpScalar(Cursor $cursor, string $type, $value) case is_nan($value): $value = 'NAN'; break; default: $value = (string) $value; - if (false === strpos($value, $this->decimalPoint)) { + if (!str_contains($value, $this->decimalPoint)) { $value .= $this->decimalPoint.'0'; } break; @@ -324,7 +324,7 @@ public function leaveHash(Cursor $cursor, int $type, $class, bool $hasChild, int * @param bool $hasChild When the dump of the hash has child item * @param int $cut The number of items the hash has been cut by */ - protected function dumpEllipsis(Cursor $cursor, $hasChild, $cut) + protected function dumpEllipsis(Cursor $cursor, bool $hasChild, int $cut) { if ($cut) { $this->line .= ' …'; @@ -428,7 +428,7 @@ protected function dumpKey(Cursor $cursor) * * @return string The value with style decoration */ - protected function style($style, $value, $attr = []) + protected function style(string $style, string $value, array $attr = []) { if (null === $this->colors) { $this->colors = $this->supportsColors(); @@ -441,7 +441,7 @@ protected function style($style, $value, $attr = []) if (isset($attr['ellipsis'], $attr['ellipsis-type'])) { $prefix = substr($value, 0, -$attr['ellipsis']); - if ('cli' === \PHP_SAPI && 'path' === $attr['ellipsis-type'] && isset($_SERVER[$pwd = '\\' === \DIRECTORY_SEPARATOR ? 'CD' : 'PWD']) && 0 === strpos($prefix, $_SERVER[$pwd])) { + if ('cli' === \PHP_SAPI && 'path' === $attr['ellipsis-type'] && isset($_SERVER[$pwd = '\\' === \DIRECTORY_SEPARATOR ? 'CD' : 'PWD']) && str_starts_with($prefix, $_SERVER[$pwd])) { $prefix = '.'.substr($prefix, \strlen($_SERVER[$pwd])); } if (!empty($attr['ellipsis-tail'])) { @@ -475,7 +475,7 @@ protected function style($style, $value, $attr = []) } else { $value = "\033[{$this->styles[$style]}m".$value; } - if ($cchrCount && $endCchr === substr($value, -\strlen($endCchr))) { + if ($cchrCount && str_ends_with($value, $endCchr)) { $value = substr($value, 0, -\strlen($endCchr)); } else { $value .= "\033[{$this->styles['default']}m"; diff --git a/app/vendor/symfony/var-dumper/Dumper/ContextProvider/SourceContextProvider.php b/app/vendor/symfony/var-dumper/Dumper/ContextProvider/SourceContextProvider.php index c3cd3221a..2e2c81816 100644 --- a/app/vendor/symfony/var-dumper/Dumper/ContextProvider/SourceContextProvider.php +++ b/app/vendor/symfony/var-dumper/Dumper/ContextProvider/SourceContextProvider.php @@ -56,7 +56,7 @@ public function getContext(): ?array $line = $trace[$i]['line'] ?? $line; while (++$i < $this->limit) { - if (isset($trace[$i]['function'], $trace[$i]['file']) && empty($trace[$i]['class']) && 0 !== strpos($trace[$i]['function'], 'call_user_func')) { + if (isset($trace[$i]['function'], $trace[$i]['file']) && empty($trace[$i]['class']) && !str_starts_with($trace[$i]['function'], 'call_user_func')) { $file = $trace[$i]['file']; $line = $trace[$i]['line']; @@ -98,7 +98,7 @@ public function getContext(): ?array if (null !== $this->projectDir) { $context['project_dir'] = $this->projectDir; - if (0 === strpos($file, $this->projectDir)) { + if (str_starts_with($file, $this->projectDir)) { $context['file_relative'] = ltrim(substr($file, \strlen($this->projectDir)), \DIRECTORY_SEPARATOR); } } diff --git a/app/vendor/symfony/var-dumper/Dumper/HtmlDumper.php b/app/vendor/symfony/var-dumper/Dumper/HtmlDumper.php index 9bbd2d65a..6c3abaa2b 100644 --- a/app/vendor/symfony/var-dumper/Dumper/HtmlDumper.php +++ b/app/vendor/symfony/var-dumper/Dumper/HtmlDumper.php @@ -116,21 +116,16 @@ public function setDisplayOptions(array $displayOptions) /** * Sets an HTML header that will be dumped once in the output stream. - * - * @param string $header An HTML string */ - public function setDumpHeader($header) + public function setDumpHeader(?string $header) { $this->dumpHeader = $header; } /** * Sets an HTML prefix and suffix that will encapse every single dump. - * - * @param string $prefix The prepended HTML string - * @param string $suffix The appended HTML string */ - public function setDumpBoundaries($prefix, $suffix) + public function setDumpBoundaries(string $prefix, string $suffix) { $this->dumpPrefix = $prefix; $this->dumpSuffix = $suffix; @@ -153,7 +148,7 @@ public function dump(Data $data, $output = null, array $extraDisplayOptions = [] */ protected function getDumpHeader() { - $this->headerIsDumped = null !== $this->outputStream ? $this->outputStream : $this->lineDumper; + $this->headerIsDumped = $this->outputStream ?? $this->lineDumper; if (null !== $this->dumpHeader) { return $this->dumpHeader; @@ -851,7 +846,7 @@ public function leaveHash(Cursor $cursor, int $type, $class, bool $hasChild, int /** * {@inheritdoc} */ - protected function style($style, $value, $attr = []) + protected function style(string $style, string $value, array $attr = []) { if ('' === $value) { return ''; @@ -951,7 +946,7 @@ protected function dumpLine(int $depth, bool $endOfValue = false) if (-1 === $this->lastDepth) { $this->line = sprintf($this->dumpPrefix, $this->dumpId, $this->indentPad).$this->line; } - if ($this->headerIsDumped !== (null !== $this->outputStream ? $this->outputStream : $this->lineDumper)) { + if ($this->headerIsDumped !== ($this->outputStream ?? $this->lineDumper)) { $this->line = $this->getDumpHeader().$this->line; } @@ -985,7 +980,7 @@ private function getSourceLink(string $file, int $line) } } -function esc($str) +function esc(string $str) { return htmlspecialchars($str, \ENT_QUOTES, 'UTF-8'); } diff --git a/app/vendor/symfony/var-dumper/Server/Connection.php b/app/vendor/symfony/var-dumper/Server/Connection.php index d8be23587..55d9214d0 100644 --- a/app/vendor/symfony/var-dumper/Server/Connection.php +++ b/app/vendor/symfony/var-dumper/Server/Connection.php @@ -31,7 +31,7 @@ class Connection */ public function __construct(string $host, array $contextProviders = []) { - if (false === strpos($host, '://')) { + if (!str_contains($host, '://')) { $host = 'tcp://'.$host; } @@ -78,7 +78,7 @@ public function write(Data $data): bool return false; } - private static function nullErrorHandler($t, $m) + private static function nullErrorHandler(int $t, string $m) { // no-op } diff --git a/app/vendor/symfony/var-dumper/Server/DumpServer.php b/app/vendor/symfony/var-dumper/Server/DumpServer.php index 28decf319..7cb5bf0c4 100644 --- a/app/vendor/symfony/var-dumper/Server/DumpServer.php +++ b/app/vendor/symfony/var-dumper/Server/DumpServer.php @@ -30,7 +30,7 @@ class DumpServer public function __construct(string $host, LoggerInterface $logger = null) { - if (false === strpos($host, '://')) { + if (!str_contains($host, '://')) { $host = 'tcp://'.$host; } diff --git a/app/vendor/symfony/var-dumper/composer.json b/app/vendor/symfony/var-dumper/composer.json index 16da4888f..2d4889d00 100644 --- a/app/vendor/symfony/var-dumper/composer.json +++ b/app/vendor/symfony/var-dumper/composer.json @@ -18,7 +18,7 @@ "require": { "php": ">=7.2.5", "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php80": "^1.15" + "symfony/polyfill-php80": "^1.16" }, "require-dev": { "ext-iconv": "*", diff --git a/app/vendor/theseer/tokenizer/CHANGELOG.md b/app/vendor/theseer/tokenizer/CHANGELOG.md index 314934f12..1eff3830d 100644 --- a/app/vendor/theseer/tokenizer/CHANGELOG.md +++ b/app/vendor/theseer/tokenizer/CHANGELOG.md @@ -2,6 +2,14 @@ All notable changes to Tokenizer are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles. + +## [1.2.1] - 2021-07-28 + +### Fixed + +* [#13](https://github.com/theseer/tokenizer/issues/13): Fatal error when tokenizing files that contain only a single empty line + + ## [1.2.0] - 2020-07-13 This release is now PHP 8.0 compliant. diff --git a/app/vendor/theseer/tokenizer/README.md b/app/vendor/theseer/tokenizer/README.md index 61ecaffac..e91ed8917 100644 --- a/app/vendor/theseer/tokenizer/README.md +++ b/app/vendor/theseer/tokenizer/README.md @@ -2,6 +2,7 @@ A small library for converting tokenized PHP source code into XML. +[![Test](https://github.com/theseer/tokenizer/actions/workflows/ci.yml/badge.svg)](https://github.com/theseer/tokenizer/actions/workflows/ci.yml) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/theseer/tokenizer/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/theseer/tokenizer/?branch=master) [![Code Coverage](https://scrutinizer-ci.com/g/theseer/tokenizer/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/theseer/tokenizer/?branch=master) [![Build Status](https://scrutinizer-ci.com/g/theseer/tokenizer/badges/build.png?b=master)](https://scrutinizer-ci.com/g/theseer/tokenizer/build-status/master) diff --git a/app/vendor/theseer/tokenizer/composer.lock b/app/vendor/theseer/tokenizer/composer.lock new file mode 100644 index 000000000..07fba9b50 --- /dev/null +++ b/app/vendor/theseer/tokenizer/composer.lock @@ -0,0 +1,22 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "b010f1b3d9d47d431ee1cb54ac1de755", + "packages": [], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": "^7.2 || ^8.0", + "ext-xmlwriter": "*", + "ext-dom": "*", + "ext-tokenizer": "*" + }, + "platform-dev": [] +} diff --git a/app/vendor/theseer/tokenizer/src/Tokenizer.php b/app/vendor/theseer/tokenizer/src/Tokenizer.php index df3f77b00..f582d9587 100644 --- a/app/vendor/theseer/tokenizer/src/Tokenizer.php +++ b/app/vendor/theseer/tokenizer/src/Tokenizer.php @@ -82,6 +82,7 @@ public function parse(string $source): TokenCollection { if ($v === '') { continue; } + $result->addToken($token); } } @@ -90,8 +91,12 @@ public function parse(string $source): TokenCollection { } private function fillBlanks(TokenCollection $tokens, int $maxLine): TokenCollection { - /** @var Token $prev */ - $prev = null; + $prev = new Token( + 0, + 'Placeholder', + '' + ); + $final = new TokenCollection(); foreach ($tokens as $token) { diff --git a/app/vendor/twig/markdown-extra/DefaultMarkdown.php b/app/vendor/twig/markdown-extra/DefaultMarkdown.php index 24aad2e34..9059f6c7f 100644 --- a/app/vendor/twig/markdown-extra/DefaultMarkdown.php +++ b/app/vendor/twig/markdown-extra/DefaultMarkdown.php @@ -21,14 +21,14 @@ class DefaultMarkdown implements MarkdownInterface public function __construct() { - if (class_exists(Parsedown::class)) { - $this->converter = new ErusevMarkdown(); - } elseif (class_exists(CommonMarkConverter::class)) { + if (class_exists(CommonMarkConverter::class)) { $this->converter = new LeagueMarkdown(); } elseif (class_exists(MarkdownExtra::class)) { $this->converter = new MichelfMarkdown(); + } elseif (class_exists(Parsedown::class)) { + $this->converter = new ErusevMarkdown(); } else { - throw new \LogicException('You cannot use the "markdown_to_html" filter as no Markdown library is available; try running "composer require erusev/parsedown".'); + throw new \LogicException('You cannot use the "markdown_to_html" filter as no Markdown library is available; try running "composer require league/html-to-markdown".'); } } diff --git a/app/vendor/twig/markdown-extra/composer.json b/app/vendor/twig/markdown-extra/composer.json index 788a96d9b..fd66512e5 100644 --- a/app/vendor/twig/markdown-extra/composer.json +++ b/app/vendor/twig/markdown-extra/composer.json @@ -19,7 +19,7 @@ "twig/twig": "^2.4|^3.0" }, "require-dev": { - "symfony/phpunit-bridge": "^4.4.9|^5.0.9", + "symfony/phpunit-bridge": "^4.4.9|^5.0.9|^6.0", "erusev/parsedown": "^1.7", "league/commonmark": "^1.0", "league/html-to-markdown": "^4.8|^5.0", diff --git a/app/vendor/twig/twig/.github/workflows/ci.yml b/app/vendor/twig/twig/.github/workflows/ci.yml index dfc40c30e..1fc33eb86 100644 --- a/app/vendor/twig/twig/.github/workflows/ci.yml +++ b/app/vendor/twig/twig/.github/workflows/ci.yml @@ -169,5 +169,5 @@ jobs: # ini-values: memory_limit=-1 # tools: composer:v2 # -# - run: ./drupal_test.sh +# - run: bash ./tests/drupal_test.sh # shell: "bash" diff --git a/app/vendor/twig/twig/CHANGELOG b/app/vendor/twig/twig/CHANGELOG index 832e639da..15b8d2750 100644 --- a/app/vendor/twig/twig/CHANGELOG +++ b/app/vendor/twig/twig/CHANGELOG @@ -1,3 +1,9 @@ +# 3.3.3 (2021-09-17) + + * Allow Symfony 6 + * Improve compatibility with PHP 8.1 + * Explicitly specify the encoding for mb_ord in JS escaper + # 3.3.2 (2021-05-16) * Revert "Throw a proper exception when a template name is an absolute path (as it has never been supported)" @@ -88,7 +94,17 @@ * bumped minimum PHP version to 7.2 * removed PSR-0 classes -# 2.14.6 (2021-XX-XX) +# 2.14.8 (2021-XX-XX) + + * n/a + +# 2.14.7 (2021-09-17) + + * Allow Symfony 6 + * Improve compatibility with PHP 8.1 + * Explicitly specify the encoding for mb_ord in JS escaper + +# 2.14.6 (2021-05-16) * Revert "Throw a proper exception when a template name is an absolute path (as it has never been supported)" @@ -439,7 +455,16 @@ * improved the performance of the filesystem loader * removed features that were deprecated in 1.x -# 1.44.4 (2021-XX-XX) +# 1.44.6 (2021-XX-XX) + + * n/a + +# 1.44.5 (2021-09-17) + + * Improve compatibility with PHP 8.1 + * Explicitly specify the encoding for mb_ord in JS escaper + +# 1.44.4 (2021-05-16) * Revert "Throw a proper exception when a template name is an absolute path (as it has never been supported)" diff --git a/app/vendor/twig/twig/composer.json b/app/vendor/twig/twig/composer.json index c344849d8..91ff912fc 100644 --- a/app/vendor/twig/twig/composer.json +++ b/app/vendor/twig/twig/composer.json @@ -29,7 +29,7 @@ "symfony/polyfill-ctype": "^1.8" }, "require-dev": { - "symfony/phpunit-bridge": "^4.4.9|^5.0.9", + "symfony/phpunit-bridge": "^4.4.9|^5.0.9|^6.0", "psr/container": "^1.0" }, "autoload": { diff --git a/app/vendor/twig/twig/doc/filters/abs.rst b/app/vendor/twig/twig/doc/filters/abs.rst index 77d5cf054..fea117536 100644 --- a/app/vendor/twig/twig/doc/filters/abs.rst +++ b/app/vendor/twig/twig/doc/filters/abs.rst @@ -15,4 +15,4 @@ The ``abs`` filter returns the absolute value. Internally, Twig uses the PHP `abs`_ function. -.. _`abs`: https://secure.php.net/abs +.. _`abs`: https://www.php.net/abs diff --git a/app/vendor/twig/twig/doc/filters/column.rst b/app/vendor/twig/twig/doc/filters/column.rst index 5b6769b8d..981b8608a 100644 --- a/app/vendor/twig/twig/doc/filters/column.rst +++ b/app/vendor/twig/twig/doc/filters/column.rst @@ -21,4 +21,4 @@ Arguments * ``name``: The column name to extract -.. _`array_column`: https://secure.php.net/array_column +.. _`array_column`: https://www.php.net/array_column diff --git a/app/vendor/twig/twig/doc/filters/convert_encoding.rst b/app/vendor/twig/twig/doc/filters/convert_encoding.rst index d977c752c..98645494e 100644 --- a/app/vendor/twig/twig/doc/filters/convert_encoding.rst +++ b/app/vendor/twig/twig/doc/filters/convert_encoding.rst @@ -19,4 +19,4 @@ Arguments * ``to``: The output charset * ``from``: The input charset -.. _`iconv`: https://secure.php.net/iconv +.. _`iconv`: https://www.php.net/iconv diff --git a/app/vendor/twig/twig/doc/filters/date.rst b/app/vendor/twig/twig/doc/filters/date.rst index ec08d5563..70470f0f4 100644 --- a/app/vendor/twig/twig/doc/filters/date.rst +++ b/app/vendor/twig/twig/doc/filters/date.rst @@ -71,8 +71,8 @@ Arguments * ``format``: The date format * ``timezone``: The date timezone -.. _`strtotime`: https://secure.php.net/strtotime -.. _`DateTime`: https://secure.php.net/DateTime -.. _`DateInterval`: https://secure.php.net/DateInterval -.. _`date`: https://secure.php.net/date -.. _`DateInterval::format`: https://secure.php.net/DateInterval.format +.. _`strtotime`: https://www.php.net/strtotime +.. _`DateTime`: https://www.php.net/DateTime +.. _`DateInterval`: https://www.php.net/DateInterval +.. _`date`: https://www.php.net/date +.. _`DateInterval::format`: https://www.php.net/DateInterval.format diff --git a/app/vendor/twig/twig/doc/filters/date_modify.rst b/app/vendor/twig/twig/doc/filters/date_modify.rst index cc5d6df16..e091391d1 100644 --- a/app/vendor/twig/twig/doc/filters/date_modify.rst +++ b/app/vendor/twig/twig/doc/filters/date_modify.rst @@ -16,5 +16,5 @@ Arguments * ``modifier``: The modifier -.. _`strtotime`: https://secure.php.net/strtotime -.. _`DateTime`: https://secure.php.net/DateTime +.. _`strtotime`: https://www.php.net/strtotime +.. _`DateTime`: https://www.php.net/DateTime diff --git a/app/vendor/twig/twig/doc/filters/escape.rst b/app/vendor/twig/twig/doc/filters/escape.rst index f105d97a3..e8b735db4 100644 --- a/app/vendor/twig/twig/doc/filters/escape.rst +++ b/app/vendor/twig/twig/doc/filters/escape.rst @@ -114,4 +114,4 @@ Arguments * ``strategy``: The escaping strategy * ``charset``: The string charset -.. _`htmlspecialchars`: https://secure.php.net/htmlspecialchars +.. _`htmlspecialchars`: https://www.php.net/htmlspecialchars diff --git a/app/vendor/twig/twig/doc/filters/first.rst b/app/vendor/twig/twig/doc/filters/first.rst index 8d7081a53..e0cc7cb1c 100644 --- a/app/vendor/twig/twig/doc/filters/first.rst +++ b/app/vendor/twig/twig/doc/filters/first.rst @@ -19,4 +19,4 @@ a string: It also works with objects implementing the `Traversable`_ interface. -.. _`Traversable`: https://secure.php.net/manual/en/class.traversable.php +.. _`Traversable`: https://www.php.net/manual/en/class.traversable.php diff --git a/app/vendor/twig/twig/doc/filters/format.rst b/app/vendor/twig/twig/doc/filters/format.rst index 782ea75cc..68551a3dd 100644 --- a/app/vendor/twig/twig/doc/filters/format.rst +++ b/app/vendor/twig/twig/doc/filters/format.rst @@ -15,4 +15,4 @@ The ``format`` filter formats a given string by replacing the placeholders :doc:`replace` -.. _`sprintf`: https://secure.php.net/sprintf +.. _`sprintf`: https://www.php.net/sprintf diff --git a/app/vendor/twig/twig/doc/filters/html_to_markdown.rst b/app/vendor/twig/twig/doc/filters/html_to_markdown.rst index 80145df5e..58568a445 100644 --- a/app/vendor/twig/twig/doc/filters/html_to_markdown.rst +++ b/app/vendor/twig/twig/doc/filters/html_to_markdown.rst @@ -57,9 +57,9 @@ You can also use the filter on an entire template which you ``include``: ``html_to_markdown`` is just a frontend; the actual conversion is done by one of the following compatible libraries, from which you can choose: -* `erusev/parsedown`_ * `league/html-to-markdown`_ * `michelf/php-markdown`_ +* `erusev/parsedown`_ Depending on the library, you can also add some options by passing them as an argument to the filter. Example for ``league/html-to-markdown``: @@ -72,6 +72,6 @@ to the filter. Example for ``league/html-to-markdown``: {% endapply %} -.. _erusev/parsedown: https://github.com/erusev/parsedown .. _league/html-to-markdown: https://github.com/thephpleague/html-to-markdown .. _michelf/php-markdown: https://github.com/michelf/php-markdown +.. _erusev/parsedown: https://github.com/erusev/parsedown diff --git a/app/vendor/twig/twig/doc/filters/json_encode.rst b/app/vendor/twig/twig/doc/filters/json_encode.rst index 434e2f178..34e71367e 100644 --- a/app/vendor/twig/twig/doc/filters/json_encode.rst +++ b/app/vendor/twig/twig/doc/filters/json_encode.rst @@ -19,5 +19,5 @@ Arguments Combine constants using :ref:`bitwise operators`: ``{{ data|json_encode(constant('JSON_PRETTY_PRINT') b-or constant('JSON_HEX_QUOT')) }}`` -.. _`json_encode`: https://secure.php.net/json_encode -.. _`json_encode options`: https://secure.php.net/manual/en/json.constants.php +.. _`json_encode`: https://www.php.net/json_encode +.. _`json_encode options`: https://www.php.net/manual/en/json.constants.php diff --git a/app/vendor/twig/twig/doc/filters/last.rst b/app/vendor/twig/twig/doc/filters/last.rst index 2b7c45bd1..d7ac6a533 100644 --- a/app/vendor/twig/twig/doc/filters/last.rst +++ b/app/vendor/twig/twig/doc/filters/last.rst @@ -19,4 +19,4 @@ a string: It also works with objects implementing the `Traversable`_ interface. -.. _`Traversable`: https://secure.php.net/manual/en/class.traversable.php +.. _`Traversable`: https://www.php.net/manual/en/class.traversable.php diff --git a/app/vendor/twig/twig/doc/filters/merge.rst b/app/vendor/twig/twig/doc/filters/merge.rst index e26e51c24..40146b5d7 100644 --- a/app/vendor/twig/twig/doc/filters/merge.rst +++ b/app/vendor/twig/twig/doc/filters/merge.rst @@ -45,4 +45,4 @@ overridden. Internally, Twig uses the PHP `array_merge`_ function. It supports Traversable objects by transforming those to arrays. -.. _`array_merge`: https://secure.php.net/array_merge +.. _`array_merge`: https://www.php.net/array_merge diff --git a/app/vendor/twig/twig/doc/filters/number_format.rst b/app/vendor/twig/twig/doc/filters/number_format.rst index c44e2e353..047249d67 100644 --- a/app/vendor/twig/twig/doc/filters/number_format.rst +++ b/app/vendor/twig/twig/doc/filters/number_format.rst @@ -48,4 +48,4 @@ Arguments * ``decimal_point``: The character(s) to use for the decimal point * ``thousand_sep``: The character(s) to use for the thousands separator -.. _`number_format`: https://secure.php.net/number_format +.. _`number_format`: https://www.php.net/number_format diff --git a/app/vendor/twig/twig/doc/filters/reverse.rst b/app/vendor/twig/twig/doc/filters/reverse.rst index c5ceb7d05..0c0e1ac00 100644 --- a/app/vendor/twig/twig/doc/filters/reverse.rst +++ b/app/vendor/twig/twig/doc/filters/reverse.rst @@ -41,4 +41,4 @@ Arguments * ``preserve_keys``: Preserve keys when reversing a mapping or a sequence. -.. _`Traversable`: https://secure.php.net/Traversable +.. _`Traversable`: https://www.php.net/Traversable diff --git a/app/vendor/twig/twig/doc/filters/slice.rst b/app/vendor/twig/twig/doc/filters/slice.rst index ff38bbc9f..ae83b57a0 100644 --- a/app/vendor/twig/twig/doc/filters/slice.rst +++ b/app/vendor/twig/twig/doc/filters/slice.rst @@ -62,7 +62,7 @@ Arguments * ``length``: The size of the slice * ``preserve_keys``: Whether to preserve key or not (when the input is an array) -.. _`Traversable`: https://secure.php.net/manual/en/class.traversable.php -.. _`array_slice`: https://secure.php.net/array_slice -.. _`mb_substr`: https://secure.php.net/mb-substr -.. _`substr`: https://secure.php.net/substr +.. _`Traversable`: https://www.php.net/manual/en/class.traversable.php +.. _`array_slice`: https://www.php.net/array_slice +.. _`mb_substr`: https://www.php.net/mb-substr +.. _`substr`: https://www.php.net/substr diff --git a/app/vendor/twig/twig/doc/filters/sort.rst b/app/vendor/twig/twig/doc/filters/sort.rst index 3dc5f4d73..1816c35e6 100644 --- a/app/vendor/twig/twig/doc/filters/sort.rst +++ b/app/vendor/twig/twig/doc/filters/sort.rst @@ -38,5 +38,5 @@ Arguments * ``arrow``: An arrow function -.. _`asort`: https://secure.php.net/asort +.. _`asort`: https://www.php.net/asort .. _`spaceship`: https://www.php.net/manual/en/language.operators.comparison.php diff --git a/app/vendor/twig/twig/doc/filters/split.rst b/app/vendor/twig/twig/doc/filters/split.rst index 38c4b7df0..386ae3043 100644 --- a/app/vendor/twig/twig/doc/filters/split.rst +++ b/app/vendor/twig/twig/doc/filters/split.rst @@ -46,5 +46,5 @@ Arguments * ``delimiter``: The delimiter * ``limit``: The limit argument -.. _`explode`: https://secure.php.net/explode -.. _`str_split`: https://secure.php.net/str_split +.. _`explode`: https://www.php.net/explode +.. _`str_split`: https://www.php.net/str_split diff --git a/app/vendor/twig/twig/doc/filters/striptags.rst b/app/vendor/twig/twig/doc/filters/striptags.rst index 7a0aabddc..d5f542b3d 100644 --- a/app/vendor/twig/twig/doc/filters/striptags.rst +++ b/app/vendor/twig/twig/doc/filters/striptags.rst @@ -26,4 +26,4 @@ Arguments * ``allowable_tags``: Tags which should not be stripped -.. _`strip_tags`: https://secure.php.net/strip_tags +.. _`strip_tags`: https://www.php.net/strip_tags diff --git a/app/vendor/twig/twig/doc/filters/trim.rst b/app/vendor/twig/twig/doc/filters/trim.rst index 81d5e0415..a3d36ca03 100644 --- a/app/vendor/twig/twig/doc/filters/trim.rst +++ b/app/vendor/twig/twig/doc/filters/trim.rst @@ -34,6 +34,6 @@ Arguments * ``side``: The default is to strip from the left and the right (`both`) sides, but `left` and `right` will strip from either the left side or right side only -.. _`trim`: https://secure.php.net/trim -.. _`ltrim`: https://secure.php.net/ltrim -.. _`rtrim`: https://secure.php.net/rtrim +.. _`trim`: https://www.php.net/trim +.. _`ltrim`: https://www.php.net/ltrim +.. _`rtrim`: https://www.php.net/rtrim diff --git a/app/vendor/twig/twig/doc/filters/url_encode.rst b/app/vendor/twig/twig/doc/filters/url_encode.rst index 60cf365f1..c5919be01 100644 --- a/app/vendor/twig/twig/doc/filters/url_encode.rst +++ b/app/vendor/twig/twig/doc/filters/url_encode.rst @@ -19,5 +19,5 @@ or an array as query string: Internally, Twig uses the PHP `rawurlencode`_ or the `http_build_query`_ function. -.. _`rawurlencode`: https://secure.php.net/rawurlencode -.. _`http_build_query`: https://secure.php.net/http_build_query +.. _`rawurlencode`: https://www.php.net/rawurlencode +.. _`http_build_query`: https://www.php.net/http_build_query diff --git a/app/vendor/twig/twig/doc/functions/date.rst b/app/vendor/twig/twig/doc/functions/date.rst index 3329a5698..16e1d4874 100644 --- a/app/vendor/twig/twig/doc/functions/date.rst +++ b/app/vendor/twig/twig/doc/functions/date.rst @@ -41,4 +41,4 @@ Arguments * ``date``: The date * ``timezone``: The timezone -.. _`date and time formats`: https://secure.php.net/manual/en/datetime.formats.php +.. _`date and time formats`: https://www.php.net/manual/en/datetime.formats.php diff --git a/app/vendor/twig/twig/doc/functions/dump.rst b/app/vendor/twig/twig/doc/functions/dump.rst index c7264edda..f89a1c4b1 100644 --- a/app/vendor/twig/twig/doc/functions/dump.rst +++ b/app/vendor/twig/twig/doc/functions/dump.rst @@ -63,4 +63,4 @@ Arguments * ``context``: The context to dump .. _`XDebug`: https://xdebug.org/docs/display -.. _`var_dump`: https://secure.php.net/var_dump +.. _`var_dump`: https://www.php.net/var_dump diff --git a/app/vendor/twig/twig/doc/functions/range.rst b/app/vendor/twig/twig/doc/functions/range.rst index a1f0e7c09..e537b11a6 100644 --- a/app/vendor/twig/twig/doc/functions/range.rst +++ b/app/vendor/twig/twig/doc/functions/range.rst @@ -55,4 +55,4 @@ Arguments * ``high``: The highest possible value of the sequence. * ``step``: The increment between elements of the sequence. -.. _`range`: https://secure.php.net/range +.. _`range`: https://www.php.net/range diff --git a/app/vendor/twig/twig/doc/recipes.rst b/app/vendor/twig/twig/doc/recipes.rst index 01c937dad..206a52ee0 100644 --- a/app/vendor/twig/twig/doc/recipes.rst +++ b/app/vendor/twig/twig/doc/recipes.rst @@ -528,4 +528,4 @@ include in your templates: 'tag_variable' => ['{[', ']}'], ])); -.. _callback: https://secure.php.net/manual/en/function.is-callable.php +.. _callback: https://www.php.net/manual/en/function.is-callable.php diff --git a/app/vendor/twig/twig/doc/tags/flush.rst b/app/vendor/twig/twig/doc/tags/flush.rst index 332e98251..03d2a3677 100644 --- a/app/vendor/twig/twig/doc/tags/flush.rst +++ b/app/vendor/twig/twig/doc/tags/flush.rst @@ -11,4 +11,4 @@ The ``flush`` tag tells Twig to flush the output buffer: Internally, Twig uses the PHP `flush`_ function. -.. _`flush`: https://secure.php.net/flush +.. _`flush`: https://www.php.net/flush diff --git a/app/vendor/twig/twig/doc/templates.rst b/app/vendor/twig/twig/doc/templates.rst index 2a8f38040..5311ad6ac 100644 --- a/app/vendor/twig/twig/doc/templates.rst +++ b/app/vendor/twig/twig/doc/templates.rst @@ -853,7 +853,7 @@ Twig can be extended. If you want to create your own extensions, read the .. _`other Twig syntax mode`: https://github.com/muxx/Twig-HTML.mode .. _`Notepad++ Twig Highlighter`: https://github.com/Banane9/notepadplusplus-twig .. _`web-mode.el`: http://web-mode.org/ -.. _`regular expressions`: https://secure.php.net/manual/en/pcre.pattern.php +.. _`regular expressions`: https://www.php.net/manual/en/pcre.pattern.php .. _`PHP-twig for atom`: https://github.com/reesef/php-twig .. _`TwigFiddle`: https://twigfiddle.com/ .. _`Twig pack`: https://marketplace.visualstudio.com/items?itemName=bajdzis.vscode-twig-pack diff --git a/app/vendor/twig/twig/drupal_test.sh b/app/vendor/twig/twig/drupal_test.sh deleted file mode 100755 index a25d886f8..000000000 --- a/app/vendor/twig/twig/drupal_test.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash - -set -x -set -e - -REPO=`pwd` -cd /tmp -rm -rf drupal-twig-test -composer create-project --no-interaction drupal/recommended-project:9.1.x-dev drupal-twig-test -cd drupal-twig-test -(cd vendor/twig && rm -rf twig && ln -sf $REPO twig) -php ./web/core/scripts/drupal install --no-interaction demo_umami > output -perl -p -i -e 's/^([A-Za-z]+)\: (.+)$/export DRUPAL_\1=\2/' output -source output -#echo '$config["system.logging"]["error_level"] = "verbose";' >> web/sites/default/settings.php - -wget https://get.symfony.com/cli/installer -O - | bash -export PATH="$HOME/.symfony/bin:$PATH" -symfony server:start -d --no-tls - -curl -OLsS https://get.blackfire.io/blackfire-player.phar -chmod +x blackfire-player.phar -cat > drupal-tests.bkf < $codepoint) { return sprintf('\u%04X', $codepoint); } diff --git a/app/vendor/twig/twig/src/Markup.php b/app/vendor/twig/twig/src/Markup.php index c8c5e1a17..1788acc4f 100644 --- a/app/vendor/twig/twig/src/Markup.php +++ b/app/vendor/twig/twig/src/Markup.php @@ -35,11 +35,16 @@ public function __toString() /** * @return int */ + #[\ReturnTypeWillChange] public function count() { return mb_strlen($this->content, $this->charset); } + /** + * @return mixed + */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return $this->content; diff --git a/app/vendor/twig/twig/src/Node/Node.php b/app/vendor/twig/twig/src/Node/Node.php index e974b4971..c0558b9af 100644 --- a/app/vendor/twig/twig/src/Node/Node.php +++ b/app/vendor/twig/twig/src/Node/Node.php @@ -148,6 +148,7 @@ public function removeNode(string $name): void /** * @return int */ + #[\ReturnTypeWillChange] public function count() { return \count($this->nodes); diff --git a/app/vendor/twig/twig/src/Util/TemplateDirIterator.php b/app/vendor/twig/twig/src/Util/TemplateDirIterator.php index c7339fd78..3bef14bee 100644 --- a/app/vendor/twig/twig/src/Util/TemplateDirIterator.php +++ b/app/vendor/twig/twig/src/Util/TemplateDirIterator.php @@ -16,11 +16,19 @@ */ class TemplateDirIterator extends \IteratorIterator { + /** + * @return mixed + */ + #[\ReturnTypeWillChange] public function current() { return file_get_contents(parent::current()); } + /** + * @return mixed + */ + #[\ReturnTypeWillChange] public function key() { return (string) parent::key();