From 3789da337ad90f6b03ed8564685371601b870bd2 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sat, 5 Dec 2020 20:11:04 +0100 Subject: [PATCH] fix phpstan --- Config/phpstan-baseline.neon | 229 +++++++++++++++++++++++++++++++++++ Config/phpstan.neon | 1 + 2 files changed, 230 insertions(+) diff --git a/Config/phpstan-baseline.neon b/Config/phpstan-baseline.neon index 364905f..c705294 100644 --- a/Config/phpstan-baseline.neon +++ b/Config/phpstan-baseline.neon @@ -1,2 +1,231 @@ parameters: ignoreErrors: + - + message: "#^Property Modules\\\\EventManagement\\\\Models\\\\Event\\:\\:\\$end \\(DateTime\\) does not accept DateTime\\|false\\.$#" + count: 1 + path: *Modules/EventManagement/Models/Event.php + + - + message: "#^Cannot access offset string on array\\\\|Modules\\\\Media\\\\Models\\\\Media\\.$#" + count: 4 + path: *Modules/Helper/Controller/ApiController.php + + - + message: "#^Cannot access an offset on array\\\\|Modules\\\\Media\\\\Models\\\\Media\\.$#" + count: 1 + path: *Modules/Helper/Controller/BackendController.php + + - + message: "#^Cannot call method execute\\(\\) on PDOStatement\\|false\\.$#" + count: 1 + path: *Modules/HumanResourceTimeRecording/Models/SessionMapper.php + + - + message: "#^Cannot call method fetchAll\\(\\) on PDOStatement\\|false\\.$#" + count: 1 + path: *Modules/HumanResourceTimeRecording/Models/SessionMapper.php + + - + message: "#^Parameter \\#1 \\$im of function imagejpeg expects resource, GdImage given\\.$#" + count: 1 + path: *Modules/Media/Models/UploadFile.php + + - + message: "#^Method Modules\\\\Support\\\\Models\\\\Message\\:\\:setCreated\\(\\) has parameter \\$created with no typehint specified\\.$#" + count: 1 + path: *Modules/Support/Models/Message.php + + - + message: "#^Cannot call method execute\\(\\) on PDOStatement\\|false\\.$#" + count: 1 + path: *Modules/Tasks/Models/TaskMapper.php + + - + message: "#^Cannot call method fetchAll\\(\\) on PDOStatement\\|false\\.$#" + count: 1 + path: *Modules/Tasks/Models/TaskMapper.php + + - + message: "#^Property Modules\\\\Workflow\\\\Templates\\\\Permission\\\\Workflow\\:\\:\\$id has no typehint specified\\.$#" + count: 1 + path: *Modules/Workflow/Templates/Permission/Workflow.php + + - + message: "#^Property Modules\\\\Workflow\\\\Templates\\\\Permission\\\\Workflow\\:\\:\\$state has no typehint specified\\.$#" + count: 1 + path: *Modules/Workflow/Templates/Permission/Workflow.php + + - + message: "#^Method Modules\\\\Workflow\\\\Templates\\\\Permission\\\\Workflow\\:\\:run\\(\\) has parameter \\$data with no typehint specified\\.$#" + count: 1 + path: *Modules/Workflow/Templates/Permission/Workflow.php + + - + message: "#^Method Modules\\\\Workflow\\\\Templates\\\\Permission\\\\Workflow\\:\\:runRequest\\(\\) has parameter \\$data with no typehint specified\\.$#" + count: 1 + path: *Modules/Workflow/Templates/Permission/Workflow.php + + - + message: "#^Method Modules\\\\Workflow\\\\Templates\\\\Permission\\\\Workflow\\:\\:runPending\\(\\) has parameter \\$data with no typehint specified\\.$#" + count: 1 + path: *Modules/Workflow/Templates/Permission/Workflow.php + + - + message: "#^Parameter \\#2 \\$callback of function usort expects callable\\(mixed, mixed\\)\\: int, array\\('self', 'continuousComparator'\\) given\\.$#" + count: 1 + path: *phpOMS/Algorithm/Knapsack/Continuous.php + + - + message: "#^Constructor of class phpOMS\\\\Business\\\\Marketing\\\\ArticleCorrelationAffinity has an unused parameter \\$considerQuantity\\.$#" + count: 1 + path: *phpOMS/Business/Marketing/ArticleCorrelationAffinity.php + + - + message: "#^Method phpOMS\\\\DataStorage\\\\Database\\\\BuilderAbstract\\:\\:quote\\(\\) should return string but returns string\\|false\\.$#" + count: 1 + path: *phpOMS/DataStorage/Database/BuilderAbstract.php + + - + message: "#^Parameter \\#1 \\$dbdata of class phpOMS\\\\DataStorage\\\\Database\\\\Connection\\\\MysqlConnection constructor expects array\\('db' \\=\\> string, 'host' \\=\\> string, 'port' \\=\\> int, 'login' \\=\\> string, 'password' \\=\\> string, 'database' \\=\\> string\\), array\\('db' \\=\\> string, \\?'host' \\=\\> string, \\?'port' \\=\\> int, \\?'login' \\=\\> string, \\?'password' \\=\\> string, 'database' \\=\\> string\\) given\\.$#" + count: 1 + path: *phpOMS/DataStorage/Database/Connection/ConnectionFactory.php + + - + message: "#^Parameter \\#1 \\$dbdata of class phpOMS\\\\DataStorage\\\\Database\\\\Connection\\\\PostgresConnection constructor expects array\\('db' \\=\\> string, 'host' \\=\\> string, 'port' \\=\\> int, 'login' \\=\\> string, 'password' \\=\\> string, 'database' \\=\\> string\\), array\\('db' \\=\\> string, \\?'host' \\=\\> string, \\?'port' \\=\\> int, \\?'login' \\=\\> string, \\?'password' \\=\\> string, 'database' \\=\\> string\\) given\\.$#" + count: 1 + path: *phpOMS/DataStorage/Database/Connection/ConnectionFactory.php + + - + message: "#^Parameter \\#1 \\$dbdata of class phpOMS\\\\DataStorage\\\\Database\\\\Connection\\\\SqlServerConnection constructor expects array\\('db' \\=\\> string, 'host' \\=\\> string, 'port' \\=\\> int, 'login' \\=\\> string, 'password' \\=\\> string, 'database' \\=\\> string\\), array\\('db' \\=\\> string, \\?'host' \\=\\> string, \\?'port' \\=\\> int, \\?'login' \\=\\> string, \\?'password' \\=\\> string, 'database' \\=\\> string\\) given\\.$#" + count: 1 + path: *phpOMS/DataStorage/Database/Connection/ConnectionFactory.php + + - + message: "#^Cannot call method getProperty\\(\\) on ReflectionClass\\\\|null\\.$#" + count: 1 + path: *phpOMS/DataStorage/Database/DataMapperAbstract.php + + - + message: "#^Parameter \\#1 \\$mapper of static method phpOMS\\\\DataStorage\\\\Database\\\\DataMapperAbstract\\:\\:getInitialized\\(\\) expects string, phpOMS\\\\DataStorage\\\\Database\\\\DataMapperAbstract given\\.$#" + count: 2 + path: *phpOMS/DataStorage/Database/DataMapperAbstract.php + + - + message: "#^Parameter \\#1 \\$mapper of static method phpOMS\\\\DataStorage\\\\Database\\\\DataMapperAbstract\\:\\:getInitializedArray\\(\\) expects string, phpOMS\\\\DataStorage\\\\Database\\\\DataMapperAbstract given\\.$#" + count: 2 + path: *phpOMS/DataStorage/Database/DataMapperAbstract.php + + - + message: "#^Array \\(array\\\\) does not accept phpOMS\\\\DataStorage\\\\DataStorageConnectionInterface\\.$#" + count: 1 + path: *phpOMS/DataStorage/Database/DatabasePool.php + + - + message: "#^Parameter \\#2 \\$operator of method phpOMS\\\\DataStorage\\\\Database\\\\Query\\\\Builder\\:\\:where\\(\\) expects array\\|string, array\\|string\\|null given\\.$#" + count: 2 + path: *phpOMS/DataStorage/Database/Query/Builder.php + + - + message: "#^Possibly invalid array key type phpOMS\\\\DataStorage\\\\Database\\\\Query\\\\Builder\\|string\\.$#" + count: 1 + path: *phpOMS/DataStorage/Database/Query/Builder.php + + - + message: "#^Parameter \\#2 \\$operator of method phpOMS\\\\DataStorage\\\\Database\\\\Query\\\\Builder\\:\\:on\\(\\) expects array\\|string, array\\|string\\|null given\\.$#" + count: 2 + path: *phpOMS/DataStorage/Database/Query/Builder.php + + - + message: "#^Parameter \\#3 \\$values of method phpOMS\\\\DataStorage\\\\Database\\\\Query\\\\Builder\\:\\:on\\(\\) expects array\\|string, array\\|string\\|null given\\.$#" + count: 2 + path: *phpOMS/DataStorage/Database/Query/Builder.php + + - + message: "#^Cannot call method bindParam\\(\\) on PDOStatement\\|false\\.$#" + count: 1 + path: *phpOMS/DataStorage/Database/Query/Builder.php + + - + message: "#^Cannot call method execute\\(\\) on PDOStatement\\|false\\.$#" + count: 1 + path: *phpOMS/DataStorage/Database/Query/Builder.php + + - + message: "#^Call to an undefined method phpOMS\\\\DataStorage\\\\Database\\\\Query\\\\Column\\:\\:getColumn\\(\\)\\.$#" + count: 1 + path: *phpOMS/DataStorage/Database/Query/Builder.php + + - + message: "#^Property phpOMS\\\\DataStorage\\\\Session\\\\FileSession\\:\\:\\$sid \\(string\\) does not accept string\\|false\\.$#" + count: 1 + path: *phpOMS/DataStorage/Session/FileSession.php + + - + message: "#^Method phpOMS\\\\DataStorage\\\\Session\\\\FileSessionHandler\\:\\:create_sid\\(\\) should return string but returns string\\|false\\.$#" + count: 1 + path: *phpOMS/DataStorage/Session/FileSessionHandler.php + + - + message: "#^Property phpOMS\\\\DataStorage\\\\Session\\\\HttpSession\\:\\:\\$sid \\(string\\) does not accept string\\|false\\.$#" + count: 1 + path: *phpOMS/DataStorage/Session/HttpSession.php + + - + message: "#^Method phpOMS\\\\Math\\\\Geometry\\\\ConvexHull\\\\MonotoneChain\\:\\:createConvexHull\\(\\) should return array\\ float\\|int, 'y' \\=\\> float\\|int\\)\\> but returns array\\ float\\|int, 'y' \\=\\> float\\|int\\)\\>\\.$#" + count: 1 + path: *phpOMS/Math/Geometry/ConvexHull/MonotoneChain.php + + - + message: "#^Parameter \\#3 \\$length of function array_slice expects int\\|null, float\\|int given\\.$#" + count: 1 + path: *phpOMS/Math/Geometry/ConvexHull/MonotoneChain.php + + - + message: "#^Parameter \\#1 \\$matrix of method phpOMS\\\\Math\\\\Matrix\\\\Matrix\\:\\:setMatrix\\(\\) expects array\\\\>, array\\\\> given\\.$#" + count: 1 + path: *phpOMS/Math/Matrix/CholeskyDecomposition.php + + - + message: "#^Method phpOMS\\\\Math\\\\Matrix\\\\Matrix\\:\\:current\\(\\) should return int but returns float\\|int\\.$#" + count: 1 + path: *phpOMS/Math/Matrix/Matrix.php + + - + message: "#^Method phpOMS\\\\Math\\\\Matrix\\\\Matrix\\:\\:key\\(\\) should return string but returns int\\.$#" + count: 1 + path: *phpOMS/Math/Matrix/Matrix.php + + - + message: "#^Parameter \\#1 \\$offset of method phpOMS\\\\Math\\\\Matrix\\\\Matrix\\:\\:offsetExists\\(\\) expects string, int given\\.$#" + count: 1 + path: *phpOMS/Math/Matrix/Matrix.php + + - + message: "#^Binary operation \"\\-\" between string\\|null and int results in an error\\.$#" + count: 1 + path: *phpOMS/Math/Matrix/Matrix.php + + - + message: "#^Parameter \\#2 \\$offset of function array_slice expects int, float\\|int given\\.$#" + count: 1 + path: *phpOMS/Math/Statistic/MeasureOfDispersion.php + + - + message: "#^Parameter \\#2 \\$timezone of class phpOMS\\\\Stdlib\\\\Base\\\\SmartDateTime constructor expects DateTimeZone\\|null, DateTimeZone\\|false given\\.$#" + count: 1 + path: *phpOMS/Stdlib/Base/SmartDateTime.php + + - + message: "#^Parameter \\#1 \\$timestamp of function getdate expects int\\|null, int\\|false given\\.$#" + count: 1 + path: *phpOMS/Stdlib/Base/SmartDateTime.php + + - + message: "#^Cannot call method getWeight\\(\\) on phpOMS\\\\Stdlib\\\\Graph\\\\Edge\\|null\\.$#" + count: 1 + path: *phpOMS/Stdlib/Graph/Graph.php + + - + message: "#^Call to an undefined method DirectoryIterator\\|RecursiveIteratorIterator\\\\|RegexIterator\\:\\:getPathname\\(\\)\\.$#" + count: 1 + path: *phpOMS/System/File/Local/Directory.php diff --git a/Config/phpstan.neon b/Config/phpstan.neon index 6bea320..7466f6d 100755 --- a/Config/phpstan.neon +++ b/Config/phpstan.neon @@ -41,6 +41,7 @@ parameters: - */Web/* - */Modules/**/Application/* - */Modules/Organization/Controller/BackendController.php + - *Model/CoreSettings.php ignoreErrors: - '#[.]*PhpOffice\\PhpSpreadsheet\\[.]*#' - '#^Call to an undefined method phpOMS\\Module\\ModuleAbstract::[.]*#'