From 9fcb6f3f04aa219c7f0541dc8446b6e74b3557b8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20B=C3=BCrk?= <stefan@buerk.tech>
Date: Sat, 26 Feb 2022 20:45:51 +0100
Subject: [PATCH] [BUGFIX] Raise doctrine/lexer:"^1.2.2"

doctrine/lexer has released a new minor version with changed
method docblocks, which now emits phpstan errors because of
incompatible types.

This patch raises the minor version for development and core
usage and adding phpstan ignore pattern to the baseline file
until doctrine/lexer has fixed the incompatible state. This
is a dedicated preparation to raise other dev dependencies.

Issue has been reported to the corresponding github repository:
https://github.com/doctrine/lexer/issues/62

used commands:

> composer req doctrine/lexer:"^1.2.2"
> composer req doctrine/lexer:"^1.2.2" \
  --no-update -d typo3/sysext/core
> Build/Scripts/runTests.sh \
  -s phpstanGenerateBaseline

Resolves: #97055
Releases: main, 11.5
Change-Id: Ib5c04202bdc6a4b5787a191e4bf1e175982fb217
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/73736
Tested-by: core-ci <typo3@b13.com>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
---
 Build/phpstan/phpstan-baseline.neon |  5 +++++
 composer.json                       |  2 +-
 composer.lock                       | 28 ++++++++++++----------------
 typo3/sysext/core/composer.json     |  2 +-
 4 files changed, 19 insertions(+), 18 deletions(-)

diff --git a/Build/phpstan/phpstan-baseline.neon b/Build/phpstan/phpstan-baseline.neon
index b69c461d520e..cc2b0734106c 100644
--- a/Build/phpstan/phpstan-baseline.neon
+++ b/Build/phpstan/phpstan-baseline.neon
@@ -1200,6 +1200,11 @@ parameters:
 			count: 1
 			path: ../../typo3/sysext/core/Classes/Database/Schema/Parser/Parser.php
 
+		-
+			message: "#^Parameter \\#1 \\$tokens of method Doctrine\\\\Common\\\\Lexer\\\\AbstractLexer\\:\\:isNextTokenAny\\(\\) expects array\\<string\\>, array\\<int, int\\> given\\.$#"
+			count: 13
+			path: ../../typo3/sysext/core/Classes/Database/Schema/Parser/Parser.php
+
 		-
 			message: "#^Unreachable statement \\- code above always terminates\\.$#"
 			count: 3
diff --git a/composer.json b/composer.json
index 838f20823a59..1db9c04b4252 100644
--- a/composer.json
+++ b/composer.json
@@ -51,7 +51,7 @@
 		"doctrine/dbal": "^2.13.5",
 		"doctrine/event-manager": "^1.0.0",
 		"doctrine/instantiator": "^1.4",
-		"doctrine/lexer": "^1.2.1",
+		"doctrine/lexer": "^1.2.2",
 		"egulias/email-validator": "^3.1",
 		"enshrined/svg-sanitize": "^0.15.4",
 		"guzzlehttp/guzzle": "^7.3.0",
diff --git a/composer.lock b/composer.lock
index 1e93eb586d4f..9def8ff2c707 100644
--- a/composer.lock
+++ b/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": "eafbccbf0c3689dd12d3c52b4605c62a",
+    "content-hash": "8333ea1bfa42deb8566028e0975d6335",
     "packages": [
         {
             "name": "bacon/bacon-qr-code",
@@ -633,32 +633,28 @@
         },
         {
             "name": "doctrine/lexer",
-            "version": "1.2.1",
+            "version": "1.2.2",
             "source": {
                 "type": "git",
                 "url": "https://github.com/doctrine/lexer.git",
-                "reference": "e864bbf5904cb8f5bb334f99209b48018522f042"
+                "reference": "9c50f840f257bbb941e6f4a0e94ccf5db5c3f76c"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/doctrine/lexer/zipball/e864bbf5904cb8f5bb334f99209b48018522f042",
-                "reference": "e864bbf5904cb8f5bb334f99209b48018522f042",
+                "url": "https://api.github.com/repos/doctrine/lexer/zipball/9c50f840f257bbb941e6f4a0e94ccf5db5c3f76c",
+                "reference": "9c50f840f257bbb941e6f4a0e94ccf5db5c3f76c",
                 "shasum": ""
             },
             "require": {
-                "php": "^7.2 || ^8.0"
+                "php": "^7.1 || ^8.0"
             },
             "require-dev": {
-                "doctrine/coding-standard": "^6.0",
-                "phpstan/phpstan": "^0.11.8",
-                "phpunit/phpunit": "^8.2"
+                "doctrine/coding-standard": "^9.0",
+                "phpstan/phpstan": "1.3",
+                "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5",
+                "vimeo/psalm": "^4.11"
             },
             "type": "library",
-            "extra": {
-                "branch-alias": {
-                    "dev-master": "1.2.x-dev"
-                }
-            },
             "autoload": {
                 "psr-4": {
                     "Doctrine\\Common\\Lexer\\": "lib/Doctrine/Common/Lexer"
@@ -693,7 +689,7 @@
             ],
             "support": {
                 "issues": "https://github.com/doctrine/lexer/issues",
-                "source": "https://github.com/doctrine/lexer/tree/1.2.1"
+                "source": "https://github.com/doctrine/lexer/tree/1.2.2"
             },
             "funding": [
                 {
@@ -709,7 +705,7 @@
                     "type": "tidelift"
                 }
             ],
-            "time": "2020-05-25T17:44:05+00:00"
+            "time": "2022-01-12T08:27:12+00:00"
         },
         {
             "name": "egulias/email-validator",
diff --git a/typo3/sysext/core/composer.json b/typo3/sysext/core/composer.json
index 849df8c6b0ee..ddd55052188c 100644
--- a/typo3/sysext/core/composer.json
+++ b/typo3/sysext/core/composer.json
@@ -34,7 +34,7 @@
 		"doctrine/dbal": "^2.13.5",
 		"doctrine/event-manager": "^1.0.0",
 		"doctrine/instantiator": "^1.4",
-		"doctrine/lexer": "^1.2.1",
+		"doctrine/lexer": "^1.2.2",
 		"egulias/email-validator": "^3.1",
 		"enshrined/svg-sanitize": "^0.15.4",
 		"guzzlehttp/guzzle": "^7.3.0",
-- 
GitLab