From 08d74df6e39081cca28cbd1e1430b53a574aa4b9 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Fri, 24 Jan 2025 15:23:06 -0700 Subject: [PATCH 1/8] Fix parse error: #3894 Signed-off-by: Andy Miller --- system/src/Grav/Common/Uri.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/src/Grav/Common/Uri.php b/system/src/Grav/Common/Uri.php index 994ab0174..ccf6118c3 100644 --- a/system/src/Grav/Common/Uri.php +++ b/system/src/Grav/Common/Uri.php @@ -1268,7 +1268,7 @@ class Uri } // Build path. - $request_uri = $env['REQUEST_URI'] ?? ''; + $request_uri = $env['REQUEST_URI'] ?? '/'; $this->path = rawurldecode(parse_url('http://example.com' . $request_uri, PHP_URL_PATH)); // Build query string. From d798859acd9814c20df57d8ee6712cac0ed85fc6 Mon Sep 17 00:00:00 2001 From: Rotzbua Date: Wed, 5 Feb 2025 19:16:51 +0100 Subject: [PATCH 2/8] chore(ci): update GH Actions php test (#3867) - php versions should be strings - caching updated to current recommendation - fixed env var name --- .github/workflows/tests.yaml | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index f054bc25b..7b705eb2f 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -10,20 +10,18 @@ permissions: contents: read # to fetch code (actions/checkout) jobs: - unit-tests: + strategy: + matrix: + php: ['8.3', '8.2', '8.1', '8.0', '7.4', '7.3'] + os: [ubuntu-latest] runs-on: ${{ matrix.os }} - strategy: - matrix: - php: [8.3, 8.2, 8.1, 8.0, 7.4, 7.3] - os: [ubuntu-latest] - steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - - name: Setup PHP + - name: Setup PHP ${{ matrix.php }} uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} @@ -31,17 +29,11 @@ jobs: tools: composer:v2 coverage: none env: - COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} - -# - name: Update composer -# run: composer update -# -# - name: Validate composer.json and composer.lock -# run: composer validate + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Get composer cache directory id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" + run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - name: Cache dependencies uses: actions/cache@v4 From 83d098b891b4b8c7781482a773e936dcb4282793 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Fri, 7 Mar 2025 12:06:58 -0700 Subject: [PATCH 3/8] throws error Signed-off-by: Andy Miller --- system/src/Grav/Framework/Collection/AbstractLazyCollection.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/src/Grav/Framework/Collection/AbstractLazyCollection.php b/system/src/Grav/Framework/Collection/AbstractLazyCollection.php index ec73f9c9f..045685eb2 100644 --- a/system/src/Grav/Framework/Collection/AbstractLazyCollection.php +++ b/system/src/Grav/Framework/Collection/AbstractLazyCollection.php @@ -26,7 +26,7 @@ abstract class AbstractLazyCollection extends BaseAbstractLazyCollection impleme * @par ArrayCollection * @phpstan-var ArrayCollection */ - protected ?\Doctrine\Common\Collections\Collection $collection; + protected $collection; /** * {@inheritDoc} From 8d7b658aa6932ca78db12e728313c846e9d99198 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Sun, 30 Mar 2025 15:22:45 -0600 Subject: [PATCH 4/8] Some fixes that impacted file uploads Signed-off-by: Andy Miller --- .../src/Grav/Framework/Form/FormFlashFile.php | 39 ++++++++++--------- 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/system/src/Grav/Framework/Form/FormFlashFile.php b/system/src/Grav/Framework/Form/FormFlashFile.php index f0c71442f..306401ade 100644 --- a/system/src/Grav/Framework/Form/FormFlashFile.php +++ b/system/src/Grav/Framework/Form/FormFlashFile.php @@ -16,11 +16,14 @@ use InvalidArgumentException; use JsonSerializable; use Psr\Http\Message\StreamInterface; use Psr\Http\Message\UploadedFileInterface; +use ReturnTypeWillChange; use RuntimeException; use function copy; use function fopen; use function is_string; use function sprintf; +use const UPLOAD_ERR_NO_FILE; +use const UPLOAD_ERR_OK; /** * Class FormFlashFile @@ -29,15 +32,15 @@ use function sprintf; class FormFlashFile implements UploadedFileInterface, JsonSerializable { /** @var string */ - private $id; + private string $id; /** @var string */ - private $field; + private string $field; /** @var bool */ - private $moved = false; + private bool $moved = false; /** @var array */ - private $upload; + private array $upload; /** @var FormFlash */ - private $flash; + private FormFlash $flash; /** * FormFlashFile constructor. @@ -54,7 +57,7 @@ class FormFlashFile implements UploadedFileInterface, JsonSerializable $tmpFile = $this->getTmpFile(); if (!$tmpFile && $this->isOk()) { - $this->upload['error'] = \UPLOAD_ERR_NO_FILE; + $this->upload['error'] = UPLOAD_ERR_NO_FILE; } if (!isset($this->upload['size'])) { @@ -65,7 +68,7 @@ class FormFlashFile implements UploadedFileInterface, JsonSerializable /** * @return StreamInterface */ - public function getStream() + public function getStream(): StreamInterface { $this->validateActive(); @@ -86,7 +89,7 @@ class FormFlashFile implements UploadedFileInterface, JsonSerializable * @param string $targetPath * @return void */ - public function moveTo($targetPath) + public function moveTo($targetPath): void { $this->validateActive(); @@ -126,7 +129,7 @@ class FormFlashFile implements UploadedFileInterface, JsonSerializable /** * @return int */ - public function getSize() + public function getSize(): int { return $this->upload['size']; } @@ -134,15 +137,15 @@ class FormFlashFile implements UploadedFileInterface, JsonSerializable /** * @return int */ - public function getError() + public function getError(): int { - return $this->upload['error'] ?? \UPLOAD_ERR_OK; + return $this->upload['error'] ?? UPLOAD_ERR_OK; } /** * @return string */ - public function getClientFilename() + public function getClientFilename(): string { return $this->upload['name'] ?? 'unknown'; } @@ -150,7 +153,7 @@ class FormFlashFile implements UploadedFileInterface, JsonSerializable /** * @return string */ - public function getClientMediaType() + public function getClientMediaType(): string { return $this->upload['type'] ?? 'application/octet-stream'; } @@ -178,7 +181,7 @@ class FormFlashFile implements UploadedFileInterface, JsonSerializable /** * @return string */ - public function getDestination() + public function getDestination(): string { return $this->upload['path'] ?? ''; } @@ -186,8 +189,8 @@ class FormFlashFile implements UploadedFileInterface, JsonSerializable /** * @return array */ - #[\ReturnTypeWillChange] - public function jsonSerialize() + #[ReturnTypeWillChange] + public function jsonSerialize(): array { return $this->upload; } @@ -226,7 +229,7 @@ class FormFlashFile implements UploadedFileInterface, JsonSerializable /** * @return array */ - #[\ReturnTypeWillChange] + #[ReturnTypeWillChange] public function __debugInfo() { return [ @@ -261,6 +264,6 @@ class FormFlashFile implements UploadedFileInterface, JsonSerializable */ private function isOk(): bool { - return \UPLOAD_ERR_OK === $this->getError(); + return UPLOAD_ERR_OK === $this->getError(); } } From 830a442faa2c489e741b22ab9714a093fc92f0d7 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Sun, 30 Mar 2025 15:23:22 -0600 Subject: [PATCH 5/8] update vendor libs Signed-off-by: Andy Miller --- composer.lock | 294 +++++++++++++++++++++++++------------------------- 1 file changed, 148 insertions(+), 146 deletions(-) diff --git a/composer.lock b/composer.lock index 08e5a264e..2386254ea 100644 --- a/composer.lock +++ b/composer.lock @@ -8,16 +8,16 @@ "packages": [ { "name": "composer/ca-bundle", - "version": "1.5.2", + "version": "1.5.6", "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", - "reference": "48a792895a2b7a6ee65dd5442c299d7b835b6137" + "reference": "f65c239c970e7f072f067ab78646e9f0b2935175" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/48a792895a2b7a6ee65dd5442c299d7b835b6137", - "reference": "48a792895a2b7a6ee65dd5442c299d7b835b6137", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/f65c239c970e7f072f067ab78646e9f0b2935175", + "reference": "f65c239c970e7f072f067ab78646e9f0b2935175", "shasum": "" }, "require": { @@ -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.5.2" + "source": "https://github.com/composer/ca-bundle/tree/1.5.6" }, "funding": [ { @@ -80,7 +80,7 @@ "type": "tidelift" } ], - "time": "2024-09-25T07:49:53+00:00" + "time": "2025-03-06T14:30:56+00:00" }, { "name": "composer/semver", @@ -333,29 +333,27 @@ }, { "name": "doctrine/deprecations", - "version": "1.1.3", + "version": "1.1.4", "source": { "type": "git", "url": "https://github.com/doctrine/deprecations.git", - "reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab" + "reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/deprecations/zipball/dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab", - "reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab", + "url": "https://api.github.com/repos/doctrine/deprecations/zipball/31610dbb31faa98e6b5447b62340826f54fbc4e9", + "reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^9", - "phpstan/phpstan": "1.4.10 || 1.10.15", - "phpstan/phpstan-phpunit": "^1.0", + "doctrine/coding-standard": "^9 || ^12", + "phpstan/phpstan": "1.4.10 || 2.0.3", + "phpstan/phpstan-phpunit": "^1.0 || ^2", "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "psalm/plugin-phpunit": "0.18.4", - "psr/log": "^1 || ^2 || ^3", - "vimeo/psalm": "4.30.0 || 5.12.0" + "psr/log": "^1 || ^2 || ^3" }, "suggest": { "psr/log": "Allows logging deprecations via PSR-3 logger implementation" @@ -363,7 +361,7 @@ "type": "library", "autoload": { "psr-4": { - "Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations" + "Doctrine\\Deprecations\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -374,22 +372,22 @@ "homepage": "https://www.doctrine-project.org/", "support": { "issues": "https://github.com/doctrine/deprecations/issues", - "source": "https://github.com/doctrine/deprecations/tree/1.1.3" + "source": "https://github.com/doctrine/deprecations/tree/1.1.4" }, - "time": "2024-01-30T19:34:25+00:00" + "time": "2024-12-07T21:18:45+00:00" }, { "name": "donatj/phpuseragentparser", - "version": "v1.9.0", + "version": "v1.10.0", "source": { "type": "git", "url": "https://github.com/donatj/PhpUserAgent.git", - "reference": "e807895c848f0e4a0f0001bbb1c99cfb7181111e" + "reference": "3ba73057d2a4a275badb88b7708e91e159c40367" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/donatj/PhpUserAgent/zipball/e807895c848f0e4a0f0001bbb1c99cfb7181111e", - "reference": "e807895c848f0e4a0f0001bbb1c99cfb7181111e", + "url": "https://api.github.com/repos/donatj/PhpUserAgent/zipball/3ba73057d2a4a275badb88b7708e91e159c40367", + "reference": "3ba73057d2a4a275badb88b7708e91e159c40367", "shasum": "" }, "require": { @@ -434,7 +432,7 @@ ], "support": { "issues": "https://github.com/donatj/PhpUserAgent/issues", - "source": "https://github.com/donatj/PhpUserAgent/tree/v1.9.0" + "source": "https://github.com/donatj/PhpUserAgent/tree/v1.10.0" }, "funding": [ { @@ -450,7 +448,7 @@ "type": "ko_fi" } ], - "time": "2024-08-28T22:45:36+00:00" + "time": "2024-10-30T15:45:03+00:00" }, { "name": "dragonmantank/cron-expression", @@ -602,16 +600,16 @@ }, { "name": "filp/whoops", - "version": "2.16.0", + "version": "2.18.0", "source": { "type": "git", "url": "https://github.com/filp/whoops.git", - "reference": "befcdc0e5dce67252aa6322d82424be928214fa2" + "reference": "a7de6c3c6c3c022f5cfc337f8ede6a14460cf77e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filp/whoops/zipball/befcdc0e5dce67252aa6322d82424be928214fa2", - "reference": "befcdc0e5dce67252aa6322d82424be928214fa2", + "url": "https://api.github.com/repos/filp/whoops/zipball/a7de6c3c6c3c022f5cfc337f8ede6a14460cf77e", + "reference": "a7de6c3c6c3c022f5cfc337f8ede6a14460cf77e", "shasum": "" }, "require": { @@ -661,7 +659,7 @@ ], "support": { "issues": "https://github.com/filp/whoops/issues", - "source": "https://github.com/filp/whoops/tree/2.16.0" + "source": "https://github.com/filp/whoops/tree/2.18.0" }, "funding": [ { @@ -669,21 +667,21 @@ "type": "github" } ], - "time": "2024-09-25T12:00:00+00:00" + "time": "2025-03-15T12:00:00+00:00" }, { "name": "getgrav/cache", - "version": "v2.0.0", + "version": "v2.0.1", "target-dir": "Gregwar/Cache", "source": { "type": "git", "url": "https://github.com/getgrav/Cache.git", - "reference": "56fd63f752779928fcd1074ab7d12f406dde8861" + "reference": "28e2b0072add37b9547daea1da6fcd26d660850b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/getgrav/Cache/zipball/56fd63f752779928fcd1074ab7d12f406dde8861", - "reference": "56fd63f752779928fcd1074ab7d12f406dde8861", + "url": "https://api.github.com/repos/getgrav/Cache/zipball/28e2b0072add37b9547daea1da6fcd26d660850b", + "reference": "28e2b0072add37b9547daea1da6fcd26d660850b", "shasum": "" }, "require": { @@ -718,9 +716,9 @@ "system" ], "support": { - "source": "https://github.com/getgrav/Cache/tree/v2.0.0" + "source": "https://github.com/getgrav/Cache/tree/v2.0.1" }, - "time": "2021-04-20T05:48:00+00:00" + "time": "2024-10-25T14:21:29+00:00" }, { "name": "getgrav/image", @@ -889,38 +887,39 @@ }, { "name": "itsgoingd/clockwork", - "version": "v5.2.2", + "version": "v5.3.4", "source": { "type": "git", "url": "https://github.com/itsgoingd/clockwork.git", - "reference": "29bc4cedfbe742b419544c30b7b6e15cd9da08ef" + "reference": "c27ad77a08a9e58bf0049de46969fa4fe3b506e5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/itsgoingd/clockwork/zipball/29bc4cedfbe742b419544c30b7b6e15cd9da08ef", - "reference": "29bc4cedfbe742b419544c30b7b6e15cd9da08ef", + "url": "https://api.github.com/repos/itsgoingd/clockwork/zipball/c27ad77a08a9e58bf0049de46969fa4fe3b506e5", + "reference": "c27ad77a08a9e58bf0049de46969fa4fe3b506e5", "shasum": "" }, "require": { "ext-json": "*", - "php": ">=5.6" + "php": ">=7.1" }, "suggest": { "ext-pdo": "Needed in order to use a SQL database for metadata storage", "ext-pdo_mysql": "Needed in order to use MySQL for metadata storage", "ext-pdo_postgres": "Needed in order to use Postgres for metadata storage", "ext-pdo_sqlite": "Needed in order to use a SQLite for metadata storage", - "ext-redis": "Needed in order to use Redis for metadata storage" + "ext-redis": "Needed in order to use Redis for metadata storage", + "php-http/discovery": "Vanilla integration - required for the middleware zero-configuration setup" }, "type": "library", "extra": { "laravel": { - "providers": [ - "Clockwork\\Support\\Laravel\\ClockworkServiceProvider" - ], "aliases": { "Clockwork": "Clockwork\\Support\\Laravel\\Facade" - } + }, + "providers": [ + "Clockwork\\Support\\Laravel\\ClockworkServiceProvider" + ] } }, "autoload": { @@ -952,7 +951,7 @@ ], "support": { "issues": "https://github.com/itsgoingd/clockwork/issues", - "source": "https://github.com/itsgoingd/clockwork/tree/v5.2.2" + "source": "https://github.com/itsgoingd/clockwork/tree/v5.3.4" }, "funding": [ { @@ -960,20 +959,20 @@ "type": "github" } ], - "time": "2024-04-14T10:49:22+00:00" + "time": "2025-02-09T15:57:21+00:00" }, { "name": "league/climate", - "version": "3.8.2", + "version": "3.10.0", "source": { "type": "git", "url": "https://github.com/thephpleague/climate.git", - "reference": "a785a3ac8f584eed4abd45e4e16fe64c46659a28" + "reference": "237f70e1032b16d32ff3f65dcda68706911e1c74" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/climate/zipball/a785a3ac8f584eed4abd45e4e16fe64c46659a28", - "reference": "a785a3ac8f584eed4abd45e4e16fe64c46659a28", + "url": "https://api.github.com/repos/thephpleague/climate/zipball/237f70e1032b16d32ff3f65dcda68706911e1c74", + "reference": "237f70e1032b16d32ff3f65dcda68706911e1c74", "shasum": "" }, "require": { @@ -982,9 +981,10 @@ "seld/cli-prompt": "^1.0" }, "require-dev": { - "mikey179/vfsstream": "^1.6.10", - "mockery/mockery": "^1.4.2", - "phpunit/phpunit": "^9.5.10" + "mikey179/vfsstream": "^1.6.12", + "mockery/mockery": "^1.6.12", + "phpunit/phpunit": "^9.5.10", + "squizlabs/php_codesniffer": "^3.10" }, "suggest": { "ext-mbstring": "If ext-mbstring is not available you MUST install symfony/polyfill-mbstring" @@ -1023,9 +1023,9 @@ ], "support": { "issues": "https://github.com/thephpleague/climate/issues", - "source": "https://github.com/thephpleague/climate/tree/3.8.2" + "source": "https://github.com/thephpleague/climate/tree/3.10.0" }, - "time": "2022-06-18T14:42:08+00:00" + "time": "2024-11-18T09:09:55+00:00" }, { "name": "matthiasmullie/minify", @@ -1153,16 +1153,16 @@ }, { "name": "maximebf/debugbar", - "version": "v1.23.2", + "version": "v1.23.6", "source": { "type": "git", - "url": "https://github.com/maximebf/php-debugbar.git", - "reference": "689720d724c771ac4add859056744b7b3f2406da" + "url": "https://github.com/php-debugbar/php-debugbar.git", + "reference": "4b3d5f1afe09a7db5a9d3282890f49f6176d6542" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/maximebf/php-debugbar/zipball/689720d724c771ac4add859056744b7b3f2406da", - "reference": "689720d724c771ac4add859056744b7b3f2406da", + "url": "https://api.github.com/repos/php-debugbar/php-debugbar/zipball/4b3d5f1afe09a7db5a9d3282890f49f6176d6542", + "reference": "4b3d5f1afe09a7db5a9d3282890f49f6176d6542", "shasum": "" }, "require": { @@ -1214,10 +1214,11 @@ "debugbar" ], "support": { - "issues": "https://github.com/maximebf/php-debugbar/issues", - "source": "https://github.com/maximebf/php-debugbar/tree/v1.23.2" + "issues": "https://github.com/php-debugbar/php-debugbar/issues", + "source": "https://github.com/php-debugbar/php-debugbar/tree/v1.23.6" }, - "time": "2024-09-16T11:23:09+00:00" + "abandoned": "php-debugbar/php-debugbar", + "time": "2025-02-13T12:22:36+00:00" }, { "name": "miljar/php-exif", @@ -2602,8 +2603,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -2681,8 +2682,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -2761,8 +2762,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -2835,8 +2836,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -2912,8 +2913,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -2992,8 +2993,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -3408,25 +3409,25 @@ "packages-dev": [ { "name": "behat/gherkin", - "version": "v4.9.0", + "version": "v4.10.0", "source": { "type": "git", "url": "https://github.com/Behat/Gherkin.git", - "reference": "0bc8d1e30e96183e4f36db9dc79caead300beff4" + "reference": "cbb83c4c435dd8d05a161f2a5ae322e61b2f4db6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Behat/Gherkin/zipball/0bc8d1e30e96183e4f36db9dc79caead300beff4", - "reference": "0bc8d1e30e96183e4f36db9dc79caead300beff4", + "url": "https://api.github.com/repos/Behat/Gherkin/zipball/cbb83c4c435dd8d05a161f2a5ae322e61b2f4db6", + "reference": "cbb83c4c435dd8d05a161f2a5ae322e61b2f4db6", "shasum": "" }, "require": { "php": "~7.2|~8.0" }, "require-dev": { - "cucumber/cucumber": "dev-gherkin-22.0.0", + "cucumber/cucumber": "dev-gherkin-24.1.0", "phpunit/phpunit": "~8|~9", - "symfony/yaml": "~3|~4|~5" + "symfony/yaml": "~3|~4|~5|~6|~7" }, "suggest": { "symfony/yaml": "If you want to parse features, represented in YAML files" @@ -3465,9 +3466,9 @@ ], "support": { "issues": "https://github.com/Behat/Gherkin/issues", - "source": "https://github.com/Behat/Gherkin/tree/v4.9.0" + "source": "https://github.com/Behat/Gherkin/tree/v4.10.0" }, - "time": "2021-10-12T13:05:09+00:00" + "time": "2024-10-19T14:46:06+00:00" }, { "name": "codeception/codeception", @@ -3845,6 +3846,7 @@ "issues": "https://github.com/Codeception/phpunit-wrapper/issues", "source": "https://github.com/Codeception/phpunit-wrapper/tree/9.0.9" }, + "abandoned": true, "time": "2022-05-23T06:24:11+00:00" }, { @@ -4131,16 +4133,16 @@ }, { "name": "guzzlehttp/promises", - "version": "2.0.3", + "version": "2.2.0", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "6ea8dd08867a2a42619d65c3deb2c0fcbf81c8f8" + "reference": "7c69f28996b0a6920945dd20b3857e499d9ca96c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/6ea8dd08867a2a42619d65c3deb2c0fcbf81c8f8", - "reference": "6ea8dd08867a2a42619d65c3deb2c0fcbf81c8f8", + "url": "https://api.github.com/repos/guzzle/promises/zipball/7c69f28996b0a6920945dd20b3857e499d9ca96c", + "reference": "7c69f28996b0a6920945dd20b3857e499d9ca96c", "shasum": "" }, "require": { @@ -4194,7 +4196,7 @@ ], "support": { "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/2.0.3" + "source": "https://github.com/guzzle/promises/tree/2.2.0" }, "funding": [ { @@ -4210,20 +4212,20 @@ "type": "tidelift" } ], - "time": "2024-07-18T10:29:17+00:00" + "time": "2025-03-27T13:27:01+00:00" }, { "name": "myclabs/deep-copy", - "version": "1.12.0", + "version": "1.13.0", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c" + "reference": "024473a478be9df5fdaca2c793f2232fe788e414" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", - "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/024473a478be9df5fdaca2c793f2232fe788e414", + "reference": "024473a478be9df5fdaca2c793f2232fe788e414", "shasum": "" }, "require": { @@ -4262,7 +4264,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.12.0" + "source": "https://github.com/myclabs/DeepCopy/tree/1.13.0" }, "funding": [ { @@ -4270,7 +4272,7 @@ "type": "tidelift" } ], - "time": "2024-06-12T14:39:25+00:00" + "time": "2025-02-12T12:17:51+00:00" }, { "name": "nikic/php-parser", @@ -4448,16 +4450,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.12.6", + "version": "1.12.23", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "dc4d2f145a88ea7141ae698effd64d9df46527ae" + "reference": "29201e7a743a6ab36f91394eab51889a82631428" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/dc4d2f145a88ea7141ae698effd64d9df46527ae", - "reference": "dc4d2f145a88ea7141ae698effd64d9df46527ae", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/29201e7a743a6ab36f91394eab51889a82631428", + "reference": "29201e7a743a6ab36f91394eab51889a82631428", "shasum": "" }, "require": { @@ -4502,7 +4504,7 @@ "type": "github" } ], - "time": "2024-10-06T15:03:59+00:00" + "time": "2025-03-23T14:57:32+00:00" }, { "name": "phpstan/phpstan-deprecation-rules", @@ -4872,16 +4874,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.6.21", + "version": "9.6.22", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "de6abf3b6f8dd955fac3caad3af7a9504e8c2ffa" + "reference": "f80235cb4d3caa59ae09be3adf1ded27521d1a9c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/de6abf3b6f8dd955fac3caad3af7a9504e8c2ffa", - "reference": "de6abf3b6f8dd955fac3caad3af7a9504e8c2ffa", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f80235cb4d3caa59ae09be3adf1ded27521d1a9c", + "reference": "f80235cb4d3caa59ae09be3adf1ded27521d1a9c", "shasum": "" }, "require": { @@ -4892,7 +4894,7 @@ "ext-mbstring": "*", "ext-xml": "*", "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.12.0", + "myclabs/deep-copy": "^1.12.1", "phar-io/manifest": "^2.0.4", "phar-io/version": "^3.2.1", "php": ">=7.3", @@ -4955,7 +4957,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.21" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.22" }, "funding": [ { @@ -4971,7 +4973,7 @@ "type": "tidelift" } ], - "time": "2024-09-19T10:50:18+00:00" + "time": "2024-12-05T13:48:26+00:00" }, { "name": "psr/http-client", @@ -5990,16 +5992,16 @@ }, { "name": "symfony/browser-kit", - "version": "v5.4.40", + "version": "v5.4.45", "source": { "type": "git", "url": "https://github.com/symfony/browser-kit.git", - "reference": "92c8ba1e5ee12d07120744c90898516132b4e58b" + "reference": "03cce39764429e07fbab9b989a1182a24578341d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/browser-kit/zipball/92c8ba1e5ee12d07120744c90898516132b4e58b", - "reference": "92c8ba1e5ee12d07120744c90898516132b4e58b", + "url": "https://api.github.com/repos/symfony/browser-kit/zipball/03cce39764429e07fbab9b989a1182a24578341d", + "reference": "03cce39764429e07fbab9b989a1182a24578341d", "shasum": "" }, "require": { @@ -6042,7 +6044,7 @@ "description": "Simulates the behavior of a web browser, allowing you to make requests, click on links and submit forms programmatically", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/browser-kit/tree/v5.4.40" + "source": "https://github.com/symfony/browser-kit/tree/v5.4.45" }, "funding": [ { @@ -6058,20 +6060,20 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:33:22+00:00" + "time": "2024-10-22T13:05:35+00:00" }, { "name": "symfony/css-selector", - "version": "v5.4.40", + "version": "v5.4.45", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "ea43887e9afd2029509662d4f95e8b5ef6fc9bbb" + "reference": "4f7f3c35fba88146b56d0025d20ace3f3901f097" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/ea43887e9afd2029509662d4f95e8b5ef6fc9bbb", - "reference": "ea43887e9afd2029509662d4f95e8b5ef6fc9bbb", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/4f7f3c35fba88146b56d0025d20ace3f3901f097", + "reference": "4f7f3c35fba88146b56d0025d20ace3f3901f097", "shasum": "" }, "require": { @@ -6108,7 +6110,7 @@ "description": "Converts CSS selectors to XPath expressions", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/css-selector/tree/v5.4.40" + "source": "https://github.com/symfony/css-selector/tree/v5.4.45" }, "funding": [ { @@ -6124,20 +6126,20 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:33:22+00:00" + "time": "2024-09-25T14:11:13+00:00" }, { "name": "symfony/deprecation-contracts", - "version": "v2.5.3", + "version": "v2.5.4", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "80d075412b557d41002320b96a096ca65aa2c98d" + "reference": "605389f2a7e5625f273b53960dc46aeaf9c62918" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/80d075412b557d41002320b96a096ca65aa2c98d", - "reference": "80d075412b557d41002320b96a096ca65aa2c98d", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/605389f2a7e5625f273b53960dc46aeaf9c62918", + "reference": "605389f2a7e5625f273b53960dc46aeaf9c62918", "shasum": "" }, "require": { @@ -6145,12 +6147,12 @@ }, "type": "library", "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, "branch-alias": { "dev-main": "2.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" } }, "autoload": { @@ -6175,7 +6177,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.3" + "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.4" }, "funding": [ { @@ -6191,20 +6193,20 @@ "type": "tidelift" } ], - "time": "2023-01-24T14:02:46+00:00" + "time": "2024-09-25T14:11:13+00:00" }, { "name": "symfony/dom-crawler", - "version": "v5.4.44", + "version": "v5.4.48", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", - "reference": "4c76e4176a5472c5afe504194d7bbef5cfdd1703" + "reference": "b57df76f4757a9a8dfbb57ba48d7780cc20776c6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/4c76e4176a5472c5afe504194d7bbef5cfdd1703", - "reference": "4c76e4176a5472c5afe504194d7bbef5cfdd1703", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/b57df76f4757a9a8dfbb57ba48d7780cc20776c6", + "reference": "b57df76f4757a9a8dfbb57ba48d7780cc20776c6", "shasum": "" }, "require": { @@ -6250,7 +6252,7 @@ "description": "Eases DOM navigation for HTML and XML documents", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/dom-crawler/tree/v5.4.44" + "source": "https://github.com/symfony/dom-crawler/tree/v5.4.48" }, "funding": [ { @@ -6266,20 +6268,20 @@ "type": "tidelift" } ], - "time": "2024-09-11T06:50:28+00:00" + "time": "2024-11-13T14:36:38+00:00" }, { "name": "symfony/finder", - "version": "v5.4.43", + "version": "v5.4.45", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "ae25a9145a900764158d439653d5630191155ca0" + "reference": "63741784cd7b9967975eec610b256eed3ede022b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/ae25a9145a900764158d439653d5630191155ca0", - "reference": "ae25a9145a900764158d439653d5630191155ca0", + "url": "https://api.github.com/repos/symfony/finder/zipball/63741784cd7b9967975eec610b256eed3ede022b", + "reference": "63741784cd7b9967975eec610b256eed3ede022b", "shasum": "" }, "require": { @@ -6313,7 +6315,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v5.4.43" + "source": "https://github.com/symfony/finder/tree/v5.4.45" }, "funding": [ { @@ -6329,7 +6331,7 @@ "type": "tidelift" } ], - "time": "2024-08-13T14:03:51+00:00" + "time": "2024-09-28T13:32:08+00:00" }, { "name": "theseer/tokenizer", @@ -6384,7 +6386,7 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": {}, "prefer-stable": false, "prefer-lowest": false, "platform": { @@ -6397,7 +6399,7 @@ "ext-libxml": "*", "ext-gd": "*" }, - "platform-dev": [], + "platform-dev": {}, "platform-overrides": { "php": "7.3.6" }, From 7613e38b6d5679ba6ed3945dccf1e52fb33b535a Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Mon, 31 Mar 2025 14:11:35 -0600 Subject: [PATCH 6/8] Add support for validate match Signed-off-by: Andy Miller --- .../src/Grav/Common/Data/BlueprintSchema.php | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/system/src/Grav/Common/Data/BlueprintSchema.php b/system/src/Grav/Common/Data/BlueprintSchema.php index e61410b83..13786b29f 100644 --- a/system/src/Grav/Common/Data/BlueprintSchema.php +++ b/system/src/Grav/Common/Data/BlueprintSchema.php @@ -196,6 +196,38 @@ class BlueprintSchema extends BlueprintSchemaBase implements ExportInterface $messages += Validation::validate($child, $rule); + if (isset($rule['validate']['match']) || isset($rule['validate']['match_exact']) || isset($rule['validate']['match_any'])) { + $ruleKey = current(array_intersect(['match', 'match_exact', 'match_any'], array_keys($rule['validate']))); + $otherKey = $rule['validate'][$ruleKey] ?? null; + $otherVal = $data[$otherKey] ?? null; + $otherLabel = $this->items[$otherKey]['label'] ?? $otherKey; + $currentVal = $data[$key] ?? null; + $currentLabel = $this->items[$key]['label'] ?? $key; + + // Determine comparison type (loose, strict, substring) + // Perform comparison: + $isValid = false; + if ($ruleKey === 'match') { + $isValid = ($currentVal == $otherVal); + } elseif ($ruleKey === 'match_exact') { + $isValid = ($currentVal === $otherVal); + } elseif ($ruleKey === 'match_any') { + // If strings: + if (is_string($currentVal) && is_string($otherVal)) { + $isValid = (strlen($currentVal) && strlen($otherVal) && (str_contains($currentVal, + $otherVal) || strpos($otherVal, $currentVal) !== false)); + } + // If arrays: + if (is_array($currentVal) && is_array($otherVal)) { + $common = array_intersect($currentVal, $otherVal); + $isValid = !empty($common); + } + } + if (!$isValid) { + $messages[$rule['name']][] = $currentLabel.' field does not match '. $otherLabel; + } + } + } elseif (is_array($child) && is_array($val)) { // Array has been defined in blueprints. $messages += $this->validateArray($child, $val, $strict); From 90fd68d4a5d35776fe3821e3d5c40f4972f5a7a6 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Mon, 31 Mar 2025 14:12:05 -0600 Subject: [PATCH 7/8] handle empty value on require with ignore Signed-off-by: Andy Miller --- system/src/Grav/Common/Data/Validation.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/system/src/Grav/Common/Data/Validation.php b/system/src/Grav/Common/Data/Validation.php index 3a8ca81a9..e668f617e 100644 --- a/system/src/Grav/Common/Data/Validation.php +++ b/system/src/Grav/Common/Data/Validation.php @@ -48,12 +48,14 @@ class Validation } $validate = (array)($field['validate'] ?? null); - $type = $validate['type'] ?? $field['type']; + $validate_type = $validate['type'] ?? null; $required = $validate['required'] ?? false; + $type = $validate_type ?? $field['type']; + + $required = $required && ($validate_type !== 'ignore'); // If value isn't required, we will stop validation if empty value is given. - if ($required !== true && ($value === null || $value === '' || (($field['type'] === 'checkbox' || $field['type'] === 'switch') && $value == false)) - ) { + if ($required !== true && ($value === null || $value === '' || empty($value) || (($field['type'] === 'checkbox' || $field['type'] === 'switch') && $value == false))) { return []; } From fa56984dc3317e7f3d7946b7f7231d4ea4d36080 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Mon, 31 Mar 2025 19:26:01 -0600 Subject: [PATCH 8/8] use lang string Signed-off-by: Andy Miller --- system/src/Grav/Common/Data/BlueprintSchema.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/src/Grav/Common/Data/BlueprintSchema.php b/system/src/Grav/Common/Data/BlueprintSchema.php index 13786b29f..8db66540e 100644 --- a/system/src/Grav/Common/Data/BlueprintSchema.php +++ b/system/src/Grav/Common/Data/BlueprintSchema.php @@ -224,7 +224,7 @@ class BlueprintSchema extends BlueprintSchemaBase implements ExportInterface } } if (!$isValid) { - $messages[$rule['name']][] = $currentLabel.' field does not match '. $otherLabel; + $messages[$rule['name']][] = sprintf(Grav::instance()['language']->translate('PLUGIN_FORM.VALIDATION_MATCH'), $currentLabel, $otherLabel); } }