Skip to content

Commit bca7711

Browse files
authored
Fix new Psalm and PHPCS errors (#111)
1 parent e74756f commit bca7711

File tree

6 files changed

+20
-7
lines changed

6 files changed

+20
-7
lines changed

.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/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

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@
3030
"doctrine/deprecations": "^1.0"
3131
},
3232
"require-dev": {
33-
"doctrine/coding-standard": "^9 || ^10",
33+
"doctrine/coding-standard": "^9 || ^12",
3434
"phpstan/phpstan": "^1.3",
3535
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.5",
3636
"psalm/plugin-phpunit": "^0.18.3",
37-
"vimeo/psalm": "^4.11 || ^5.0"
37+
"vimeo/psalm": "^4.11 || ^5.21"
3838
},
3939
"autoload": {
4040
"psr-4": {

phpcs.xml.dist

+6-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<config name="php_version" value="70100"/>
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>
@@ -32,4 +32,9 @@
3232
<!-- Remove when dropping PHPUnit 7 -->
3333
<exclude-pattern>tests/*</exclude-pattern>
3434
</rule>
35+
36+
<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingAnyTypeHint">
37+
<!-- The sniff does not interpret @inheritDoc correctly anymore -->
38+
<exclude-pattern>src/Token.php</exclude-pattern>
39+
</rule>
3540
</ruleset>

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"/>
@@ -52,6 +54,12 @@
5254
<file name="src/Token.php" />
5355
</errorLevel>
5456
</MixedReturnStatement>
57+
<PossiblyUnusedProperty>
58+
<errorLevel type="suppress">
59+
<!-- TODO: Cover this property in a test -->
60+
<referencedProperty name="Doctrine\Common\Lexer\Token::$position"/>
61+
</errorLevel>
62+
</PossiblyUnusedProperty>
5563
<ReferenceConstraintViolation>
5664
<errorLevel type="suppress">
5765
<!-- https://github.com/vimeo/psalm/issues/8891 -->

src/AbstractLexer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ abstract class AbstractLexer
7070
/**
7171
* Composed regex for input parsing.
7272
*
73-
* @var string|null
73+
* @var non-empty-string|null
7474
*/
7575
private $regex;
7676

0 commit comments

Comments
 (0)