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 @@ ?>
= __d('debug_kit', 'No previous requests logged.') ?>
++ = __d('debug_kit', 'No requests logged.') ?> + +
-= count($requests) ?> = __d('debug_kit', 'previous requests available') ?>
++ = count($requests) ?> = __d('debug_kit', 'requests available') ?> + +