From c31d5533d1c82925021a6e02dc5ec36360ce1701 Mon Sep 17 00:00:00 2001 From: neznaika0 Date: Thu, 26 Dec 2024 22:36:03 +0300 Subject: [PATCH] dev: Update phpstan-baseline --- .../booleanAnd.leftNotBoolean.neon | 63 -------------- .../booleanAnd.rightNotBoolean.neon | 43 ---------- .../booleanNot.exprNotBoolean.neon | 68 --------------- .../booleanOr.leftNotBoolean.neon | 13 --- .../booleanOr.rightNotBoolean.neon | 18 ---- .../codeigniter.superglobalAccessAssign.neon | 2 +- .../elseif.condNotBoolean.neon | 8 -- utils/phpstan-baseline/if.condNotBoolean.neon | 82 +------------------ utils/phpstan-baseline/loader.neon | 7 -- .../ternary.condNotBoolean.neon | 43 ---------- 10 files changed, 2 insertions(+), 345 deletions(-) delete mode 100644 utils/phpstan-baseline/booleanAnd.leftNotBoolean.neon delete mode 100644 utils/phpstan-baseline/booleanAnd.rightNotBoolean.neon delete mode 100644 utils/phpstan-baseline/booleanNot.exprNotBoolean.neon delete mode 100644 utils/phpstan-baseline/booleanOr.leftNotBoolean.neon delete mode 100644 utils/phpstan-baseline/booleanOr.rightNotBoolean.neon delete mode 100644 utils/phpstan-baseline/elseif.condNotBoolean.neon delete mode 100644 utils/phpstan-baseline/ternary.condNotBoolean.neon diff --git a/utils/phpstan-baseline/booleanAnd.leftNotBoolean.neon b/utils/phpstan-baseline/booleanAnd.leftNotBoolean.neon deleted file mode 100644 index 856ad498e2e6..000000000000 --- a/utils/phpstan-baseline/booleanAnd.leftNotBoolean.neon +++ /dev/null @@ -1,63 +0,0 @@ -# total 12 errors - -parameters: - ignoreErrors: - - - message: '#^Only booleans are allowed in &&, array\|int\|string\|null given on the left side\.$#' - count: 1 - path: ../../system/BaseModel.php - - - - message: '#^Only booleans are allowed in &&, array\|string\|null given on the left side\.$#' - count: 1 - path: ../../system/CLI/CLI.php - - - - message: '#^Only booleans are allowed in &&, string given on the left side\.$#' - count: 1 - path: ../../system/Cache/Handlers/BaseHandler.php - - - - message: '#^Only booleans are allowed in &&, int given on the left side\.$#' - count: 1 - path: ../../system/Commands/Server/Serve.php - - - - message: '#^Only booleans are allowed in &&, string\|null given on the left side\.$#' - count: 3 - path: ../../system/Common.php - - - - message: '#^Only booleans are allowed in &&, string given on the left side\.$#' - count: 1 - path: ../../system/Database/Forge.php - - - - message: '#^Only booleans are allowed in &&, int given on the left side\.$#' - count: 1 - path: ../../system/Database/MySQLi/Connection.php - - - - message: '#^Only booleans are allowed in &&, int given on the left side\.$#' - count: 1 - path: ../../system/Email/Email.php - - - - message: '#^Only booleans are allowed in &&, string\|null given on the left side\.$#' - count: 1 - path: ../../system/HTTP/Response.php - - - - message: '#^Only booleans are allowed in &&, array given on the left side\.$#' - count: 1 - path: ../../system/Model.php - - - - message: '#^Only booleans are allowed in &&, string\|null given on the left side\.$#' - count: 1 - path: ../../system/Model.php - - - - message: '#^Only booleans are allowed in &&, array\ given on the left side\.$#' - count: 1 - path: ../../system/Router/RouteCollection.php diff --git a/utils/phpstan-baseline/booleanAnd.rightNotBoolean.neon b/utils/phpstan-baseline/booleanAnd.rightNotBoolean.neon deleted file mode 100644 index 8be1c9e657d0..000000000000 --- a/utils/phpstan-baseline/booleanAnd.rightNotBoolean.neon +++ /dev/null @@ -1,43 +0,0 @@ -# total 8 errors - -parameters: - ignoreErrors: - - - message: '#^Only booleans are allowed in &&, array\ given on the right side\.$#' - count: 1 - path: ../../system/BaseModel.php - - - - message: '#^Only booleans are allowed in &&, list\ given on the right side\.$#' - count: 1 - path: ../../system/CLI/CLI.php - - - - message: '#^Only booleans are allowed in &&, int\<0, max\> given on the right side\.$#' - count: 1 - path: ../../system/Database/MigrationRunner.php - - - - message: '#^Only booleans are allowed in &&, string given on the right side\.$#' - count: 1 - path: ../../system/Email/Email.php - - - - message: '#^Only booleans are allowed in &&, array\ given on the right side\.$#' - count: 2 - path: ../../system/HTTP/Files/FileCollection.php - - - - message: '#^Only booleans are allowed in &&, string\|null given on the right side\.$#' - count: 1 - path: ../../system/HTTP/Response.php - - - - message: '#^Only booleans are allowed in &&, array\ given on the right side\.$#' - count: 4 - path: ../../system/HTTP/UserAgent.php - - - - message: '#^Only booleans are allowed in &&, string given on the right side\.$#' - count: 2 - path: ../../system/Model.php diff --git a/utils/phpstan-baseline/booleanNot.exprNotBoolean.neon b/utils/phpstan-baseline/booleanNot.exprNotBoolean.neon deleted file mode 100644 index 41a36091437c..000000000000 --- a/utils/phpstan-baseline/booleanNot.exprNotBoolean.neon +++ /dev/null @@ -1,68 +0,0 @@ -# total 13 errors - -parameters: - ignoreErrors: - - - message: '#^Only booleans are allowed in a negated boolean, mixed given\.$#' - count: 1 - path: ../../system/Cache/Handlers/PredisHandler.php - - - - message: '#^Only booleans are allowed in a negated boolean, TWhenNot given\.$#' - count: 1 - path: ../../system/Database/BaseBuilder.php - - - - message: '#^Only booleans are allowed in a negated boolean, array given\.$#' - count: 1 - path: ../../system/Database/MySQLi/Connection.php - - - - message: '#^Only booleans are allowed in a negated boolean, string given\.$#' - count: 1 - path: ../../system/Database/SQLite3/Connection.php - - - - message: '#^Only booleans are allowed in a negated boolean, array\\>\> given\.$#' - count: 1 - path: ../../system/Filters/Filters.php - - - - message: '#^Only booleans are allowed in a negated boolean, int\<0, max\> given\.$#' - count: 1 - path: ../../system/Helpers/form_helper.php - - - - message: '#^Only booleans are allowed in a negated boolean, CodeIgniter\\CodeIgniter given\.$#' - count: 1 - path: ../../system/Test/CIUnitTestCase.php - - - - message: '#^Only booleans are allowed in a negated boolean, array\|null given\.$#' - count: 6 - path: ../../system/Validation/FileRules.php - - - - message: '#^Only booleans are allowed in a negated boolean, mixed given\.$#' - count: 1 - path: ../../tests/system/Email/EmailTest.php - - - - message: '#^Only booleans are allowed in a negated boolean, CodeIgniter\\Router\\RouteCollection\|null given\.$#' - count: 1 - path: ../../tests/system/HomeTest.php - - - - message: '#^Only booleans are allowed in a negated boolean, mixed given\.$#' - count: 2 - path: ../../tests/system/Models/FindModelTest.php - - - - message: '#^Only booleans are allowed in a negated boolean, CodeIgniter\\Router\\RouteCollection\|null given\.$#' - count: 1 - path: ../../tests/system/Test/FeatureTestAutoRoutingImprovedTest.php - - - - message: '#^Only booleans are allowed in a negated boolean, CodeIgniter\\Router\\RouteCollection\|null given\.$#' - count: 1 - path: ../../tests/system/Test/FeatureTestTraitTest.php diff --git a/utils/phpstan-baseline/booleanOr.leftNotBoolean.neon b/utils/phpstan-baseline/booleanOr.leftNotBoolean.neon deleted file mode 100644 index bb6d0e1d3324..000000000000 --- a/utils/phpstan-baseline/booleanOr.leftNotBoolean.neon +++ /dev/null @@ -1,13 +0,0 @@ -# total 2 errors - -parameters: - ignoreErrors: - - - message: '#^Only booleans are allowed in \|\|, string given on the left side\.$#' - count: 1 - path: ../../system/CLI/CLI.php - - - - message: '#^Only booleans are allowed in \|\|, string\|null given on the left side\.$#' - count: 2 - path: ../../system/CLI/CLI.php diff --git a/utils/phpstan-baseline/booleanOr.rightNotBoolean.neon b/utils/phpstan-baseline/booleanOr.rightNotBoolean.neon deleted file mode 100644 index cca548646c48..000000000000 --- a/utils/phpstan-baseline/booleanOr.rightNotBoolean.neon +++ /dev/null @@ -1,18 +0,0 @@ -# total 3 errors - -parameters: - ignoreErrors: - - - message: '#^Only booleans are allowed in \|\|, string\|null given on the right side\.$#' - count: 3 - path: ../../system/CLI/CLI.php - - - - message: '#^Only booleans are allowed in \|\|, int given on the right side\.$#' - count: 1 - path: ../../system/HotReloader/HotReloader.php - - - - message: '#^Only booleans are allowed in \|\|, mixed given on the right side\.$#' - count: 1 - path: ../../tests/system/Models/FindModelTest.php diff --git a/utils/phpstan-baseline/codeigniter.superglobalAccessAssign.neon b/utils/phpstan-baseline/codeigniter.superglobalAccessAssign.neon index 2b08524179cb..4eae1fef60ee 100644 --- a/utils/phpstan-baseline/codeigniter.superglobalAccessAssign.neon +++ b/utils/phpstan-baseline/codeigniter.superglobalAccessAssign.neon @@ -3,7 +3,7 @@ parameters: ignoreErrors: - - message: '#^Assigning non\-falsy\-string directly on offset ''HTTP_HOST'' of \$_SERVER is discouraged\.$#' + message: '#^Assigning string directly on offset ''HTTP_HOST'' of \$_SERVER is discouraged\.$#' count: 1 path: ../../system/Commands/Utilities/Routes.php diff --git a/utils/phpstan-baseline/elseif.condNotBoolean.neon b/utils/phpstan-baseline/elseif.condNotBoolean.neon deleted file mode 100644 index 81f9d151f114..000000000000 --- a/utils/phpstan-baseline/elseif.condNotBoolean.neon +++ /dev/null @@ -1,8 +0,0 @@ -# total 1 error - -parameters: - ignoreErrors: - - - message: '#^Only booleans are allowed in an elseif condition, \(callable\)\|null given\.$#' - count: 2 - path: ../../system/Database/BaseBuilder.php diff --git a/utils/phpstan-baseline/if.condNotBoolean.neon b/utils/phpstan-baseline/if.condNotBoolean.neon index 3acc4f2b460b..6e9b4b56f3fb 100644 --- a/utils/phpstan-baseline/if.condNotBoolean.neon +++ b/utils/phpstan-baseline/if.condNotBoolean.neon @@ -1,4 +1,4 @@ -# total 17 errors +# total 1 error parameters: ignoreErrors: @@ -6,83 +6,3 @@ parameters: message: '#^Only booleans are allowed in an if condition, mixed given\.$#' count: 1 path: ../../system/CLI/CLI.php - - - - message: '#^Only booleans are allowed in an if condition, Config\\Routing given\.$#' - count: 1 - path: ../../system/Commands/Utilities/Routes.php - - - - message: '#^Only booleans are allowed in an if condition, string\|null given\.$#' - count: 3 - path: ../../system/Commands/Utilities/Routes.php - - - - message: '#^Only booleans are allowed in an if condition, TWhen given\.$#' - count: 1 - path: ../../system/Database/BaseBuilder.php - - - - message: '#^Only booleans are allowed in an if condition, string\|null given\.$#' - count: 1 - path: ../../system/Database/MigrationRunner.php - - - - message: '#^Only booleans are allowed in an if condition, string\|null given\.$#' - count: 1 - path: ../../system/Email/Email.php - - - - message: '#^Only booleans are allowed in an if condition, array\|string\|null given\.$#' - count: 2 - path: ../../system/Encryption/Handlers/OpenSSLHandler.php - - - - message: '#^Only booleans are allowed in an if condition, array\ given\.$#' - count: 1 - path: ../../system/HTTP/RedirectResponse.php - - - - message: '#^Only booleans are allowed in an if condition, string given\.$#' - count: 1 - path: ../../system/HTTP/Request.php - - - - message: '#^Only booleans are allowed in an if condition, string\|null given\.$#' - count: 2 - path: ../../system/HTTP/Response.php - - - - message: '#^Only booleans are allowed in an if condition, array\|int\|string\|null given\.$#' - count: 2 - path: ../../system/Model.php - - - - message: '#^Only booleans are allowed in an if condition, object\|string\|null given\.$#' - count: 1 - path: ../../system/RESTful/BaseResource.php - - - - message: '#^Only booleans are allowed in an if condition, mixed given\.$#' - count: 2 - path: ../../system/Session/Handlers/Database/PostgreHandler.php - - - - message: '#^Only booleans are allowed in an if condition, mixed given\.$#' - count: 1 - path: ../../system/Session/Handlers/MemcachedHandler.php - - - - message: '#^Only booleans are allowed in an if condition, string\|null given\.$#' - count: 1 - path: ../../system/View/Table.php - - - - message: '#^Only booleans are allowed in an if condition, mixed given\.$#' - count: 5 - path: ../../tests/system/Models/FindModelTest.php - - - - message: '#^Only booleans are allowed in an if condition, list\ given\.$#' - count: 1 - path: ../../tests/system/Test/FilterTestTraitTest.php diff --git a/utils/phpstan-baseline/loader.neon b/utils/phpstan-baseline/loader.neon index 40d901a7ab2d..91fa70d7d8ff 100644 --- a/utils/phpstan-baseline/loader.neon +++ b/utils/phpstan-baseline/loader.neon @@ -1,12 +1,7 @@ includes: - argument.type.neon - assign.propertyType.neon - - booleanAnd.leftNotBoolean.neon - booleanAnd.rightAlwaysTrue.neon - - booleanAnd.rightNotBoolean.neon - - booleanNot.exprNotBoolean.neon - - booleanOr.leftNotBoolean.neon - - booleanOr.rightNotBoolean.neon - class.notFound.neon - codeigniter.cacheHandlerInstance.neon - codeigniter.configArgumentInstanceof.neon @@ -18,7 +13,6 @@ includes: - codeigniter.superglobalAccessAssign.neon - codeigniter.unknownServiceMethod.neon - deadCode.unreachable.neon - - elseif.condNotBoolean.neon - empty.notAllowed.neon - empty.property.neon - expr.resultUnused.neon @@ -62,7 +56,6 @@ includes: - return.type.neon - return.unusedType.neon - staticMethod.notFound.neon - - ternary.condNotBoolean.neon - ternary.shortNotAllowed.neon - unset.offset.neon - varTag.type.neon diff --git a/utils/phpstan-baseline/ternary.condNotBoolean.neon b/utils/phpstan-baseline/ternary.condNotBoolean.neon deleted file mode 100644 index 97d5bc785dac..000000000000 --- a/utils/phpstan-baseline/ternary.condNotBoolean.neon +++ /dev/null @@ -1,43 +0,0 @@ -# total 8 errors - -parameters: - ignoreErrors: - - - message: '#^Only booleans are allowed in a ternary operator condition, array\|null given\.$#' - count: 1 - path: ../../system/BaseModel.php - - - - message: '#^Only booleans are allowed in a ternary operator condition, string\|null given\.$#' - count: 1 - path: ../../system/CLI/CLI.php - - - - message: '#^Only booleans are allowed in a ternary operator condition, int\<0, max\> given\.$#' - count: 3 - path: ../../system/Database/MigrationRunner.php - - - - message: '#^Only booleans are allowed in a ternary operator condition, string\|null given\.$#' - count: 1 - path: ../../system/Database/MigrationRunner.php - - - - message: '#^Only booleans are allowed in a ternary operator condition, int\|null given\.$#' - count: 1 - path: ../../system/HTTP/OutgoingRequest.php - - - - message: '#^Only booleans are allowed in a ternary operator condition, string\|null given\.$#' - count: 1 - path: ../../system/Helpers/text_helper.php - - - - message: '#^Only booleans are allowed in a ternary operator condition, string\|null given\.$#' - count: 1 - path: ../../system/Router/AutoRouter.php - - - - message: '#^Only booleans are allowed in a ternary operator condition, string\|null given\.$#' - count: 1 - path: ../../system/Router/RouteCollection.php