From 81d86be2c950e8700c22b7be6fa9db535bbfea6c Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Wed, 28 Dec 2022 23:34:46 +0100 Subject: [PATCH 1/5] Remove obsolete array types --- src/AbstractLexer.php | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/AbstractLexer.php b/src/AbstractLexer.php index eed4c51..e160a8f 100644 --- a/src/AbstractLexer.php +++ b/src/AbstractLexer.php @@ -56,16 +56,14 @@ abstract class AbstractLexer /** * The next token in the input. * - * @var mixed[]|null - * @psalm-var Token|null + * @var Token|null */ public $lookahead; /** * The last matched/seen token. * - * @var mixed[]|null - * @psalm-var Token|null + * @var Token|null */ public $token; @@ -217,8 +215,7 @@ public function isA($value, $token) /** * Moves the lookahead token forward. * - * @return mixed[]|null The next token or NULL if there are no more tokens ahead. - * @psalm-return Token|null + * @return Token|null The next token or NULL if there are no more tokens ahead. */ public function peek() { @@ -232,8 +229,7 @@ public function peek() /** * Peeks at the next token, returns it and immediately resets the peek. * - * @return mixed[]|null The next token or NULL if there are no more tokens ahead. - * @psalm-return Token|null + * @return Token|null The next token or NULL if there are no more tokens ahead. */ public function glimpse() { From bca77115eacc6760edc37bdb79e52d5fd9645a45 Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Mon, 5 Feb 2024 12:05:03 +0100 Subject: [PATCH 2/5] Fix new Psalm and PHPCS errors (#111) --- .github/workflows/coding-standards.yml | 2 +- .github/workflows/static-analysis.yml | 2 +- composer.json | 4 ++-- phpcs.xml.dist | 7 ++++++- psalm.xml | 10 +++++++++- src/AbstractLexer.php | 2 +- 6 files changed, 20 insertions(+), 7 deletions(-) diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml index e64a966..1d7110a 100644 --- a/.github/workflows/coding-standards.yml +++ b/.github/workflows/coding-standards.yml @@ -24,4 +24,4 @@ on: jobs: coding-standards: name: "Coding Standards" - uses: "doctrine/.github/.github/workflows/coding-standards.yml@3.0.0" + uses: "doctrine/.github/.github/workflows/coding-standards.yml@4.0.0" diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index b1cd768..c32da64 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -26,4 +26,4 @@ on: jobs: static-analysis: name: "Static Analysis" - uses: "doctrine/.github/.github/workflows/static-analysis.yml@3.0.0" + uses: "doctrine/.github/.github/workflows/static-analysis.yml@4.0.0" diff --git a/composer.json b/composer.json index be3013c..7e16723 100644 --- a/composer.json +++ b/composer.json @@ -30,11 +30,11 @@ "doctrine/deprecations": "^1.0" }, "require-dev": { - "doctrine/coding-standard": "^9 || ^10", + "doctrine/coding-standard": "^9 || ^12", "phpstan/phpstan": "^1.3", "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", "psalm/plugin-phpunit": "^0.18.3", - "vimeo/psalm": "^4.11 || ^5.0" + "vimeo/psalm": "^4.11 || ^5.21" }, "autoload": { "psr-4": { diff --git a/phpcs.xml.dist b/phpcs.xml.dist index 54a9e54..5131f5d 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -9,7 +9,7 @@ - + src tests @@ -32,4 +32,9 @@ tests/* + + + + src/Token.php + diff --git a/psalm.xml b/psalm.xml index daebf3a..237d612 100644 --- a/psalm.xml +++ b/psalm.xml @@ -1,11 +1,13 @@ @@ -52,6 +54,12 @@ + + + + + + diff --git a/src/AbstractLexer.php b/src/AbstractLexer.php index e160a8f..8bbe6b0 100644 --- a/src/AbstractLexer.php +++ b/src/AbstractLexer.php @@ -70,7 +70,7 @@ abstract class AbstractLexer /** * Composed regex for input parsing. * - * @var string|null + * @var non-empty-string|null */ private $regex; From b1031f0d165050d0f528c7c26a131e3d08bcc44c Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Mon, 5 Feb 2024 12:05:19 +0100 Subject: [PATCH 3/5] Update branch metadata (#112) --- .doctrine-project.json | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/.doctrine-project.json b/.doctrine-project.json index 192de97..d35c93c 100644 --- a/.doctrine-project.json +++ b/.doctrine-project.json @@ -5,35 +5,34 @@ "docsSlug": "doctrine-lexer", "versions": [ { - "name": "3.0", - "branchName": "3.0.x", + "name": "3.1", + "branchName": "3.1.x", "slug": "latest", "upcoming": true }, + { + "name": "3.0", + "branchName": "3.0.x", + "slug": "3.1", + "current": true + }, { "name": "2.1", "branchName": "2.1.x", - "upcoming": true + "slug": "2.1", + "maintained": true }, { "name": "2.0", "branchName": "2.0.x", - "aliases": [ - "current", - "stable" - ] - }, - { - "name": "1.3", - "branchName": "1.3.x", - "upcoming": true + "slug": "2.0", + "maintained": false }, { "name": "1.2", "branchName": "1.2.x", "slug": "1.2", - "current": true, - "maintained": true + "maintained": false }, { "name": "1.1", From 2bf803401fa9770373d2af062bc48cafd1ef2c89 Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Mon, 5 Feb 2024 12:35:21 +0100 Subject: [PATCH 4/5] Make data providers static (#114) --- composer.json | 2 +- tests/AbstractLexerTest.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 7e16723..3ac4b50 100644 --- a/composer.json +++ b/composer.json @@ -32,7 +32,7 @@ "require-dev": { "doctrine/coding-standard": "^9 || ^12", "phpstan/phpstan": "^1.3", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.6", "psalm/plugin-phpunit": "^0.18.3", "vimeo/psalm": "^4.11 || ^5.21" }, diff --git a/tests/AbstractLexerTest.php b/tests/AbstractLexerTest.php index 68a6181..ee581ae 100644 --- a/tests/AbstractLexerTest.php +++ b/tests/AbstractLexerTest.php @@ -32,7 +32,7 @@ public function tearDown(): void /** * @psalm-return list>}> */ - public function dataProvider(): array + public static function dataProvider(): array { return [ [ @@ -175,7 +175,7 @@ public function testGlimpse(string $input, array $expectedTokens): void /** * @psalm-return list */ - public function inputUntilPositionDataProvider(): array + public static function inputUntilPositionDataProvider(): array { return [ ['price=10', 5, 'price'], From 861c870e8b75f7c8f69c146c7f89cc1c0f1b49b6 Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Mon, 5 Feb 2024 12:35:39 +0100 Subject: [PATCH 5/5] Bump CI workflows (#113) --- .github/workflows/composer-lint.yml | 2 +- .github/workflows/continuous-integration.yml | 4 ++-- .github/workflows/release-on-milestone-closed.yml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/composer-lint.yml b/.github/workflows/composer-lint.yml index dbc934a..3707dcc 100644 --- a/.github/workflows/composer-lint.yml +++ b/.github/workflows/composer-lint.yml @@ -17,4 +17,4 @@ on: jobs: composer-lint: name: "Composer Lint" - uses: "doctrine/.github/.github/workflows/composer-lint.yml@3.0.0" + uses: "doctrine/.github/.github/workflows/composer-lint.yml@4.0.0" diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 41b615f..a8ef251 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -24,6 +24,6 @@ on: jobs: phpunit: name: "PHPUnit" - uses: "doctrine/.github/.github/workflows/continuous-integration.yml@3.0.0" + uses: "doctrine/.github/.github/workflows/continuous-integration.yml@4.0.0" with: - php-versions: '["7.1", "7.2", "7.3", "7.4", "8.0", "8.1", "8.2"]' + php-versions: '["7.1", "7.2", "7.3", "7.4", "8.0", "8.1", "8.2", "8.3"]' diff --git a/.github/workflows/release-on-milestone-closed.yml b/.github/workflows/release-on-milestone-closed.yml index 949de82..34abfbc 100644 --- a/.github/workflows/release-on-milestone-closed.yml +++ b/.github/workflows/release-on-milestone-closed.yml @@ -8,7 +8,7 @@ on: jobs: release: name: "Git tag, release & create merge-up PR" - uses: "doctrine/.github/.github/workflows/release-on-milestone-closed.yml@2.1.0" + uses: "doctrine/.github/.github/workflows/release-on-milestone-closed.yml@4.0.0" secrets: GIT_AUTHOR_EMAIL: ${{ secrets.GIT_AUTHOR_EMAIL }} GIT_AUTHOR_NAME: ${{ secrets.GIT_AUTHOR_NAME }}