Skip to content

Commit

Permalink
Update psalm to 6.x
Browse files Browse the repository at this point in the history
  • Loading branch information
mmoll committed Dec 16, 2024
1 parent efa8ae2 commit 591bd69
Show file tree
Hide file tree
Showing 12 changed files with 46 additions and 4 deletions.
3 changes: 0 additions & 3 deletions MO4/Library/PregLibrary.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,11 @@ class PregLibrary
* @return array<string>|array<array>
*
* @throws RuntimeException
*
* @psalm-suppress ArgumentTypeCoercion
*/
public static function MO4PregSplit(string $pattern, string $subject, int $limit = -1, int $flags = 0): array
{
$pregSplitResult = \preg_split($pattern, $subject, $limit, $flags);

// @phan-suppress-next-line PhanTypeComparisonToArray
if (false === $pregSplitResult) {
throw new RuntimeException('Unexpected Error in MO4 Coding Standard.');
}
Expand Down
2 changes: 2 additions & 0 deletions MO4/Sniffs/Arrays/ArrayDoubleArrowAlignmentSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
* @license http://spdx.org/licenses/MIT MIT License
*
* @link https://github.com/mayflower/mo4-coding-standard
*
* @psalm-api
*/
class ArrayDoubleArrowAlignmentSniff implements Sniff
{
Expand Down
2 changes: 2 additions & 0 deletions MO4/Sniffs/Arrays/MultiLineArraySniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
* @license http://spdx.org/licenses/MIT MIT License
*
* @link https://github.com/mayflower/mo4-coding-standard
*
* @psalm-api
*/
class MultiLineArraySniff implements Sniff
{
Expand Down
2 changes: 2 additions & 0 deletions MO4/Sniffs/Commenting/PropertyCommentSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
* @license http://spdx.org/licenses/MIT MIT License
*
* @link https://github.com/mayflower/mo4-coding-standard
*
* @psalm-api
*/
class PropertyCommentSniff extends AbstractScopeSniff
{
Expand Down
2 changes: 2 additions & 0 deletions MO4/Sniffs/Formatting/AlphabeticalUseStatementsSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
* @license http://spdx.org/licenses/MIT MIT License
*
* @link https://github.com/mayflower/mo4-coding-standard
*
* @psalm-api
*/
class AlphabeticalUseStatementsSniff extends UseDeclarationSniff
{
Expand Down
2 changes: 2 additions & 0 deletions MO4/Sniffs/Formatting/UnnecessaryNamespaceUsageSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
* @license http://spdx.org/licenses/MIT MIT License
*
* @link https://github.com/mayflower/mo4-coding-standard
*
* @psalm-api
*/
class UnnecessaryNamespaceUsageSniff implements Sniff
{
Expand Down
2 changes: 2 additions & 0 deletions MO4/Sniffs/Strings/VariableInDoubleQuotedStringSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
* @license http://spdx.org/licenses/MIT MIT License
*
* @link https://github.com/mayflower/mo4-coding-standard
*
* @psalm-api
*/
class VariableInDoubleQuotedStringSniff implements Sniff
{
Expand Down
2 changes: 2 additions & 0 deletions MO4/Sniffs/WhiteSpace/ConstantSpacingSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
* @license http://spdx.org/licenses/MIT MIT License
*
* @link https://github.com/mayflower/mo4-coding-standard
*
* @psalm-api
*/
class ConstantSpacingSniff implements Sniff
{
Expand Down
3 changes: 3 additions & 0 deletions MO4/Sniffs/WhiteSpace/MultipleEmptyLinesSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
use PHP_CodeSniffer\Files\File;
use PHP_CodeSniffer\Sniffs\Sniff;

/**
* @psalm-api
*/
class MultipleEmptyLinesSniff implements Sniff
{
/**
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"phpstan/phpstan-strict-rules": "^1.6",
"phpunit/phpunit": "^7.5.20 || ^8.5.36 || ^9.6.15",
"psalm/plugin-phpunit": "^0.18",
"vimeo/psalm": "^5.26"
"vimeo/psalm": "6.x-dev"
},
"config": {
"allow-plugins": {
Expand Down
27 changes: 27 additions & 0 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="dev-master@765dcbfe43002e52e4808b65561842784fe7bcc7">
<file src="MO4/Sniffs/Formatting/AlphabeticalUseStatementsSniff.php">
<PossiblyFalseArgument>
<code><![CDATA[\substr($a, $min)]]></code>
<code><![CDATA[\substr($b, $min)]]></code>
</PossiblyFalseArgument>
</file>
<file src="MO4/Sniffs/Formatting/UnnecessaryNamespaceUsageSniff.php">
<PossiblyFalseArgument>
<code><![CDATA[$replacement]]></code>
<code><![CDATA[$replacement]]></code>
</PossiblyFalseArgument>
</file>
<file src="MO4/Sniffs/Strings/VariableInDoubleQuotedStringSniff.php">
<PossiblyFalseArgument>
<code><![CDATA[\substr($content, 0, $pos)]]></code>
<code><![CDATA[\substr($content, 0, $pos)]]></code>
<code><![CDATA[\substr($content, 0, $pos)]]></code>
<code><![CDATA[\substr($content, 0, $pos)]]></code>
</PossiblyFalseArgument>
<PossiblyFalseOperand>
<code><![CDATA[$after]]></code>
<code><![CDATA[$before]]></code>
</PossiblyFalseOperand>
</file>
</files>
1 change: 1 addition & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
autoloader="tests/bootstrap.php"
errorBaseline="psalm-baseline.xml"
>
<projectFiles>
<directory name="MO4" />
Expand Down

0 comments on commit 591bd69

Please sign in to comment.