Skip to content

Commit 9a3516d

Browse files
committed
Merge branch '2.1.x' into 3.0.x
* 2.1.x: Bump CI workflows (doctrine#113) Make data providers static (doctrine#114) Update branch metadata (doctrine#112) Fix new Psalm and PHPCS errors (doctrine#111) Remove obsolete array types
2 parents 84a527d + 861c870 commit 9a3516d

11 files changed

+41
-36
lines changed

.doctrine-project.json

+13-14
Original file line numberDiff line numberDiff line change
@@ -5,35 +5,34 @@
55
"docsSlug": "doctrine-lexer",
66
"versions": [
77
{
8-
"name": "3.0",
9-
"branchName": "3.0.x",
8+
"name": "3.1",
9+
"branchName": "3.1.x",
1010
"slug": "latest",
1111
"upcoming": true
1212
},
13+
{
14+
"name": "3.0",
15+
"branchName": "3.0.x",
16+
"slug": "3.1",
17+
"current": true
18+
},
1319
{
1420
"name": "2.1",
1521
"branchName": "2.1.x",
16-
"upcoming": true
22+
"slug": "2.1",
23+
"maintained": true
1724
},
1825
{
1926
"name": "2.0",
2027
"branchName": "2.0.x",
21-
"aliases": [
22-
"current",
23-
"stable"
24-
]
25-
},
26-
{
27-
"name": "1.3",
28-
"branchName": "1.3.x",
29-
"upcoming": true
28+
"slug": "2.0",
29+
"maintained": false
3030
},
3131
{
3232
"name": "1.2",
3333
"branchName": "1.2.x",
3434
"slug": "1.2",
35-
"current": true,
36-
"maintained": true
35+
"maintained": false
3736
},
3837
{
3938
"name": "1.1",

.github/workflows/coding-standards.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ on:
2424
jobs:
2525
coding-standards:
2626
name: "Coding Standards"
27-
uses: "doctrine/.github/.github/workflows/coding-standards.yml@3.0.0"
27+
uses: "doctrine/.github/.github/workflows/coding-standards.yml@4.0.0"

.github/workflows/composer-lint.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ on:
1717
jobs:
1818
composer-lint:
1919
name: "Composer Lint"
20-
uses: "doctrine/.github/.github/workflows/composer-lint.yml@3.0.0"
20+
uses: "doctrine/.github/.github/workflows/composer-lint.yml@4.0.0"

.github/workflows/continuous-integration.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ on:
2424
jobs:
2525
phpunit:
2626
name: "PHPUnit"
27-
uses: "doctrine/.github/.github/workflows/continuous-integration.yml@3.0.0"
27+
uses: "doctrine/.github/.github/workflows/continuous-integration.yml@4.0.0"
2828
with:
29-
php-versions: '["8.1", "8.2"]'
29+
php-versions: '["8.1", "8.2", "8.3"]'

.github/workflows/release-on-milestone-closed.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
jobs:
99
release:
1010
name: "Git tag, release & create merge-up PR"
11-
uses: "doctrine/.github/.github/workflows/release-on-milestone-closed.yml@2.1.0"
11+
uses: "doctrine/.github/.github/workflows/release-on-milestone-closed.yml@4.0.0"
1212
secrets:
1313
GIT_AUTHOR_EMAIL: ${{ secrets.GIT_AUTHOR_EMAIL }}
1414
GIT_AUTHOR_NAME: ${{ secrets.GIT_AUTHOR_NAME }}

.github/workflows/static-analysis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ on:
2626
jobs:
2727
static-analysis:
2828
name: "Static Analysis"
29-
uses: "doctrine/.github/.github/workflows/static-analysis.yml@3.0.0"
29+
uses: "doctrine/.github/.github/workflows/static-analysis.yml@4.0.0"

composer.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@
2929
"php": "^8.1"
3030
},
3131
"require-dev": {
32-
"doctrine/coding-standard": "^10",
33-
"phpstan/phpstan": "^1.9",
34-
"phpunit/phpunit": "^9.5",
32+
"doctrine/coding-standard": "^12",
33+
"phpstan/phpstan": "^1.10",
34+
"phpunit/phpunit": "^9.6",
3535
"psalm/plugin-phpunit": "^0.18.3",
36-
"vimeo/psalm": "^5.0"
36+
"vimeo/psalm": "^5.21"
3737
},
3838
"autoload": {
3939
"psr-4": {

phpcs.xml.dist

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<config name="php_version" value="80100"/>
1010

1111
<!-- Ignore warnings and show progress of the run -->
12-
<arg value="np"/>
12+
<arg value="nps"/>
1313

1414
<file>src</file>
1515
<file>tests</file>

psalm.xml

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
<?xml version="1.0"?>
22
<psalm
33
errorLevel="1"
4-
phpVersion="8.1"
4+
phpVersion="8.3"
55
resolveFromConfigFile="true"
66
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
77
xmlns="https://getpsalm.org/schema/config"
88
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
9+
findUnusedBaselineEntry="true"
10+
findUnusedCode="true"
911
>
1012
<projectFiles>
1113
<directory name="src"/>
@@ -41,6 +43,12 @@
4143
<file name="src/Token.php" />
4244
</errorLevel>
4345
</MixedReturnStatement>
46+
<PossiblyUnusedProperty>
47+
<errorLevel type="suppress">
48+
<!-- TODO: Cover this property in a test -->
49+
<referencedProperty name="Doctrine\Common\Lexer\Token::$position"/>
50+
</errorLevel>
51+
</PossiblyUnusedProperty>
4452
<ReferenceConstraintViolation>
4553
<errorLevel type="suppress">
4654
<!-- https://github.com/vimeo/psalm/issues/8891 -->

src/AbstractLexer.php

+6-8
Original file line numberDiff line numberDiff line change
@@ -49,21 +49,21 @@ abstract class AbstractLexer
4949
/**
5050
* The next token in the input.
5151
*
52-
* @var mixed[]|null
53-
* @psalm-var Token<T, V>|null
52+
* @var Token<T, V>|null
5453
*/
5554
public Token|null $lookahead;
5655

5756
/**
5857
* The last matched/seen token.
5958
*
60-
* @var mixed[]|null
61-
* @psalm-var Token<T, V>|null
59+
* @var Token<T, V>|null
6260
*/
6361
public Token|null $token;
6462

6563
/**
6664
* Composed regex for input parsing.
65+
*
66+
* @var non-empty-string|null
6767
*/
6868
private string|null $regex = null;
6969

@@ -203,8 +203,7 @@ public function isA(string $value, int|string|UnitEnum $token)
203203
/**
204204
* Moves the lookahead token forward.
205205
*
206-
* @return mixed[]|null The next token or NULL if there are no more tokens ahead.
207-
* @psalm-return Token<T, V>|null
206+
* @return Token<T, V>|null The next token or NULL if there are no more tokens ahead.
208207
*/
209208
public function peek()
210209
{
@@ -218,8 +217,7 @@ public function peek()
218217
/**
219218
* Peeks at the next token, returns it and immediately resets the peek.
220219
*
221-
* @return mixed[]|null The next token or NULL if there are no more tokens ahead.
222-
* @psalm-return Token<T, V>|null
220+
* @return Token<T, V>|null The next token or NULL if there are no more tokens ahead.
223221
*/
224222
public function glimpse()
225223
{

tests/AbstractLexerTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function tearDown(): void
2929
}
3030

3131
/** @psalm-return list<array{string, list<Token<string, string|int>>}> */
32-
public function dataProvider(): array
32+
public static function dataProvider(): array
3333
{
3434
return [
3535
[
@@ -170,7 +170,7 @@ public function testGlimpse(string $input, array $expectedTokens): void
170170
}
171171

172172
/** @psalm-return list<array{string, int, string}> */
173-
public function inputUntilPositionDataProvider(): array
173+
public static function inputUntilPositionDataProvider(): array
174174
{
175175
return [
176176
['price=10', 5, 'price'],

0 commit comments

Comments
 (0)