Skip to content

Commit

Permalink
Merge pull request #231 from patchlevel/update-phpstan-to-v2
Browse files Browse the repository at this point in the history
Update phpstan to v2, add symfony extension, add extra type annotations
  • Loading branch information
DavidBadura authored Jan 2, 2025
2 parents 0ecbc0a + 901d186 commit e3085bb
Show file tree
Hide file tree
Showing 6 changed files with 95 additions and 16 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ cs: vendor

.PHONY: phpstan
phpstan: vendor ## run phpstan static code analyser
vendor/bin/phpstan analyse
php -d memory_limit=312M vendor/bin/phpstan analyse

.PHONY: phpstan-baseline
phpstan-baseline: vendor ## run phpstan static code analyser
vendor/bin/phpstan analyse --generate-baseline
php -d memory_limit=312M vendor/bin/phpstan analyse --generate-baseline

.PHONY: psalm
psalm: vendor ## run psalm static code analyser
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
"league/commonmark": "^2.4",
"patchlevel/coding-standard": "^1.3.0",
"phpspec/prophecy-phpunit": "^2.1.0",
"phpstan/phpstan": "^1.10.48",
"phpstan/phpstan": "^2.1.0",
"phpstan/phpstan-symfony": "^2.0",
"phpunit/phpunit": "^10.5.2",
"psalm/plugin-symfony": "^5.1.0",
"roave/security-advisories": "dev-master",
Expand Down
85 changes: 78 additions & 7 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -1,8 +1,2 @@
parameters:
ignoreErrors:

-
message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#"
count: 1
path: src/DependencyInjection/Configuration.php

1 change: 1 addition & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
includes:
- phpstan-baseline.neon
- vendor/phpstan/phpstan-symfony/extension.neon

parameters:
level: max
Expand Down
12 changes: 12 additions & 0 deletions src/DataCollector/EventSourcingCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,18 @@
* events: array<string, class-string>
* }
* @psalm-property DataType|array{} $data
* @phpstan-type MessageType = array{
* event_class: class-string,
* event_name: string,
* event: Data,
* headers: list<Data>
* }
* @phpstan-type DataType = array{
* messages: list<MessageType>,
* aggregates: array<string, class-string<AggregateRoot>>,
* events: array<string, class-string>
* }
* @phpstan-property DataType|array{} $data
*/
final class EventSourcingCollector extends DataCollector
{
Expand Down

0 comments on commit e3085bb

Please sign in to comment.