Skip to content

Commit

Permalink
Fix new Psalm and PHPCS errors
Browse files Browse the repository at this point in the history
  • Loading branch information
derrabus committed Feb 5, 2024
1 parent e74756f commit 1e07427
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/coding-standards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 1 addition & 1 deletion .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
7 changes: 6 additions & 1 deletion phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<config name="php_version" value="70100"/>

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

<file>src</file>
<file>tests</file>
Expand All @@ -32,4 +32,9 @@
<!-- Remove when dropping PHPUnit 7 -->
<exclude-pattern>tests/*</exclude-pattern>
</rule>

<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingAnyTypeHint">
<!-- The sniff does not interpret @inheritDoc correctly anymore -->
<exclude-pattern>src/Token.php</exclude-pattern>
</rule>
</ruleset>
10 changes: 9 additions & 1 deletion psalm.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<?xml version="1.0"?>
<psalm
errorLevel="1"
phpVersion="8.1"
phpVersion="8.3"
resolveFromConfigFile="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
findUnusedBaselineEntry="true"
findUnusedCode="true"
>
<projectFiles>
<directory name="src"/>
Expand Down Expand Up @@ -52,6 +54,12 @@
<file name="src/Token.php" />
</errorLevel>
</MixedReturnStatement>
<PossiblyUnusedProperty>
<errorLevel type="suppress">
<!-- TODO: Cover this property in a test -->
<referencedProperty name="Doctrine\Common\Lexer\Token::$position"/>
</errorLevel>
</PossiblyUnusedProperty>
<ReferenceConstraintViolation>
<errorLevel type="suppress">
<!-- https://github.com/vimeo/psalm/issues/8891 -->
Expand Down
2 changes: 1 addition & 1 deletion src/AbstractLexer.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ abstract class AbstractLexer
/**
* Composed regex for input parsing.
*
* @var string|null
* @var non-empty-string|null
*/
private $regex;

Expand Down

0 comments on commit 1e07427

Please sign in to comment.