Skip to content

Commit

Permalink
Update psalm to 6.x and minimum PHP to 8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
mmoll committed Jan 26, 2025
1 parent efa8ae2 commit 79cd76e
Show file tree
Hide file tree
Showing 13 changed files with 32 additions and 12 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,10 @@ jobs:
matrix:
os: [ubuntu-latest]
php_version:
# - 7.2
# - 7.3
- 7.4
- 8.0
- 8.1
- 8.2
- 8.3
# - 8.4
- 8.4
dependencies_level:
- --prefer-lowest
- ""
Expand Down
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
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"source": "https://github.com/mayflower/mo4-coding-standard"
},
"require": {
"php": "~7.4 || ~8.0",
"php": "~8.1",
"dealerdirect/phpcodesniffer-composer-installer": "~0.7 || ~1.0",
"escapestudios/symfony2-coding-standard": "^3.10.0",
"slevomat/coding-standard": "^8.14",
Expand All @@ -34,9 +34,9 @@
"phan/phan": "^5.4.2",
"phpstan/phpstan": "^1.12",
"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"
"phpunit/phpunit": "^8.5.36 || ^9.6.15",
"psalm/plugin-phpunit": "^0.19",
"vimeo/psalm": "^6.0.0"
},
"config": {
"allow-plugins": {
Expand Down
9 changes: 9 additions & 0 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="dev-master@765dcbfe43002e52e4808b65561842784fe7bcc7">
<file src="MO4/Library/PregLibrary.php">
<ArgumentTypeCoercion>
<code><![CDATA[$flags]]></code>
<code><![CDATA[$pattern]]></code>
</ArgumentTypeCoercion>
</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 79cd76e

Please sign in to comment.