From 6fab05debb2bedd9cb935868bacad441e33fafa3 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 3 Jan 2023 08:29:15 +0100 Subject: update to 5.6.0 --- composer.json | 13 ++- php-phpmyadmin-sql-parser5-autoload.patch | 20 ++-- php-phpmyadmin-sql-parser5-php81.patch | 187 ------------------------------ php-phpmyadmin-sql-parser5.spec | 39 ++++--- 4 files changed, 42 insertions(+), 217 deletions(-) delete mode 100644 php-phpmyadmin-sql-parser5-php81.patch diff --git a/composer.json b/composer.json index 6d95d9d..303c3d3 100644 --- a/composer.json +++ b/composer.json @@ -20,13 +20,16 @@ "symfony/polyfill-mbstring": "^1.3" }, "require-dev": { - "phpmyadmin/coding-standard": "^2.1.1", + "phpmyadmin/coding-standard": "^3.0", "phpmyadmin/motranslator": "^4.0 || ^5.0", - "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^0.12.54", - "phpstan/phpstan-phpunit": "^0.12.16", + "phpstan/extension-installer": "^1.1", + "phpstan/phpstan": "^1.2", + "phpstan/phpstan-phpunit": "^1.0", "phpunit/php-code-coverage": "*", - "phpunit/phpunit": "^7.4 || ^8 || ^9" + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "psalm/plugin-phpunit": "^0.16.1", + "vimeo/psalm": "^4.11", + "zumba/json-serializer": "^3.0" }, "conflict": { "phpmyadmin/motranslator": "<3.0" diff --git a/php-phpmyadmin-sql-parser5-autoload.patch b/php-phpmyadmin-sql-parser5-autoload.patch index 34a6030..0089c85 100644 --- a/php-phpmyadmin-sql-parser5-autoload.patch +++ b/php-phpmyadmin-sql-parser5-autoload.patch @@ -1,6 +1,6 @@ diff -up ./bin/highlight-query.rpm ./bin/highlight-query ---- ./bin/highlight-query.rpm 2020-01-08 07:34:11.970216276 +0100 -+++ ./bin/highlight-query 2020-01-08 07:35:49.464106360 +0100 +--- ./bin/highlight-query.rpm 2021-12-09 05:31:52.000000000 +0100 ++++ ./bin/highlight-query 2021-12-09 10:49:49.580910263 +0100 @@ -2,29 +2,7 @@ runHighlight()); diff -up ./bin/lint-query.rpm ./bin/lint-query ---- ./bin/lint-query.rpm 2020-01-08 07:34:11.970216276 +0100 -+++ ./bin/lint-query 2020-01-08 07:36:02.913951007 +0100 +--- ./bin/lint-query.rpm 2021-12-09 05:31:52.000000000 +0100 ++++ ./bin/lint-query 2021-12-09 10:49:49.580910263 +0100 @@ -2,29 +2,7 @@ runLint()); diff -up ./bin/tokenize-query.rpm ./bin/tokenize-query ---- ./bin/tokenize-query.rpm 2020-01-08 07:34:11.970216276 +0100 -+++ ./bin/tokenize-query 2020-01-08 07:36:16.233799679 +0100 +--- ./bin/tokenize-query.rpm 2021-12-09 05:31:52.000000000 +0100 ++++ ./bin/tokenize-query 2021-12-09 10:49:49.580910263 +0100 @@ -2,29 +2,7 @@ runTokenize()); diff -up ./src/Translator.php.rpm ./src/Translator.php ---- ./src/Translator.php.rpm 2020-01-08 07:34:11.970216276 +0100 -+++ ./src/Translator.php 2020-01-08 07:37:02.060280464 +0100 -@@ -42,7 +42,7 @@ class Translator +--- ./src/Translator.php.rpm 2021-12-09 10:49:49.580910263 +0100 ++++ ./src/Translator.php 2021-12-09 10:50:32.375725681 +0100 +@@ -45,7 +45,7 @@ class Translator self::$loader->textdomain('sqlparser'); // Set path where to look for a domain @@ -111,4 +111,4 @@ diff -up ./src/Translator.php.rpm ./src/Translator.php + self::$loader->bindtextdomain('sqlparser', __DIR__ . '/locale/'); } - if (self::$translator === null) { + if (self::$translator !== null) { diff --git a/php-phpmyadmin-sql-parser5-php81.patch b/php-phpmyadmin-sql-parser5-php81.patch deleted file mode 100644 index e43d7a7..0000000 --- a/php-phpmyadmin-sql-parser5-php81.patch +++ /dev/null @@ -1,187 +0,0 @@ -Adapted for 5.4.2 from upstream: - - -From 57b6c4366da680dbde339393edb3055c0ca6311d Mon Sep 17 00:00:00 2001 -From: William Desportes -Date: Tue, 17 Aug 2021 00:11:59 +0200 -Subject: [PATCH] Fix PHP 8.1 fatal errors on classes that "implements - ArrayAccess" - -"PHP Fatal error: During inheritance of ArrayAccess: Uncaught Return type of PhpMyAdmin\SqlParser\TokensList::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress the notice" - -"Fatal error: During inheritance of ArrayAccess: Uncaught Return type of PhpMyAdmin\SqlParser\TokensList::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress the notice" - -I added "#[ReturnTypeWillChange]" - -Signed-off-by: William Desportes ---- - src/TokensList.php | 4 ++++ - src/UtfString.php | 4 ++++ - 2 files changed, 8 insertions(+) - -diff --git a/src/TokensList.php b/src/TokensList.php -index 486e3aa6..7b63a045 100644 ---- a/src/TokensList.php -+++ b/src/TokensList.php -@@ -153,6 +153,7 @@ public function getNextOfTypeAndValue($type, $value) - * @param int $offset the offset to be set - * @param Token $value the token to be saved - */ -+ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) - { - if ($offset === null) { -@@ -169,6 +170,7 @@ public function offsetSet($offset, $value) - * - * @return Token - */ -+ #[ReturnTypeWillChange] - public function offsetGet($offset) - { - return $offset < $this->count ? $this->tokens[$offset] : null; -@@ -181,6 +183,7 @@ public function offsetGet($offset) - * - * @return bool - */ -+ #[ReturnTypeWillChange] - public function offsetExists($offset) - { - return $offset < $this->count; -@@ -191,6 +194,7 @@ public function offsetExists($offset) - * - * @param int $offset the offset to be unset - */ -+ #[ReturnTypeWillChange] - public function offsetUnset($offset) - { - unset($this->tokens[$offset]); -diff --git a/src/UtfString.php b/src/UtfString.php -index 217d1989..ee6e21f0 100644 ---- a/src/UtfString.php -+++ b/src/UtfString.php -@@ -91,6 +91,7 @@ public function __construct($str) - * - * @return bool - */ -+ #[ReturnTypeWillChange] - public function offsetExists($offset) - { - return ($offset >= 0) && ($offset < $this->charLen); -@@ -103,6 +104,7 @@ public function offsetExists($offset) - * - * @return string|null - */ -+ #[ReturnTypeWillChange] - public function offsetGet($offset) - { - if (($offset < 0) || ($offset >= $this->charLen)) { -@@ -146,6 +148,7 @@ public function offsetGet($offset) - * - * @throws Exception not implemented. - */ -+ #[ReturnTypeWillChange] - public function offsetSet($offset, $value) - { - throw new Exception('Not implemented.'); -@@ -158,6 +161,7 @@ public function offsetSet($offset, $value) - * - * @throws Exception not implemented. - */ -+ #[ReturnTypeWillChange] - public function offsetUnset($offset) - { - throw new Exception('Not implemented.'); - -From ed900e5b219b13c62dd260fd03ff65c31723d385 Mon Sep 17 00:00:00 2001 -From: William Desportes -Date: Sun, 5 Sep 2021 21:58:36 +0200 -Subject: [PATCH] Use fully qualified syntax for "#[\ReturnTypeWillChange]" - -Ref: 644f6bea450d5d22cb7c7c7991698d9d7945756b - -Signed-off-by: William Desportes ---- - src/TokensList.php | 9 ++++----- - src/UtfString.php | 9 ++++----- - 2 files changed, 8 insertions(+), 10 deletions(-) - -diff --git a/src/TokensList.php b/src/TokensList.php -index bdc520c5..21cac879 100644 ---- a/src/TokensList.php -+++ b/src/TokensList.php -@@ -154,7 +153,7 @@ public function getNextOfTypeAndValue($type, $value) - * @param int $offset the offset to be set - * @param Token $value the token to be saved - */ -- #[ReturnTypeWillChange] -+ #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) - { - if ($offset === null) { -@@ -171,7 +170,7 @@ public function offsetSet($offset, $value) - * - * @return Token - */ -- #[ReturnTypeWillChange] -+ #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $offset < $this->count ? $this->tokens[$offset] : null; -@@ -184,7 +183,7 @@ public function offsetGet($offset) - * - * @return bool - */ -- #[ReturnTypeWillChange] -+ #[\ReturnTypeWillChange] - public function offsetExists($offset) - { - return $offset < $this->count; -@@ -195,7 +194,7 @@ public function offsetExists($offset) - * - * @param int $offset the offset to be unset - */ -- #[ReturnTypeWillChange] -+ #[\ReturnTypeWillChange] - public function offsetUnset($offset) - { - unset($this->tokens[$offset]); -diff --git a/src/UtfString.php b/src/UtfString.php -index 548aa28f..ffd89323 100644 ---- a/src/UtfString.php -+++ b/src/UtfString.php -@@ -92,7 +91,7 @@ public function __construct($str) - * - * @return bool - */ -- #[ReturnTypeWillChange] -+ #[\ReturnTypeWillChange] - public function offsetExists($offset) - { - return ($offset >= 0) && ($offset < $this->charLen); -@@ -105,7 +104,7 @@ public function offsetExists($offset) - * - * @return string|null - */ -- #[ReturnTypeWillChange] -+ #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - if (($offset < 0) || ($offset >= $this->charLen)) { -@@ -149,7 +148,7 @@ public function offsetGet($offset) - * - * @throws Exception not implemented. - */ -- #[ReturnTypeWillChange] -+ #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) - { - throw new Exception('Not implemented.'); -@@ -162,7 +161,7 @@ public function offsetSet($offset, $value) - * - * @throws Exception not implemented. - */ -- #[ReturnTypeWillChange] -+ #[\ReturnTypeWillChange] - public function offsetUnset($offset) - { - throw new Exception('Not implemented.'); diff --git a/php-phpmyadmin-sql-parser5.spec b/php-phpmyadmin-sql-parser5.spec index ff1e4a2..3eea8a5 100644 --- a/php-phpmyadmin-sql-parser5.spec +++ b/php-phpmyadmin-sql-parser5.spec @@ -1,6 +1,6 @@ # remirepo/fedora spec file for php-phpmyadmin-sql-parser5 # -# Copyright (c) 2015-2021 Remi Collet +# Copyright (c) 2015-2023 Remi Collet # License: CC-BY-SA # http://creativecommons.org/licenses/by-sa/4.0/ # @@ -9,7 +9,7 @@ %bcond_without tests -%global gh_commit b210e219a54df9b9822880780bb3ba0fffa1f542 +%global gh_commit 63f2f77847586864a661ef009ae687dbdda0a9f1 %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) %global gh_owner phpmyadmin #global gh_date 20150820 @@ -19,8 +19,8 @@ %global major 5 Name: php-%{gh_owner}-%{gh_project}%{major} -Version: 5.4.2 -Release: 3%{?gh_date?%{gh_date}git%{gh_short}}%{?dist} +Version: 5.6.0 +Release: 1%{?gh_date?%{gh_date}git%{gh_short}}%{?dist} Summary: A validating SQL lexer and parser with a focus on MySQL dialect License: GPLv2+ @@ -29,8 +29,6 @@ Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit # Use our autoloader and locale relocation Patch0: %{name}-autoload.patch -# Upstream patches for PHP 8.1 -Patch1: %{name}-php81.patch BuildArch: noarch BuildRequires: gettext @@ -40,15 +38,19 @@ BuildRequires: php-composer(phpmyadmin/motranslator) >= 3.0 BuildRequires: php-mbstring BuildRequires: php-spl # For tests, from composer.json "require-dev": { -# "phpmyadmin/coding-standard": "^2.1.1", +# "phpmyadmin/coding-standard": "^3.0", # "phpmyadmin/motranslator": "^4.0 || ^5.0", -# "phpstan/extension-installer": "^1.0", -# "phpstan/phpstan": "^0.12.54", -# "phpstan/phpstan-phpunit": "^0.12.16", +# "phpstan/extension-installer": "^1.1", +# "phpstan/phpstan": "^1.2", +# "phpstan/phpstan-phpunit": "^1.0", # "phpunit/php-code-coverage": "*", -# "phpunit/phpunit": "^7.4 || ^8 || 9" -BuildRequires: phpunit9 +# "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", +# "psalm/plugin-phpunit": "^0.16.1", +# "vimeo/psalm": "^4.11", +# "zumba/json-serializer": "^3.0" +BuildRequires: phpunit9 >= 9.5 %global phpunit %{_bindir}/phpunit9 +BuildRequires: php-composer(zumba/json-serializer) >= 3.0 %endif # For autoloader BuildRequires: php-composer(fedora/autoloader) @@ -90,8 +92,6 @@ Autoloader: %{_datadir}/php/%{ns_vendor}/%{ns_project}%{major}/autoload.php %patch0 -p0 -b .rpm find src -name \*rpm -exec rm {} \; -%patch1 -p1 -b .php81 -find src -name \*php81 -exec rm {} \; : Create autoloader cat <<'AUTOLOAD' | tee src/autoload.php @@ -143,13 +143,16 @@ cat << 'EOF' | tee vendor/autoload.php - 5.6.0-1 +- update to 5.6.0 + +* Thu Dec 9 2021 Remi Collet - 5.5.0-1 +- update to 5.5.0 + * Fri Oct 29 2021 Remi Collet - 5.4.2-3 - add upstream patches for PHP 8.1 -- cgit