Skip to content

Commit

Permalink
Add phpstan baseline config
Browse files Browse the repository at this point in the history
  • Loading branch information
yhabteab committed Aug 24, 2023
1 parent 2b430f5 commit 2e32fb7
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 10 deletions.
36 changes: 36 additions & 0 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
parameters:
ignoreErrors:
-
message: "#^Method ipl\\\\Scheduler\\\\Cron\\:\\:getNextDue\\(\\) should return DateTimeInterface but returns DateTimeInterface\\|null\\.$#"
count: 2
path: src/Cron.php

-
message: "#^Method ipl\\\\Scheduler\\\\Cron\\:\\:jsonSerialize\\(\\) return type has no value type specified in iterable type array\\.$#"
count: 1
path: src/Cron.php

-
message: "#^Method ipl\\\\Scheduler\\\\RRule\\:\\:getNextDue\\(\\) should return DateTimeInterface but returns DateTimeInterface\\|null\\.$#"
count: 1
path: src/RRule.php

-
message: "#^Method ipl\\\\Scheduler\\\\RRule\\:\\:jsonSerialize\\(\\) return type has no value type specified in iterable type array\\.$#"
count: 1
path: src/RRule.php

-
message: "#^Parameter \\#1 \\$timezone of class DateTimeZone constructor expects string, string\\|null given\\.$#"
count: 1
path: src/RRule.php

-
message: "#^Parameter \\#2 \\$before of class Recurr\\\\Transformer\\\\Constraint\\\\BetweenConstraint constructor expects DateTimeInterface, DateTimeInterface\\|null given\\.$#"
count: 1
path: src/RRule.php

-
message: "#^Parameter \\#1 \\$timer of static method React\\\\EventLoop\\\\Loop\\:\\:cancelTimer\\(\\) expects React\\\\EventLoop\\\\TimerInterface, React\\\\EventLoop\\\\TimerInterface\\|null given\\.$#"
count: 1
path: src/Scheduler.php
17 changes: 7 additions & 10 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
includes:
- phpstan-baseline.neon

parameters:
level: max

checkFunctionNameCase: true
checkInternalClassCaseSensitivity: true
treatPhpDocTypesAsCertain: false

paths:
- src

Expand All @@ -14,22 +21,12 @@ parameters:
- '#. but return statement is missing#'
reportUnmatched: false

- '#Method ipl\\Scheduler\\.*::getNextDue\(\) .* but returns DateTimeInterface\|null#'

- '#Call to an undefined method DateTimeInterface::#'

- '#Parameter \#1 \$timezone of class DateTimeZone constructor expects string, string\|null given#'

- '#Call to an undefined method React\\Promise\\PromiseInterface::#'

- '#Parameter \#1 \$timer of static method React\\EventLoop\\Loop::cancelTimer\(\) expects#'

- '#Method ipl\\Scheduler\\.*::jsonSerialize\(\) return type has no value type specified in iterable type#'

- '#Method ipl\\Scheduler\\.* should return \$this.* but returns static#'

- '#Parameter \#2 \$before of class Recurr\\Transformer\\Constraint\\BetweenConstraint constructor#'

- '#Parameter \#1 \$rrule of class Recurr\\Rule constructor expects string\|null, array.*\|string given#'

- '#Parameter \#1 \$callback of function call_user_func_array expects callable\(\): mixed, array{Recurr\\Rule, string} given#'

0 comments on commit 2e32fb7

Please sign in to comment.