From 2e32fb7dae74ddb016d94e739a91067884a8e4d1 Mon Sep 17 00:00:00 2001 From: Yonas Habteab Date: Thu, 24 Aug 2023 09:43:51 +0200 Subject: [PATCH] Add phpstan `baseline` config --- phpstan-baseline.neon | 36 ++++++++++++++++++++++++++++++++++++ phpstan.neon | 17 +++++++---------- 2 files changed, 43 insertions(+), 10 deletions(-) create mode 100644 phpstan-baseline.neon diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon new file mode 100644 index 0000000..14e1edc --- /dev/null +++ b/phpstan-baseline.neon @@ -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 diff --git a/phpstan.neon b/phpstan.neon index 10b732a..5891e2f 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,6 +1,13 @@ +includes: + - phpstan-baseline.neon + parameters: level: max + checkFunctionNameCase: true + checkInternalClassCaseSensitivity: true + treatPhpDocTypesAsCertain: false + paths: - src @@ -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#'