Skip to content

Commit bb2043d

Browse files
Use PHPStan instead of Psalm
1 parent 367ce91 commit bb2043d

16 files changed

+41
-93
lines changed

.gitattributes

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
/.github export-ignore
2-
/.phive export-ignore
3-
/.psalm export-ignore
4-
/build export-ignore
5-
/.gitattributes export-ignore
6-
/.gitignore export-ignore
7-
/.php-cs-fixer.dist.php export-ignore
8-
/build.xml export-ignore
9-
/phpunit.xml export-ignore
10-
/tests export-ignore
11-
/tools export-ignore
12-
/tools/* binary
1+
/.github export-ignore
2+
/.phive export-ignore
3+
/build export-ignore
4+
/.gitattributes export-ignore
5+
/.gitignore export-ignore
6+
/.php-cs-fixer.dist.php export-ignore
7+
/build.xml export-ignore
8+
/phpstan.neon export-ignore
9+
/phpunit.xml export-ignore
10+
/tests export-ignore
11+
/tools export-ignore
12+
/tools/* binary
1313

1414
*.php diff=php

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ jobs:
3131
- name: Run PHP-CS-Fixer
3232
run: ./tools/php-cs-fixer fix --dry-run --show-progress=dots --using-cache=no --verbose
3333

34-
type-checker:
35-
name: Type Checker
34+
static-analysis:
35+
name: Static Analysis
3636

3737
runs-on: ubuntu-latest
3838

@@ -49,8 +49,8 @@ jobs:
4949
- name: Install dependencies with Composer
5050
run: ./tools/composer update --no-interaction --no-ansi --no-progress
5151

52-
- name: Run Psalm
53-
run: ./tools/psalm --config=.psalm/config.xml --no-progress --shepherd --show-info=false --stats
52+
- name: Run PHPStan
53+
run: ./tools/phpstan analyse --no-progress --error-format=github
5454

5555
tests:
5656
name: Tests

.phive/phars.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phive xmlns="https://phar.io/phive">
3-
<phar name="php-cs-fixer" version="^3.0" installed="3.41.1" location="./tools/php-cs-fixer" copy="true"/>
4-
<phar name="psalm" version="^5.0" installed="5.18.0" location="./tools/psalm" copy="true"/>
5-
<phar name="composer" version="^2.0.3" installed="2.6.6" location="./tools/composer" copy="true"/>
3+
<phar name="php-cs-fixer" version="^3.59" installed="3.59.3" location="./tools/php-cs-fixer" copy="true"/>
4+
<phar name="composer" version="^2.7" installed="2.7.7" location="./tools/composer" copy="true"/>
5+
<phar name="phpstan" version="^1.11" installed="1.11.5" location="./tools/phpstan" copy="true"/>
66
</phive>

.psalm/baseline.xml

Lines changed: 0 additions & 39 deletions
This file was deleted.

.psalm/config.xml

Lines changed: 0 additions & 18 deletions
This file was deleted.

phpstan.neon

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
parameters:
2+
level: 9
3+
paths:
4+
- src
5+
- tests

src/Chunk.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,15 @@ public function endRange(): int
5454
}
5555

5656
/**
57-
* @psalm-return list<Line>
57+
* @return list<Line>
5858
*/
5959
public function lines(): array
6060
{
6161
return $this->lines;
6262
}
6363

6464
/**
65-
* @psalm-param list<Line> $lines
65+
* @param list<Line> $lines
6666
*/
6767
public function setLines(array $lines): void
6868
{

src/Diff.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,24 @@
1919
final class Diff implements IteratorAggregate
2020
{
2121
/**
22-
* @psalm-var non-empty-string
22+
* @var non-empty-string
2323
*/
2424
private string $from;
2525

2626
/**
27-
* @psalm-var non-empty-string
27+
* @var non-empty-string
2828
*/
2929
private string $to;
3030

3131
/**
32-
* @psalm-var list<Chunk>
32+
* @var list<Chunk>
3333
*/
3434
private array $chunks;
3535

3636
/**
37-
* @psalm-param non-empty-string $from
38-
* @psalm-param non-empty-string $to
39-
* @psalm-param list<Chunk> $chunks
37+
* @param non-empty-string $from
38+
* @param non-empty-string $to
39+
* @param list<Chunk> $chunks
4040
*/
4141
public function __construct(string $from, string $to, array $chunks = [])
4242
{
@@ -46,31 +46,31 @@ public function __construct(string $from, string $to, array $chunks = [])
4646
}
4747

4848
/**
49-
* @psalm-return non-empty-string
49+
* @return non-empty-string
5050
*/
5151
public function from(): string
5252
{
5353
return $this->from;
5454
}
5555

5656
/**
57-
* @psalm-return non-empty-string
57+
* @return non-empty-string
5858
*/
5959
public function to(): string
6060
{
6161
return $this->to;
6262
}
6363

6464
/**
65-
* @psalm-return list<Chunk>
65+
* @return list<Chunk>
6666
*/
6767
public function chunks(): array
6868
{
6969
return $this->chunks;
7070
}
7171

7272
/**
73-
* @psalm-param list<Chunk> $chunks
73+
* @param list<Chunk> $chunks
7474
*/
7575
public function setChunks(array $chunks): void
7676
{

src/Output/StrictUnifiedDiffOutputBuilder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ final class StrictUnifiedDiffOutputBuilder implements DiffOutputBuilderInterface
4646
private bool $collapseRanges;
4747

4848
/**
49-
* @psalm-var positive-int
49+
* @var positive-int
5050
*/
5151
private int $commonLineThreshold;
5252
private string $header;
5353

5454
/**
55-
* @psalm-var positive-int
55+
* @var positive-int
5656
*/
5757
private int $contextLines;
5858

src/Output/UnifiedDiffOutputBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ final class UnifiedDiffOutputBuilder extends AbstractChunkOutputBuilder
3030
private int $commonLineThreshold = 6;
3131

3232
/**
33-
* @psalm-var positive-int
33+
* @var positive-int
3434
*/
3535
private int $contextLines = 3;
3636
private string $header;

0 commit comments

Comments
 (0)